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

Commit aa80ee2f authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7792703 from b7984d73 to sc-qpr1-release

Change-Id: Ic094e95243f5c4370a12d51fde355377adc111d5
parents 6bb2a983 b7984d73
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2205,6 +2205,15 @@ public interface CommandsInterface {
    public void setUiccSubscription(int slotId, int appIndex, int subId, int subStatus,
            Message result);

    /**
     * Whether the device modem supports reporting the EID in either the slot or card status or
     * through ATR.
     * @return true if the modem supports EID.
     */
    default boolean supportsEid() {
        return false;
    }

    /**
     * Tells the modem if data is allowed or not.
     *
+13 −0
Original line number Diff line number Diff line
@@ -4705,6 +4705,19 @@ public class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    /**
     * Whether the device modem supports reporting the EID in either the slot or card status or
     * through ATR.
     * @return true if the modem supports EID.
     */
    @Override
    public boolean supportsEid() {
        // EID should be supported as long as HAL >= 1.2.
        //  - in HAL 1.2 we have EID through ATR
        //  - in later HAL versions we also have EID through slot / card status.
        return mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_2);
    }

    @Override
    public void setDataAllowed(boolean allowed, Message result) {
        IRadio radioProxy = getRadioProxy(result);
+1 −10
Original line number Diff line number Diff line
@@ -712,7 +712,7 @@ public class UiccController extends Handler {
            slotId = index;
        }

        if (eidIsNotSupported(status)) {
        if (!mCis[0].supportsEid()) {
            // we will never get EID from the HAL, so set mDefaultEuiccCardId to UNSUPPORTED_CARD_ID
            if (DBG) log("eid is not supported");
            mDefaultEuiccCardId = UNSUPPORTED_CARD_ID;
@@ -774,15 +774,6 @@ public class UiccController extends Handler {
        mIccChangedRegistrants.notifyRegistrants(new AsyncResult(null, index, null));
    }

    /**
     * Returns true if EID is not supproted.
     */
    private boolean eidIsNotSupported(IccCardStatus status) {
        // if card status does not contain slot ID, we know we are on HAL < 1.2, so EID will never
        // be available
        return status.physicalSlotIndex == INVALID_SLOT_ID;
    }

    /**
     * Add a cardString to mCardStrings. If this is an ICCID, trailing Fs will be automatically
     * stripped.
+12 −2
Original line number Diff line number Diff line
@@ -69,12 +69,12 @@ import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo;
import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;
import com.android.internal.telephony.gsm.SuppServiceNotification;
import com.android.internal.telephony.uicc.AdnCapacity;
import com.android.internal.telephony.uicc.ReceivedPhonebookRecords;
import com.android.internal.telephony.uicc.SimPhonebookRecord;
import com.android.internal.telephony.uicc.IccCardApplicationStatus.PersoSubState;
import com.android.internal.telephony.uicc.IccCardStatus;
import com.android.internal.telephony.uicc.IccIoResult;
import com.android.internal.telephony.uicc.IccSlotStatus;
import com.android.internal.telephony.uicc.ReceivedPhonebookRecords;
import com.android.internal.telephony.uicc.SimPhonebookRecord;
import com.android.telephony.Rlog;

import java.util.ArrayList;
@@ -85,6 +85,7 @@ import java.util.concurrent.atomic.AtomicInteger;
public class SimulatedCommands extends BaseCommands
        implements CommandsInterface, SimulatedRadioControl {
    private static final String LOG_TAG = "SimulatedCommands";
    private boolean mSupportsEid = true;

    private enum SimLockState {
        NONE,
@@ -2467,6 +2468,15 @@ public class SimulatedCommands extends BaseCommands
                new ReceivedPhonebookRecords(4, phonebookRecordInfoGroup), null));
    }

    public void setSupportsEid(boolean supportsEid) {
        mSupportsEid = supportsEid;
    }

    @Override
    public boolean supportsEid() {
        return mSupportsEid;
    }

    @Override
    public void getSimPhonebookCapacity(Message result) {
        resultSuccess(result, new AdnCapacity(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+5 −0
Original line number Diff line number Diff line
@@ -448,6 +448,9 @@ public class UiccControllerTest extends TelephonyTest {
        ics.atr = "abcdef0123456789abcdef";
        ics.iccid = "123451234567890";
        // make it seem like EID is not supported by setting physical slot = -1 like on HAL < 1.2

        mSimulatedCommands.setSupportsEid(false);

        ics.physicalSlotIndex = UiccController.INVALID_SLOT_ID;
        AsyncResult ar = new AsyncResult(null, ics, null);
        Message msg = Message.obtain(mUiccControllerUT, EVENT_GET_ICC_STATUS_DONE, ar);
@@ -456,6 +459,8 @@ public class UiccControllerTest extends TelephonyTest {
        // assert that the default eUICC card Id is UNSUPPORTED_CARD_ID
        assertEquals(TelephonyManager.UNSUPPORTED_CARD_ID,
                mUiccControllerUT.getCardIdForDefaultEuicc());

        mSimulatedCommands.setSupportsEid(true);
    }

    /**