Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -6856,4 +6856,7 @@ <!-- Whether the View-based scroll haptic feedback implementation is enabled for {@link InputDevice#SOURCE_ROTARY_ENCODER}s. --> <bool name="config_viewBasedRotaryEncoderHapticsEnabled">false</bool> <!-- Whether the media player is shown on the quick settings --> <bool name="config_quickSettingsShowMediaPlayer">true</bool> </resources> core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -5298,4 +5298,6 @@ <java-symbol type="array" name="config_tvExternalInputLoggingDeviceBrandNames" /> <java-symbol type="bool" name="config_viewRotaryEncoderHapticScrollFedbackEnabled" /> <java-symbol type="bool" name="config_viewBasedRotaryEncoderHapticsEnabled" /> <java-symbol type="bool" name="config_quickSettingsShowMediaPlayer" /> </resources> packages/SystemUI/src/com/android/systemui/util/Utils.java +6 −4 Original line number Diff line number Diff line Loading @@ -83,17 +83,19 @@ public class Utils { /** * Allow the media player to be shown in the QS area, controlled by 2 flags. * Off by default, but can be disabled by setting to 0 * On by default, but can be disabled by setting either flag to 0/false. */ public static boolean useQsMediaPlayer(Context context) { // TODO(b/192412820): Replace SHOW_MEDIA_ON_QUICK_SETTINGS with compile-time value // Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS can't be toggled at runtime, so simply // cache the first result we fetch and use that going forward. Do this to avoid unnecessary // binder calls which may happen on the critical path. if (sUseQsMediaPlayer == null) { int flag = Settings.Global.getInt(context.getContentResolver(), // TODO(b/192412820): Consolidate SHOW_MEDIA_ON_QUICK_SETTINGS into compile-time value. final int settingsFlag = Settings.Global.getInt(context.getContentResolver(), Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1); sUseQsMediaPlayer = flag > 0; final boolean configFlag = context.getResources() .getBoolean(com.android.internal.R.bool.config_quickSettingsShowMediaPlayer); sUseQsMediaPlayer = settingsFlag > 0 && configFlag; } return sUseQsMediaPlayer; } Loading services/core/java/com/android/server/notification/PreferencesHelper.java +7 −3 Original line number Diff line number Diff line Loading @@ -161,7 +161,6 @@ public class PreferencesHelper implements RankingConfig { static final boolean DEFAULT_BUBBLES_ENABLED = true; @VisibleForTesting static final int DEFAULT_BUBBLE_PREFERENCE = BUBBLE_PREFERENCE_NONE; static final boolean DEFAULT_MEDIA_NOTIFICATION_FILTERING = true; private static final int NOTIFICATION_UPDATE_LOG_SUBTYPE_FROM_APP = 0; private static final int NOTIFICATION_UPDATE_LOG_SUBTYPE_FROM_USER = 1; Loading Loading @@ -200,7 +199,7 @@ public class PreferencesHelper implements RankingConfig { private SparseBooleanArray mBubblesEnabled; private SparseBooleanArray mLockScreenShowNotifications; private SparseBooleanArray mLockScreenPrivateNotifications; private boolean mIsMediaNotificationFilteringEnabled = DEFAULT_MEDIA_NOTIFICATION_FILTERING; private boolean mIsMediaNotificationFilteringEnabled; // When modes_api flag is enabled, this value only tracks whether the current user has any // channels marked as "priority channels", but not necessarily whether they are permitted // to bypass DND by current zen policy. Loading @@ -224,6 +223,8 @@ public class PreferencesHelper implements RankingConfig { mAppOps = appOpsManager; mUserProfiles = userProfiles; mShowReviewPermissionsNotification = showReviewPermissionsNotification; mIsMediaNotificationFilteringEnabled = context.getResources() .getBoolean(R.bool.config_quickSettingsShowMediaPlayer); XML_VERSION = 4; Loading Loading @@ -2692,8 +2693,11 @@ public class PreferencesHelper implements RankingConfig { /** Requests check of the feature setting for showing media notifications in quick settings. */ public void updateMediaNotificationFilteringEnabled() { // TODO(b/192412820): Consolidate SHOW_MEDIA_ON_QUICK_SETTINGS into compile-time value. final boolean newValue = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1) > 0; Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1) > 0 && mContext.getResources().getBoolean( R.bool.config_quickSettingsShowMediaPlayer); if (newValue != mIsMediaNotificationFilteringEnabled) { mIsMediaNotificationFilteringEnabled = newValue; updateConfig(); Loading Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -6856,4 +6856,7 @@ <!-- Whether the View-based scroll haptic feedback implementation is enabled for {@link InputDevice#SOURCE_ROTARY_ENCODER}s. --> <bool name="config_viewBasedRotaryEncoderHapticsEnabled">false</bool> <!-- Whether the media player is shown on the quick settings --> <bool name="config_quickSettingsShowMediaPlayer">true</bool> </resources>
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -5298,4 +5298,6 @@ <java-symbol type="array" name="config_tvExternalInputLoggingDeviceBrandNames" /> <java-symbol type="bool" name="config_viewRotaryEncoderHapticScrollFedbackEnabled" /> <java-symbol type="bool" name="config_viewBasedRotaryEncoderHapticsEnabled" /> <java-symbol type="bool" name="config_quickSettingsShowMediaPlayer" /> </resources>
packages/SystemUI/src/com/android/systemui/util/Utils.java +6 −4 Original line number Diff line number Diff line Loading @@ -83,17 +83,19 @@ public class Utils { /** * Allow the media player to be shown in the QS area, controlled by 2 flags. * Off by default, but can be disabled by setting to 0 * On by default, but can be disabled by setting either flag to 0/false. */ public static boolean useQsMediaPlayer(Context context) { // TODO(b/192412820): Replace SHOW_MEDIA_ON_QUICK_SETTINGS with compile-time value // Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS can't be toggled at runtime, so simply // cache the first result we fetch and use that going forward. Do this to avoid unnecessary // binder calls which may happen on the critical path. if (sUseQsMediaPlayer == null) { int flag = Settings.Global.getInt(context.getContentResolver(), // TODO(b/192412820): Consolidate SHOW_MEDIA_ON_QUICK_SETTINGS into compile-time value. final int settingsFlag = Settings.Global.getInt(context.getContentResolver(), Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1); sUseQsMediaPlayer = flag > 0; final boolean configFlag = context.getResources() .getBoolean(com.android.internal.R.bool.config_quickSettingsShowMediaPlayer); sUseQsMediaPlayer = settingsFlag > 0 && configFlag; } return sUseQsMediaPlayer; } Loading
services/core/java/com/android/server/notification/PreferencesHelper.java +7 −3 Original line number Diff line number Diff line Loading @@ -161,7 +161,6 @@ public class PreferencesHelper implements RankingConfig { static final boolean DEFAULT_BUBBLES_ENABLED = true; @VisibleForTesting static final int DEFAULT_BUBBLE_PREFERENCE = BUBBLE_PREFERENCE_NONE; static final boolean DEFAULT_MEDIA_NOTIFICATION_FILTERING = true; private static final int NOTIFICATION_UPDATE_LOG_SUBTYPE_FROM_APP = 0; private static final int NOTIFICATION_UPDATE_LOG_SUBTYPE_FROM_USER = 1; Loading Loading @@ -200,7 +199,7 @@ public class PreferencesHelper implements RankingConfig { private SparseBooleanArray mBubblesEnabled; private SparseBooleanArray mLockScreenShowNotifications; private SparseBooleanArray mLockScreenPrivateNotifications; private boolean mIsMediaNotificationFilteringEnabled = DEFAULT_MEDIA_NOTIFICATION_FILTERING; private boolean mIsMediaNotificationFilteringEnabled; // When modes_api flag is enabled, this value only tracks whether the current user has any // channels marked as "priority channels", but not necessarily whether they are permitted // to bypass DND by current zen policy. Loading @@ -224,6 +223,8 @@ public class PreferencesHelper implements RankingConfig { mAppOps = appOpsManager; mUserProfiles = userProfiles; mShowReviewPermissionsNotification = showReviewPermissionsNotification; mIsMediaNotificationFilteringEnabled = context.getResources() .getBoolean(R.bool.config_quickSettingsShowMediaPlayer); XML_VERSION = 4; Loading Loading @@ -2692,8 +2693,11 @@ public class PreferencesHelper implements RankingConfig { /** Requests check of the feature setting for showing media notifications in quick settings. */ public void updateMediaNotificationFilteringEnabled() { // TODO(b/192412820): Consolidate SHOW_MEDIA_ON_QUICK_SETTINGS into compile-time value. final boolean newValue = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1) > 0; Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1) > 0 && mContext.getResources().getBoolean( R.bool.config_quickSettingsShowMediaPlayer); if (newValue != mIsMediaNotificationFilteringEnabled) { mIsMediaNotificationFilteringEnabled = newValue; updateConfig(); Loading