diff options
author | Jim Miller <jaggies@google.com> | 2014-11-21 18:37:59 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-11-21 18:38:03 +0000 |
commit | 0284e5e49864a6e039d77210bbea0a013b0e23ec (patch) | |
tree | 6db5dcc9cd59535a48b71869fe8915c3e7a4384b /packages/SystemUI/src/com/android/systemui/keyguard | |
parent | 26750711e12900aca6c7c35556b4548038cfb505 (diff) | |
parent | 52a6133f4ba8b1d08f5158d802790d6a1b16568d (diff) | |
download | frameworks_base-0284e5e49864a6e039d77210bbea0a013b0e23ec.zip frameworks_base-0284e5e49864a6e039d77210bbea0a013b0e23ec.tar.gz frameworks_base-0284e5e49864a6e039d77210bbea0a013b0e23ec.tar.bz2 |
Merge "Add multi-sim support to keyguard" into lmp-mr1-dev
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/keyguard')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 5f92dc6..8213127 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -43,6 +43,7 @@ import android.os.SystemProperties; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; +import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.util.EventLog; import android.util.Log; @@ -57,6 +58,7 @@ import com.android.internal.policy.IKeyguardExitCallback; import com.android.internal.policy.IKeyguardShowCallback; import com.android.internal.telephony.IccCardConstants; import com.android.internal.widget.LockPatternUtils; +import com.android.keyguard.KeyguardConstants; import com.android.keyguard.KeyguardDisplayManager; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.KeyguardUpdateMonitorCallback; @@ -116,7 +118,8 @@ public class KeyguardViewMediator extends SystemUI { private static final int KEYGUARD_DISPLAY_TIMEOUT_DELAY_DEFAULT = 30000; private static final long KEYGUARD_DONE_PENDING_TIMEOUT_MS = 3000; - final static boolean DEBUG = false; + private static final boolean DEBUG = KeyguardConstants.DEBUG; + private static final boolean DEBUG_SIM_STATES = KeyguardConstants.DEBUG_SIM_STATES; private final static boolean DBG_WAKE = false; private final static String TAG = "KeyguardViewMediator"; @@ -360,8 +363,12 @@ public class KeyguardViewMediator extends SystemUI { } @Override - public void onSimStateChanged(IccCardConstants.State simState) { - if (DEBUG) Log.d(TAG, "onSimStateChanged: " + simState); + public void onSimStateChanged(int subId, int slotId, IccCardConstants.State simState) { + + if (DEBUG_SIM_STATES) { + Log.d(TAG, "onSimStateChanged(subId=" + subId + ", slotId=" + slotId + + ",state=" + simState + ")"); + } switch (simState) { case NOT_READY: @@ -371,7 +378,7 @@ public class KeyguardViewMediator extends SystemUI { synchronized (this) { if (shouldWaitForProvisioning()) { if (!isShowing()) { - if (DEBUG) Log.d(TAG, "ICC_ABSENT isn't showing," + if (DEBUG_SIM_STATES) Log.d(TAG, "ICC_ABSENT isn't showing," + " we need to show the keyguard since the " + "device isn't provisioned yet."); doKeyguardLocked(null); @@ -385,7 +392,8 @@ public class KeyguardViewMediator extends SystemUI { case PUK_REQUIRED: synchronized (this) { if (!isShowing()) { - if (DEBUG) Log.d(TAG, "INTENT_VALUE_ICC_LOCKED and keygaurd isn't " + if (DEBUG_SIM_STATES) Log.d(TAG, + "INTENT_VALUE_ICC_LOCKED and keygaurd isn't " + "showing; need to show keyguard so user can enter sim pin"); doKeyguardLocked(null); } else { @@ -396,11 +404,11 @@ public class KeyguardViewMediator extends SystemUI { case PERM_DISABLED: synchronized (this) { if (!isShowing()) { - if (DEBUG) Log.d(TAG, "PERM_DISABLED and " + if (DEBUG_SIM_STATES) Log.d(TAG, "PERM_DISABLED and " + "keygaurd isn't showing."); doKeyguardLocked(null); } else { - if (DEBUG) Log.d(TAG, "PERM_DISABLED, resetStateLocked to" + if (DEBUG_SIM_STATES) Log.d(TAG, "PERM_DISABLED, resetStateLocked to" + "show permanently disabled message in lockscreen."); resetStateLocked(); } @@ -413,6 +421,9 @@ public class KeyguardViewMediator extends SystemUI { } } break; + default: + if (DEBUG_SIM_STATES) Log.v(TAG, "Ignoring state: " + simState); + break; } } @@ -913,13 +924,13 @@ public class KeyguardViewMediator extends SystemUI { } // if the setup wizard hasn't run yet, don't show - final boolean requireSim = !SystemProperties.getBoolean("keyguard.no_require_sim", - false); - final IccCardConstants.State state = mUpdateMonitor.getSimState(); - final boolean lockedOrMissing = state.isPinLocked() - || ((state == IccCardConstants.State.ABSENT - || state == IccCardConstants.State.PERM_DISABLED) - && requireSim); + final boolean requireSim = !SystemProperties.getBoolean("keyguard.no_require_sim", false); + final boolean absent = mUpdateMonitor.getNextSubIdForState( + IccCardConstants.State.ABSENT) != SubscriptionManager.INVALID_SUB_ID; + final boolean disabled = mUpdateMonitor.getNextSubIdForState( + IccCardConstants.State.PERM_DISABLED) != SubscriptionManager.INVALID_SUB_ID; + final boolean lockedOrMissing = mUpdateMonitor.isSimPinSecure() + || ((absent || disabled) && requireSim); if (!lockedOrMissing && shouldWaitForProvisioning()) { if (DEBUG) Log.d(TAG, "doKeyguard: not showing because device isn't provisioned" |