对UiccCardApplication的认识

 UiccCardApplication,描述智能卡应用的信息,在UiccCard 中创建,主要包含如下内容
 <1> 对应的卡的信息,如APPState,AppType
 <2> 读取卡信息的对象,如IccFileHandler,IccRecrods
 <3> 对卡状态的数据监听器,如 mReadyRegistrants
 UiccCardApplciation只会创建一次,一旦卡的状态发生变化,UiccCardApplication 就会被更新
  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;
            mAppType = as.app_type;
            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 &&
                    mPersoSubState == PersoSubState.PERSOSUBSTATE_SIM_NETWORK) {
                notifyNetworkLockedRegistrantsIfNeeded(null); 数据发生变化,通知相关对象
            }

            if (mAppState != oldAppState) {
                if (DBG) log(oldAppType + " changed state: " + oldAppState + " -> " + mAppState);
                // If the app state turns to APPSTATE_READY, then query FDN status,
                //as it might have failed in earlier attempt.
                if (mAppState == AppState.APPSTATE_READY) {
                    queryFdn();
                    queryPin1State();
                }
                notifyPinLockedRegistrantsIfNeeded(null);// 数据发生变化,通知相关对象
                notifyReadyRegistrantsIfNeeded(null);// 数据发生变化,通知相关对象
            }
        }
    }
    当SIM卡的状态为Ready 的时候,就会通知 具体的IccRecords 去执行 加载SIM卡的信息,以RuimRecords 为例
    <1>  mParentApp.registerForReady(this, EVENT_APP_READY, null); //注册数据监听
    <2> public void onReady() {
        fetchRuimRecords();// 读取Records
        mCi.getCDMASubscription(obtainMessage(EVENT_GET_CDMA_SUBSCRIPTION_DONE));
    }
    具体的读取数据的操作是由IccFileHandler 完成的,数据保存在IccRecords 和相关系统属性中。


  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值