Search in sources :

Example 1 with AppStatus

use of android.hardware.radio.V1_0.AppStatus in project android_frameworks_opt_telephony by LineageOS.

the class RadioResponse method convertHalCardStatus.

private IccCardStatus convertHalCardStatus(CardStatus cardStatus) {
    IccCardStatus iccCardStatus = new IccCardStatus();
    iccCardStatus.setCardState(cardStatus.cardState);
    iccCardStatus.setUniversalPinState(cardStatus.universalPinState);
    iccCardStatus.mGsmUmtsSubscriptionAppIndex = cardStatus.gsmUmtsSubscriptionAppIndex;
    iccCardStatus.mCdmaSubscriptionAppIndex = cardStatus.cdmaSubscriptionAppIndex;
    iccCardStatus.mImsSubscriptionAppIndex = cardStatus.imsSubscriptionAppIndex;
    int numApplications = cardStatus.applications.size();
    // limit to maximum allowed applications
    if (numApplications > com.android.internal.telephony.uicc.IccCardStatus.CARD_MAX_APPS) {
        numApplications = com.android.internal.telephony.uicc.IccCardStatus.CARD_MAX_APPS;
    }
    iccCardStatus.mApplications = new IccCardApplicationStatus[numApplications];
    for (int i = 0; i < numApplications; i++) {
        AppStatus rilAppStatus = cardStatus.applications.get(i);
        IccCardApplicationStatus appStatus = new IccCardApplicationStatus();
        appStatus.app_type = appStatus.AppTypeFromRILInt(rilAppStatus.appType);
        appStatus.app_state = appStatus.AppStateFromRILInt(rilAppStatus.appState);
        appStatus.perso_substate = appStatus.PersoSubstateFromRILInt(rilAppStatus.persoSubstate);
        appStatus.aid = rilAppStatus.aidPtr;
        appStatus.app_label = rilAppStatus.appLabelPtr;
        appStatus.pin1_replaced = rilAppStatus.pin1Replaced;
        appStatus.pin1 = appStatus.PinStateFromRILInt(rilAppStatus.pin1);
        appStatus.pin2 = appStatus.PinStateFromRILInt(rilAppStatus.pin2);
        iccCardStatus.mApplications[i] = appStatus;
        mRil.riljLog("IccCardApplicationStatus " + i + ":" + appStatus.toString());
    }
    return iccCardStatus;
}
Also used : AppStatus(android.hardware.radio.V1_0.AppStatus) IccCardStatus(com.android.internal.telephony.uicc.IccCardStatus) IccCardApplicationStatus(com.android.internal.telephony.uicc.IccCardApplicationStatus)

Aggregations

AppStatus (android.hardware.radio.V1_0.AppStatus)1 IccCardApplicationStatus (com.android.internal.telephony.uicc.IccCardApplicationStatus)1 IccCardStatus (com.android.internal.telephony.uicc.IccCardStatus)1