Loading src/java/com/android/internal/telephony/uicc/euicc/EuiccPort.java +6 −24 Original line number Diff line number Diff line Loading @@ -101,9 +101,6 @@ public class EuiccPort extends UiccPort { private static final String DEV_CAP_NR5GC = "nr5gc"; private static final String DEV_CAP_EUTRAN5GC = "eutran5gc"; private static final String ATR_ESIM_OS_V_M5 = "3B9F97C00AB1FE453FC6838031E073FE211F65D002341569810F21"; // These interfaces are used for simplifying the code by leveraging lambdas. private interface ApduRequestBuilder { void build(RequestBuilder requestBuilder) Loading @@ -128,7 +125,6 @@ public class EuiccPort extends UiccPort { private volatile String mEid; @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE) public boolean mIsSupportsMultipleEnabledProfiles; private String mAtr; public EuiccPort(Context c, CommandsInterface ci, IccCardStatus ics, int phoneId, Object lock, UiccCard card, boolean isSupportsMultipleEnabledProfiles) { Loading @@ -141,7 +137,6 @@ public class EuiccPort extends UiccPort { mEid = ics.eid; mCardId = ics.eid; } mAtr = ics.atr; mIsSupportsMultipleEnabledProfiles = isSupportsMultipleEnabledProfiles; } Loading @@ -165,7 +160,6 @@ public class EuiccPort extends UiccPort { if (!TextUtils.isEmpty(ics.eid)) { mEid = ics.eid; } mAtr = ics.atr; super.update(c, ci, ics, uiccCard); } } Loading @@ -187,13 +181,8 @@ public class EuiccPort extends UiccPort { * @since 1.1.0 [GSMA SGP.22] */ public void getAllProfiles(AsyncResultCallback<EuiccProfileInfo[]> callback, Handler handler) { byte[] profileTags; if (mIsSupportsMultipleEnabledProfiles) { profileTags = ATR_ESIM_OS_V_M5.equals(mAtr) ? Tags.EUICC_PROFILE_MEP_TAGS : Tags.EUICC_PROFILE_MEP_TAGS_WITH_9F20; } else { profileTags = Tags.EUICC_PROFILE_TAGS; } byte[] profileTags = mIsSupportsMultipleEnabledProfiles ? Tags.EUICC_PROFILE_MEP_TAGS : Tags.EUICC_PROFILE_TAGS; sendApdu( newRequestProvider((RequestBuilder requestBuilder) -> requestBuilder.addStoreData(Asn1Node.newBuilder(Tags.TAG_GET_PROFILES) Loading Loading @@ -234,13 +223,8 @@ public class EuiccPort extends UiccPort { */ public final void getProfile(String iccid, AsyncResultCallback<EuiccProfileInfo> callback, Handler handler) { byte[] profileTags; if (mIsSupportsMultipleEnabledProfiles) { profileTags = ATR_ESIM_OS_V_M5.equals(mAtr) ? Tags.EUICC_PROFILE_MEP_TAGS : Tags.EUICC_PROFILE_MEP_TAGS_WITH_9F20; } else { profileTags = Tags.EUICC_PROFILE_TAGS; } byte[] profileTags = mIsSupportsMultipleEnabledProfiles ? Tags.EUICC_PROFILE_MEP_TAGS : Tags.EUICC_PROFILE_TAGS; sendApdu( newRequestProvider((RequestBuilder requestBuilder) -> requestBuilder.addStoreData(Asn1Node.newBuilder(Tags.TAG_GET_PROFILES) Loading Loading @@ -1260,10 +1244,8 @@ public class EuiccPort extends UiccPort { // if the Profile is in the Enabled state on the same eSIM Port as where this // getProfilesInfo command was sent. So should check for enabledOnEsimPort(TAG_PORT) // tag and verify its value is a valid port (means port value is >=0) or not. if ((profileNode.hasChild(Tags.TAG_PORT) && profileNode.getChild(Tags.TAG_PORT).asInteger() >= 0) || (profileNode.hasChild(Tags.TAG_PORT_9F20) && profileNode.getChild(Tags.TAG_PORT_9F20).asInteger() >= 0)) { if (profileNode.hasChild(Tags.TAG_PORT) && profileNode.getChild(Tags.TAG_PORT).asInteger() >= 0) { profileBuilder.setState(EuiccProfileInfo.PROFILE_STATE_ENABLED); } else { // noinspection WrongConstant Loading src/java/com/android/internal/telephony/uicc/euicc/Tags.java +0 −20 Original line number Diff line number Diff line Loading @@ -84,10 +84,7 @@ class Tags { static final int TAG_PROFILE_NAME = 0x92; static final int TAG_OPERATOR_ID = 0xB7; static final int TAG_CARRIER_PRIVILEGE_RULES = 0xBF76; // TODO: PORT TAG(9F20 OR 9F24) will be used based on ATR Strings because not all MEP capable // devices have M5 OS. Once modem team is ready, revert back to 9F24 TAG only. static final int TAG_PORT = 0x9F24; static final int TAG_PORT_9F20 = 0x9F20; // Tags from the RefArDo data standard - https://source.android.com/devices/tech/config/uicc static final int TAG_REF_AR_DO = 0xE2; Loading Loading @@ -129,22 +126,5 @@ class Tags { (byte) (TAG_PORT % 256), }; // TAG list for Euicc Profile with 9F20 tag. // TODO: This is temporary change, should be removed once all devices are upgraded to M5 OS. static final byte[] EUICC_PROFILE_MEP_TAGS_WITH_9F20 = new byte[] { TAG_ICCID, (byte) TAG_NICKNAME, (byte) TAG_SERVICE_PROVIDER_NAME, (byte) TAG_PROFILE_NAME, (byte) TAG_OPERATOR_ID, (byte) (TAG_PROFILE_STATE / 256), (byte) (TAG_PROFILE_STATE % 256), (byte) TAG_PROFILE_CLASS, (byte) TAG_PROFILE_POLICY_RULE, (byte) (TAG_CARRIER_PRIVILEGE_RULES / 256), (byte) (TAG_CARRIER_PRIVILEGE_RULES % 256), (byte) (TAG_PORT_9F20 / 256), (byte) (TAG_PORT_9F20 % 256), }; private Tags() {} } tests/telephonytests/src/com/android/internal/telephony/uicc/euicc/EuiccPortTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ public class EuiccPortTest extends TelephonyTest { assertEquals(1, profiles.length); assertEquals("98760000000000543210", profiles[0].getIccid()); assertEquals(EuiccProfileInfo.PROFILE_STATE_ENABLED, profiles[0].getState()); verifyStoreData(channel, "BF2D0F5C0D5A909192B79F709599BF769F20"); verifyStoreData(channel, "BF2D0F5C0D5A909192B79F709599BF769F24"); } @Test Loading @@ -203,7 +203,7 @@ public class EuiccPortTest extends TelephonyTest { @Test public void testEnabledOnEsimPort_GetAllProfiles() { int channel = mockLogicalChannelResponses( "BF2D18A016E3145A0A896700000000004523019F7001009F2001019000"); "BF2D18A016E3145A0A896700000000004523019F7001009F2401019000"); ResultCaptor<EuiccProfileInfo[]> resultCaptor = new ResultCaptor<>(); mEuiccPort.mIsSupportsMultipleEnabledProfiles = true; // MEP capable Loading @@ -218,7 +218,7 @@ public class EuiccPortTest extends TelephonyTest { // which is valid port. So the state should be enabled. // (As per MEP state and enabledOnEsimPort concept) assertEquals(EuiccProfileInfo.PROFILE_STATE_ENABLED, profiles[0].getState()); verifyStoreData(channel, "BF2D0F5C0D5A909192B79F709599BF769F20"); verifyStoreData(channel, "BF2D0F5C0D5A909192B79F709599BF769F24"); } @Test Loading @@ -235,7 +235,7 @@ public class EuiccPortTest extends TelephonyTest { EuiccProfileInfo[] profiles = resultCaptor.result; assertEquals(1, profiles.length); assertEquals(EuiccProfileInfo.PROFILE_STATE_DISABLED, profiles[0].getState()); verifyStoreData(channel, "BF2D0F5C0D5A909192B79F709599BF769F20"); verifyStoreData(channel, "BF2D0F5C0D5A909192B79F709599BF769F24"); } @Test Loading Loading
src/java/com/android/internal/telephony/uicc/euicc/EuiccPort.java +6 −24 Original line number Diff line number Diff line Loading @@ -101,9 +101,6 @@ public class EuiccPort extends UiccPort { private static final String DEV_CAP_NR5GC = "nr5gc"; private static final String DEV_CAP_EUTRAN5GC = "eutran5gc"; private static final String ATR_ESIM_OS_V_M5 = "3B9F97C00AB1FE453FC6838031E073FE211F65D002341569810F21"; // These interfaces are used for simplifying the code by leveraging lambdas. private interface ApduRequestBuilder { void build(RequestBuilder requestBuilder) Loading @@ -128,7 +125,6 @@ public class EuiccPort extends UiccPort { private volatile String mEid; @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE) public boolean mIsSupportsMultipleEnabledProfiles; private String mAtr; public EuiccPort(Context c, CommandsInterface ci, IccCardStatus ics, int phoneId, Object lock, UiccCard card, boolean isSupportsMultipleEnabledProfiles) { Loading @@ -141,7 +137,6 @@ public class EuiccPort extends UiccPort { mEid = ics.eid; mCardId = ics.eid; } mAtr = ics.atr; mIsSupportsMultipleEnabledProfiles = isSupportsMultipleEnabledProfiles; } Loading @@ -165,7 +160,6 @@ public class EuiccPort extends UiccPort { if (!TextUtils.isEmpty(ics.eid)) { mEid = ics.eid; } mAtr = ics.atr; super.update(c, ci, ics, uiccCard); } } Loading @@ -187,13 +181,8 @@ public class EuiccPort extends UiccPort { * @since 1.1.0 [GSMA SGP.22] */ public void getAllProfiles(AsyncResultCallback<EuiccProfileInfo[]> callback, Handler handler) { byte[] profileTags; if (mIsSupportsMultipleEnabledProfiles) { profileTags = ATR_ESIM_OS_V_M5.equals(mAtr) ? Tags.EUICC_PROFILE_MEP_TAGS : Tags.EUICC_PROFILE_MEP_TAGS_WITH_9F20; } else { profileTags = Tags.EUICC_PROFILE_TAGS; } byte[] profileTags = mIsSupportsMultipleEnabledProfiles ? Tags.EUICC_PROFILE_MEP_TAGS : Tags.EUICC_PROFILE_TAGS; sendApdu( newRequestProvider((RequestBuilder requestBuilder) -> requestBuilder.addStoreData(Asn1Node.newBuilder(Tags.TAG_GET_PROFILES) Loading Loading @@ -234,13 +223,8 @@ public class EuiccPort extends UiccPort { */ public final void getProfile(String iccid, AsyncResultCallback<EuiccProfileInfo> callback, Handler handler) { byte[] profileTags; if (mIsSupportsMultipleEnabledProfiles) { profileTags = ATR_ESIM_OS_V_M5.equals(mAtr) ? Tags.EUICC_PROFILE_MEP_TAGS : Tags.EUICC_PROFILE_MEP_TAGS_WITH_9F20; } else { profileTags = Tags.EUICC_PROFILE_TAGS; } byte[] profileTags = mIsSupportsMultipleEnabledProfiles ? Tags.EUICC_PROFILE_MEP_TAGS : Tags.EUICC_PROFILE_TAGS; sendApdu( newRequestProvider((RequestBuilder requestBuilder) -> requestBuilder.addStoreData(Asn1Node.newBuilder(Tags.TAG_GET_PROFILES) Loading Loading @@ -1260,10 +1244,8 @@ public class EuiccPort extends UiccPort { // if the Profile is in the Enabled state on the same eSIM Port as where this // getProfilesInfo command was sent. So should check for enabledOnEsimPort(TAG_PORT) // tag and verify its value is a valid port (means port value is >=0) or not. if ((profileNode.hasChild(Tags.TAG_PORT) && profileNode.getChild(Tags.TAG_PORT).asInteger() >= 0) || (profileNode.hasChild(Tags.TAG_PORT_9F20) && profileNode.getChild(Tags.TAG_PORT_9F20).asInteger() >= 0)) { if (profileNode.hasChild(Tags.TAG_PORT) && profileNode.getChild(Tags.TAG_PORT).asInteger() >= 0) { profileBuilder.setState(EuiccProfileInfo.PROFILE_STATE_ENABLED); } else { // noinspection WrongConstant Loading
src/java/com/android/internal/telephony/uicc/euicc/Tags.java +0 −20 Original line number Diff line number Diff line Loading @@ -84,10 +84,7 @@ class Tags { static final int TAG_PROFILE_NAME = 0x92; static final int TAG_OPERATOR_ID = 0xB7; static final int TAG_CARRIER_PRIVILEGE_RULES = 0xBF76; // TODO: PORT TAG(9F20 OR 9F24) will be used based on ATR Strings because not all MEP capable // devices have M5 OS. Once modem team is ready, revert back to 9F24 TAG only. static final int TAG_PORT = 0x9F24; static final int TAG_PORT_9F20 = 0x9F20; // Tags from the RefArDo data standard - https://source.android.com/devices/tech/config/uicc static final int TAG_REF_AR_DO = 0xE2; Loading Loading @@ -129,22 +126,5 @@ class Tags { (byte) (TAG_PORT % 256), }; // TAG list for Euicc Profile with 9F20 tag. // TODO: This is temporary change, should be removed once all devices are upgraded to M5 OS. static final byte[] EUICC_PROFILE_MEP_TAGS_WITH_9F20 = new byte[] { TAG_ICCID, (byte) TAG_NICKNAME, (byte) TAG_SERVICE_PROVIDER_NAME, (byte) TAG_PROFILE_NAME, (byte) TAG_OPERATOR_ID, (byte) (TAG_PROFILE_STATE / 256), (byte) (TAG_PROFILE_STATE % 256), (byte) TAG_PROFILE_CLASS, (byte) TAG_PROFILE_POLICY_RULE, (byte) (TAG_CARRIER_PRIVILEGE_RULES / 256), (byte) (TAG_CARRIER_PRIVILEGE_RULES % 256), (byte) (TAG_PORT_9F20 / 256), (byte) (TAG_PORT_9F20 % 256), }; private Tags() {} }
tests/telephonytests/src/com/android/internal/telephony/uicc/euicc/EuiccPortTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ public class EuiccPortTest extends TelephonyTest { assertEquals(1, profiles.length); assertEquals("98760000000000543210", profiles[0].getIccid()); assertEquals(EuiccProfileInfo.PROFILE_STATE_ENABLED, profiles[0].getState()); verifyStoreData(channel, "BF2D0F5C0D5A909192B79F709599BF769F20"); verifyStoreData(channel, "BF2D0F5C0D5A909192B79F709599BF769F24"); } @Test Loading @@ -203,7 +203,7 @@ public class EuiccPortTest extends TelephonyTest { @Test public void testEnabledOnEsimPort_GetAllProfiles() { int channel = mockLogicalChannelResponses( "BF2D18A016E3145A0A896700000000004523019F7001009F2001019000"); "BF2D18A016E3145A0A896700000000004523019F7001009F2401019000"); ResultCaptor<EuiccProfileInfo[]> resultCaptor = new ResultCaptor<>(); mEuiccPort.mIsSupportsMultipleEnabledProfiles = true; // MEP capable Loading @@ -218,7 +218,7 @@ public class EuiccPortTest extends TelephonyTest { // which is valid port. So the state should be enabled. // (As per MEP state and enabledOnEsimPort concept) assertEquals(EuiccProfileInfo.PROFILE_STATE_ENABLED, profiles[0].getState()); verifyStoreData(channel, "BF2D0F5C0D5A909192B79F709599BF769F20"); verifyStoreData(channel, "BF2D0F5C0D5A909192B79F709599BF769F24"); } @Test Loading @@ -235,7 +235,7 @@ public class EuiccPortTest extends TelephonyTest { EuiccProfileInfo[] profiles = resultCaptor.result; assertEquals(1, profiles.length); assertEquals(EuiccProfileInfo.PROFILE_STATE_DISABLED, profiles[0].getState()); verifyStoreData(channel, "BF2D0F5C0D5A909192B79F709599BF769F20"); verifyStoreData(channel, "BF2D0F5C0D5A909192B79F709599BF769F24"); } @Test Loading