Use calling user ID when calling isDeviceLocked
If isDeviceLocked is called with clearCallingIdentity, original userId should be explicitly passed Bug: 67621847 Test: Manual Change-Id: I2bcb92572898811cc96bda1149ef806e6239e929
This commit is contained in:
committed by
Siyamed Sinir
parent
7e3f20e249
commit
66bde67120
@@ -435,11 +435,12 @@ public class ClipboardService extends SystemService {
|
||||
}
|
||||
|
||||
private boolean isDeviceLocked() {
|
||||
int callingUserId = UserHandle.getCallingUserId();
|
||||
final long token = Binder.clearCallingIdentity();
|
||||
try {
|
||||
final KeyguardManager keyguardManager = getContext().getSystemService(
|
||||
KeyguardManager.class);
|
||||
return keyguardManager != null && keyguardManager.isDeviceLocked();
|
||||
return keyguardManager != null && keyguardManager.isDeviceLocked(callingUserId);
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(token);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user