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

Commit 106bc918 authored by Roman Birg's avatar Roman Birg
Browse files

SystemUI: update keyguard state when profiles disable keyguard



Also add a broadcast receiver to watch for profile changes/updates and
update the tile whenever we receive those.

Ref: CYNGNOS-1930

Change-Id: I68d4789159cb9a0a25609380054ae5545c9df5bd
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent f9a848fb
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -971,6 +971,12 @@ public class KeyguardViewMediator extends SystemUI {
        return !mInternallyDisabled;
    }

    private boolean isProfileDisablingKeyguard() {
        final Profile activeProfile = ProfileManager.getInstance(mContext).getActiveProfile();
        return activeProfile != null
                && activeProfile.getScreenLockMode().getValue() == Profile.LockMode.DISABLE;
    }

    /**
     * Same semantics as {@link android.view.WindowManagerPolicy#enableKeyguard}; provide
     * a way for external stuff to override normal keyguard behavior.  For instance
@@ -999,7 +1005,7 @@ public class KeyguardViewMediator extends SystemUI {
                // hiding keyguard that is showing, remember to reshow later
                if (DEBUG) Log.d(TAG, "remembering to reshow, hiding keyguard, "
                        + "disabling status bar expansion");
                mNeedToReshowWhenReenabled = true;
                mNeedToReshowWhenReenabled = !isProfileDisablingKeyguard();
                updateInputRestrictedLocked();
                hideLocked();
            } else if (enabled && mNeedToReshowWhenReenabled) {