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

Commit e6dfa7bd authored by Roshan's avatar Roshan
Browse files

nfc: Remove usage of "eSIM" from offhost names

Partial revert of aosp/3253198

Bug: 321314635
Test: TH
Change-Id: Id2cd39c977d40b1367854e137c364891676db729
parent e4df6da4
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -258,7 +258,7 @@ public final class NfcAdapter {
    /**
     * Mandatory String extra field in {@link #ACTION_TRANSACTION_DETECTED}
     * Indicates the Secure Element on which the transaction occurred.
     * eSE1...eSEn for Embedded Secure Elements, SIM1...SIMn for UICC, etc.
     * eSE1...eSEn for Embedded Secure Elements, SIM1...SIMn for UICC/EUICC, etc.
     */
    public static final String EXTRA_SECURE_ELEMENT_NAME = "android.nfc.extra.SECURE_ELEMENT_NAME";

@@ -733,7 +733,7 @@ public final class NfcAdapter {
     *
     * @return List<String> containing secure elements on the device which supports
     *                      off host card emulation. eSE for Embedded secure element,
     *                      SIM for UICC, eSIM for EUICC and so on.
     *                      SIM for UICC/EUICC and so on.
     * @hide
     */
    public @NonNull List<String> getSupportedOffHostSecureElements() {
@@ -753,11 +753,6 @@ public final class NfcAdapter {
        if (pm.hasSystemFeature(PackageManager.FEATURE_NFC_OFF_HOST_CARD_EMULATION_ESE)) {
            offHostSE.add("eSE");
        }
        if (Flags.enableCardEmulationEuicc()
                && callServiceReturn(
                        () -> sCardEmulationService.isEuiccSupported(), false)) {
            offHostSE.add("eSIM");
        }
        return offHostSE;
    }

+0 −2
Original line number Diff line number Diff line
@@ -308,8 +308,6 @@ public final class ApduServiceInfo implements Parcelable {
                        mOffHostName = "eSE1";
                    } else if (mOffHostName.equals("SIM")) {
                        mOffHostName = "SIM1";
                    } else if (Flags.enableCardEmulationEuicc() && mOffHostName.equals("eSIM")) {
                        mOffHostName = "eSIM1";
                    }
                }
                mStaticOffHostName = mOffHostName;
+2 −6
Original line number Diff line number Diff line
@@ -548,13 +548,11 @@ public final class CardEmulation {

        List<String> validSE = adapter.getSupportedOffHostSecureElements();
        if ((offHostSecureElement.startsWith("eSE") && !validSE.contains("eSE"))
                || (offHostSecureElement.startsWith("SIM") && !validSE.contains("SIM"))
                || (offHostSecureElement.startsWith("eSIM") && !validSE.contains("eSIM"))) {
                || (offHostSecureElement.startsWith("SIM") && !validSE.contains("SIM"))) {
            return false;
        }

        if (!offHostSecureElement.startsWith("eSE") && !offHostSecureElement.startsWith("SIM")
                && !(Flags.enableCardEmulationEuicc() && offHostSecureElement.startsWith("eSIM"))) {
        if (!offHostSecureElement.startsWith("eSE") && !offHostSecureElement.startsWith("SIM")) {
            return false;
        }

@@ -562,8 +560,6 @@ public final class CardEmulation {
            offHostSecureElement = "eSE1";
        } else if (offHostSecureElement.equals("SIM")) {
            offHostSecureElement = "SIM1";
        } else if (Flags.enableCardEmulationEuicc() && offHostSecureElement.equals("eSIM")) {
            offHostSecureElement = "eSIM1";
        }
        final String offHostSecureElementV = new String(offHostSecureElement);
        return callServiceReturn(() ->