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

Commit 64bfd985 authored by Alex Yakavenka's avatar Alex Yakavenka
Browse files

Telephony: Delay SIM IO until SIM_READY

When SIM_REFRESH with SIM_INIT is received we need to
reread EFs but only if and when app is ready.

Bug: 8445450
Change-Id: I066a1e6547cfdcba91230f5fbfa8050864327c5d
parent 0f7c9029
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.os.Registrant;
import android.os.RegistrantList;

import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState;

import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -91,6 +92,7 @@ public abstract class IccRecords extends Handler implements IccConstants {
    public static final int EVENT_SPN = 2; // Service Provider Name

    public static final int EVENT_GET_ICC_RECORD_DONE = 100;
    protected static final int EVENT_APP_READY = 1;

    /**
     * Generic ICC record loaded callback. Subclasses can call EF load methods on
@@ -330,6 +332,17 @@ public abstract class IccRecords extends Handler implements IccConstants {
     */
    public abstract void onRefresh(boolean fileChanged, int[] fileList);

    /**
     * Called by subclasses (SimRecords and RuimRecords) whenever
     * IccRefreshResponse.REFRESH_RESULT_INIT event received
     */
    protected void onIccRefreshInit() {
        adnCache.reset();
        if (mParentApp.getState() == AppState.APPSTATE_READY) {
            // This will cause files to be reread
            sendMessage(obtainMessage(EVENT_APP_READY));
        }
    }

    public boolean getRecordsLoaded() {
        if (recordsToLoad == 0 && recordsRequested == true) {
+1 −2
Original line number Diff line number Diff line
@@ -75,7 +75,6 @@ public final class RuimRecords extends IccRecords {
    private String mHomeNetworkId;

    // ***** Event Constants
    private static final int EVENT_APP_READY = 1;
    private static final int EVENT_GET_IMSI_DONE = 3;
    private static final int EVENT_GET_DEVICE_IDENTITY_DONE = 4;
    private static final int EVENT_GET_ICCID_DONE = 5;
@@ -752,7 +751,7 @@ public final class RuimRecords extends IccRecords {
            case IccRefreshResponse.REFRESH_RESULT_INIT:
                if (DBG) log("handleRuimRefresh with SIM_REFRESH_INIT");
                // need to reload all files (that we care about)
                fetchRuimRecords();
                onIccRefreshInit();
                break;
            case IccRefreshResponse.REFRESH_RESULT_RESET:
                if (DBG) log("handleRuimRefresh with SIM_REFRESH_RESET");
+1 −4
Original line number Diff line number Diff line
@@ -119,8 +119,6 @@ public class SIMRecords extends IccRecords {
    private static final int CPHS_SST_MBN_ENABLED = 0x30;

    // ***** Event Constants

    private static final int EVENT_APP_READY = 1;
    private static final int EVENT_GET_IMSI_DONE = 3;
    private static final int EVENT_GET_ICCID_DONE = 4;
    private static final int EVENT_GET_MBI_DONE = 5;
@@ -1190,8 +1188,7 @@ public class SIMRecords extends IccRecords {
            case IccRefreshResponse.REFRESH_RESULT_INIT:
                if (DBG) log("handleSimRefresh with SIM_REFRESH_INIT");
                // need to reload all files (that we care about)
                adnCache.reset();
                fetchSimRecords();
                onIccRefreshInit();
                break;
            case IccRefreshResponse.REFRESH_RESULT_RESET:
                if (DBG) log("handleSimRefresh with SIM_REFRESH_RESET");