From 1c8e3c0bd314b29cca8b92655c87d847da266683 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Tue, 20 Nov 2018 20:07:55 +0100 Subject: KeyguardDisableHandler: make properly user aware Also fixes an issue where the disable handler was not properly updated after adding a secure lockscreen. Also fixes an issue where the disable handler was not properly updated after the device policy changes for users other than USER_SYSTEM. Also prevents adding new privileged usages of the API. Also removes a workaround that prevented Keyguard from re-engaging if it timed out while the it was disabled. The workaround is no longer necessary because the in-call UI is now using the SHOW_WHEN_LOCKED API instead of disabling the keyguard. Change-Id: Ib2644252b3806de4cb09f03991d789b83e924a11 Fixes: 119322269 Test: atest KeyguardDisableHandlerTest CtsActivityManagerDeviceTestCases:KeyguardTests --- .../framework/permission/tests/WindowManagerPermissionTests.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/permission/src') diff --git a/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java b/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java index 14312cf84693..369a002fa273 100644 --- a/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java +++ b/tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java @@ -20,6 +20,7 @@ import android.content.res.Configuration; import android.os.Binder; import android.os.RemoteException; import android.os.ServiceManager; +import android.os.UserHandle; import android.test.suitebuilder.annotation.SmallTest; import android.view.IWindowManager; import junit.framework.TestCase; @@ -107,7 +108,7 @@ public class WindowManagerPermissionTests extends TestCase { public void testDISABLE_KEYGUARD() { Binder token = new Binder(); try { - mWm.disableKeyguard(token, "foo"); + mWm.disableKeyguard(token, "foo", UserHandle.myUserId()); fail("IWindowManager.disableKeyguard did not throw SecurityException as" + " expected"); } catch (SecurityException e) { @@ -117,7 +118,7 @@ public class WindowManagerPermissionTests extends TestCase { } try { - mWm.reenableKeyguard(token); + mWm.reenableKeyguard(token, UserHandle.myUserId()); fail("IWindowManager.reenableKeyguard did not throw SecurityException as" + " expected"); } catch (SecurityException e) { -- cgit v1.2.3-59-g8ed1b