From 8bd61cddb856bc91ddef437cd731b1a8db2c3bee Mon Sep 17 00:00:00 2001 From: Caitlin Shkuratov Date: Fri, 7 Jul 2023 19:51:59 +0000 Subject: [PATCH] [CS] Have SBNotifActivityStarter use KeyguardStateController#isOccluded. CentralSurfacesImpl#isOccluded just delegates to KeyguardStateController under-the-hood, so the activity starter can use KSC directly. Bug: 277764509 Test: manual: verified via logging that SBNAS receives correct isOccluded value when a notification is clicked (true if HUN appears on top of occluding activity like camera, false otherwise) Test: atest StatusBarNotificationActivityStarterTest Change-Id: If9d37bd308306a36ea296688406436b6511da26a --- .../phone/StatusBarNotificationActivityStarter.java | 2 +- .../phone/StatusBarNotificationActivityStarterTest.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java index f79a08173bf24..b5d3f08e0f86c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java @@ -280,7 +280,7 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte mShadeController.addPostCollapseAction(runnable); mShadeController.collapseShade(true /* animate */); } else if (mKeyguardStateController.isShowing() - && mCentralSurfaces.isOccluded()) { + && mKeyguardStateController.isOccluded()) { mStatusBarKeyguardViewManager.addAfterKeyguardGoneRunnable(runnable); mShadeController.collapseShade(); } else { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java index d44af885a27ee..8f91950cb3297 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java @@ -274,7 +274,7 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase { notification.flags |= Notification.FLAG_AUTO_CANCEL; when(mKeyguardStateController.isShowing()).thenReturn(true); - when(mCentralSurfaces.isOccluded()).thenReturn(true); + when(mKeyguardStateController.isOccluded()).thenReturn(true); // When mNotificationActivityStarter.onNotificationClicked(entry, mNotificationRow); @@ -340,7 +340,7 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase { // Given sbn.getNotification().contentIntent = null; when(mKeyguardStateController.isShowing()).thenReturn(true); - when(mCentralSurfaces.isOccluded()).thenReturn(true); + when(mKeyguardStateController.isOccluded()).thenReturn(true); // When mNotificationActivityStarter.onNotificationClicked(entry, mBubbleNotificationRow); @@ -368,7 +368,7 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase { // Given sbn.getNotification().contentIntent = mContentIntent; when(mKeyguardStateController.isShowing()).thenReturn(true); - when(mCentralSurfaces.isOccluded()).thenReturn(true); + when(mKeyguardStateController.isOccluded()).thenReturn(true); // When mNotificationActivityStarter.onNotificationClicked(entry, mBubbleNotificationRow);