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

Commit 078e91b0 authored by Clara Bayarri's avatar Clara Bayarri
Browse files

Fix crash in KeyguardManager.isDeviceLocked

A missing clearCallingIdentity was causing crashes when
isDeviceLocked is queried.

Bug: 26576080
Change-Id: I2d78e803873a02861335a95b1bbf13a4d9b45655
parent 00a9b890
Loading
Loading
Loading
Loading
+9 −4
Original line number Original line Diff line number Diff line
@@ -664,11 +664,16 @@ public class TrustManagerService extends SystemService {
        public boolean isDeviceLocked(int userId) throws RemoteException {
        public boolean isDeviceLocked(int userId) throws RemoteException {
            userId = ActivityManager.handleIncomingUser(getCallingPid(), getCallingUid(), userId,
            userId = ActivityManager.handleIncomingUser(getCallingPid(), getCallingUid(), userId,
                    false /* allowAll */, true /* requireFull */, "isDeviceLocked", null);
                    false /* allowAll */, true /* requireFull */, "isDeviceLocked", null);

            long token = Binder.clearCallingIdentity();
            try {
                if (!mLockPatternUtils.isSeparateProfileChallengeEnabled(userId)) {
                if (!mLockPatternUtils.isSeparateProfileChallengeEnabled(userId)) {
                    userId = resolveProfileParent(userId);
                    userId = resolveProfileParent(userId);
                }
                }

                return isDeviceLockedInner(userId);
                return isDeviceLockedInner(userId);
            } finally {
                Binder.restoreCallingIdentity(token);
            }
        }
        }


        @Override
        @Override