From 421cf7df11caeb8504ab3e0b0d05d198c9667f97 Mon Sep 17 00:00:00 2001 From: Justin Weir Date: Mon, 6 Mar 2023 15:48:12 -0500 Subject: [PATCH] Disable shade open when FRP is active Bug: 267313135 Test: manual and presubmits. added unit test. Change-Id: Id3a155a2ac821620619d4b36904d132b76a6fde8 --- .../systemui/statusbar/phone/CentralSurfacesImpl.java | 3 ++- .../statusbar/phone/CentralSurfacesImplTest.java | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java index be791f9e2242d..460fb88ec5794 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -3571,7 +3571,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { boolean goingToSleepWithoutAnimation = isGoingToSleep() && !mDozeParameters.shouldControlScreenOff(); boolean disabled = (!mDeviceInteractive && !mDozeServiceHost.isPulsing()) - || goingToSleepWithoutAnimation; + || goingToSleepWithoutAnimation + || mDeviceProvisionedController.isFrpActive(); mNotificationPanelViewController.setTouchAndAnimationDisabled(disabled); mNotificationIconAreaController.setAnimationsEnabled(!disabled); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java index 5a5b1424758fc..52a93e7e07b3a 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java @@ -1259,6 +1259,15 @@ public class CentralSurfacesImplTest extends SysuiTestCase { verify(mPowerManagerService, never()).wakeUp(anyLong(), anyInt(), anyString(), anyString()); } + @Test + public void frpLockedDevice_shadeDisabled() { + when(mDeviceProvisionedController.isFrpActive()).thenReturn(true); + when(mDozeServiceHost.isPulsing()).thenReturn(true); + mCentralSurfaces.updateNotificationPanelTouchState(); + + verify(mNotificationPanelViewController).setTouchAndAnimationDisabled(true); + } + /** * Configures the appropriate mocks and then calls {@link CentralSurfacesImpl#updateIsKeyguard} * to reconfigure the keyguard to reflect the requested showing/occluded states.