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

Commit 184357ae authored by Qingxi Li's avatar Qingxi Li
Browse files

Add interface to get phoneID from UiccSlot

Bug: 72753162
Test: bit FrameworksTelephonyTests:*
Change-Id: Ie236c47f290fcd4dff15eae1bb274e4cbd285f56
parent 0be6d774
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ public class UiccSlot extends Handler {

    public static final String EXTRA_ICC_CARD_ADDED =
            "com.android.internal.telephony.uicc.ICC_CARD_ADDED";
    public static final int INVALID_PHONE_ID = -1;

    private final Object mLock = new Object();
    private boolean mActive;
@@ -59,8 +60,8 @@ public class UiccSlot extends Handler {
    private RadioState mLastRadioState = RadioState.RADIO_UNAVAILABLE;
    private boolean mIsEuicc;
    private String mIccId;
    private Integer mPhoneId = null;
    private AnswerToReset mAtr;
    private int mPhoneId = INVALID_PHONE_ID;

    private static final int EVENT_CARD_REMOVED = 13;
    private static final int EVENT_CARD_ADDED = 14;
@@ -143,7 +144,7 @@ public class UiccSlot extends Handler {
                if (mActive) {
                    mActive = false;
                    mLastRadioState = RadioState.RADIO_UNAVAILABLE;
                    mPhoneId = null;
                    mPhoneId = INVALID_PHONE_ID;
                    if (mUiccCard != null) mUiccCard.dispose();
                    mUiccCard = null;
                }
@@ -186,6 +187,10 @@ public class UiccSlot extends Handler {
        return mActive;
    }

    public int getPhoneId() {
        return mPhoneId;
    }

    public String getIccId() {
        if (mIccId != null) {
            return mIccId;
@@ -317,7 +322,7 @@ public class UiccSlot extends Handler {
        }
        mUiccCard = null;

        if (mPhoneId != null) {
        if (mPhoneId != INVALID_PHONE_ID) {
            UiccProfile.broadcastInternalIccStateChangedIntent(
                    IccCardConstants.INTENT_VALUE_ICC_UNKNOWN, null, mPhoneId);
        }