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

Commit 0eee33de authored by Wink Saville's avatar Wink Saville Committed by Android (Google) Code Review
Browse files

Merge "Telephony: Remove IccFileHandler from PhoneBase"

parents 0adcd07c 12ef0981
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import com.android.internal.telephony.test.SimulatedRadioControl;
import com.android.internal.telephony.gsm.SIMRecords;

import java.util.Locale;
import java.util.concurrent.atomic.AtomicReference;


/**
@@ -116,7 +117,6 @@ public abstract class PhoneBase extends Handler implements Phone {

    /* Instance Variables */
    public CommandsInterface mCM;
    protected IccFileHandler mIccFileHandler;
    boolean mDnsCheckDisabled;
    public DataConnectionTracker mDataConnectionTracker;
    boolean mDoesRilSendMultipleCallRing;
@@ -125,7 +125,7 @@ public abstract class PhoneBase extends Handler implements Phone {
    public boolean mIsTheCurrentActivePhone = true;
    boolean mIsVoiceCapable = true;
    public IccRecords mIccRecords;
    public IccCard mIccCard;
    protected AtomicReference<IccCard> mIccCard = new AtomicReference<IccCard>();
    public SmsStorageMonitor mSmsStorageMonitor;
    public SmsUsageMonitor mSmsUsageMonitor;
    public SMSDispatcher mSMS;
@@ -268,7 +268,7 @@ public abstract class PhoneBase extends Handler implements Phone {
        mSmsUsageMonitor = null;
        mSMS = null;
        mIccRecords = null;
        mIccCard = null;
        mIccCard.set(null);
        mDataConnectionTracker = null;
    }

@@ -630,7 +630,11 @@ public abstract class PhoneBase extends Handler implements Phone {
    /**
     * Retrieves the IccFileHandler of the Phone instance
     */
    public abstract IccFileHandler getIccFileHandler();
    public IccFileHandler getIccFileHandler(){
        IccCard iccCard = mIccCard.get();
        if (iccCard == null) return null;
        return iccCard.getIccFileHandler();
    }

    /*
     * Retrieves the Handler of the Phone instance
@@ -655,7 +659,7 @@ public abstract class PhoneBase extends Handler implements Phone {

    @Override
    public IccCard getIccCard() {
        return mIccCard;
        return mIccCard.get();
    }

    @Override
+2 −3
Original line number Diff line number Diff line
@@ -85,9 +85,8 @@ public class CDMALTEPhone extends CDMAPhone {

    @Override
    protected void initSstIcc() {
        mIccCard = UiccController.getInstance(this).getIccCard();
        mIccRecords = mIccCard.getIccRecords();
        mIccFileHandler = mIccCard.getIccFileHandler();
        mIccCard.set(UiccController.getInstance(this).getIccCard());
        mIccRecords = mIccCard.get().getIccRecords();
        // CdmaLteServiceStateTracker registers with IccCard to know
        // when the card is ready. So create mIccCard before the ServiceStateTracker
        mSST = new CdmaLteServiceStateTracker(this);
+2 −11
Original line number Diff line number Diff line
@@ -149,9 +149,8 @@ public class CDMAPhone extends PhoneBase {
    }

    protected void initSstIcc() {
        mIccCard = UiccController.getInstance(this).getIccCard();
        mIccRecords = mIccCard.getIccRecords();
        mIccFileHandler = mIccCard.getIccFileHandler();
        mIccCard.set(UiccController.getInstance(this).getIccCard());
        mIccRecords = mIccCard.get().getIccRecords();
        // CdmaServiceStateTracker registers with IccCard to know
        // when the Ruim card is ready. So create mIccCard before the ServiceStateTracker
        mSST = new CdmaServiceStateTracker(this);
@@ -251,7 +250,6 @@ public class CDMAPhone extends PhoneBase {
        mRuimPhoneBookInterfaceManager = null;
        mRuimSmsInterfaceManager = null;
        mSubInfo = null;
        mIccFileHandler = null;
        mCT = null;
        mSST = null;
        mEriManager = null;
@@ -1126,13 +1124,6 @@ public class CDMAPhone extends PhoneBase {
        super.setSystemProperty(property, value);
    }

    /**
     * {@inheritDoc}
     */
    public IccFileHandler getIccFileHandler() {
        return this.mIccFileHandler;
    }

    /**
     * Activate or deactivate cell broadcast SMS.
     *
+1 −1
Original line number Diff line number Diff line
@@ -349,7 +349,7 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
                ss.setOperatorAlphaLong(eriText);
            }

            if (phone.mIccCard.getState() == IccCard.State.READY) {
            if (phone.getIccCard().getState() == IccCard.State.READY) {
                // SIM is found on the device. If ERI roaming is OFF, and SID/NID matches
                // one configfured in SIM, use operator name  from CSIM record.
                boolean showSpn =
+2 −3
Original line number Diff line number Diff line
@@ -209,8 +209,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
        // Unregister for all events.
        cm.unregisterForRadioStateChanged(this);
        cm.unregisterForVoiceNetworkStateChanged(this);
        phone.mIccCard.unregisterForReady(this);

        phone.getIccCard().unregisterForReady(this);
        cm.unregisterForCdmaOtaProvision(this);
        phone.unregisterForEriFileLoaded(this);
        phone.mIccRecords.unregisterForRecordsLoaded(this);
@@ -498,7 +497,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
            // NV is ready when subscription source is NV
            sendMessage(obtainMessage(EVENT_NV_READY));
        } else {
            phone.mIccCard.registerForReady(this, EVENT_RUIM_READY, null);
            phone.getIccCard().registerForReady(this, EVENT_RUIM_READY, null);
        }
    }

Loading