kaifyou Android 7.0 UICC 分析(四)

來源:互聯網
上載者:User

標籤:one   rri   訊息通知   case   ice   msi   start   try   interface   

本文講解SIMRecords

/frameworks/opt/telephony/src/java/com/android/internal/telephony/uicc/SIMRecords.java

構造方法:

    public SIMRecords(UiccCardApplication app, Context c, CommandsInterface ci) {        super(app, c, ci);        mAdnCache = new AdnRecordCache(mFh);        mVmConfig = new VoiceMailConstants();        mSpnOverride = new SpnOverride();        mCi.setOnSmsOnSim(this, EVENT_SMS_ON_SIM, null);//訊息註冊,當Ci接收到EVENT_SMS_ON_SIM訊息通知SIMRecords        mCi.registerForIccRefresh(this, EVENT_SIM_REFRESH, null);        // Start off by setting empty state        resetRecords();        mParentApp.registerForReady(this, EVENT_APP_READY, null);//當卡準備好,UiccCardApplication會通過notifyReadyRegistrantsifNeeded()通知SIMRecords        mParentApp.registerForLocked(this, EVENT_APP_LOCKED, null);//EVENT_APP_LOCKED訊息同樣處理        if (DBG) log("SIMRecords X ctor this=" + this);        IntentFilter intentfilter = new IntentFilter();        intentfilter.addAction(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED);        c.registerReceiver(mReceiver, intentfilter); //接收ACTION_CARRIER_CONFIG_CHANGED訊息的處理    }

 

接收UiccCardApplication 的通知,訊息EVENT_APP_READY、EVENT_APP_LOCKED 的處理:

        try { switch (msg.what) {            case EVENT_APP_READY:                onReady();                break;            case EVENT_APP_LOCKED:                onLocked();                break;            }

onReady() 方法,直接調用fetchSimRecords(),到這裡開始載入EF檔案資訊:

具體的讀取SIM卡EF檔案資訊的過程是有IccFileHandler來實現的,根據EF檔案的類型,調用不同的方法loadEFTransparent()和loadEFLinearFixed(),最終都會調用RILJ 的iccIOForApp() 方法;

    protected void fetchSimRecords() {        if (DBG) log("fetchSimRecords " + mRecordsToLoad);        mCi.getIMSIForApp(mParentApp.getAid(), obtainMessage(EVENT_GET_IMSI_DONE));//擷取IMSI資訊,返回的資料在該類handleMessage()中處理        mRecordsToLoad++;  //沒讀取一項資訊,計數值就加1        mFh.loadEFTransparent(EF_ICCID, obtainMessage(EVENT_GET_ICCID_DONE));//擷取ICCID        mRecordsToLoad++;        // Same goes for Call Forward Status indicator: fetch both        // EF[CFIS] and CPHS-EF, with EF[CFIS] preferred.        loadCallForwardingRecords();        getSpnFsm(true, null);        loadEfLiAndEfPl();        if (CRASH_RIL) {            String sms = "0107912160130310f20404d0110041007030208054832b0120"                         + "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"                         + "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"                         + "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"                         + "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"                         + "ffffffffffffffffffffffffffffff";            byte[] ba = IccUtils.hexStringToBytes(sms);            mFh.updateEFLinearFixed(EF_SMS, 1, ba, null,                            obtainMessage(EVENT_MARK_SMS_READ_DONE, 1));        }        if (DBG) log("fetchSimRecords " + mRecordsToLoad + " requested: " + mRecordsRequested);    }

 

kaifyou Android 7.0 UICC 分析(四)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.