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

Commit 5d97f563 authored by Chen Xu's avatar Chen Xu
Browse files

make sure mep flag is set properly

when iccCardStatus arrives before iccslotStatus, euicc card object will
be created first with only one port, thus mep supprted flag is not set. when
later we received anther icccardstatus for the second port or received
iccSlotStatus, this mep flag is not updated in euicc port object.

Bug: 224634854
Test: Manual
Change-Id: I86c8cb94b0ddbde008a7ccba4a4471f2d1fcf132
parent 5c69a0f2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ public class UiccCard {
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    private CardState mCardState;
    protected String mCardId;
    private boolean mIsSupportsMultipleEnabledProfiles;
    protected boolean mIsSupportsMultipleEnabledProfiles;

    protected HashMap<Integer, UiccPort> mUiccPorts = new HashMap<>();
    private HashMap<Integer, Integer> mPhoneIdToPortIdx = new HashMap<>();
@@ -215,6 +215,7 @@ public class UiccCard {
        pw.println(" mCardState=" + mCardState);
        pw.println(" mCardId=" + mCardId);
        pw.println(" mNumberOfPorts=" + mUiccPorts.size());
        pw.println( "mIsSupportsMultipleEnabledProfiles=" + mIsSupportsMultipleEnabledProfiles);
        pw.println();
        for (UiccPort uiccPort : mUiccPorts.values()) {
            uiccPort.dump(fd, pw, args);
+19 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.uicc.IccCardStatus;
import com.android.internal.telephony.uicc.UiccCard;
import com.android.internal.telephony.uicc.UiccPort;
import com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback;
import com.android.telephony.Rlog;

@@ -53,6 +54,24 @@ public class EuiccCard extends UiccCard {
        }
    }

    /**
     * Updates MEP(Multiple Enabled Profile) support flag.
     *
     * <p>If IccSlotStatus comes later, the number of ports reported is only known after the
     * UiccCard creation which will impact UICC MEP capability.
     */
    @Override
    public void updateSupportMultipleEnabledProfile(boolean supported) {
        mIsSupportsMultipleEnabledProfiles = supported;
        for (UiccPort port : mUiccPorts.values()) {
            if (port instanceof EuiccPort) {
                ((EuiccPort) port).updateSupportMultipleEnabledProfile(supported);
            } else {
                loge("eUICC card has non-euicc port object:" + port.toString());
            }
        }
    }

    @Override
    public void update(Context c, CommandsInterface ci, IccCardStatus ics, int phoneId) {
        synchronized (mLock) {
+9 −0
Original line number Diff line number Diff line
@@ -164,6 +164,15 @@ public class EuiccPort extends UiccPort {
        }
    }

    /**
     * Updates MEP(Multiple Enabled Profile) support flag.
     * The flag can be updated after the port creation.
     */
    public void updateSupportMultipleEnabledProfile(boolean supported) {
        logd("updateSupportMultipleEnabledProfile");
        mIsSupportsMultipleEnabledProfiles = supported;
    }

    /**
     * Gets a list of user-visible profiles.
     *