Search in sources :

Example 1 with PersoSubState

use of com.android.internal.telephony.uicc.IccCardApplicationStatus.PersoSubState 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

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