Merge "Use calling user ID when calling isDeviceLocked" into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
31bcb22572
@@ -435,11 +435,12 @@ public class ClipboardService extends SystemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isDeviceLocked() {
|
private boolean isDeviceLocked() {
|
||||||
|
int callingUserId = UserHandle.getCallingUserId();
|
||||||
final long token = Binder.clearCallingIdentity();
|
final long token = Binder.clearCallingIdentity();
|
||||||
try {
|
try {
|
||||||
final KeyguardManager keyguardManager = getContext().getSystemService(
|
final KeyguardManager keyguardManager = getContext().getSystemService(
|
||||||
KeyguardManager.class);
|
KeyguardManager.class);
|
||||||
return keyguardManager != null && keyguardManager.isDeviceLocked();
|
return keyguardManager != null && keyguardManager.isDeviceLocked(callingUserId);
|
||||||
} finally {
|
} finally {
|
||||||
Binder.restoreCallingIdentity(token);
|
Binder.restoreCallingIdentity(token);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user