From 47a65c79c94ac605e3a17e66555f2db7ac05b9d1 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Thu, 15 Feb 2018 14:16:18 -0800 Subject: [PATCH] Hide activities when AOD comes in Display timeout does not lock the keyguard, which means that activities won't immediatelly disappear. We need to factor AOD into to equation to make sure that the user won't see phantom activities under the status bar window when the display times out. Fixes: 73120928 Test: open Settings, wait for display timeout Test: Wait for display timeout, press power, see launcher Test: Launch maps, start navigation (FLAG_SHOW_WHEN_LOCKED) Test: Go to AOD, press power button: activity is occluding keyguard Test: Press home: bouncer shows up Test: Unlock: maps goes into pip mode Test: Go to AOD and back to lock screen: keyguard visible Test: Expand maps, go to AOD, back to lock screen: maps is occluding keyguard Change-Id: I9b7512313af2f851d8788ec53de7880bce3bed2c --- core/java/android/app/IActivityManager.aidl | 6 ++- .../keyguard/KeyguardViewMediator.java | 43 ++++++++++++------- .../systemui/statusbar/phone/StatusBar.java | 4 ++ .../phone/StatusBarWindowManager.java | 4 +- .../statusbar/phone/StatusBarTest.java | 7 ++- .../server/am/ActivityManagerService.java | 10 +++-- .../com/android/server/am/ActivityStack.java | 13 +++--- .../server/am/ActivityStackSupervisor.java | 4 +- .../android/server/am/KeyguardController.java | 29 +++++++++---- .../keyguard/KeyguardServiceDelegate.java | 3 +- .../am/ActivityStackSupervisorTests.java | 2 +- 11 files changed, 82 insertions(+), 43 deletions(-) diff --git a/core/java/android/app/IActivityManager.aidl b/core/java/android/app/IActivityManager.aidl index 99efecd219848..3bb87a33852fb 100644 --- a/core/java/android/app/IActivityManager.aidl +++ b/core/java/android/app/IActivityManager.aidl @@ -322,12 +322,14 @@ interface IActivityManager { /** * Informs ActivityManagerService that the keyguard is showing. * - * @param showing True if the keyguard is showing, false otherwise. + * @param showingKeyguard True if the keyguard is showing, false otherwise. + * @param showingAod True if AOD is showing, false otherwise. * @param secondaryDisplayShowing The displayId of the secondary display on which the keyguard * is showing, or INVALID_DISPLAY if there is no such display. Only meaningful if * showing is true. */ - void setLockScreenShown(boolean showing, int secondaryDisplayShowing); + void setLockScreenShown(boolean showingKeyguard, boolean showingAod, + int secondaryDisplayShowing); boolean finishActivityAffinity(in IBinder token); // This is not public because you need to be very careful in how you // manage your activity to make sure it is always the uid you expect. diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index a1b17e4ef0ea4..d6e59c77af9ce 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -27,7 +27,6 @@ import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STR import android.app.ActivityManager; import android.app.AlarmManager; -import android.app.NotificationManager; import android.app.PendingIntent; import android.app.StatusBarManager; import android.app.trust.TrustManager; @@ -235,6 +234,9 @@ public class KeyguardViewMediator extends SystemUI { // answer whether the input should be restricted) private boolean mShowing; + // AOD is enabled and status bar is in AOD state. + private boolean mAodShowing; + // display id of the secondary display on which we have put a keyguard window private int mSecondaryDisplayShowing = INVALID_DISPLAY; @@ -664,7 +666,7 @@ public class KeyguardViewMediator extends SystemUI { @Override public void onSecondaryDisplayShowingChanged(int displayId) { synchronized (KeyguardViewMediator.this) { - setShowingLocked(mShowing, displayId, false); + setShowingLocked(mShowing, mAodShowing, displayId, false); } } }; @@ -707,10 +709,10 @@ public class KeyguardViewMediator extends SystemUI { setShowingLocked(!shouldWaitForProvisioning() && !mLockPatternUtils.isLockScreenDisabled( KeyguardUpdateMonitor.getCurrentUser()), - mSecondaryDisplayShowing, true /* forceCallbacks */); + mAodShowing, mSecondaryDisplayShowing, true /* forceCallbacks */); } else { // The system's keyguard is disabled or missing. - setShowingLocked(false, mSecondaryDisplayShowing, true); + setShowingLocked(false, mAodShowing, mSecondaryDisplayShowing, true); } mStatusBarKeyguardViewManager = @@ -1311,7 +1313,7 @@ public class KeyguardViewMediator extends SystemUI { if (mLockPatternUtils.checkVoldPassword(KeyguardUpdateMonitor.getCurrentUser())) { if (DEBUG) Log.d(TAG, "Not showing lock screen since just decrypted"); // Without this, settings is not enabled until the lock screen first appears - setShowingLocked(false); + setShowingLocked(false, mAodShowing); hideLocked(); return; } @@ -1713,10 +1715,12 @@ public class KeyguardViewMediator extends SystemUI { playSound(mTrustedSoundId); } - private void updateActivityLockScreenState(boolean showing, int secondaryDisplayShowing) { + private void updateActivityLockScreenState(boolean showing, boolean aodShowing, + int secondaryDisplayShowing) { mUiOffloadThread.submit(() -> { try { - ActivityManager.getService().setLockScreenShown(showing, secondaryDisplayShowing); + ActivityManager.getService().setLockScreenShown(showing, aodShowing, + secondaryDisplayShowing); } catch (RemoteException e) { } }); @@ -1740,7 +1744,7 @@ public class KeyguardViewMediator extends SystemUI { if (DEBUG) Log.d(TAG, "handleShow"); } - setShowingLocked(true); + setShowingLocked(true, mAodShowing); mStatusBarKeyguardViewManager.show(options); mHiding = false; mWakeAndUnlocking = false; @@ -1849,7 +1853,7 @@ public class KeyguardViewMediator extends SystemUI { } mWakeAndUnlocking = false; - setShowingLocked(false); + setShowingLocked(false, mAodShowing); mDismissCallbackRegistry.notifyDismissSucceeded(); mStatusBarKeyguardViewManager.hide(startTime, fadeoutDuration); resetKeyguardDonePendingLocked(); @@ -1909,7 +1913,7 @@ public class KeyguardViewMediator extends SystemUI { Trace.beginSection("KeyguardViewMediator#handleVerifyUnlock"); synchronized (KeyguardViewMediator.this) { if (DEBUG) Log.d(TAG, "handleVerifyUnlock"); - setShowingLocked(true); + setShowingLocked(true, mAodShowing); mStatusBarKeyguardViewManager.dismissAndCollapse(); } Trace.endSection(); @@ -2064,6 +2068,10 @@ public class KeyguardViewMediator extends SystemUI { pw.print(" mDrawnCallback: "); pw.println(mDrawnCallback); } + public void setAodShowing(boolean aodShowing) { + setShowingLocked(mShowing, aodShowing); + } + private static class StartKeyguardExitAnimParams { long startTime; @@ -2075,20 +2083,23 @@ public class KeyguardViewMediator extends SystemUI { } } - private void setShowingLocked(boolean showing) { - setShowingLocked(showing, mSecondaryDisplayShowing, false /* forceCallbacks */); + private void setShowingLocked(boolean showing, boolean aodShowing) { + setShowingLocked(showing, aodShowing, mSecondaryDisplayShowing, + false /* forceCallbacks */); } - private void setShowingLocked( - boolean showing, int secondaryDisplayShowing, boolean forceCallbacks) { - final boolean notifyDefaultDisplayCallbacks = showing != mShowing || forceCallbacks; + private void setShowingLocked(boolean showing, boolean aodShowing, int secondaryDisplayShowing, + boolean forceCallbacks) { + final boolean notifyDefaultDisplayCallbacks = showing != mShowing + || aodShowing != mAodShowing || forceCallbacks; if (notifyDefaultDisplayCallbacks || secondaryDisplayShowing != mSecondaryDisplayShowing) { mShowing = showing; + mAodShowing = aodShowing; mSecondaryDisplayShowing = secondaryDisplayShowing; if (notifyDefaultDisplayCallbacks) { notifyDefaultDisplayCallbacks(showing); } - updateActivityLockScreenState(showing, secondaryDisplayShowing); + updateActivityLockScreenState(showing, aodShowing, secondaryDisplayShowing); } } 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 ddb67dfa8f333..b8325febfa45a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -408,6 +408,7 @@ public class StatusBar extends SystemUI implements DemoMode, protected NotificationEntryManager mEntryManager; protected NotificationViewHierarchyManager mViewHierarchyManager; protected AppOpsListener mAppOpsListener; + protected KeyguardViewMediator mKeyguardViewMediator; private ZenModeController mZenController; /** @@ -632,6 +633,7 @@ public class StatusBar extends SystemUI implements DemoMode, mAppOpsListener = Dependency.get(AppOpsListener.class); mAppOpsListener.setUpWithPresenter(this, mEntryManager); mZenController = Dependency.get(ZenModeController.class); + mKeyguardViewMediator = getComponent(KeyguardViewMediator.class); mColorExtractor = Dependency.get(SysuiColorExtractor.class); mColorExtractor.addOnColorsChangedListener(this); @@ -4628,6 +4630,7 @@ public class StatusBar extends SystemUI implements DemoMode, boolean dozing = mDozingRequested && mState == StatusBarState.KEYGUARD || mFingerprintUnlockController.getMode() == FingerprintUnlockController.MODE_WAKE_AND_UNLOCK_PULSING; + final boolean alwaysOn = DozeParameters.getInstance(mContext).getAlwaysOn(); // When in wake-and-unlock we may not have received a change to mState // but we still should not be dozing, manually set to false. if (mFingerprintUnlockController.getMode() == @@ -4635,6 +4638,7 @@ public class StatusBar extends SystemUI implements DemoMode, dozing = false; } mDozing = dozing; + mKeyguardViewMediator.setAodShowing(mDozing && alwaysOn); mStatusBarWindowManager.setDozing(mDozing); mStatusBarKeyguardViewManager.setDozing(mDozing); if (mAmbientIndicationContainer instanceof DozeReceiver) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java index 309a1a7abe4de..2437c51628337 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java @@ -143,7 +143,9 @@ public class StatusBarWindowManager implements RemoteInputController.Callback, D final boolean scrimsOccludingWallpaper = state.scrimsVisibility == ScrimController.VISIBILITY_FULLY_OPAQUE; - if (state.keyguardShowing && !state.backdropShowing && !scrimsOccludingWallpaper) { + final boolean keyguardOrAod = state.keyguardShowing + || (state.dozing && mDozeParameters.getAlwaysOn()); + if (keyguardOrAod && !state.backdropShowing && !scrimsOccludingWallpaper) { mLpChanged.flags |= WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER; } else { mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER; 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 f81ffd8256688..4a66bb7deca06 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 @@ -70,6 +70,7 @@ import com.android.systemui.ForegroundServiceController; import com.android.systemui.R; import com.android.systemui.SysuiTestCase; import com.android.systemui.assist.AssistManager; +import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.keyguard.WakefulnessLifecycle; import com.android.systemui.recents.misc.SystemServicesProxy; import com.android.systemui.statusbar.ActivatableNotificationView; @@ -132,6 +133,7 @@ public class StatusBarTest extends SysuiTestCase { @Mock private NotificationViewHierarchyManager mViewHierarchyManager; @Mock private VisualStabilityManager mVisualStabilityManager; @Mock private NotificationListener mNotificationListener; + @Mock private KeyguardViewMediator mKeyguardViewMediator; private TestableStatusBar mStatusBar; private FakeMetricsLogger mMetricsLogger; @@ -200,7 +202,7 @@ public class StatusBarTest extends SysuiTestCase { mPowerManager, mNotificationPanelView, mBarService, mNotificationListener, mNotificationLogger, mVisualStabilityManager, mViewHierarchyManager, mEntryManager, mScrimController, mFingerprintUnlockController, - mock(ActivityLaunchAnimator.class)); + mock(ActivityLaunchAnimator.class), mKeyguardViewMediator); mStatusBar.mContext = mContext; mStatusBar.mComponents = mContext.getComponents(); mEntryManager.setUpForTest(mStatusBar, mStackScroller, mStatusBar, mHeadsUpManager, @@ -638,7 +640,7 @@ public class StatusBarTest extends SysuiTestCase { NotificationViewHierarchyManager viewHierarchyManager, TestableNotificationEntryManager entryManager, ScrimController scrimController, FingerprintUnlockController fingerprintUnlockController, - ActivityLaunchAnimator launchAnimator) { + ActivityLaunchAnimator launchAnimator, KeyguardViewMediator keyguardViewMediator) { mStatusBarKeyguardViewManager = man; mUnlockMethodCache = unlock; mKeyguardIndicationController = key; @@ -656,6 +658,7 @@ public class StatusBarTest extends SysuiTestCase { mScrimController = scrimController; mFingerprintUnlockController = fingerprintUnlockController; mActivityLaunchAnimator = launchAnimator; + mKeyguardViewMediator = keyguardViewMediator; mClearAllEnabled = true; } diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 5131a93503f5b..c6a24b71ffafc 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -820,7 +820,7 @@ public class ActivityManagerService extends IActivityManager.Stub public boolean canShowErrorDialogs() { return mShowDialogs && !mSleeping && !mShuttingDown - && !mKeyguardController.isKeyguardShowing(DEFAULT_DISPLAY) + && !mKeyguardController.isKeyguardOrAodShowing(DEFAULT_DISPLAY) && !mUserController.hasUserRestriction(UserManager.DISALLOW_SYSTEM_ERROR_DIALOGS, mUserController.getCurrentUserId()) && !(UserManager.isDeviceInDemoMode(mContext) @@ -13202,7 +13202,8 @@ public class ActivityManagerService extends IActivityManager.Stub } @Override - public void setLockScreenShown(boolean showing, int secondaryDisplayShowing) { + public void setLockScreenShown(boolean keyguardShowing, boolean aodShowing, + int secondaryDisplayShowing) { if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires permission " @@ -13212,13 +13213,14 @@ public class ActivityManagerService extends IActivityManager.Stub synchronized(this) { long ident = Binder.clearCallingIdentity(); try { - mKeyguardController.setKeyguardShown(showing, secondaryDisplayShowing); + mKeyguardController.setKeyguardShown(keyguardShowing, aodShowing, + secondaryDisplayShowing); } finally { Binder.restoreCallingIdentity(ident); } } - mHandler.obtainMessage(DISPATCH_SCREEN_KEYGUARD_MSG, showing ? 1 : 0, 0) + mHandler.obtainMessage(DISPATCH_SCREEN_KEYGUARD_MSG, keyguardShowing ? 1 : 0, 0) .sendToTarget(); } diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index aa462ec7ca895..5628fe1395f6d 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -2019,8 +2019,9 @@ class ActivityStack extends ConfigurationContai * @return true if {@param r} is visible taken Keyguard state into account, false otherwise */ boolean checkKeyguardVisibility(ActivityRecord r, boolean shouldBeVisible, boolean isTop) { - final boolean keyguardShowing = mStackSupervisor.getKeyguardController().isKeyguardShowing( - mDisplayId != INVALID_DISPLAY ? mDisplayId : DEFAULT_DISPLAY); + final int displayId = mDisplayId != INVALID_DISPLAY ? mDisplayId : DEFAULT_DISPLAY; + final boolean keyguardOrAodShowing = mStackSupervisor.getKeyguardController() + .isKeyguardOrAodShowing(displayId); final boolean keyguardLocked = mStackSupervisor.getKeyguardController().isKeyguardLocked(); final boolean showWhenLocked = r.canShowWhenLocked(); final boolean dismissKeyguard = r.hasDismissKeyguardWindows(); @@ -2041,10 +2042,9 @@ class ActivityStack extends ConfigurationContai return true; } } - if (keyguardShowing) { - + if (keyguardOrAodShowing) { // If keyguard is showing, nothing is visible, except if we are able to dismiss Keyguard - // right away. + // right away and AOD isn't visible. return shouldBeVisible && mStackSupervisor.getKeyguardController() .canShowActivityWhileKeyguardShowing(r, dismissKeyguard); } else if (keyguardLocked) { @@ -5139,8 +5139,9 @@ class ActivityStack extends ConfigurationContai mService, taskId, info, intent, voiceSession, voiceInteractor); // add the task to stack first, mTaskPositioner might need the stack association addTask(task, toTop, "createTaskRecord"); + final int displayId = mDisplayId != INVALID_DISPLAY ? mDisplayId : DEFAULT_DISPLAY; final boolean isLockscreenShown = mService.mStackSupervisor.getKeyguardController() - .isKeyguardShowing(mDisplayId != INVALID_DISPLAY ? mDisplayId : DEFAULT_DISPLAY); + .isKeyguardOrAodShowing(displayId); if (!mStackSupervisor.getLaunchParamsController() .layoutTask(task, info.windowLayout, activity, source, options) && !matchParentBounds() && task.isResizeable() && !isLockscreenShown) { diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index 265e4fa078fc7..d5dfdcf0f5587 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -3382,8 +3382,8 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D stack.goToSleepIfPossible(false /* shuttingDown */); } else { stack.awakeFromSleepingLocked(); - if (isFocusedStack(stack) - && !getKeyguardController().isKeyguardShowing(display.mDisplayId)) { + if (isFocusedStack(stack) && !getKeyguardController().isKeyguardOrAodShowing( + display.mDisplayId)) { // If the keyguard is unlocked - resume immediately. // It is possible that the display will not be awake at the time we // process the keyguard going away, which can happen before the sleep token diff --git a/services/core/java/com/android/server/am/KeyguardController.java b/services/core/java/com/android/server/am/KeyguardController.java index b67dd0dc479b3..1b7f75b2d52cd 100644 --- a/services/core/java/com/android/server/am/KeyguardController.java +++ b/services/core/java/com/android/server/am/KeyguardController.java @@ -62,6 +62,7 @@ class KeyguardController { private final ActivityStackSupervisor mStackSupervisor; private WindowManagerService mWindowManager; private boolean mKeyguardShowing; + private boolean mAodShowing; private boolean mKeyguardGoingAway; private boolean mOccluded; private boolean mDismissalRequested; @@ -81,6 +82,15 @@ class KeyguardController { mWindowManager = windowManager; } + /** + * @return true if either Keyguard or AOD are showing, not going away, and not being occluded + * on the given display, false otherwise + */ + boolean isKeyguardOrAodShowing(int displayId) { + return (mKeyguardShowing || mAodShowing) && !mKeyguardGoingAway && + (displayId == DEFAULT_DISPLAY ? !mOccluded : displayId == mSecondaryDisplayShowing); + } + /** * @return true if Keyguard is showing, not going away, and not being occluded on the given * display, false otherwise @@ -108,17 +118,19 @@ class KeyguardController { /** * Update the Keyguard showing state. */ - void setKeyguardShown(boolean showing, int secondaryDisplayShowing) { - boolean showingChanged = showing != mKeyguardShowing; + void setKeyguardShown(boolean keyguardShowing, boolean aodShowing, + int secondaryDisplayShowing) { + boolean showingChanged = keyguardShowing != mKeyguardShowing || aodShowing != mAodShowing; if (!showingChanged && secondaryDisplayShowing == mSecondaryDisplayShowing) { return; } - mKeyguardShowing = showing; + mKeyguardShowing = keyguardShowing; + mAodShowing = aodShowing; mSecondaryDisplayShowing = secondaryDisplayShowing; if (showingChanged) { dismissDockedStackIfNeeded(); setKeyguardGoingAway(false); - if (showing) { + if (keyguardShowing) { mDismissalRequested = false; } } @@ -230,8 +242,8 @@ class KeyguardController { // Allow to show it when we are about to dismiss Keyguard. This isn't allowed if r is // already the dismissing activity, in which case we don't allow it to repeatedly dismiss // Keyguard. - return dismissKeyguard && canDismissKeyguard() && - (mDismissalRequested || r != mDismissingKeyguardActivity); + return dismissKeyguard && canDismissKeyguard() && !mAodShowing + && (mDismissalRequested || r != mDismissingKeyguardActivity); } /** @@ -369,9 +381,9 @@ class KeyguardController { } private void updateKeyguardSleepToken() { - if (mSleepToken == null && isKeyguardShowing(DEFAULT_DISPLAY)) { + if (mSleepToken == null && isKeyguardOrAodShowing(DEFAULT_DISPLAY)) { mSleepToken = mService.acquireSleepToken("Keyguard", DEFAULT_DISPLAY); - } else if (mSleepToken != null && !isKeyguardShowing(DEFAULT_DISPLAY)) { + } else if (mSleepToken != null && !isKeyguardOrAodShowing(DEFAULT_DISPLAY)) { mSleepToken.release(); mSleepToken = null; } @@ -380,6 +392,7 @@ class KeyguardController { void dump(PrintWriter pw, String prefix) { pw.println(prefix + "KeyguardController:"); pw.println(prefix + " mKeyguardShowing=" + mKeyguardShowing); + pw.println(prefix + " mAodShowing=" + mAodShowing); pw.println(prefix + " mKeyguardGoingAway=" + mKeyguardGoingAway); pw.println(prefix + " mOccluded=" + mOccluded); pw.println(prefix + " mDismissingKeyguardActivity=" + mDismissingKeyguardActivity); diff --git a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java index 062b154b8c1a1..81a8c55c5aea6 100644 --- a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java +++ b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java @@ -213,7 +213,8 @@ public class KeyguardServiceDelegate { // There are no longer any keyguard windows on secondary displays, so pass // INVALID_DISPLAY. All that means is that showWhenLocked activities on // secondary displays now get to show. - ActivityManager.getService().setLockScreenShown(true, INVALID_DISPLAY); + ActivityManager.getService().setLockScreenShown(true /* keyguardShowing */, + false /* aodShowing */, INVALID_DISPLAY); } catch (RemoteException e) { // Local call. } diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityStackSupervisorTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityStackSupervisorTests.java index b452ea506095f..cda968a7ec3e8 100644 --- a/services/tests/servicestests/src/com/android/server/am/ActivityStackSupervisorTests.java +++ b/services/tests/servicestests/src/com/android/server/am/ActivityStackSupervisorTests.java @@ -240,7 +240,7 @@ public class ActivityStackSupervisorTests extends ActivityTestsBase { doReturn(displayShouldSleep).when(display).shouldSleep(); doReturn(displaySleeping).when(display).isSleeping(); - doReturn(keyguardShowing).when(keyguard).isKeyguardShowing(anyInt()); + doReturn(keyguardShowing).when(keyguard).isKeyguardOrAodShowing(anyInt()); mSupervisor.mFocusedStack = isFocusedStack ? stack : null; mSupervisor.applySleepTokensLocked(true);