Merge "Support SIM permanently disabled state." into honeycomb-LTE
This commit is contained in:
@ -1728,6 +1728,9 @@
|
|||||||
<string name="lockscreen_missing_sim_instructions">Please insert a SIM card.</string>
|
<string name="lockscreen_missing_sim_instructions">Please insert a SIM card.</string>
|
||||||
<!-- Shown in the lock screen to ask the user to insert a SIM card when sim is missing or not readable. -->
|
<!-- Shown in the lock screen to ask the user to insert a SIM card when sim is missing or not readable. -->
|
||||||
<string name="lockscreen_missing_sim_instructions_long">The SIM card is missing or not readable. Please insert a SIM card.</string>
|
<string name="lockscreen_missing_sim_instructions_long">The SIM card is missing or not readable. Please insert a SIM card.</string>
|
||||||
|
<!-- Shown in the lock screen to inform the user to SIM card is permanently disabled. -->
|
||||||
|
<string name="lockscreen_permanent_disabled_sim_instructions">Your SIM card is permanently disabled.\n
|
||||||
|
Please contact your wireless service provider to obtain another SIM card.</string>
|
||||||
|
|
||||||
<!-- Shown in the lock screen when there is emergency calls only mode. -->
|
<!-- Shown in the lock screen when there is emergency calls only mode. -->
|
||||||
<string name="emergency_calls_only" msgid="2485604591272668370">Emergency calls only</string>
|
<string name="emergency_calls_only" msgid="2485604591272668370">Emergency calls only</string>
|
||||||
|
@ -114,7 +114,15 @@ public class KeyguardUpdateMonitor {
|
|||||||
}
|
}
|
||||||
String stateExtra = intent.getStringExtra(IccCard.INTENT_KEY_ICC_STATE);
|
String stateExtra = intent.getStringExtra(IccCard.INTENT_KEY_ICC_STATE);
|
||||||
if (IccCard.INTENT_VALUE_ICC_ABSENT.equals(stateExtra)) {
|
if (IccCard.INTENT_VALUE_ICC_ABSENT.equals(stateExtra)) {
|
||||||
this.simState = IccCard.State.ABSENT;
|
final String absentReason = intent
|
||||||
|
.getStringExtra(IccCard.INTENT_KEY_LOCKED_REASON);
|
||||||
|
|
||||||
|
if (IccCard.INTENT_VALUE_ABSENT_ON_PERM_DISABLED.equals(
|
||||||
|
absentReason)) {
|
||||||
|
this.simState = IccCard.State.PERM_DISABLED;
|
||||||
|
} else {
|
||||||
|
this.simState = IccCard.State.ABSENT;
|
||||||
|
}
|
||||||
} else if (IccCard.INTENT_VALUE_ICC_READY.equals(stateExtra)) {
|
} else if (IccCard.INTENT_VALUE_ICC_READY.equals(stateExtra)) {
|
||||||
this.simState = IccCard.State.READY;
|
this.simState = IccCard.State.READY;
|
||||||
} else if (IccCard.INTENT_VALUE_ICC_LOCKED.equals(stateExtra)) {
|
} else if (IccCard.INTENT_VALUE_ICC_LOCKED.equals(stateExtra)) {
|
||||||
|
@ -581,7 +581,9 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
|
|||||||
final boolean provisioned = mUpdateMonitor.isDeviceProvisioned();
|
final boolean provisioned = mUpdateMonitor.isDeviceProvisioned();
|
||||||
final IccCard.State state = mUpdateMonitor.getSimState();
|
final IccCard.State state = mUpdateMonitor.getSimState();
|
||||||
final boolean lockedOrMissing = state.isPinLocked()
|
final boolean lockedOrMissing = state.isPinLocked()
|
||||||
|| ((state == IccCard.State.ABSENT) && requireSim);
|
|| ((state == IccCard.State.ABSENT
|
||||||
|
|| state == IccCard.State.PERM_DISABLED)
|
||||||
|
&& requireSim);
|
||||||
|
|
||||||
if (!lockedOrMissing && !provisioned) {
|
if (!lockedOrMissing && !provisioned) {
|
||||||
if (DEBUG) Log.d(TAG, "doKeyguard: not showing because device isn't provisioned"
|
if (DEBUG) Log.d(TAG, "doKeyguard: not showing because device isn't provisioned"
|
||||||
@ -688,12 +690,15 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
|
|||||||
|
|
||||||
switch (simState) {
|
switch (simState) {
|
||||||
case ABSENT:
|
case ABSENT:
|
||||||
|
case PERM_DISABLED:
|
||||||
// only force lock screen in case of missing sim if user hasn't
|
// only force lock screen in case of missing sim if user hasn't
|
||||||
// gone through setup wizard
|
// gone through setup wizard
|
||||||
if (!mUpdateMonitor.isDeviceProvisioned()) {
|
if (!mUpdateMonitor.isDeviceProvisioned()) {
|
||||||
if (!isShowing()) {
|
if (!isShowing()) {
|
||||||
if (DEBUG) Log.d(TAG, "INTENT_VALUE_ICC_ABSENT and keygaurd isn't showing, we need "
|
if (DEBUG) Log.d(TAG, "INTENT_VALUE_ICC_ABSENT "
|
||||||
+ "to show the keyguard since the device isn't provisioned yet.");
|
+ "or PERM_DISABLED and keygaurd isn't showing,"
|
||||||
|
+ " we need to show the keyguard since the "
|
||||||
|
+ "device isn't provisioned yet.");
|
||||||
doKeyguard();
|
doKeyguard();
|
||||||
} else {
|
} else {
|
||||||
resetStateLocked();
|
resetStateLocked();
|
||||||
|
@ -181,7 +181,8 @@ public class LockPatternKeyguardView extends KeyguardViewBase {
|
|||||||
private boolean stuckOnLockScreenBecauseSimMissing() {
|
private boolean stuckOnLockScreenBecauseSimMissing() {
|
||||||
return mRequiresSim
|
return mRequiresSim
|
||||||
&& (!mUpdateMonitor.isDeviceProvisioned())
|
&& (!mUpdateMonitor.isDeviceProvisioned())
|
||||||
&& (mUpdateMonitor.getSimState() == IccCard.State.ABSENT);
|
&& (mUpdateMonitor.getSimState() == IccCard.State.ABSENT ||
|
||||||
|
mUpdateMonitor.getSimState() == IccCard.State.PERM_DISABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,8 +55,10 @@ public class LockPatternKeyguardViewProperties implements KeyguardViewProperties
|
|||||||
|
|
||||||
private boolean isSimPinSecure() {
|
private boolean isSimPinSecure() {
|
||||||
final IccCard.State simState = mUpdateMonitor.getSimState();
|
final IccCard.State simState = mUpdateMonitor.getSimState();
|
||||||
return (simState == IccCard.State.PIN_REQUIRED || simState == IccCard.State.PUK_REQUIRED
|
return (simState == IccCard.State.PIN_REQUIRED
|
||||||
|| simState == IccCard.State.ABSENT);
|
|| simState == IccCard.State.PUK_REQUIRED
|
||||||
|
|| simState == IccCard.State.ABSENT
|
||||||
|
|| simState == IccCard.State.PERM_DISABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,12 @@ class LockScreen extends LinearLayout implements KeyguardScreen,
|
|||||||
/**
|
/**
|
||||||
* The sim card is locked.
|
* The sim card is locked.
|
||||||
*/
|
*/
|
||||||
SimLocked(true);
|
SimLocked(true),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The sim card is permanently disabled due to puk unlock failure
|
||||||
|
*/
|
||||||
|
SimPermDisabled(false);
|
||||||
|
|
||||||
private final boolean mShowStatusLines;
|
private final boolean mShowStatusLines;
|
||||||
|
|
||||||
@ -450,7 +455,9 @@ class LockScreen extends LinearLayout implements KeyguardScreen,
|
|||||||
*/
|
*/
|
||||||
private Status getCurrentStatus(IccCard.State simState) {
|
private Status getCurrentStatus(IccCard.State simState) {
|
||||||
boolean missingAndNotProvisioned = (!mUpdateMonitor.isDeviceProvisioned()
|
boolean missingAndNotProvisioned = (!mUpdateMonitor.isDeviceProvisioned()
|
||||||
&& simState == IccCard.State.ABSENT);
|
&& (simState == IccCard.State.ABSENT
|
||||||
|
|| simState == IccCard.State.PERM_DISABLED));
|
||||||
|
|
||||||
if (missingAndNotProvisioned) {
|
if (missingAndNotProvisioned) {
|
||||||
return Status.SimMissingLocked;
|
return Status.SimMissingLocked;
|
||||||
}
|
}
|
||||||
@ -468,6 +475,8 @@ class LockScreen extends LinearLayout implements KeyguardScreen,
|
|||||||
return Status.SimPukLocked;
|
return Status.SimPukLocked;
|
||||||
case READY:
|
case READY:
|
||||||
return Status.Normal;
|
return Status.Normal;
|
||||||
|
case PERM_DISABLED:
|
||||||
|
return Status.SimPermDisabled;
|
||||||
case UNKNOWN:
|
case UNKNOWN:
|
||||||
return Status.SimMissing;
|
return Status.SimMissing;
|
||||||
}
|
}
|
||||||
@ -542,6 +551,18 @@ class LockScreen extends LinearLayout implements KeyguardScreen,
|
|||||||
enableUnlock(); // do not need to show the e-call button; user may unlock
|
enableUnlock(); // do not need to show the e-call button; user may unlock
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SimPermDisabled:
|
||||||
|
// text
|
||||||
|
mStatusView.setCarrierText(R.string.lockscreen_missing_sim_message_short);
|
||||||
|
mScreenLocked.setText(
|
||||||
|
R.string.lockscreen_permanent_disabled_sim_instructions);
|
||||||
|
|
||||||
|
// layout
|
||||||
|
mScreenLocked.setVisibility(View.VISIBLE);
|
||||||
|
mLockPatternUtils.updateEmergencyCallText(mEmergencyCallText);
|
||||||
|
enableUnlock(); // do not need to show the e-call button; user may unlock
|
||||||
|
break;
|
||||||
|
|
||||||
case SimMissingLocked:
|
case SimMissingLocked:
|
||||||
// text
|
// text
|
||||||
mStatusView.setCarrierText(
|
mStatusView.setCarrierText(
|
||||||
|
@ -84,6 +84,9 @@ public abstract class IccCard {
|
|||||||
static public final String INTENT_VALUE_LOCKED_ON_PUK = "PUK";
|
static public final String INTENT_VALUE_LOCKED_ON_PUK = "PUK";
|
||||||
/* NETWORK means ICC is locked on NETWORK PERSONALIZATION */
|
/* NETWORK means ICC is locked on NETWORK PERSONALIZATION */
|
||||||
static public final String INTENT_VALUE_LOCKED_NETWORK = "NETWORK";
|
static public final String INTENT_VALUE_LOCKED_NETWORK = "NETWORK";
|
||||||
|
/* PERM_DISABLED means ICC is permanently disabled due to puk fails */
|
||||||
|
static public final String INTENT_VALUE_ABSENT_ON_PERM_DISABLED = "PERM_DISABLED";
|
||||||
|
|
||||||
|
|
||||||
protected static final int EVENT_ICC_LOCKED_OR_ABSENT = 1;
|
protected static final int EVENT_ICC_LOCKED_OR_ABSENT = 1;
|
||||||
private static final int EVENT_GET_ICC_STATUS_DONE = 2;
|
private static final int EVENT_GET_ICC_STATUS_DONE = 2;
|
||||||
@ -112,7 +115,8 @@ public abstract class IccCard {
|
|||||||
PUK_REQUIRED,
|
PUK_REQUIRED,
|
||||||
NETWORK_LOCKED,
|
NETWORK_LOCKED,
|
||||||
READY,
|
READY,
|
||||||
NOT_READY;
|
NOT_READY,
|
||||||
|
PERM_DISABLED;
|
||||||
|
|
||||||
public boolean isPinLocked() {
|
public boolean isPinLocked() {
|
||||||
return ((this == PIN_REQUIRED) || (this == PUK_REQUIRED));
|
return ((this == PIN_REQUIRED) || (this == PUK_REQUIRED));
|
||||||
@ -120,7 +124,8 @@ public abstract class IccCard {
|
|||||||
|
|
||||||
public boolean iccCardExist() {
|
public boolean iccCardExist() {
|
||||||
return ((this == PIN_REQUIRED) || (this == PUK_REQUIRED)
|
return ((this == PIN_REQUIRED) || (this == PUK_REQUIRED)
|
||||||
|| (this == NETWORK_LOCKED) || (this == READY));
|
|| (this == NETWORK_LOCKED) || (this == READY)
|
||||||
|
|| (this == PERM_DISABLED));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,6 +421,7 @@ public abstract class IccCard {
|
|||||||
boolean transitionedIntoPinLocked;
|
boolean transitionedIntoPinLocked;
|
||||||
boolean transitionedIntoAbsent;
|
boolean transitionedIntoAbsent;
|
||||||
boolean transitionedIntoNetworkLocked;
|
boolean transitionedIntoNetworkLocked;
|
||||||
|
boolean transitionedIntoPermBlocked;
|
||||||
boolean isIccCardRemoved;
|
boolean isIccCardRemoved;
|
||||||
boolean isIccCardAdded;
|
boolean isIccCardAdded;
|
||||||
|
|
||||||
@ -434,6 +440,8 @@ public abstract class IccCard {
|
|||||||
transitionedIntoAbsent = (oldState != State.ABSENT && newState == State.ABSENT);
|
transitionedIntoAbsent = (oldState != State.ABSENT && newState == State.ABSENT);
|
||||||
transitionedIntoNetworkLocked = (oldState != State.NETWORK_LOCKED
|
transitionedIntoNetworkLocked = (oldState != State.NETWORK_LOCKED
|
||||||
&& newState == State.NETWORK_LOCKED);
|
&& newState == State.NETWORK_LOCKED);
|
||||||
|
transitionedIntoPermBlocked = (oldState != State.PERM_DISABLED
|
||||||
|
&& newState == State.PERM_DISABLED);
|
||||||
isIccCardRemoved = (oldState != null &&
|
isIccCardRemoved = (oldState != null &&
|
||||||
oldState.iccCardExist() && newState == State.ABSENT);
|
oldState.iccCardExist() && newState == State.ABSENT);
|
||||||
isIccCardAdded = (oldState == State.ABSENT &&
|
isIccCardAdded = (oldState == State.ABSENT &&
|
||||||
@ -454,6 +462,10 @@ public abstract class IccCard {
|
|||||||
mNetworkLockedRegistrants.notifyRegistrants();
|
mNetworkLockedRegistrants.notifyRegistrants();
|
||||||
broadcastIccStateChangedIntent(INTENT_VALUE_ICC_LOCKED,
|
broadcastIccStateChangedIntent(INTENT_VALUE_ICC_LOCKED,
|
||||||
INTENT_VALUE_LOCKED_NETWORK);
|
INTENT_VALUE_LOCKED_NETWORK);
|
||||||
|
} else if (transitionedIntoPermBlocked) {
|
||||||
|
if (mDbg) log("Notify SIM permanently disabled.");
|
||||||
|
broadcastIccStateChangedIntent(INTENT_VALUE_ICC_ABSENT,
|
||||||
|
INTENT_VALUE_ABSENT_ON_PERM_DISABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isIccCardRemoved) {
|
if (isIccCardRemoved) {
|
||||||
@ -762,6 +774,9 @@ public abstract class IccCard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if PIN required
|
// check if PIN required
|
||||||
|
if (app.pin1.isPermBlocked()) {
|
||||||
|
return IccCard.State.PERM_DISABLED;
|
||||||
|
}
|
||||||
if (app.app_state.isPinRequired()) {
|
if (app.app_state.isPinRequired()) {
|
||||||
return IccCard.State.PIN_REQUIRED;
|
return IccCard.State.PIN_REQUIRED;
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.internal.telephony;
|
package com.android.internal.telephony;
|
||||||
|
|
||||||
|
import com.android.internal.telephony.IccCardStatus.PinState;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See also RIL_AppStatus in include/telephony/ril.h
|
* See also RIL_AppStatus in include/telephony/ril.h
|
||||||
@ -104,8 +106,8 @@ public class IccCardApplication {
|
|||||||
public String app_label;
|
public String app_label;
|
||||||
// applicable to USIM and CSIM
|
// applicable to USIM and CSIM
|
||||||
public int pin1_replaced;
|
public int pin1_replaced;
|
||||||
public int pin1;
|
public PinState pin1;
|
||||||
public int pin2;
|
public PinState pin2;
|
||||||
|
|
||||||
AppType AppTypeFromRILInt(int type) {
|
AppType AppTypeFromRILInt(int type) {
|
||||||
AppType newType;
|
AppType newType;
|
||||||
@ -177,6 +179,33 @@ public class IccCardApplication {
|
|||||||
return newSubState;
|
return newSubState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PinState PinStateFromRILInt(int state) {
|
||||||
|
PinState newPinState;
|
||||||
|
switch(state) {
|
||||||
|
case 0:
|
||||||
|
newPinState = PinState.PINSTATE_UNKNOWN;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newPinState = PinState.PINSTATE_ENABLED_NOT_VERIFIED;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newPinState = PinState.PINSTATE_ENABLED_VERIFIED;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
newPinState = PinState.PINSTATE_DISABLED;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
newPinState = PinState.PINSTATE_ENABLED_BLOCKED;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
newPinState = PinState.PINSTATE_ENABLED_PERM_BLOCKED;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new RuntimeException("Unrecognized RIL_PinState: " + state);
|
||||||
|
}
|
||||||
|
return newPinState;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
@ -185,6 +214,12 @@ public class IccCardApplication {
|
|||||||
if (app_state == AppState.APPSTATE_SUBSCRIPTION_PERSO) {
|
if (app_state == AppState.APPSTATE_SUBSCRIPTION_PERSO) {
|
||||||
sb.append(",").append(perso_substate);
|
sb.append(",").append(perso_substate);
|
||||||
}
|
}
|
||||||
|
if (app_type == AppType.APPTYPE_CSIM ||
|
||||||
|
app_type == AppType.APPTYPE_USIM ||
|
||||||
|
app_type == AppType.APPTYPE_ISIM) {
|
||||||
|
sb.append(",pin1=").append(pin1);
|
||||||
|
sb.append(",pin2=").append(pin2);
|
||||||
|
}
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,19 @@ public class IccCardStatus {
|
|||||||
PINSTATE_ENABLED_VERIFIED,
|
PINSTATE_ENABLED_VERIFIED,
|
||||||
PINSTATE_DISABLED,
|
PINSTATE_DISABLED,
|
||||||
PINSTATE_ENABLED_BLOCKED,
|
PINSTATE_ENABLED_BLOCKED,
|
||||||
PINSTATE_ENABLED_PERM_BLOCKED
|
PINSTATE_ENABLED_PERM_BLOCKED;
|
||||||
|
|
||||||
|
boolean isPermBlocked() {
|
||||||
|
return this == PINSTATE_ENABLED_PERM_BLOCKED;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isPinRequired() {
|
||||||
|
return this == PINSTATE_ENABLED_NOT_VERIFIED;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isPukRequired() {
|
||||||
|
return this == PINSTATE_ENABLED_BLOCKED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private CardState mCardState;
|
private CardState mCardState;
|
||||||
|
@ -2925,8 +2925,8 @@ public final class RIL extends BaseCommands implements CommandsInterface {
|
|||||||
ca.aid = p.readString();
|
ca.aid = p.readString();
|
||||||
ca.app_label = p.readString();
|
ca.app_label = p.readString();
|
||||||
ca.pin1_replaced = p.readInt();
|
ca.pin1_replaced = p.readInt();
|
||||||
ca.pin1 = p.readInt();
|
ca.pin1 = ca.PinStateFromRILInt(p.readInt());
|
||||||
ca.pin2 = p.readInt();
|
ca.pin2 = ca.PinStateFromRILInt(p.readInt());
|
||||||
status.addApplication(ca);
|
status.addApplication(ca);
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
|
Reference in New Issue
Block a user