Add toString for IccCard Status and App.

Enhance the debug info for GET_SIM_STATUS. Print out the
Card status and App status instead of Object id. It helps
to debug PUK lock and other SIM related issues.

Change-Id: I489f3933529a9719827a8799c41de8e999db6b40
This commit is contained in:
John Wang
2011-06-09 15:42:58 -07:00
parent 88748e6dc0
commit c7a58b4de0
2 changed files with 40 additions and 0 deletions

View File

@@ -177,4 +177,15 @@ public class IccCardApplication {
return newSubState;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{").append(app_type).append(",").append(app_state);
if (app_state == AppState.APPSTATE_SUBSCRIPTION_PERSO) {
sb.append(",").append(perso_substate);
}
sb.append("}");
return sb.toString();
}
}

View File

@@ -144,4 +144,33 @@ public class IccCardStatus {
return mApplications.get(index);
}
@Override
public String toString() {
IccCardApplication app;
StringBuilder sb = new StringBuilder();
sb.append("IccCardState {").append(mCardState).append(",")
.append(mUniversalPinState)
.append(",num_apps=").append(mNumApplications)
.append(",gsm_id=").append(mGsmUmtsSubscriptionAppIndex);
if (mGsmUmtsSubscriptionAppIndex >=0
&& mGsmUmtsSubscriptionAppIndex <CARD_MAX_APPS) {
app = getApplication(mGsmUmtsSubscriptionAppIndex);
sb.append(app == null ? "null" : app);
}
sb.append(",cmda_id=").append(mCdmaSubscriptionAppIndex);
if (mCdmaSubscriptionAppIndex >=0
&& mCdmaSubscriptionAppIndex <CARD_MAX_APPS) {
app = getApplication(mCdmaSubscriptionAppIndex);
sb.append(app == null ? "null" : app);
}
sb.append(",ism_id=").append(mImsSubscriptionAppIndex);
sb.append("}");
return sb.toString();
}
}