Files
brave-core/android/java
Serg 34f390c990 [Android] Honor Brave Rewards disabled-by-policy pref (#35651)
brave_rewards::IsDisabledByPolicy() was hardcoded to return false on
Android regardless of the managed kDisabledByPolicy pref, so every
native call site that gates on brave_rewards::IsSupported() failed to
suppress for Brave Origin subscribers (and enterprise admins setting
the BraveRewardsDisabled policy).

Symptoms fixed:
- Ads service kept initializing on Android for Origin profiles
  (AdsServiceFactory::GetForProfile gates on IsSupported).
- NTP sponsored background images and sponsored rich-media takeover
  rendered (downstream of the ads service via ViewCounterService).
- DAY_10 / DAY_30 / DAY_35 Rewards retention notifications fired
  (RetentionNotificationPublisher gates on rewardsNativeWorker
  .isSupported).

Java-side Rewards UI surfaces were already correctly gated via
BraveRewardsPolicy.isDisabledByPolicy(profile) and are unaffected.

Also decouples BraveVpnUtils.isRegionSupported() from
BraveRewardsNativeWorker.isSupported() — otherwise the guard flip would
cause VPN UI to hide for any profile where Rewards is policy-disabled
as a side effect. Added BraveVpnNativeWorker.isSupportedRegion that
does the OFAC region check directly via brave_l10n.

Resolves: https://github.com/brave/brave-browser/issues/54703
2026-04-20 17:08:14 +01:00
..