Fix ClipboardService device lock check for cross profile
am: 0595b5a94b
Change-Id: I6aeaaef43a8e8c5ede049ae9e97fbf6d0129bac4
diff --git a/services/core/java/com/android/server/clipboard/ClipboardService.java b/services/core/java/com/android/server/clipboard/ClipboardService.java
index 383f116..83ec036 100644
--- a/services/core/java/com/android/server/clipboard/ClipboardService.java
+++ b/services/core/java/com/android/server/clipboard/ClipboardService.java
@@ -307,10 +307,15 @@
}
private boolean isDeviceLocked() {
- final KeyguardManager keyguardManager = (KeyguardManager) mContext.getSystemService(
- Context.KEYGUARD_SERVICE);
- return keyguardManager != null && keyguardManager.isKeyguardLocked()
+ final long token = Binder.clearCallingIdentity();
+ try {
+ final KeyguardManager keyguardManager = (KeyguardManager) mContext.getSystemService(
+ Context.KEYGUARD_SERVICE);
+ return keyguardManager != null && keyguardManager.isKeyguardLocked()
&& keyguardManager.isKeyguardSecure();
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
private final void checkUriOwnerLocked(Uri uri, int uid) {