diff --git a/packages/SystemUI/src/com/android/systemui/util/Utils.java b/packages/SystemUI/src/com/android/systemui/util/Utils.java index e5f30cf63ac33..9e3fcc401ffa5 100644 --- a/packages/SystemUI/src/com/android/systemui/util/Utils.java +++ b/packages/SystemUI/src/com/android/systemui/util/Utils.java @@ -129,9 +129,7 @@ public class Utils { * Off by default, but can be disabled by setting to 0 */ public static boolean useQsMediaPlayer(Context context) { - int flag = Settings.Global.getInt(context.getContentResolver(), - Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1); - return flag > 0; + return true; } /** diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 26237f8045ade..d4a57884879b8 100755 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -1621,8 +1621,6 @@ public class NotificationManagerService extends SystemService { = Settings.Global.getUriFor(Settings.Global.MAX_NOTIFICATION_ENQUEUE_RATE); private final Uri NOTIFICATION_HISTORY_ENABLED = Settings.Secure.getUriFor(Settings.Secure.NOTIFICATION_HISTORY_ENABLED); - private final Uri NOTIFICATION_SHOW_MEDIA_ON_QUICK_SETTINGS_URI - = Settings.Global.getUriFor(Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS); SettingsObserver(Handler handler) { super(handler); @@ -1640,8 +1638,6 @@ public class NotificationManagerService extends SystemService { false, this, UserHandle.USER_ALL); resolver.registerContentObserver(NOTIFICATION_HISTORY_ENABLED, false, this, UserHandle.USER_ALL); - resolver.registerContentObserver(NOTIFICATION_SHOW_MEDIA_ON_QUICK_SETTINGS_URI, - false, this, UserHandle.USER_ALL); update(null); } @@ -1678,9 +1674,6 @@ public class NotificationManagerService extends SystemService { Settings.Secure.NOTIFICATION_HISTORY_ENABLED, 0) == 1); } } - if (uri == null || NOTIFICATION_SHOW_MEDIA_ON_QUICK_SETTINGS_URI.equals(uri)) { - mPreferencesHelper.updateMediaNotificationFilteringEnabled(); - } } } diff --git a/services/core/java/com/android/server/notification/PreferencesHelper.java b/services/core/java/com/android/server/notification/PreferencesHelper.java index dd6a83bc3f605..bc78d66037fe1 100644 --- a/services/core/java/com/android/server/notification/PreferencesHelper.java +++ b/services/core/java/com/android/server/notification/PreferencesHelper.java @@ -166,7 +166,8 @@ public class PreferencesHelper implements RankingConfig { private SparseBooleanArray mBadgingEnabled; private boolean mBubblesEnabledGlobally = DEFAULT_GLOBAL_ALLOW_BUBBLE; - private boolean mIsMediaNotificationFilteringEnabled = DEFAULT_MEDIA_NOTIFICATION_FILTERING; + private final boolean mIsMediaNotificationFilteringEnabled = + DEFAULT_MEDIA_NOTIFICATION_FILTERING; private boolean mAreChannelsBypassingDnd; private boolean mHideSilentStatusBarIcons = DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS; @@ -186,7 +187,6 @@ public class PreferencesHelper implements RankingConfig { updateBadgingEnabled(); updateBubblesEnabled(); - updateMediaNotificationFilteringEnabled(); syncChannelsBypassingDnd(mContext.getUserId()); } @@ -2292,16 +2292,6 @@ public class PreferencesHelper implements RankingConfig { return mBubblesEnabledGlobally; } - /** Requests check of the feature setting for showing media notifications in quick settings. */ - public void updateMediaNotificationFilteringEnabled() { - final boolean newValue = Settings.Global.getInt(mContext.getContentResolver(), - Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1) > 0; - if (newValue != mIsMediaNotificationFilteringEnabled) { - mIsMediaNotificationFilteringEnabled = newValue; - updateConfig(); - } - } - /** Returns true if the setting is enabled for showing media notifications in quick settings. */ public boolean isMediaNotificationFilteringEnabled() { return mIsMediaNotificationFilteringEnabled; diff --git a/services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java b/services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java index e10dfeedae56d..4dc8ad9d0a981 100644 --- a/services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +++ b/services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java @@ -2124,22 +2124,6 @@ public class PreferencesHelperTest extends UiServiceTestCase { assertFalse(mHelper.bubblesEnabled()); } - @Test - public void testShowQSMediaOverrideTrue() { - Global.putInt(getContext().getContentResolver(), - Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1); - mHelper.updateMediaNotificationFilteringEnabled(); // would be called by settings observer - assertTrue(mHelper.isMediaNotificationFilteringEnabled()); - } - - @Test - public void testShowQSMediaOverrideFalse() { - Global.putInt(getContext().getContentResolver(), - Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 0); - mHelper.updateMediaNotificationFilteringEnabled(); // would be called by settings observer - assertFalse(mHelper.isMediaNotificationFilteringEnabled()); - } - @Test public void testOnLocaleChanged_updatesDefaultChannels() throws Exception { String newLabel = "bananas!";