BraveRewardsNativeWorker crashes when constructed before the browser is
fully initialized. This happens when an AlarmManager retention
notification (DAY_10/DAY_30/DAY_35) fires and the app process is started
by Android just to handle the broadcast — ProfileManager::
GetActiveUserProfile() dereferences a null g_browser_process in this
case.
The fix:
- Checks that GetActiveUserProfile() returns a valid profile before
creating the native worker in JNI_BraveRewardsNativeWorker_Init. If it
doesn't, the native object is not created.
- Resets the Java singleton when native init is skipped, so subsequent
calls can retry once the browser is fully initialized.
- Adds null-profile guards to IsSupported, IsSupportedSkipRegionCheck,
and IsRewardsEnabled which also call GetActiveUserProfile()
independently.
- Adds null checks for getInstance() at all call sites since it can now
return null.
Resolves: https://github.com/brave/brave-browser/issues/53877