From 555a59ad27412a08eb0b8f2724a36ba3443d90b2 Mon Sep 17 00:00:00 2001 From: Tony Mak Date: Wed, 4 Jan 2017 12:17:54 +0000 Subject: [PATCH] Allow current profiles to disable keyguard Test: make cts -j20 && cts-tradefed run cts --module CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testScreenCaptureDisabled_allowedPrimaryUser It is not really a CTS verifies the change directly. But I can observe that keyguard is dismissed by a test running in managed profile Bug: 34049587 Change-Id: I94e3d0cd01b10f31745781f35fdc8e3554994db8 --- .../java/com/android/server/wm/WindowManagerService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 2ade924bf77d5..f6d3881e94851 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -3850,9 +3850,9 @@ public class WindowManagerService extends IWindowManager.Stub return; } - // If this isn't coming from the current user, ignore it. - if (Binder.getCallingUserHandle().getIdentifier() != mCurrentUserId) { - Log.d(TAG_WM, "non-current user, ignore disableKeyguard"); + // If this isn't coming from the current profiles, ignore it. + if (!isCurrentProfileLocked(UserHandle.getCallingUserId())) { + Log.d(TAG_WM, "non-current profiles, ignore disableKeyguard"); return; }