Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ded73323 authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by Siyamed Sinir
Browse files

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
parent d87d2746
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -307,11 +307,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);
        }