From edd5748e07b671c81e12a25722cd1e293d774dab Mon Sep 17 00:00:00 2001 From: Roman Birg Date: Mon, 26 Oct 2015 10:41:34 -0700 Subject: 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: OSS NIGHTLIES-1721, CYNGNOS-1930 Change-Id: I68d4789159cb9a0a25609380054ae5545c9df5bd Signed-off-by: Roman Birg --- .../src/com/android/systemui/keyguard/KeyguardViewMediator.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index dd76a3e..c78119e 100755 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -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) { -- cgit v1.1