Loading core/proto/android/server/windowmanagerservice.proto +11 −1 Original line number Diff line number Diff line Loading @@ -112,8 +112,9 @@ message KeyguardControllerProto { option (.android.msg_privacy).dest = DEST_AUTOMATIC; optional bool keyguard_showing = 1; repeated KeyguardOccludedProto keyguard_occluded_states = 2; repeated KeyguardOccludedProto keyguard_occluded_states = 2 [deprecated=true]; optional bool aod_showing = 3; repeated KeyguardPerDisplayProto keyguard_per_display = 4; } message KeyguardOccludedProto { Loading @@ -123,6 +124,15 @@ message KeyguardOccludedProto { optional bool keyguard_occluded = 2; } message KeyguardPerDisplayProto { option (.android.msg_privacy).dest = DEST_AUTOMATIC; optional int32 display_id = 1; optional bool keyguard_showing = 2; optional bool aod_showing = 3; optional bool keyguard_occluded = 4; } /* represents PhoneWindowManager */ message WindowManagerPolicyProto { option (.android.msg_privacy).dest = DEST_AUTOMATIC; Loading services/core/java/com/android/server/wm/ActivityRecord.java +8 −4 Original line number Diff line number Diff line Loading @@ -2755,14 +2755,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return false; } boolean isKeyguardLocked = mAtmService.isKeyguardLocked(); boolean isCurrentAppLocked = mAtmService.getLockTaskModeState() != LOCK_TASK_MODE_NONE; final TaskDisplayArea taskDisplayArea = getDisplayArea(); boolean hasRootPinnedTask = taskDisplayArea != null && taskDisplayArea.hasPinnedTask(); // Don't return early if !isNotLocked, since we want to throw an exception if the activity // is in an incorrect state boolean isNotLockedOrOnKeyguard = !isKeyguardLocked && !isCurrentAppLocked; boolean isNotLockedOrOnKeyguard = !isKeyguardLocked() && !isCurrentAppLocked; // We don't allow auto-PiP when something else is already pipped. if (beforeStopping && hasRootPinnedTask) { Loading Loading @@ -3161,7 +3160,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // If the current activity is not opaque, we need to make sure the visibilities of // activities be updated, they may be seen by users. ensureVisibility = true; } else if (mTaskSupervisor.getKeyguardController().isKeyguardLocked() } else if (isKeyguardLocked() && mTaskSupervisor.getKeyguardController().topActivityOccludesKeyguard(this)) { // Ensure activity visibilities and update lockscreen occluded/dismiss state when // finishing the top activity that occluded keyguard. So that, the Loading Loading @@ -3990,6 +3989,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A }); } boolean isKeyguardLocked() { return (mDisplayContent != null) ? mDisplayContent.isKeyguardLocked() : mRootWindowContainer.getDefaultDisplay().isKeyguardLocked(); } void checkKeyguardFlagsChanged() { final boolean containsDismissKeyguard = containsDismissKeyguardWindow(); final boolean containsShowWhenLocked = containsShowWhenLockedWindow(); Loading Loading @@ -5179,7 +5183,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A void notifyUnknownVisibilityLaunchedForKeyguardTransition() { // No display activities never add a window, so there is no point in waiting them for // relayout. if (noDisplay || !mTaskSupervisor.getKeyguardController().isKeyguardLocked()) { if (noDisplay || !isKeyguardLocked()) { return; } Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +11 −6 Original line number Diff line number Diff line Loading @@ -2799,7 +2799,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { mH.sendMessage(msg); } try { mKeyguardController.setKeyguardShown(keyguardShowing, aodShowing); mRootWindowContainer.forAllDisplays(displayContent -> { mKeyguardController.setKeyguardShown(displayContent.getDisplayId(), keyguardShowing, aodShowing); }); } finally { Binder.restoreCallingIdentity(ident); } Loading Loading @@ -3359,7 +3362,9 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { final long token = Binder.clearCallingIdentity(); try { synchronized (mGlobalLock) { mKeyguardController.keyguardGoingAway(flags); mRootWindowContainer.forAllDisplays(displayContent -> { mKeyguardController.keyguardGoingAway(displayContent.getDisplayId(), flags); }); } } finally { Binder.restoreCallingIdentity(token); Loading Loading @@ -3442,7 +3447,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } }; if (isKeyguardLocked()) { if (r.isKeyguardLocked()) { // If the keyguard is showing or occluded, then try and dismiss it before // entering picture-in-picture (this will prompt the user to authenticate if the // device is currently locked). Loading Loading @@ -3787,8 +3792,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { mRecentTasks.notifyTaskPersisterLocked(task, flush); } boolean isKeyguardLocked() { return mKeyguardController.isKeyguardLocked(); boolean isKeyguardLocked(int displayId) { return mKeyguardController.isKeyguardLocked(displayId); } /** Loading Loading @@ -6035,7 +6040,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { final long ident = Binder.clearCallingIdentity(); try { if (mAmInternal.shouldConfirmCredentials(userId)) { if (mKeyguardController.isKeyguardLocked()) { if (mKeyguardController.isKeyguardLocked(DEFAULT_DISPLAY)) { // Showing launcher to avoid user entering credential twice. startHomeActivity(currentUserId, "notifyLockedProfile"); } Loading services/core/java/com/android/server/wm/DisplayArea.java +1 −1 Original line number Diff line number Diff line Loading @@ -560,7 +560,7 @@ public class DisplayArea<T extends WindowContainer> extends WindowContainer<T> { // Ignore the orientation of keyguard if it is going away or is not showing while // the device is fully awake. In other words, use the orientation of keyguard if // its window is visible while the device is going to sleep or is sleeping. if (!mWmService.mAtmService.isKeyguardLocked() if (!mDisplayContent.isKeyguardLocked() && mDisplayContent.getDisplayPolicy().isAwake() // Device is not going to sleep. && policy.okToAnimate(true /* ignoreScreenOn */)) { Loading services/core/java/com/android/server/wm/DisplayContent.java +24 −0 Original line number Diff line number Diff line Loading @@ -5841,6 +5841,30 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp return (flags & FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD) != 0; } /** * @return whether keyguard is locked for this display */ boolean isKeyguardLocked() { return mRootWindowContainer.mTaskSupervisor .getKeyguardController().isKeyguardLocked(mDisplayId); } /** * @return whether keyguard is going away on this display */ boolean isKeyguardGoingAway() { return mRootWindowContainer.mTaskSupervisor .getKeyguardController().isKeyguardGoingAway(mDisplayId); } /** * @return whether AOD is showing on this display */ boolean isAodShowing() { return mRootWindowContainer.mTaskSupervisor .getKeyguardController().isAodShowing(mDisplayId); } @VisibleForTesting void removeAllTasks() { forAllTasks((t) -> { t.getRootTask().removeChild(t, "removeAllTasks"); }); Loading Loading
core/proto/android/server/windowmanagerservice.proto +11 −1 Original line number Diff line number Diff line Loading @@ -112,8 +112,9 @@ message KeyguardControllerProto { option (.android.msg_privacy).dest = DEST_AUTOMATIC; optional bool keyguard_showing = 1; repeated KeyguardOccludedProto keyguard_occluded_states = 2; repeated KeyguardOccludedProto keyguard_occluded_states = 2 [deprecated=true]; optional bool aod_showing = 3; repeated KeyguardPerDisplayProto keyguard_per_display = 4; } message KeyguardOccludedProto { Loading @@ -123,6 +124,15 @@ message KeyguardOccludedProto { optional bool keyguard_occluded = 2; } message KeyguardPerDisplayProto { option (.android.msg_privacy).dest = DEST_AUTOMATIC; optional int32 display_id = 1; optional bool keyguard_showing = 2; optional bool aod_showing = 3; optional bool keyguard_occluded = 4; } /* represents PhoneWindowManager */ message WindowManagerPolicyProto { option (.android.msg_privacy).dest = DEST_AUTOMATIC; Loading
services/core/java/com/android/server/wm/ActivityRecord.java +8 −4 Original line number Diff line number Diff line Loading @@ -2755,14 +2755,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return false; } boolean isKeyguardLocked = mAtmService.isKeyguardLocked(); boolean isCurrentAppLocked = mAtmService.getLockTaskModeState() != LOCK_TASK_MODE_NONE; final TaskDisplayArea taskDisplayArea = getDisplayArea(); boolean hasRootPinnedTask = taskDisplayArea != null && taskDisplayArea.hasPinnedTask(); // Don't return early if !isNotLocked, since we want to throw an exception if the activity // is in an incorrect state boolean isNotLockedOrOnKeyguard = !isKeyguardLocked && !isCurrentAppLocked; boolean isNotLockedOrOnKeyguard = !isKeyguardLocked() && !isCurrentAppLocked; // We don't allow auto-PiP when something else is already pipped. if (beforeStopping && hasRootPinnedTask) { Loading Loading @@ -3161,7 +3160,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // If the current activity is not opaque, we need to make sure the visibilities of // activities be updated, they may be seen by users. ensureVisibility = true; } else if (mTaskSupervisor.getKeyguardController().isKeyguardLocked() } else if (isKeyguardLocked() && mTaskSupervisor.getKeyguardController().topActivityOccludesKeyguard(this)) { // Ensure activity visibilities and update lockscreen occluded/dismiss state when // finishing the top activity that occluded keyguard. So that, the Loading Loading @@ -3990,6 +3989,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A }); } boolean isKeyguardLocked() { return (mDisplayContent != null) ? mDisplayContent.isKeyguardLocked() : mRootWindowContainer.getDefaultDisplay().isKeyguardLocked(); } void checkKeyguardFlagsChanged() { final boolean containsDismissKeyguard = containsDismissKeyguardWindow(); final boolean containsShowWhenLocked = containsShowWhenLockedWindow(); Loading Loading @@ -5179,7 +5183,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A void notifyUnknownVisibilityLaunchedForKeyguardTransition() { // No display activities never add a window, so there is no point in waiting them for // relayout. if (noDisplay || !mTaskSupervisor.getKeyguardController().isKeyguardLocked()) { if (noDisplay || !isKeyguardLocked()) { return; } Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +11 −6 Original line number Diff line number Diff line Loading @@ -2799,7 +2799,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { mH.sendMessage(msg); } try { mKeyguardController.setKeyguardShown(keyguardShowing, aodShowing); mRootWindowContainer.forAllDisplays(displayContent -> { mKeyguardController.setKeyguardShown(displayContent.getDisplayId(), keyguardShowing, aodShowing); }); } finally { Binder.restoreCallingIdentity(ident); } Loading Loading @@ -3359,7 +3362,9 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { final long token = Binder.clearCallingIdentity(); try { synchronized (mGlobalLock) { mKeyguardController.keyguardGoingAway(flags); mRootWindowContainer.forAllDisplays(displayContent -> { mKeyguardController.keyguardGoingAway(displayContent.getDisplayId(), flags); }); } } finally { Binder.restoreCallingIdentity(token); Loading Loading @@ -3442,7 +3447,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } }; if (isKeyguardLocked()) { if (r.isKeyguardLocked()) { // If the keyguard is showing or occluded, then try and dismiss it before // entering picture-in-picture (this will prompt the user to authenticate if the // device is currently locked). Loading Loading @@ -3787,8 +3792,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { mRecentTasks.notifyTaskPersisterLocked(task, flush); } boolean isKeyguardLocked() { return mKeyguardController.isKeyguardLocked(); boolean isKeyguardLocked(int displayId) { return mKeyguardController.isKeyguardLocked(displayId); } /** Loading Loading @@ -6035,7 +6040,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { final long ident = Binder.clearCallingIdentity(); try { if (mAmInternal.shouldConfirmCredentials(userId)) { if (mKeyguardController.isKeyguardLocked()) { if (mKeyguardController.isKeyguardLocked(DEFAULT_DISPLAY)) { // Showing launcher to avoid user entering credential twice. startHomeActivity(currentUserId, "notifyLockedProfile"); } Loading
services/core/java/com/android/server/wm/DisplayArea.java +1 −1 Original line number Diff line number Diff line Loading @@ -560,7 +560,7 @@ public class DisplayArea<T extends WindowContainer> extends WindowContainer<T> { // Ignore the orientation of keyguard if it is going away or is not showing while // the device is fully awake. In other words, use the orientation of keyguard if // its window is visible while the device is going to sleep or is sleeping. if (!mWmService.mAtmService.isKeyguardLocked() if (!mDisplayContent.isKeyguardLocked() && mDisplayContent.getDisplayPolicy().isAwake() // Device is not going to sleep. && policy.okToAnimate(true /* ignoreScreenOn */)) { Loading
services/core/java/com/android/server/wm/DisplayContent.java +24 −0 Original line number Diff line number Diff line Loading @@ -5841,6 +5841,30 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp return (flags & FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD) != 0; } /** * @return whether keyguard is locked for this display */ boolean isKeyguardLocked() { return mRootWindowContainer.mTaskSupervisor .getKeyguardController().isKeyguardLocked(mDisplayId); } /** * @return whether keyguard is going away on this display */ boolean isKeyguardGoingAway() { return mRootWindowContainer.mTaskSupervisor .getKeyguardController().isKeyguardGoingAway(mDisplayId); } /** * @return whether AOD is showing on this display */ boolean isAodShowing() { return mRootWindowContainer.mTaskSupervisor .getKeyguardController().isAodShowing(mDisplayId); } @VisibleForTesting void removeAllTasks() { forAllTasks((t) -> { t.getRootTask().removeChild(t, "removeAllTasks"); }); Loading