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

Commit 9e94c455 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Always re-enable keyguard state when the user switches." into nyc-dev

parents e36da9c8 3e6ac81d
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -5346,7 +5346,13 @@ public class WindowManagerService extends IWindowManager.Stub
        // If this isn't coming from the system then don't allow disabling the lockscreen
        // to bypass security.
        if (Binder.getCallingUid() != Process.SYSTEM_UID && isKeyguardSecure()) {
            Log.d(TAG_WM, "current mode is SecurityMode, ignore hide keyguard");
            Log.d(TAG_WM, "current mode is SecurityMode, ignore disableKeyguard");
            return;
        }

        // If this isn't coming from the current user, ignore it.
        if (Binder.getCallingUserHandle().getIdentifier() != mCurrentUserId) {
            Log.d(TAG_WM, "non-current user, ignore disableKeyguard");
            return;
        }

@@ -5661,6 +5667,11 @@ public class WindowManagerService extends IWindowManager.Stub
            mAppTransition.setCurrentUser(newUserId);
            mPolicy.setCurrentUserLw(newUserId);

            // If keyguard was disabled, re-enable it
            // TODO: Keep track of keyguardEnabled state per user and use here...
            // e.g. enabled = mKeyguardDisableHandler.getEnabledStateForUser(newUserId);
            mPolicy.enableKeyguard(true);

            // Hide windows that should not be seen by the new user.
            final int numDisplays = mDisplayContents.size();
            for (int displayNdx = 0; displayNdx < numDisplays; ++displayNdx) {
@@ -10022,6 +10033,7 @@ public class WindowManagerService extends IWindowManager.Stub
        }
    }

    @Override
    public void createWallpaperInputConsumer(InputChannel inputChannel) {
        synchronized (mWindowMap) {
            mWallpaperInputConsumer = new InputConsumerImpl(this, "wallpaper input", inputChannel);
@@ -10030,6 +10042,7 @@ public class WindowManagerService extends IWindowManager.Stub
        }
    }

    @Override
    public void removeWallpaperInputConsumer() {
        synchronized (mWindowMap) {
            if (mWallpaperInputConsumer != null) {
@@ -11125,6 +11138,7 @@ public class WindowManagerService extends IWindowManager.Stub
        }
    }

    @Override
    public void registerShortcutKey(long shortcutCode, IShortcutService shortcutKeyReceiver)
            throws RemoteException {
        if (!checkCallingPermission(Manifest.permission.REGISTER_WINDOW_MANAGER_LISTENERS,