Search in sources :

Example 1 with AppType

use of com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType in project android_frameworks_opt_telephony by LineageOS.

the class UiccCard method activateDefaultApps.

private void activateDefaultApps() {
    int gsmIndex = mGsmUmtsSubscriptionAppIndex;
    int cdmaIndex = mCdmaSubscriptionAppIndex;
    if (gsmIndex < 0 || cdmaIndex < 0) {
        for (int i = 0; i < mUiccApplications.length; i++) {
            if (mUiccApplications[i] == null) {
                continue;
            }
            AppType appType = mUiccApplications[i].getType();
            if (gsmIndex < 0 && (appType == AppType.APPTYPE_USIM || appType == AppType.APPTYPE_SIM)) {
                gsmIndex = i;
            } else if (cdmaIndex < 0 && (appType == AppType.APPTYPE_CSIM || appType == AppType.APPTYPE_RUIM)) {
                cdmaIndex = i;
            }
        }
    }
    if (gsmIndex >= 0) {
        mCi.setUiccSubscription(gsmIndex, true, null);
    }
    if (cdmaIndex >= 0) {
        mCi.setUiccSubscription(cdmaIndex, true, null);
    }
}
Also used : AppType(com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType)

Example 2 with AppType

use of com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType in project android_frameworks_opt_telephony by LineageOS.

the class UiccProfile method activateDefaultApps.

private void activateDefaultApps() {
    int gsmIndex = mGsmUmtsSubscriptionAppIndex;
    int cdmaIndex = mCdmaSubscriptionAppIndex;
    if (gsmIndex < 0 || cdmaIndex < 0) {
        for (int i = 0; i < mUiccApplications.length; i++) {
            if (mUiccApplications[i] == null) {
                continue;
            }
            AppType appType = mUiccApplications[i].getType();
            if (gsmIndex < 0 && (appType == AppType.APPTYPE_USIM || appType == AppType.APPTYPE_SIM)) {
                gsmIndex = i;
            } else if (cdmaIndex < 0 && (appType == AppType.APPTYPE_CSIM || appType == AppType.APPTYPE_RUIM)) {
                cdmaIndex = i;
            }
        }
    }
    if (gsmIndex >= 0) {
        mCi.setUiccSubscription(gsmIndex, true, null);
    }
    if (cdmaIndex >= 0) {
        mCi.setUiccSubscription(cdmaIndex, true, null);
    }
}
Also used : AppType(com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType)

Example 3 with AppType

use of com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType in project android_frameworks_opt_telephony by LineageOS.

the class UiccCardApplication method update.

@UnsupportedAppUsage
public void update(IccCardApplicationStatus as, Context c, CommandsInterface ci) {
    synchronized (mLock) {
        if (mDestroyed) {
            loge("Application updated after destroyed! Fix me!");
            return;
        }
        if (DBG)
            log(mAppType + " update. New " + as);
        mContext = c;
        mCi = ci;
        AppType oldAppType = mAppType;
        AppState oldAppState = mAppState;
        PersoSubState oldPersoSubState = mPersoSubState;
        PinState oldPin1State = mPin1State;
        mAppType = as.app_type;
        mAuthContext = getAuthContext(mAppType);
        mAppState = as.app_state;
        mPersoSubState = as.perso_substate;
        mAid = as.aid;
        mAppLabel = as.app_label;
        mPin1Replaced = (as.pin1_replaced != 0);
        mPin1State = as.pin1;
        mPin2State = as.pin2;
        if (mAppType != oldAppType) {
            if (mIccFh != null) {
                mIccFh.dispose();
            }
            if (mIccRecords != null) {
                mIccRecords.dispose();
            }
            mIccFh = createIccFileHandler(as.app_type);
            mIccRecords = createIccRecords(as.app_type, c, ci);
        }
        if (mPersoSubState != oldPersoSubState && PersoSubState.isPersoLocked(mPersoSubState)) {
            notifyNetworkLockedRegistrantsIfNeeded(null);
        }
        if (mAppState != oldAppState) {
            if (DBG)
                log(oldAppType + " changed state: " + oldAppState + " -> " + mAppState);
            // as it might have failed in earlier attempt.
            if (mAppState == AppState.APPSTATE_READY) {
                queryFdn();
                queryPin1State();
            }
            notifyPinLockedRegistrantsIfNeeded(null);
            notifyReadyRegistrantsIfNeeded(null);
            notifyDetectedRegistrantsIfNeeded(null);
        } else {
            if (mPin1State != oldPin1State)
                queryPin1State();
        }
    }
}
Also used : PinState(com.android.internal.telephony.uicc.IccCardStatus.PinState) AppState(com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState) AppType(com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType) PersoSubState(com.android.internal.telephony.uicc.IccCardApplicationStatus.PersoSubState) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Aggregations

AppType (com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType)3 UnsupportedAppUsage (android.compat.annotation.UnsupportedAppUsage)1 AppState (com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState)1 PersoSubState (com.android.internal.telephony.uicc.IccCardApplicationStatus.PersoSubState)1 PinState (com.android.internal.telephony.uicc.IccCardStatus.PinState)1