diff options
-rw-r--r-- | nfc/api/system-current.txt | 2 | ||||
-rw-r--r-- | nfc/java/android/nfc/INfcAdapter.aidl | 2 | ||||
-rw-r--r-- | nfc/java/android/nfc/NfcOemExtension.java | 55 |
3 files changed, 53 insertions, 6 deletions
diff --git a/nfc/api/system-current.txt b/nfc/api/system-current.txt index 1019a10547e0..031ed73e18ea 100644 --- a/nfc/api/system-current.txt +++ b/nfc/api/system-current.txt @@ -57,7 +57,7 @@ package android.nfc { @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") @NonNull public android.nfc.T4tNdefNfcee getT4tNdefNfcee(); diff --git a/nfc/java/android/nfc/INfcAdapter.aidl b/nfc/java/android/nfc/INfcAdapter.aidl index 13e6734d6e48..5ae1be201088 100644 --- a/nfc/java/android/nfc/INfcAdapter.aidl +++ b/nfc/java/android/nfc/INfcAdapter.aidl @@ -115,7 +115,7 @@ interface INfcAdapter 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 ac7b8bb6af7e..f1198ed92cff 100644 --- a/nfc/java/android/nfc/NfcOemExtension.java +++ b/nfc/java/android/nfc/NfcOemExtension.java @@ -39,6 +39,7 @@ import android.os.Binder; 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 final class NfcOemExtension { 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; @@ -627,14 +670,18 @@ public final class NfcOemExtension { /** * 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>()); } /** |