From da330ff413c6761e1d82c2b3cb12798067e5df80 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 11 Jun 2019 15:41:28 -0700 Subject: [PATCH] Fixes an issue where the wrong icons where ambient This is a regression from P from when we hid the statusbar icons of non-high-priority notifications by default Fixes: 134444704 Test: atest SystemUITests Merged-In: I2e571353735efb0d763ecc236f60aefe4c2b51d4 Change-Id: I2e571353735efb0d763ecc236f60aefe4c2b51d4 --- .../stack/NotificationStackScrollLayout.java | 16 ++++++++-------- .../statusbar/phone/NotificationIconAreaController.java | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 4e48eff6083d..c6a6643684c9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -20,7 +20,7 @@ import static com.android.systemui.Dependency.ALLOW_NOTIFICATION_LONG_PRESS_NAME import static com.android.systemui.statusbar.notification.ActivityLaunchAnimator.ExpandAnimationParameters; import static com.android.systemui.statusbar.notification.stack.StackScrollAlgorithm.ANCHOR_SCROLLING; import static com.android.systemui.statusbar.notification.stack.StackStateAnimator.ANIMATION_DURATION_SWIPE; -import static com.android.systemui.statusbar.phone.NotificationIconAreaController.LOW_PRIORITY; +import static com.android.systemui.statusbar.phone.NotificationIconAreaController.HIGH_PRIORITY; import static com.android.systemui.util.InjectionInflationController.VIEW_CONTEXT; import static java.lang.annotation.RetentionPolicy.SOURCE; @@ -186,7 +186,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd private int mCurrentStackHeight = Integer.MAX_VALUE; private final Paint mBackgroundPaint = new Paint(); private final boolean mShouldDrawNotificationBackground; - private boolean mLowPriorityBeforeSpeedBump; + private boolean mHighPriorityBeforeSpeedBump; private final boolean mAllowLongPress; private boolean mDismissRtl; @@ -580,12 +580,12 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd TunerService tunerService = Dependency.get(TunerService.class); tunerService.addTunable((key, newValue) -> { - if (key.equals(LOW_PRIORITY)) { - mLowPriorityBeforeSpeedBump = "1".equals(newValue); + if (key.equals(HIGH_PRIORITY)) { + mHighPriorityBeforeSpeedBump = "1".equals(newValue); } else if (key.equals(Settings.Secure.NOTIFICATION_DISMISS_RTL)) { updateDismissRtlSetting("1".equals(newValue)); } - }, LOW_PRIORITY, Settings.Secure.NOTIFICATION_DISMISS_RTL); + }, HIGH_PRIORITY, Settings.Secure.NOTIFICATION_DISMISS_RTL); mEntryManager.addNotificationEntryListener(new NotificationEntryListener() { @Override @@ -5711,10 +5711,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd ExpandableNotificationRow row = (ExpandableNotificationRow) view; currentIndex++; boolean beforeSpeedBump; - if (mLowPriorityBeforeSpeedBump) { - beforeSpeedBump = !row.getEntry().ambient; - } else { + if (mHighPriorityBeforeSpeedBump) { beforeSpeedBump = row.getEntry().isHighPriority(); + } else { + beforeSpeedBump = !row.getEntry().ambient; } if (beforeSpeedBump) { speedBumpIndex = currentIndex; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java index 177b72a01f85..4fb5b98ec3ad 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java @@ -43,7 +43,7 @@ import java.util.function.Function; public class NotificationIconAreaController implements DarkReceiver, StatusBarStateController.StateListener { - public static final String LOW_PRIORITY = "low_priority"; + public static final String HIGH_PRIORITY = "high_priority"; private static final long AOD_ICONS_APPEAR_DURATION = 200; private final ContrastColorUtil mContrastColorUtil; -- 2.11.0