Loading core/java/android/app/Notification.java +2 −1 Original line number Diff line number Diff line Loading @@ -5937,8 +5937,9 @@ public class Notification implements Parcelable /** * @return whether this notification is a foreground service notification * @hide */ private boolean isForegroundService() { public boolean isForegroundService() { return (flags & Notification.FLAG_FOREGROUND_SERVICE) != 0; } Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +1 −4 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ */ package com.android.systemui.statusbar; import static android.app.NotificationManager.IMPORTANCE_DEFAULT; import static android.app.admin.DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED; import android.app.ActivityManager; Loading Loading @@ -295,9 +294,7 @@ public class NotificationLockscreenUserManagerImpl implements } boolean exceedsPriorityThreshold; if (NotificationUtils.useNewInterruptionModel(mContext)) { exceedsPriorityThreshold = getEntryManager().getNotificationData().getImportance(sbn.getKey()) >= IMPORTANCE_DEFAULT; exceedsPriorityThreshold = getEntryManager().getNotificationData().isHighPriority(sbn); } else { exceedsPriorityThreshold = !getEntryManager().getNotificationData().isAmbient(sbn.getKey()); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationData.java +14 −0 Original line number Diff line number Diff line Loading @@ -593,6 +593,20 @@ public class NotificationData { } } /** * Returns true if this notification should be displayed in the high-priority notifications * section (and on the lockscreen and status bar). */ public boolean isHighPriority(StatusBarNotification statusBarNotification) { if (mRankingMap != null) { getRanking(statusBarNotification.getKey(), mTmpRanking); return mTmpRanking.getImportance() >= NotificationManager.IMPORTANCE_DEFAULT || statusBarNotification.getNotification().isForegroundService() || statusBarNotification.getNotification().hasMediaSession(); } return false; } public boolean isAmbient(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +8 −12 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.systemui.statusbar.notification.stack; import static android.app.NotificationManager.IMPORTANCE_DEFAULT; import static com.android.systemui.statusbar.notification.ActivityLaunchAnimator .ExpandAnimationParameters; import static com.android.systemui.statusbar.phone.NotificationIconAreaController.LOW_PRIORITY; Loading @@ -28,7 +26,6 @@ import android.animation.TimeAnimator; import android.animation.ValueAnimator; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.NotificationManager; import android.app.WallpaperManager; import android.content.Context; import android.content.Intent; Loading Loading @@ -2315,8 +2312,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd View child = getChildAt(i); if (child.getVisibility() != View.GONE && child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; if (mEntryManager.getNotificationData().getImportance( row.getStatusBarNotification().getKey()) < IMPORTANCE_DEFAULT) { if (mEntryManager.getNotificationData().isHighPriority( row.getStatusBarNotification())) { break; } else { lastChildBeforeGap = row; Loading @@ -2334,8 +2331,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd View child = getChildAt(i); if (child.getVisibility() != View.GONE && child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; if (mEntryManager.getNotificationData().getImportance( row.getStatusBarNotification().getKey()) < IMPORTANCE_DEFAULT) { if (!mEntryManager.getNotificationData().isHighPriority( row.getStatusBarNotification())) { return row; } } Loading Loading @@ -5218,9 +5215,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd beforeSpeedBump = !mEntryManager.getNotificationData().isAmbient( row.getStatusBarNotification().getKey()); } else { beforeSpeedBump = mEntryManager.getNotificationData().getImportance( row.getStatusBarNotification().getKey()) >= NotificationManager.IMPORTANCE_DEFAULT; beforeSpeedBump = mEntryManager.getNotificationData().isHighPriority( row.getStatusBarNotification()); } if (beforeSpeedBump) { speedBumpIndex = currentIndex; Loading @@ -5244,8 +5240,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd continue; } ExpandableNotificationRow row = (ExpandableNotificationRow) view; if (mEntryManager.getNotificationData().getImportance( row.getStatusBarNotification().getKey()) < IMPORTANCE_DEFAULT) { if (!mEntryManager.getNotificationData().isHighPriority( row.getStatusBarNotification())) { if (currentIndex > 0) { gapIndex = currentIndex; } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +1 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ package com.android.systemui.statusbar.phone; import static com.android.systemui.doze.util.BurnInHelperKt.getBurnInOffset; import android.app.NotificationManager; import android.content.Context; import android.content.res.Resources; import android.graphics.Color; Loading Loading @@ -190,8 +189,7 @@ public class NotificationIconAreaController implements DarkReceiver { return false; } if (!showLowPriority && mEntryManager.getNotificationData().getImportance(entry.key) < NotificationManager.IMPORTANCE_DEFAULT) { && !mEntryManager.getNotificationData().isHighPriority(entry.notification)) { return false; } if (!StatusBar.isTopLevelChild(entry)) { Loading Loading
core/java/android/app/Notification.java +2 −1 Original line number Diff line number Diff line Loading @@ -5937,8 +5937,9 @@ public class Notification implements Parcelable /** * @return whether this notification is a foreground service notification * @hide */ private boolean isForegroundService() { public boolean isForegroundService() { return (flags & Notification.FLAG_FOREGROUND_SERVICE) != 0; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +1 −4 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ */ package com.android.systemui.statusbar; import static android.app.NotificationManager.IMPORTANCE_DEFAULT; import static android.app.admin.DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED; import android.app.ActivityManager; Loading Loading @@ -295,9 +294,7 @@ public class NotificationLockscreenUserManagerImpl implements } boolean exceedsPriorityThreshold; if (NotificationUtils.useNewInterruptionModel(mContext)) { exceedsPriorityThreshold = getEntryManager().getNotificationData().getImportance(sbn.getKey()) >= IMPORTANCE_DEFAULT; exceedsPriorityThreshold = getEntryManager().getNotificationData().isHighPriority(sbn); } else { exceedsPriorityThreshold = !getEntryManager().getNotificationData().isAmbient(sbn.getKey()); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationData.java +14 −0 Original line number Diff line number Diff line Loading @@ -593,6 +593,20 @@ public class NotificationData { } } /** * Returns true if this notification should be displayed in the high-priority notifications * section (and on the lockscreen and status bar). */ public boolean isHighPriority(StatusBarNotification statusBarNotification) { if (mRankingMap != null) { getRanking(statusBarNotification.getKey(), mTmpRanking); return mTmpRanking.getImportance() >= NotificationManager.IMPORTANCE_DEFAULT || statusBarNotification.getNotification().isForegroundService() || statusBarNotification.getNotification().hasMediaSession(); } return false; } public boolean isAmbient(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +8 −12 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.systemui.statusbar.notification.stack; import static android.app.NotificationManager.IMPORTANCE_DEFAULT; import static com.android.systemui.statusbar.notification.ActivityLaunchAnimator .ExpandAnimationParameters; import static com.android.systemui.statusbar.phone.NotificationIconAreaController.LOW_PRIORITY; Loading @@ -28,7 +26,6 @@ import android.animation.TimeAnimator; import android.animation.ValueAnimator; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.NotificationManager; import android.app.WallpaperManager; import android.content.Context; import android.content.Intent; Loading Loading @@ -2315,8 +2312,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd View child = getChildAt(i); if (child.getVisibility() != View.GONE && child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; if (mEntryManager.getNotificationData().getImportance( row.getStatusBarNotification().getKey()) < IMPORTANCE_DEFAULT) { if (mEntryManager.getNotificationData().isHighPriority( row.getStatusBarNotification())) { break; } else { lastChildBeforeGap = row; Loading @@ -2334,8 +2331,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd View child = getChildAt(i); if (child.getVisibility() != View.GONE && child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; if (mEntryManager.getNotificationData().getImportance( row.getStatusBarNotification().getKey()) < IMPORTANCE_DEFAULT) { if (!mEntryManager.getNotificationData().isHighPriority( row.getStatusBarNotification())) { return row; } } Loading Loading @@ -5218,9 +5215,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd beforeSpeedBump = !mEntryManager.getNotificationData().isAmbient( row.getStatusBarNotification().getKey()); } else { beforeSpeedBump = mEntryManager.getNotificationData().getImportance( row.getStatusBarNotification().getKey()) >= NotificationManager.IMPORTANCE_DEFAULT; beforeSpeedBump = mEntryManager.getNotificationData().isHighPriority( row.getStatusBarNotification()); } if (beforeSpeedBump) { speedBumpIndex = currentIndex; Loading @@ -5244,8 +5240,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd continue; } ExpandableNotificationRow row = (ExpandableNotificationRow) view; if (mEntryManager.getNotificationData().getImportance( row.getStatusBarNotification().getKey()) < IMPORTANCE_DEFAULT) { if (!mEntryManager.getNotificationData().isHighPriority( row.getStatusBarNotification())) { if (currentIndex > 0) { gapIndex = currentIndex; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +1 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ package com.android.systemui.statusbar.phone; import static com.android.systemui.doze.util.BurnInHelperKt.getBurnInOffset; import android.app.NotificationManager; import android.content.Context; import android.content.res.Resources; import android.graphics.Color; Loading Loading @@ -190,8 +189,7 @@ public class NotificationIconAreaController implements DarkReceiver { return false; } if (!showLowPriority && mEntryManager.getNotificationData().getImportance(entry.key) < NotificationManager.IMPORTANCE_DEFAULT) { && !mEntryManager.getNotificationData().isHighPriority(entry.notification)) { return false; } if (!StatusBar.isTopLevelChild(entry)) { Loading