summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2015-05-27 17:47:48 -0700
committerRoman Birg <roman@cyngn.com>2016-02-08 16:27:16 -0800
commit47a4c8062adf2980dfcfd10bcedbfd3250c7218a (patch)
tree2e5f9df58f22b74897c04a17d85246cd876e0393 /packages/SystemUI/src
parent15d73db14341f0fe72edc4fe92d1085b52ece5da (diff)
downloadframeworks_base-47a4c8062adf2980dfcfd10bcedbfd3250c7218a.zip
frameworks_base-47a4c8062adf2980dfcfd10bcedbfd3250c7218a.tar.gz
frameworks_base-47a4c8062adf2980dfcfd10bcedbfd3250c7218a.tar.bz2
SystemUI: prompt for SIM PIN if lockscreen is disabled
Ref: CYNGNOS-1930 Change-Id: Ie5d2557c84c1ff9f1053de525e68c5ed790ecb99 Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'packages/SystemUI/src')
-rwxr-xr-xpackages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java50
1 files changed, 28 insertions, 22 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 26102d6..dd76a3e 100755
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -517,7 +517,9 @@ public class KeyguardViewMediator extends SystemUI {
break;
case READY:
synchronized (this) {
- if (mShowing) {
+ if (mInternallyDisabled) {
+ hideLocked();
+ } else if (mShowing) {
resetStateLocked();
}
}
@@ -761,7 +763,7 @@ public class KeyguardViewMediator extends SystemUI {
Slog.w(TAG, "Failed to call onKeyguardExitResult(false)", e);
}
mExitSecureCallback = null;
- if (!mExternallyEnabled) {
+ if (!mInternallyDisabled && !mExternallyEnabled) {
hideLocked();
}
} else if (mShowing) {
@@ -914,6 +916,10 @@ public class KeyguardViewMediator extends SystemUI {
if (DEBUG) Log.d(TAG, "isKeyguardDisabled: keyguard is disabled by setting");
return true;
}
+ if (mInternallyDisabled) {
+ if (DEBUG) Log.d(TAG, "isKeyguardDisabled: keyguard is disabled internally");
+ return true;
+ }
Profile profile = mProfileManager.getActiveProfile();
if (profile != null) {
if (profile.getScreenLockMode().getValue() == Profile.LockMode.DISABLE) {
@@ -973,15 +979,15 @@ public class KeyguardViewMediator extends SystemUI {
public void setKeyguardEnabled(boolean enabled) {
synchronized (this) {
if (DEBUG) Log.d(TAG, "setKeyguardEnabled(" + enabled + ")");
-
- if (mInternallyDisabled && enabled && !lockscreenEnforcedByDevicePolicy()) {
+ mExternallyEnabled = enabled;
+ if (mInternallyDisabled
+ && enabled
+ && !lockscreenEnforcedByDevicePolicy()) {
// if keyguard is forcefully disabled internally (by lock screen tile), don't allow
// it to be enabled externally, unless the device policy manager says so.
return;
}
- mExternallyEnabled = enabled;
-
if (!enabled && mShowing) {
if (mExitSecureCallback != null) {
if (DEBUG) Log.d(TAG, "in process of verifyUnlock request, ignoring");
@@ -1173,22 +1179,6 @@ public class KeyguardViewMediator extends SystemUI {
* Enable the keyguard if the settings are appropriate.
*/
private void doKeyguardLocked(Bundle options) {
- // if another app is disabling us, don't show
- if (!mExternallyEnabled) {
- if (DEBUG) Log.d(TAG, "doKeyguard: not showing because externally disabled");
-
- // note: we *should* set mNeedToReshowWhenReenabled=true here, but that makes
- // for an occasional ugly flicker in this situation:
- // 1) receive a call with the screen on (no keyguard) or make a call
- // 2) screen times out
- // 3) user hits key to turn screen back on
- // instead, we reenable the keyguard when we know the screen is off and the call
- // ends (see the broadcast receiver below)
- // TODO: clean this up when we have better support at the window manager level
- // for apps that wish to be on top of the keyguard
- return;
- }
-
// if the keyguard is already showing, don't bother
if (mStatusBarKeyguardViewManager.isShowing()) {
if (DEBUG) Log.d(TAG, "doKeyguard: not showing because it is already showing");
@@ -1211,6 +1201,22 @@ public class KeyguardViewMediator extends SystemUI {
return;
}
+ // if another app is disabling us, don't show
+ if (!mExternallyEnabled && !lockedOrMissing) {
+ if (DEBUG) Log.d(TAG, "doKeyguard: not showing because externally disabled");
+
+ // note: we *should* set mNeedToReshowWhenReenabled=true here, but that makes
+ // for an occasional ugly flicker in this situation:
+ // 1) receive a call with the screen on (no keyguard) or make a call
+ // 2) screen times out
+ // 3) user hits key to turn screen back on
+ // instead, we reenable the keyguard when we know the screen is off and the call
+ // ends (see the broadcast receiver below)
+ // TODO: clean this up when we have better support at the window manager level
+ // for apps that wish to be on top of the keyguard
+ return;
+ }
+
if (isKeyguardDisabled(KeyguardUpdateMonitor.getCurrentUser())
&& !lockedOrMissing) {
if (DEBUG) Log.d(TAG, "doKeyguard: not showing because lockscreen is off");