Skip to content

Commit

Permalink
Uplift of #16514 (squashed) to release
Browse files Browse the repository at this point in the history
  • Loading branch information
brave-builds committed Jan 3, 2023
1 parent aec6448 commit 4240aa7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ public abstract class BraveFeatureUtil {
public static final CachedFlag sTabSwitcherOnReturn =
new CachedFlag(ChromeFeatureList.TAB_SWITCHER_ON_RETURN, false);

// The method sets a feature state that is passed in `enabled` var. However it can
// set the feature to a Default state if Default state is what is `enabled` var.
// For example: A feature `dummy_name` has 3 states and a Default value is Disabled:
// 0: Default (Disabled)
// 1: Enabled
// 2: Disabled
// enableFeature("dummy_name", false, true) sets the `dummy_name` feature state to Default
// enableFeature("dummy_name", false, false) sets the `dummy_name` feature state to Disabled
public static void enableFeature(
String featureName, boolean enabled, boolean fallbackToDefault) {
BraveFeatureUtilJni.get().enableFeature(featureName, enabled, fallbackToDefault);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
if (PREF_BACKGROUND_VIDEO_PLAYBACK.equals(key)) {
BraveFeatureUtil.enableFeature(
BraveFeatureList.BRAVE_BACKGROUND_VIDEO_PLAYBACK_INTERNAL, (boolean) newValue,
true);
false);
if ((boolean) newValue) {
updateSummary(PREF_BACKGROUND_VIDEO_PLAYBACK,
R.string.prefs_background_video_playback_on);
Expand Down

0 comments on commit 4240aa7

Please sign in to comment.