Fix ClipboardService device lock check for cross profile am: 6d79675e0c am: 095eda9307 am: a4f6ca3e77
am: 85439e9114
Change-Id: Ic616bde55a3a60eec10d9330907e6d8164b76c86
diff --git a/services/core/java/com/android/server/clipboard/ClipboardService.java b/services/core/java/com/android/server/clipboard/ClipboardService.java
index a94a524..28028ce 100644
--- a/services/core/java/com/android/server/clipboard/ClipboardService.java
+++ b/services/core/java/com/android/server/clipboard/ClipboardService.java
@@ -307,8 +307,14 @@
}
private boolean isDeviceLocked() {
- final KeyguardManager keyguardManager = mContext.getSystemService(KeyguardManager.class);
- return keyguardManager != null && keyguardManager.isDeviceLocked();
+ final long token = Binder.clearCallingIdentity();
+ try {
+ final KeyguardManager keyguardManager = mContext.getSystemService(
+ KeyguardManager.class);
+ return keyguardManager != null && keyguardManager.isDeviceLocked();
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
}
private final void checkUriOwnerLocked(Uri uri, int uid) {