Loading core/java/android/app/KeyguardManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -440,7 +440,7 @@ public class KeyguardManager { */ public boolean isKeyguardSecure() { try { return mWM.isKeyguardSecure(); return mWM.isKeyguardSecure(mContext.getUserId()); } catch (RemoteException ex) { return false; } Loading core/java/android/view/IWindowManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ interface IWindowManager @UnsupportedAppUsage boolean isKeyguardLocked(); @UnsupportedAppUsage boolean isKeyguardSecure(); boolean isKeyguardSecure(int userId); void dismissKeyguard(IKeyguardDismissCallback callback, CharSequence message); // Requires INTERACT_ACROSS_USERS_FULL permission Loading services/core/java/com/android/server/wm/KeyguardController.java +7 −4 Original line number Diff line number Diff line Loading @@ -269,7 +269,8 @@ class KeyguardController { * @return True if we may show an activity while Keyguard is occluded, false otherwise. */ boolean canShowWhileOccluded(boolean dismissKeyguard, boolean showWhenLocked) { return showWhenLocked || dismissKeyguard && !mWindowManager.isKeyguardSecure(); return showWhenLocked || dismissKeyguard && !mWindowManager.isKeyguardSecure(mService.getCurrentUserId()); } private void visibilitiesUpdated() { Loading Loading @@ -317,7 +318,7 @@ class KeyguardController { // We only allow dismissing Keyguard via the flag when Keyguard is secure for legacy // reasons, because that's how apps used to dismiss Keyguard in the secure case. In the // insecure case, we actually show it on top of the lockscreen. See #canShowWhileOccluded. if (!mWindowManager.isKeyguardSecure()) { if (!mWindowManager.isKeyguardSecure(mService.getCurrentUserId())) { return; } Loading Loading @@ -345,7 +346,8 @@ class KeyguardController { * @return true if Keyguard can be currently dismissed without entering credentials. */ boolean canDismissKeyguard() { return mWindowManager.isKeyguardTrusted() || !mWindowManager.isKeyguardSecure(); return mWindowManager.isKeyguardTrusted() || !mWindowManager.isKeyguardSecure(mService.getCurrentUserId()); } private int resolveOccludeTransit() { Loading Loading @@ -487,7 +489,8 @@ class KeyguardController { } if (lastDismissActivity != mDismissingKeyguardActivity && !mOccluded && mDismissingKeyguardActivity != null && controller.mWindowManager.isKeyguardSecure()) { && controller.mWindowManager.isKeyguardSecure( controller.mService.getCurrentUserId())) { mRequestDismissKeyguard = true; } } Loading services/core/java/com/android/server/wm/LockTaskController.java +1 −1 Original line number Diff line number Diff line Loading @@ -762,7 +762,7 @@ public class LockTaskController { } else { // If keyguard is not secure and it is locked, dismiss the keyguard before // disabling it, which avoids the platform to think the keyguard is still on. if (mWindowManager.isKeyguardLocked() && !mWindowManager.isKeyguardSecure()) { if (mWindowManager.isKeyguardLocked() && !mWindowManager.isKeyguardSecure(userId)) { mPendingDisableFromDismiss = userId; mWindowManager.dismissKeyguard(new IKeyguardDismissCallback.Stub() { @Override Loading services/core/java/com/android/server/wm/WindowManagerService.java +7 −2 Original line number Diff line number Diff line Loading @@ -2868,8 +2868,13 @@ public class WindowManagerService extends IWindowManager.Stub } @Override public boolean isKeyguardSecure() { int userId = UserHandle.getCallingUserId(); public boolean isKeyguardSecure(int userId) { if (userId != UserHandle.getCallingUserId() && !checkCallingPermission(Manifest.permission.INTERACT_ACROSS_USERS, "isKeyguardSecure")) { throw new SecurityException("Requires INTERACT_ACROSS_USERS permission"); } long origId = Binder.clearCallingIdentity(); try { return mPolicy.isKeyguardSecure(userId); Loading Loading
core/java/android/app/KeyguardManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -440,7 +440,7 @@ public class KeyguardManager { */ public boolean isKeyguardSecure() { try { return mWM.isKeyguardSecure(); return mWM.isKeyguardSecure(mContext.getUserId()); } catch (RemoteException ex) { return false; } Loading
core/java/android/view/IWindowManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ interface IWindowManager @UnsupportedAppUsage boolean isKeyguardLocked(); @UnsupportedAppUsage boolean isKeyguardSecure(); boolean isKeyguardSecure(int userId); void dismissKeyguard(IKeyguardDismissCallback callback, CharSequence message); // Requires INTERACT_ACROSS_USERS_FULL permission Loading
services/core/java/com/android/server/wm/KeyguardController.java +7 −4 Original line number Diff line number Diff line Loading @@ -269,7 +269,8 @@ class KeyguardController { * @return True if we may show an activity while Keyguard is occluded, false otherwise. */ boolean canShowWhileOccluded(boolean dismissKeyguard, boolean showWhenLocked) { return showWhenLocked || dismissKeyguard && !mWindowManager.isKeyguardSecure(); return showWhenLocked || dismissKeyguard && !mWindowManager.isKeyguardSecure(mService.getCurrentUserId()); } private void visibilitiesUpdated() { Loading Loading @@ -317,7 +318,7 @@ class KeyguardController { // We only allow dismissing Keyguard via the flag when Keyguard is secure for legacy // reasons, because that's how apps used to dismiss Keyguard in the secure case. In the // insecure case, we actually show it on top of the lockscreen. See #canShowWhileOccluded. if (!mWindowManager.isKeyguardSecure()) { if (!mWindowManager.isKeyguardSecure(mService.getCurrentUserId())) { return; } Loading Loading @@ -345,7 +346,8 @@ class KeyguardController { * @return true if Keyguard can be currently dismissed without entering credentials. */ boolean canDismissKeyguard() { return mWindowManager.isKeyguardTrusted() || !mWindowManager.isKeyguardSecure(); return mWindowManager.isKeyguardTrusted() || !mWindowManager.isKeyguardSecure(mService.getCurrentUserId()); } private int resolveOccludeTransit() { Loading Loading @@ -487,7 +489,8 @@ class KeyguardController { } if (lastDismissActivity != mDismissingKeyguardActivity && !mOccluded && mDismissingKeyguardActivity != null && controller.mWindowManager.isKeyguardSecure()) { && controller.mWindowManager.isKeyguardSecure( controller.mService.getCurrentUserId())) { mRequestDismissKeyguard = true; } } Loading
services/core/java/com/android/server/wm/LockTaskController.java +1 −1 Original line number Diff line number Diff line Loading @@ -762,7 +762,7 @@ public class LockTaskController { } else { // If keyguard is not secure and it is locked, dismiss the keyguard before // disabling it, which avoids the platform to think the keyguard is still on. if (mWindowManager.isKeyguardLocked() && !mWindowManager.isKeyguardSecure()) { if (mWindowManager.isKeyguardLocked() && !mWindowManager.isKeyguardSecure(userId)) { mPendingDisableFromDismiss = userId; mWindowManager.dismissKeyguard(new IKeyguardDismissCallback.Stub() { @Override Loading
services/core/java/com/android/server/wm/WindowManagerService.java +7 −2 Original line number Diff line number Diff line Loading @@ -2868,8 +2868,13 @@ public class WindowManagerService extends IWindowManager.Stub } @Override public boolean isKeyguardSecure() { int userId = UserHandle.getCallingUserId(); public boolean isKeyguardSecure(int userId) { if (userId != UserHandle.getCallingUserId() && !checkCallingPermission(Manifest.permission.INTERACT_ACROSS_USERS, "isKeyguardSecure")) { throw new SecurityException("Requires INTERACT_ACROSS_USERS permission"); } long origId = Binder.clearCallingIdentity(); try { return mPolicy.isKeyguardSecure(userId); Loading