Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 103fc28e authored by Ying Xu's avatar Ying Xu Committed by android-build-merger
Browse files

Merge "Modify the SIM state "Ready" and "Loaded"" am: da79e5d5 am: 7440ed35

am: bc1ffbed

Change-Id: If84c13d4e9179eb3b35e2df70b273f88b4eeaaeb
parents b13dd1cb bc1ffbed
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1297,6 +1297,7 @@ public class RadioResponse extends IRadioResponse.Stub {
            appStatus.pin1           = appStatus.PinStateFromRILInt(rilAppStatus.pin1);
            appStatus.pin1           = appStatus.PinStateFromRILInt(rilAppStatus.pin1);
            appStatus.pin2           = appStatus.PinStateFromRILInt(rilAppStatus.pin2);
            appStatus.pin2           = appStatus.PinStateFromRILInt(rilAppStatus.pin2);
            iccCardStatus.mApplications[i] = appStatus;
            iccCardStatus.mApplications[i] = appStatus;
            mRil.riljLog("IccCardApplicationStatus " + i + ":" + appStatus.toString());
        }
        }
        return iccCardStatus;
        return iccCardStatus;
    }
    }
+11 −0
Original line number Original line Diff line number Diff line
@@ -47,6 +47,7 @@ public abstract class IccRecords extends Handler implements IccConstants {


    // ***** Instance Variables
    // ***** Instance Variables
    protected AtomicBoolean mDestroyed = new AtomicBoolean(false);
    protected AtomicBoolean mDestroyed = new AtomicBoolean(false);
    protected AtomicBoolean mLoaded = new AtomicBoolean(false);
    protected Context mContext;
    protected Context mContext;
    protected CommandsInterface mCi;
    protected CommandsInterface mCi;
    protected IccFileHandler mFh;
    protected IccFileHandler mFh;
@@ -255,6 +256,7 @@ public abstract class IccRecords extends Handler implements IccConstants {
        if (mAdnCache != null) {
        if (mAdnCache != null) {
            mAdnCache.reset();
            mAdnCache.reset();
        }
        }
        mLoaded.set(false);
    }
    }


    public abstract void onReady();
    public abstract void onReady();
@@ -817,6 +819,15 @@ public abstract class IccRecords extends Handler implements IccConstants {
    public void setVoiceCallForwardingFlag(int line, boolean enable, String number) {
    public void setVoiceCallForwardingFlag(int line, boolean enable, String number) {
    }
    }


    /**
     * Indicates wether the ICC records have been loaded or not
     *
     * @return true if the records have been loaded, false otherwise.
     */
    public boolean isLoaded() {
        return mLoaded.get();
    }

    /**
    /**
     * Indicates wether SIM is in provisioned state or not.
     * Indicates wether SIM is in provisioned state or not.
     * Overridden only if SIM can be dynamically provisioned via OTA.
     * Overridden only if SIM can be dynamically provisioned via OTA.
+2 −0
Original line number Original line Diff line number Diff line
@@ -185,6 +185,7 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords {


        mRecordsRequested = false;
        mRecordsRequested = false;
        mLockedRecordsReqReason = LOCKED_RECORDS_REQ_REASON_NONE;
        mLockedRecordsReqReason = LOCKED_RECORDS_REQ_REASON_NONE;
        mLoaded.set(false);
    }
    }


    private class EfIsimImpiLoaded implements IccRecords.IccRecordLoaded {
    private class EfIsimImpiLoaded implements IccRecords.IccRecordLoaded {
@@ -306,6 +307,7 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords {
    @Override
    @Override
    protected void onAllRecordsLoaded() {
    protected void onAllRecordsLoaded() {
       if (DBG) log("record load complete");
       if (DBG) log("record load complete");
        mLoaded.set(true);
        mRecordsLoadedRegistrants.notifyRegistrants(new AsyncResult(null, null, null));
        mRecordsLoadedRegistrants.notifyRegistrants(new AsyncResult(null, null, null));
    }
    }


+2 −0
Original line number Original line Diff line number Diff line
@@ -157,6 +157,7 @@ public class RuimRecords extends IccRecords {
        // true only when fresh set of read requests are made.
        // true only when fresh set of read requests are made.
        mRecordsRequested = false;
        mRecordsRequested = false;
        mLockedRecordsReqReason = LOCKED_RECORDS_REQ_REASON_NONE;
        mLockedRecordsReqReason = LOCKED_RECORDS_REQ_REASON_NONE;
        mLoaded.set(false);
    }
    }


    public String getMdnNumber() {
    public String getMdnNumber() {
@@ -807,6 +808,7 @@ public class RuimRecords extends IccRecords {
            setSimLanguage(mEFli, mEFpl);
            setSimLanguage(mEFli, mEFpl);
        }
        }


        mLoaded.set(true);
        mRecordsLoadedRegistrants.notifyRegistrants(new AsyncResult(null, null, null));
        mRecordsLoadedRegistrants.notifyRegistrants(new AsyncResult(null, null, null));


        // TODO: The below is hacky since the SubscriptionController may not be ready at this time.
        // TODO: The below is hacky since the SubscriptionController may not be ready at this time.
+2 −1
Original line number Original line Diff line number Diff line
@@ -293,6 +293,7 @@ public class SIMRecords extends IccRecords {
        // true only when fresh set of read requests are made.
        // true only when fresh set of read requests are made.
        mRecordsRequested = false;
        mRecordsRequested = false;
        mLockedRecordsReqReason = LOCKED_RECORDS_REQ_REASON_NONE;
        mLockedRecordsReqReason = LOCKED_RECORDS_REQ_REASON_NONE;
        mLoaded.set(false);
    }
    }


    //***** Public Methods
    //***** Public Methods
@@ -1600,7 +1601,7 @@ public class SIMRecords extends IccRecords {
        }
        }


        setVoiceMailByCountry(operator);
        setVoiceMailByCountry(operator);

        mLoaded.set(true);
        mRecordsLoadedRegistrants.notifyRegistrants(new AsyncResult(null, null, null));
        mRecordsLoadedRegistrants.notifyRegistrants(new AsyncResult(null, null, null));
    }
    }


Loading