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

Commit b94021f6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add Technology Type info for the active secure element list" into main

parents 2b9fc5c1 33a31fb2
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -57,7 +57,7 @@ package android.nfc {
  @FlaggedApi("android.nfc.nfc_oem_extension") public final class NfcOemExtension {
  @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 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") @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 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 @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();
    method @FlaggedApi("android.nfc.nfc_oem_extension") @NonNull public android.nfc.T4tNdefNfcee getT4tNdefNfcee();
+1 −1
Original line number Original line Diff line number Diff line
@@ -115,7 +115,7 @@ interface INfcAdapter
    void clearPreference();
    void clearPreference();
    void setScreenState();
    void setScreenState();
    void checkFirmware();
    void checkFirmware();
    List<String> fetchActiveNfceeList();
    Map fetchActiveNfceeList();
    void triggerInitialization();
    void triggerInitialization();
    boolean getSettingStatus();
    boolean getSettingStatus();
    boolean isTagPresent();
    boolean isTagPresent();
+51 −4
Original line number Original line Diff line number Diff line
@@ -39,6 +39,7 @@ import android.os.Binder;
import android.os.Bundle;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.RemoteException;
import android.os.ResultReceiver;
import android.os.ResultReceiver;
import android.se.omapi.Reader;
import android.util.Log;
import android.util.Log;


import java.lang.annotation.Retention;
import java.lang.annotation.Retention;
@@ -147,6 +148,48 @@ public final class NfcOemExtension {
    @Retention(RetentionPolicy.SOURCE)
    @Retention(RetentionPolicy.SOURCE)
    public @interface ControllerMode{}
    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.
     * Event that Host Card Emulation is activated.
     */
     */
@@ -627,14 +670,18 @@ public final class NfcOemExtension {
    /**
    /**
     * Get the Active NFCEE (NFC Execution Environment) List
     * Get the Active NFCEE (NFC Execution Environment) List
     *
     *
     * @return List of activated secure elements on success
     * @see Reader#getName() for the list of possible NFCEE names.
     *         which can contain "eSE" and "UICC", otherwise empty list.
     *
     * @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
    @NonNull
    @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION)
    @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION)
    public List<String> getActiveNfceeList() {
    public Map<String, Integer> getActiveNfceeList() {
        return NfcAdapter.callServiceReturn(() ->
        return NfcAdapter.callServiceReturn(() ->
            NfcAdapter.sService.fetchActiveNfceeList(), new ArrayList<String>());
            NfcAdapter.sService.fetchActiveNfceeList(), new HashMap<String, Integer>());
    }
    }


    /**
    /**