Files
brave-core/components/policy
Serg 17dc65f718 [Android] Enforce Brave Origin policies for VPN, Leo AI and Playlist on Stable/Beta (#36251)
The policy YAMLs for BraveVPNDisabled, BraveAIChatEnabled and
BravePlaylistEnabled listed Android only under future_on:, never under
supported_on:. Codegen marks them is_future on Android, and
ConfigurationPolicyHandlerList::IsBlockedFuturePolicy drops is_future
policies from the bundle on Stable and Beta channels — so the matching
managed prefs (kManagedBraveVPNDisabled, ai_chat::prefs::kEnabledByPolicy,
playlist::kPlaylistEnabledPref) never become managed, and the Java hide
checks in BraveMainPreferencesBase.onResume() and the cross-platform
playlist::IsPlaylistAllowed() never see the policy. Nightly and local
debug builds (channel != Stable/Beta) bypass the gate, which is why this
escaped pre-release.

Move android from future_on: to supported_on: android:148- in the three
YAMLs, matching the existing pattern used for BraveWalletDisabled and
BraveNewsDisabled.

Add OriginPolicies_NotFutureOnThisPlatform unit test that walks every
entry in BraveOriginServiceFactory::GetBrowserPolicyDefinitions() and
GetProfilePolicyDefinitions() and asserts policy_details.is_future is
false. The test runs on every channel and target, so future regressions
of the same shape — Brave Origin claiming to enforce a policy that the
runtime gate will silently drop — surface in unit tests instead of in
released Stable/Beta builds.

Resolves: https://github.com/brave/brave-browser/issues/55346
2026-05-07 13:04:05 -04:00
..