Loading services/core/java/com/android/server/wm/KeyguardDisableHandler.java +29 −16 Original line number Diff line number Diff line Loading @@ -68,9 +68,18 @@ public class KeyguardDisableHandler extends Handler { break; case KEYGUARD_POLICY_CHANGED: mAllowDisableKeyguard = ALLOW_DISABLE_UNKNOWN; if (mKeyguardTokenWatcher.isAcquired()) { // If we are currently disabled we need to know if the keyguard // should be re-enabled, so determine the allow state immediately. mKeyguardTokenWatcher.updateAllowState(); if (mAllowDisableKeyguard != ALLOW_DISABLE_YES) { mPolicy.enableKeyguard(true); } } else { // lazily evaluate this next time we're asked to disable keyguard mAllowDisableKeyguard = ALLOW_DISABLE_UNKNOWN; mPolicy.enableKeyguard(true); } break; } } Loading @@ -81,11 +90,9 @@ public class KeyguardDisableHandler extends Handler { super(handler, TAG); } @Override public void acquired() { public void updateAllowState() { // We fail safe and prevent disabling keyguard in the unlikely event this gets // called before DevicePolicyManagerService has started. if (mAllowDisableKeyguard == ALLOW_DISABLE_UNKNOWN) { DevicePolicyManager dpm = (DevicePolicyManager) mContext.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm != null) { Loading @@ -99,6 +106,12 @@ public class KeyguardDisableHandler extends Handler { } } } @Override public void acquired() { if (mAllowDisableKeyguard == ALLOW_DISABLE_UNKNOWN) { updateAllowState(); } if (mAllowDisableKeyguard == ALLOW_DISABLE_YES) { mPolicy.enableKeyguard(false); } else { Loading Loading
services/core/java/com/android/server/wm/KeyguardDisableHandler.java +29 −16 Original line number Diff line number Diff line Loading @@ -68,9 +68,18 @@ public class KeyguardDisableHandler extends Handler { break; case KEYGUARD_POLICY_CHANGED: mAllowDisableKeyguard = ALLOW_DISABLE_UNKNOWN; if (mKeyguardTokenWatcher.isAcquired()) { // If we are currently disabled we need to know if the keyguard // should be re-enabled, so determine the allow state immediately. mKeyguardTokenWatcher.updateAllowState(); if (mAllowDisableKeyguard != ALLOW_DISABLE_YES) { mPolicy.enableKeyguard(true); } } else { // lazily evaluate this next time we're asked to disable keyguard mAllowDisableKeyguard = ALLOW_DISABLE_UNKNOWN; mPolicy.enableKeyguard(true); } break; } } Loading @@ -81,11 +90,9 @@ public class KeyguardDisableHandler extends Handler { super(handler, TAG); } @Override public void acquired() { public void updateAllowState() { // We fail safe and prevent disabling keyguard in the unlikely event this gets // called before DevicePolicyManagerService has started. if (mAllowDisableKeyguard == ALLOW_DISABLE_UNKNOWN) { DevicePolicyManager dpm = (DevicePolicyManager) mContext.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm != null) { Loading @@ -99,6 +106,12 @@ public class KeyguardDisableHandler extends Handler { } } } @Override public void acquired() { if (mAllowDisableKeyguard == ALLOW_DISABLE_UNKNOWN) { updateAllowState(); } if (mAllowDisableKeyguard == ALLOW_DISABLE_YES) { mPolicy.enableKeyguard(false); } else { Loading