aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Tommy Humborstad <kim.tommy.humborstad@stericsson.com>2011-05-06 16:56:07 +0200
committerSverre Vegge <sverre.vegge@stericsson.com>2011-08-03 10:40:14 +0200
commitb44f19ec5496553d72a12fbfe85b3abd8e27dfdb (patch)
treec328d8c167377abbfe24bbe921d723a75a6a5b17
parent490492f309cbbca963f341aec4bd5b4fb42e3053 (diff)
downloadu300-b44f19ec5496553d72a12fbfe85b3abd8e27dfdb.tar.gz
SIM: Added printing current detected SIM card state and substate
Since vanilla Android does not use all SIM information it is important that what STE generic RIL reports is documented somewhere. This is done through a LOGD print. Signed-off-by: Sverre Vegge <sverre.vegge@stericsson.com>
-rw-r--r--u300-ril-sim.c85
1 files changed, 85 insertions, 0 deletions
diff --git a/u300-ril-sim.c b/u300-ril-sim.c
index 1dfb331..1e34efb 100644
--- a/u300-ril-sim.c
+++ b/u300-ril-sim.c
@@ -115,6 +115,71 @@ static const RIL_CardStatus staticSimStatus = {
.num_applications = 0
};
+static const char *txtSIM_Status[] = {
+ "ABSENT",
+ "NOT_READY",
+ "READY",
+ "PIN",
+ "PUK",
+ "NETWORK_PERSONALIZATION",
+ "PIN2",
+ "PUK2",
+ "NETWORK_SUBSET_PERSONALIZATION",
+ "SERVICE_PROVIDER_PERSONALIZATION",
+ "CORPORATE_PERSONALIZATION",
+ "SIM_PERSONALIZATION",
+ "STERICSSON_LOCK",
+ "BLOCKED",
+ "PERM_BLOCKED",
+ "NETWORK_PERSONALIZATION_PUK",
+ "NETWORK_SUBSET_PERSONALIZATION_PUK",
+ "SERVICE_PROVIDER_PERSONALIZATION_PUK",
+ "CORPORATE_PERSONALIZATION_PUK",
+ "SIM_PERSONALIZATION_PUK",
+ "SIM_PUK2_PERM_BLOCKED",
+ "SIM_ERROR"
+};
+
+static const char *txtRIL_PersoSubstate[] = {
+ "UNKNOWN",
+ "IN_PROGRESS",
+ "READY",
+ "SIM_NETWORK",
+ "SIM_NETWORK_SUBSET",
+ "SIM_CORPORATE",
+ "SIM_SERVICE_PROVIDER",
+ "SIM_SIM",
+ "SIM_NETWORK_PUK",
+ "SIM_NETWORK_SUBSET_PUK",
+ "SIM_CORPORATE_PUK",
+ "SIM_SERVICE_PROVIDER_PUK",
+ "SIM_SIM_PUK"
+};
+
+static const char *txtRIL_AppState[] = {
+ "UNKNOWN",
+ "DETECTED",
+ "PIN",
+ "PUK",
+ "PERSONALIZATION",
+ "READY"
+};
+
+static const char *txtRIL_PinState[] = {
+ "UNKNOWN",
+ "ENABLED_NOT_VERIFIED",
+ "ENABLED_VERIFIED",
+ "DISABLED",
+ "ENABLED_BLOCKED",
+ "ENABLED_PERM_BLOCKED"
+};
+
+static const char *txtRIL_CardState[] = {
+ "ABSENT",
+ "PRESENT",
+ "ERROR"
+};
+
/*
* The following list contains values for the structure "RIL_AppStatus" to be
* sent to Android on a given SIM state. It is indexed by the SIM_Status above.
@@ -714,6 +779,8 @@ static int getCardStatus(RIL_CardStatus *p_card_status)
p_card_status->applications[i] = app_status_array[SIM_ABSENT];
sim_status = getSIMStatus();
+ LOGD("%s() detected internal main SIM card status %s", __func__,
+ txtSIM_Status[sim_status]);
if (sim_status == SIM_ABSENT)
p_card_status->card_state = RIL_CARDSTATE_ABSENT;
@@ -738,6 +805,24 @@ static int getCardStatus(RIL_CardStatus *p_card_status)
}
}
+ char *txtPersoSubstate;
+ asprintf(&txtPersoSubstate, " with substate %s",
+ txtRIL_PersoSubstate[
+ p_card_status->applications[0].perso_substate]);
+ LOGD("%s() reporting following SIM card status:\n"
+ "\tCard Status set to %s\n"
+ "\tApplication status set to %s%s\n"
+ "\tPIN 1 Status set to %s\n"
+ "\tPIN 2 Status set to %s", __func__,
+ txtRIL_CardState[p_card_status->card_state],
+ txtRIL_AppState[p_card_status->applications[0].app_state],
+ (p_card_status->applications[0].app_state ==
+ RIL_APPSTATE_SUBSCRIPTION_PERSO ? txtPersoSubstate : ""),
+ txtRIL_PinState[p_card_status->applications[0].pin1],
+ txtRIL_PinState[p_card_status->applications[0].pin2]
+ );
+ free(txtPersoSubstate);
+
return RIL_E_SUCCESS;
}