Add Technology Type info for the active secure element list
Bug: 364120337
Test: atest -c CtsNfcTestCases
Change-Id: I52fcddd1e64a45300a8456427ec716ac8091e1f6
diff --git a/nfc/api/system-current.txt b/nfc/api/system-current.txt
index 72447b1..25d9d35 100644
--- a/nfc/api/system-current.txt
+++ b/nfc/api/system-current.txt
@@ -57,7 +57,7 @@
@FlaggedApi("android.nfc.nfc_oem_extension") public final class NfcOemExtension {
method @FlaggedApi("android.nfc.nfc_oem_extension") @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void clearPreference();
method @FlaggedApi("android.nfc.nfc_oem_extension") @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public int forceRoutingTableCommit();
- method @FlaggedApi("android.nfc.nfc_oem_extension") @NonNull public java.util.List<java.lang.String> getActiveNfceeList();
+ method @FlaggedApi("android.nfc.nfc_oem_extension") @NonNull public java.util.Map<java.lang.String,java.lang.Integer> getActiveNfceeList();
method @FlaggedApi("android.nfc.nfc_oem_extension") @NonNull @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public android.nfc.RoutingStatus getRoutingStatus();
method @FlaggedApi("android.nfc.nfc_oem_extension") @NonNull @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public java.util.List<android.nfc.NfcRoutingTableEntry> getRoutingTable();
method @FlaggedApi("android.nfc.nfc_oem_extension") @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean hasUserEnabledNfc();
diff --git a/nfc/java/android/nfc/INfcAdapter.aidl b/nfc/java/android/nfc/INfcAdapter.aidl
index a08b55f..e9a3c66 100644
--- a/nfc/java/android/nfc/INfcAdapter.aidl
+++ b/nfc/java/android/nfc/INfcAdapter.aidl
@@ -114,7 +114,7 @@
void clearPreference();
void setScreenState();
void checkFirmware();
- List<String> fetchActiveNfceeList();
+ Map fetchActiveNfceeList();
void triggerInitialization();
boolean getSettingStatus();
boolean isTagPresent();
diff --git a/nfc/java/android/nfc/NfcOemExtension.java b/nfc/java/android/nfc/NfcOemExtension.java
index 326ca64..f912cdc 100644
--- a/nfc/java/android/nfc/NfcOemExtension.java
+++ b/nfc/java/android/nfc/NfcOemExtension.java
@@ -39,6 +39,7 @@
import android.os.Bundle;
import android.os.RemoteException;
import android.os.ResultReceiver;
+import android.se.omapi.Reader;
import android.util.Log;
import java.lang.annotation.Retention;
@@ -148,6 +149,48 @@
public @interface ControllerMode{}
/**
+ * Technology Type for {@link #getActiveNfceeList()}.
+ * @hide
+ */
+ @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION)
+ public static final int NFCEE_TECH_NONE = 0;
+
+ /**
+ * Technology Type for {@link #getActiveNfceeList()}.
+ * @hide
+ */
+ @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION)
+ public static final int NFCEE_TECH_A = 1;
+
+ /**
+ * Technology Type for {@link #getActiveNfceeList()}.
+ * @hide
+ */
+ @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION)
+ public static final int NFCEE_TECH_B = 1 << 1;
+
+ /**
+ * Technology Type for {@link #getActiveNfceeList()}.
+ * @hide
+ */
+ @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION)
+ public static final int NFCEE_TECH_F = 1 << 2;
+
+ /**
+ * Nfc technology flags for {@link #getActiveNfceeList()}.
+ *
+ * @hide
+ */
+ @IntDef(flag = true, value = {
+ NFCEE_TECH_NONE,
+ NFCEE_TECH_A,
+ NFCEE_TECH_B,
+ NFCEE_TECH_F,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface NfceeTechnology {}
+
+ /**
* Event that Host Card Emulation is activated.
*/
public static final int HCE_ACTIVATE = 1;
@@ -571,14 +614,18 @@
/**
* Get the Active NFCEE (NFC Execution Environment) List
*
- * @return List of activated secure elements on success
- * which can contain "eSE" and "UICC", otherwise empty list.
+ * @see Reader#getName() for the list of possible NFCEE names.
+ *
+ * @return Map< String, @NfceeTechnology Integer >
+ * A HashMap where keys are activated secure elements and
+ * the values are bitmap of technologies supported by each secure element
+ * on success keys can contain "eSE" and "UICC", otherwise empty map.
*/
@NonNull
@FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION)
- public List<String> getActiveNfceeList() {
+ public Map<String, Integer> getActiveNfceeList() {
return NfcAdapter.callServiceReturn(() ->
- NfcAdapter.sService.fetchActiveNfceeList(), new ArrayList<String>());
+ NfcAdapter.sService.fetchActiveNfceeList(), new HashMap<String, Integer>());
}
/**