KeyguardManager: Fix user resolution of isDeviceSecure/Locked

Fixes isDeviceSecure and isDeviceLocked APIs to use
the user id of the app that executes the code rather
than that of any incoming binder call.

Change-Id: Ib7772b60c35a3ebf96830f9b013c539021e1f063
Fixes: 34592592
Test: manual
This commit is contained in:
Adrian Roos
2017-01-23 12:38:13 -08:00
parent c854415223
commit 0b1853f997

View File

@@ -322,7 +322,7 @@ public class KeyguardManager {
* password.
*/
public boolean isDeviceLocked() {
return isDeviceLocked(UserHandle.getCallingUserId());
return isDeviceLocked(UserHandle.myUserId());
}
/**
@@ -347,7 +347,7 @@ public class KeyguardManager {
* @return true if a PIN, pattern or password was set.
*/
public boolean isDeviceSecure() {
return isDeviceSecure(UserHandle.getCallingUserId());
return isDeviceSecure(UserHandle.myUserId());
}
/**