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

Commit a0a18ea4 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

am: 3c1e640d

* commit '3c1e640d':
  Fix KeyguardManager.isSecure() to observe work profile

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


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


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


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


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


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


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


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


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


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


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


    public boolean isInputRestricted() {
    public boolean isInputRestricted() {
Loading