Loading packages/SystemUI/src/com/android/systemui/util/Utils.java +1 −3 Original line number Diff line number Diff line Loading @@ -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; } /** Loading services/core/java/com/android/server/notification/NotificationManagerService.java +0 −7 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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); } Loading Loading @@ -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(); } } } Loading services/core/java/com/android/server/notification/PreferencesHelper.java +2 −12 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -186,7 +187,6 @@ public class PreferencesHelper implements RankingConfig { updateBadgingEnabled(); updateBubblesEnabled(); updateMediaNotificationFilteringEnabled(); syncChannelsBypassingDnd(mContext.getUserId()); } Loading Loading @@ -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; Loading services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +0 −16 Original line number Diff line number Diff line Loading @@ -2087,22 +2087,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!"; Loading Loading
packages/SystemUI/src/com/android/systemui/util/Utils.java +1 −3 Original line number Diff line number Diff line Loading @@ -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; } /** Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +0 −7 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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); } Loading Loading @@ -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(); } } } Loading
services/core/java/com/android/server/notification/PreferencesHelper.java +2 −12 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -186,7 +187,6 @@ public class PreferencesHelper implements RankingConfig { updateBadgingEnabled(); updateBubblesEnabled(); updateMediaNotificationFilteringEnabled(); syncChannelsBypassingDnd(mContext.getUserId()); } Loading Loading @@ -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; Loading
services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +0 −16 Original line number Diff line number Diff line Loading @@ -2087,22 +2087,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!"; Loading