Merge "Use calling user ID when calling isDeviceLocked" into mnc-dev am: a0c253d07a am: c275b77b03 am: 1f8536653b am: bc56010856 am: eeb90235bf am: eb863a6b2e

am: b353fbcb7a

Change-Id: Iba3d14106f47f98643a6a02b67bcc14437755217
This commit is contained in:
Siyamed Sinir
2017-10-31 17:41:58 +00:00
committed by android-build-merger

View File

@@ -315,11 +315,12 @@ public class ClipboardService extends IClipboard.Stub {
}
private boolean isDeviceLocked() {
int callingUserId = UserHandle.getCallingUserId();
final long token = Binder.clearCallingIdentity();
try {
final KeyguardManager keyguardManager = mContext.getSystemService(
KeyguardManager.class);
return keyguardManager != null && keyguardManager.isDeviceLocked();
return keyguardManager != null && keyguardManager.isDeviceLocked(callingUserId);
} finally {
Binder.restoreCallingIdentity(token);
}