diff options
author | xinhe <xinhe@google.com> | 2014-12-03 23:39:29 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-12-03 23:39:32 +0000 |
commit | 8f61e7549ebb7ccb6bc2d41c30a9f2da2fb9bd7c (patch) | |
tree | 52cb1073a4e0f84d0dd3088ee6b57cddc75a1ef6 /telephony | |
parent | 82611e6d9c48a1a9b5d8b37b25425b7d7354ef4f (diff) | |
parent | 18b9c3cb506ae99bed1e9e95757a22b234cf366b (diff) | |
download | frameworks_base-8f61e7549ebb7ccb6bc2d41c30a9f2da2fb9bd7c.zip frameworks_base-8f61e7549ebb7ccb6bc2d41c30a9f2da2fb9bd7c.tar.gz frameworks_base-8f61e7549ebb7ccb6bc2d41c30a9f2da2fb9bd7c.tar.bz2 |
Merge "Unable to unlock SIM with a PIN/PUK" into lmp-mr1-dev
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/com/android/internal/telephony/IccCardConstants.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/telephony/java/com/android/internal/telephony/IccCardConstants.java b/telephony/java/com/android/internal/telephony/IccCardConstants.java index e7ca8d6..c1e2518 100644 --- a/telephony/java/com/android/internal/telephony/IccCardConstants.java +++ b/telephony/java/com/android/internal/telephony/IccCardConstants.java @@ -34,6 +34,10 @@ public class IccCardConstants { static public final String INTENT_VALUE_ICC_CARD_IO_ERROR = "CARD_IO_ERROR"; /* LOCKED means ICC is locked by pin or by network */ public static final String INTENT_VALUE_ICC_LOCKED = "LOCKED"; + //TODO: we can remove this state in the future if Bug 18489776 analysis + //#42's first race condition is resolved + /* INTERNAL LOCKED means ICC is locked by pin or by network */ + public static final String INTENT_VALUE_ICC_INTERNAL_LOCKED = "INTERNAL_LOCKED"; /* READY means ICC is ready to access */ public static final String INTENT_VALUE_ICC_READY = "READY"; /* IMSI means ICC IMSI is ready in property */ @@ -81,5 +85,21 @@ public class IccCardConstants { || (this == NETWORK_LOCKED) || (this == READY) || (this == PERM_DISABLED) || (this == CARD_IO_ERROR)); } + + public static State intToState(int state) throws IllegalArgumentException { + switch(state) { + case 0: return UNKNOWN; + case 1: return ABSENT; + case 2: return PIN_REQUIRED; + case 3: return PUK_REQUIRED; + case 4: return NETWORK_LOCKED; + case 5: return READY; + case 6: return NOT_READY; + case 7: return PERM_DISABLED; + case 8: return CARD_IO_ERROR; + default: + throw new IllegalArgumentException(); + } + } } } |