Fix issue where scrims would not go away
Change-Id: Ibb683d6bddadd5b670da28427d4801e03d575bd8
Fixes: 70245015
Test: runtest -x packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index 7c33437..3e32446 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -5112,6 +5112,7 @@
public void notifyFpAuthModeChanged() {
updateDozing();
+ updateScrimController();
}
private void updateDozing() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
index 713f7843..0aeb7b6 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
@@ -104,6 +104,7 @@
PowerManager mPowerManager;
SystemServicesProxy mSystemServicesProxy;
NotificationPanelView mNotificationPanelView;
+ ScrimController mScrimController;
IStatusBarService mBarService;
ArrayList<Entry> mNotificationList;
private DisplayMetrics mDisplayMetrics = new DisplayMetrics();
@@ -131,6 +132,7 @@
mNotificationPanelView = mock(NotificationPanelView.class);
when(mNotificationPanelView.getLayoutParams()).thenReturn(new LayoutParams(0, 0));
mNotificationList = mock(ArrayList.class);
+ mScrimController = mock(ScrimController.class);
IPowerManager powerManagerService = mock(IPowerManager.class);
HandlerThread handlerThread = new HandlerThread("TestThread");
handlerThread.start();
@@ -143,7 +145,7 @@
mStatusBar = new TestableStatusBar(mStatusBarKeyguardViewManager, mUnlockMethodCache,
mKeyguardIndicationController, mStackScroller, mHeadsUpManager,
mNotificationData, mPowerManager, mSystemServicesProxy, mNotificationPanelView,
- mBarService);
+ mBarService, mScrimController);
mStatusBar.mContext = mContext;
mStatusBar.mComponents = mContext.getComponents();
doAnswer(invocation -> {
@@ -532,12 +534,21 @@
mStatusBar.updateKeyguardState(false, false);
}
+ @Test
+ public void testFingerprintNotification_UpdatesScrims() {
+ mStatusBar.mStatusBarWindowManager = mock(StatusBarWindowManager.class);
+ mStatusBar.mFingerprintUnlockController = mock(FingerprintUnlockController.class);
+ mStatusBar.mDozeScrimController = mock(DozeScrimController.class);
+ mStatusBar.notifyFpAuthModeChanged();
+ verify(mScrimController).transitionTo(any(), any());
+ }
+
static class TestableStatusBar extends StatusBar {
public TestableStatusBar(StatusBarKeyguardViewManager man,
UnlockMethodCache unlock, KeyguardIndicationController key,
NotificationStackScrollLayout stack, HeadsUpManager hum, NotificationData nd,
PowerManager pm, SystemServicesProxy ssp, NotificationPanelView panelView,
- IStatusBarService barService) {
+ IStatusBarService barService, ScrimController scrimController) {
mStatusBarKeyguardViewManager = man;
mUnlockMethodCache = unlock;
mKeyguardIndicationController = key;
@@ -550,7 +561,7 @@
mNotificationPanel = panelView;
mBarService = barService;
mWakefulnessLifecycle = createAwakeWakefulnessLifecycle();
- mScrimController = mock(ScrimController.class);
+ mScrimController = scrimController;
}
private WakefulnessLifecycle createAwakeWakefulnessLifecycle() {