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

Commit ca299c6f authored by Jim Miller's avatar Jim Miller Committed by android-build-merger
Browse files

Merge "Fix KeyguardManager.isSecure() to observe work profile" into nyc-dev

am: 254d9e4f

* commit '254d9e4f':
  Fix KeyguardManager.isSecure() to observe work profile

Change-Id: I92f1387372cd02790f10f2940fdeb97ec6ab4a8f
parents fca06a1d 254d9e4f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1121,10 +1121,11 @@ public interface WindowManagerPolicy {
     * isKeyguardSecure
     *
     * Return whether the keyguard requires a password to unlock.
     * @param userId
     *
     * @return true if in keyguard is secure.
     */
    public boolean isKeyguardSecure();
    public boolean isKeyguardSecure(int userId);

    /**
     * Return whether the keyguard is on.
+7 −5
Original line number Diff line number Diff line
@@ -3392,7 +3392,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }

        if (down) {
            long shortcutCode = (long) keyCode;
            long shortcutCode = keyCode;
            if (event.isCtrlPressed()) {
                shortcutCode |= ((long) KeyEvent.META_CTRL_ON) << Integer.SIZE;
            }
@@ -3511,6 +3511,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        return false;
    }

    @Override
    public void registerShortcutKey(long shortcutCode, IShortcutService shortcutService)
            throws RemoteException {
        synchronized (mLock) {
@@ -4822,7 +4823,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        mShowingLockscreen = false;
        mShowingDream = false;
        mWinShowWhenLocked = null;
        mKeyguardSecure = isKeyguardSecure();
        mKeyguardSecure = isKeyguardSecure(mCurrentUserId);
        mKeyguardSecureIncludingHidden = mKeyguardSecure
                && (mKeyguardDelegate != null && mKeyguardDelegate.isShowing());
    }
@@ -6299,9 +6300,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {

    /** {@inheritDoc} */
    @Override
    public boolean isKeyguardSecure() {
    public boolean isKeyguardSecure(int userId) {
        if (mKeyguardDelegate == null) return false;
        return mKeyguardDelegate.isSecure();
        return mKeyguardDelegate.isSecure(userId);
    }

    /** {@inheritDoc} */
@@ -6331,6 +6332,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }
    }

    @Override
    public void notifyActivityDrawnForKeyguardLw() {
        if (mKeyguardDelegate != null) {
            mHandler.post(new Runnable() {
@@ -6846,7 +6848,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    private void updateLockScreenTimeout() {
        synchronized (mScreenLockTimeout) {
            boolean enable = (mAllowLockscreenWhenOn && mAwake &&
                    mKeyguardDelegate != null && mKeyguardDelegate.isSecure());
                    mKeyguardDelegate != null && mKeyguardDelegate.isSecure(mCurrentUserId));
            if (mLockScreenTimerActive != enable) {
                if (enable) {
                    if (localLOGV) Log.v(TAG, "setting lockscreen timer");
+2 −2
Original line number Diff line number Diff line
@@ -226,9 +226,9 @@ public class KeyguardServiceDelegate {
        }
    }

    public boolean isSecure() {
    public boolean isSecure(int userId) {
        if (mKeyguardService != null) {
            mKeyguardState.secure = mKeyguardService.isSecure();
            mKeyguardState.secure = mKeyguardService.isSecure(userId);
        }
        return mKeyguardState.secure;
    }
+2 −2
Original line number Diff line number Diff line
@@ -234,8 +234,8 @@ public class KeyguardServiceWrapper implements IKeyguardService {
        return mKeyguardStateMonitor.isShowing();
    }

    public boolean isSecure() {
        return mKeyguardStateMonitor.isSecure();
    public boolean isSecure(int userId) {
        return mKeyguardStateMonitor.isSecure(userId);
    }

    public boolean isInputRestricted() {
+2 −2
Original line number Diff line number Diff line
@@ -62,8 +62,8 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub {
        return mIsShowing;
    }

    public boolean isSecure() {
        return mLockPatternUtils.isSecure(getCurrentUser()) || mSimSecure;
    public boolean isSecure(int userId) {
        return mLockPatternUtils.isSecure(userId) || mSimSecure;
    }

    public boolean isInputRestricted() {
Loading