Loading core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -8197,6 +8197,12 @@ public final class Settings { public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE = "packages_to_clear_data_before_full_restore"; /** * Setting to determine whether to use the new notification priority handling features. * @hide */ public static final String NOTIFICATION_NEW_INTERRUPTION_MODEL = "new_interruption_model"; /** * This are the settings to be backed up. * Loading Loading @@ -8311,6 +8317,7 @@ public final class Settings { CHARGING_VIBRATION_ENABLED, ACCESSIBILITY_MINIMUM_UI_TIMEOUT_ENABLED, ACCESSIBILITY_MINIMUM_UI_TIMEOUT_MS, NOTIFICATION_NEW_INTERRUPTION_MODEL, }; /** Loading Loading @@ -8470,6 +8477,7 @@ public final class Settings { VALIDATORS.put(ACCESSIBILITY_MINIMUM_UI_TIMEOUT_MS, NON_NEGATIVE_INTEGER_VALIDATOR); VALIDATORS.put(USER_SETUP_COMPLETE, BOOLEAN_VALIDATOR); VALIDATORS.put(ASSIST_GESTURE_SETUP_COMPLETE, BOOLEAN_VALIDATOR); VALIDATORS.put(NOTIFICATION_NEW_INTERRUPTION_MODEL, BOOLEAN_VALIDATOR); } /** Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManager.java +0 −3 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ package com.android.systemui.statusbar; import android.content.pm.UserInfo; import android.os.SystemProperties; import android.service.notification.StatusBarNotification; import android.util.SparseArray; Loading @@ -26,8 +25,6 @@ public interface NotificationLockscreenUserManager { String NOTIFICATION_UNLOCKED_BY_WORK_CHALLENGE_ACTION = "com.android.systemui.statusbar.work_challenge_unlocked_notification_action"; boolean AUTO_DEMOTE_NOTIFICATIONS = SystemProperties.getBoolean("debug.demote_notifs", false); boolean shouldAllowLockscreenRemoteInput(); /** Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +2 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ import com.android.systemui.recents.OverviewProxyService; import com.android.systemui.statusbar.StatusBarStateController.StateListener; import com.android.systemui.statusbar.notification.NotificationData; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.NotificationUtils; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.KeyguardMonitor; Loading Loading @@ -293,7 +294,7 @@ public class NotificationLockscreenUserManagerImpl implements return false; } boolean exceedsPriorityThreshold; if (AUTO_DEMOTE_NOTIFICATIONS) { if (NotificationUtils.useNewInterruptionModel(mContext)) { exceedsPriorityThreshold = getEntryManager().getNotificationData().getImportance(sbn.getKey()) >= IMPORTANCE_DEFAULT; Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationUtils.java +9 −0 Original line number Diff line number Diff line Loading @@ -16,8 +16,11 @@ package com.android.systemui.statusbar.notification; import static android.provider.Settings.Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL; import android.content.Context; import android.graphics.Color; import android.provider.Settings; import android.view.View; import android.widget.ImageView; Loading Loading @@ -68,4 +71,10 @@ public class NotificationUtils { context.getResources().getDisplayMetrics().density); return (int) (dimensionPixelSize * factor); } /** Returns the value of the new interruption model setting. */ public static boolean useNewInterruptionModel(Context context) { return Settings.System.getInt(context.getContentResolver(), NOTIFICATION_NEW_INTERRUPTION_MODEL, 0) != 0; } } packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +1 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import com.android.internal.util.ContrastColorUtil; import com.android.internal.widget.ViewClippingUtil; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.statusbar.NotificationLockscreenUserManager; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.StatusBarIconView; import com.android.systemui.statusbar.notification.NotificationData; Loading Loading @@ -50,7 +49,7 @@ public class NotificationIconAreaController implements DarkReceiver { public void onTuningChanged(String key, String newValue) { if (key.equals(LOW_PRIORITY)) { mShowLowPriority = "1".equals(newValue) || !NotificationLockscreenUserManager.AUTO_DEMOTE_NOTIFICATIONS; || !NotificationUtils.useNewInterruptionModel(mContext); if (mNotificationScrollLayout != null) { updateStatusBarIcons(); } Loading Loading
core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -8197,6 +8197,12 @@ public final class Settings { public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE = "packages_to_clear_data_before_full_restore"; /** * Setting to determine whether to use the new notification priority handling features. * @hide */ public static final String NOTIFICATION_NEW_INTERRUPTION_MODEL = "new_interruption_model"; /** * This are the settings to be backed up. * Loading Loading @@ -8311,6 +8317,7 @@ public final class Settings { CHARGING_VIBRATION_ENABLED, ACCESSIBILITY_MINIMUM_UI_TIMEOUT_ENABLED, ACCESSIBILITY_MINIMUM_UI_TIMEOUT_MS, NOTIFICATION_NEW_INTERRUPTION_MODEL, }; /** Loading Loading @@ -8470,6 +8477,7 @@ public final class Settings { VALIDATORS.put(ACCESSIBILITY_MINIMUM_UI_TIMEOUT_MS, NON_NEGATIVE_INTEGER_VALIDATOR); VALIDATORS.put(USER_SETUP_COMPLETE, BOOLEAN_VALIDATOR); VALIDATORS.put(ASSIST_GESTURE_SETUP_COMPLETE, BOOLEAN_VALIDATOR); VALIDATORS.put(NOTIFICATION_NEW_INTERRUPTION_MODEL, BOOLEAN_VALIDATOR); } /** Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManager.java +0 −3 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ package com.android.systemui.statusbar; import android.content.pm.UserInfo; import android.os.SystemProperties; import android.service.notification.StatusBarNotification; import android.util.SparseArray; Loading @@ -26,8 +25,6 @@ public interface NotificationLockscreenUserManager { String NOTIFICATION_UNLOCKED_BY_WORK_CHALLENGE_ACTION = "com.android.systemui.statusbar.work_challenge_unlocked_notification_action"; boolean AUTO_DEMOTE_NOTIFICATIONS = SystemProperties.getBoolean("debug.demote_notifs", false); boolean shouldAllowLockscreenRemoteInput(); /** Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +2 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ import com.android.systemui.recents.OverviewProxyService; import com.android.systemui.statusbar.StatusBarStateController.StateListener; import com.android.systemui.statusbar.notification.NotificationData; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.NotificationUtils; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.KeyguardMonitor; Loading Loading @@ -293,7 +294,7 @@ public class NotificationLockscreenUserManagerImpl implements return false; } boolean exceedsPriorityThreshold; if (AUTO_DEMOTE_NOTIFICATIONS) { if (NotificationUtils.useNewInterruptionModel(mContext)) { exceedsPriorityThreshold = getEntryManager().getNotificationData().getImportance(sbn.getKey()) >= IMPORTANCE_DEFAULT; Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationUtils.java +9 −0 Original line number Diff line number Diff line Loading @@ -16,8 +16,11 @@ package com.android.systemui.statusbar.notification; import static android.provider.Settings.Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL; import android.content.Context; import android.graphics.Color; import android.provider.Settings; import android.view.View; import android.widget.ImageView; Loading Loading @@ -68,4 +71,10 @@ public class NotificationUtils { context.getResources().getDisplayMetrics().density); return (int) (dimensionPixelSize * factor); } /** Returns the value of the new interruption model setting. */ public static boolean useNewInterruptionModel(Context context) { return Settings.System.getInt(context.getContentResolver(), NOTIFICATION_NEW_INTERRUPTION_MODEL, 0) != 0; } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +1 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import com.android.internal.util.ContrastColorUtil; import com.android.internal.widget.ViewClippingUtil; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.statusbar.NotificationLockscreenUserManager; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.StatusBarIconView; import com.android.systemui.statusbar.notification.NotificationData; Loading Loading @@ -50,7 +49,7 @@ public class NotificationIconAreaController implements DarkReceiver { public void onTuningChanged(String key, String newValue) { if (key.equals(LOW_PRIORITY)) { mShowLowPriority = "1".equals(newValue) || !NotificationLockscreenUserManager.AUTO_DEMOTE_NOTIFICATIONS; || !NotificationUtils.useNewInterruptionModel(mContext); if (mNotificationScrollLayout != null) { updateStatusBarIcons(); } Loading