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

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

Merge "[framework] Add more description to routingTable entry." into main

parents 3f89e0ea fbb249ef
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -120,6 +120,11 @@ package android.nfc {

  @FlaggedApi("android.nfc.nfc_oem_extension") public abstract class NfcRoutingTableEntry {
    method public int getNfceeId();
    method public int getType();
    field public static final int TYPE_AID = 0; // 0x0
    field public static final int TYPE_PROTOCOL = 1; // 0x1
    field public static final int TYPE_SYSTEM_CODE = 3; // 0x3
    field public static final int TYPE_TECHNOLOGY = 2; // 0x2
  }

  @FlaggedApi("android.nfc.nfc_oem_extension") public final class OemLogItems implements android.os.Parcelable {
+46 −1
Original line number Diff line number Diff line
@@ -17,8 +17,12 @@ package android.nfc;


import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.SystemApi;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Class to represent an entry of routing table. This class is abstract and extended by
 * {@link RoutingTableTechnologyEntry}, {@link RoutingTableProtocolEntry},
@@ -30,10 +34,42 @@ import android.annotation.SystemApi;
@SystemApi
public abstract class NfcRoutingTableEntry {
    private final int mNfceeId;
    private final int mType;

    /**
     * AID routing table type.
     */
    public static final int TYPE_AID = 0;
    /**
     * Protocol routing table type.
     */
    public static final int TYPE_PROTOCOL = 1;
    /**
     * Technology routing table type.
     */
    public static final int TYPE_TECHNOLOGY = 2;
    /**
     * System Code routing table type.
     */
    public static final int TYPE_SYSTEM_CODE = 3;

    /**
     * Possible type of this routing table entry.
     * @hide
     */
    @IntDef(prefix = "TYPE_", value = {
            TYPE_AID,
            TYPE_PROTOCOL,
            TYPE_TECHNOLOGY,
            TYPE_SYSTEM_CODE
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface RoutingTableType {}

    /** @hide */
    protected NfcRoutingTableEntry(int nfceeId) {
    protected NfcRoutingTableEntry(int nfceeId, @RoutingTableType int type) {
        mNfceeId = nfceeId;
        mType = type;
    }

    /**
@@ -43,4 +79,13 @@ public abstract class NfcRoutingTableEntry {
    public int getNfceeId() {
        return mNfceeId;
    }

    /**
     * Get the type of this entry.
     * @return an integer defined in {@link RoutingTableType}
     */
    @RoutingTableType
    public int getType() {
        return mType;
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import android.annotation.NonNull;
import android.annotation.SystemApi;

/**
 * Represents an AID entry in current routing table.
 * Represents an Application ID (AID) entry in current routing table.
 * @hide
 */
@FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION)
@@ -30,7 +30,7 @@ public class RoutingTableAidEntry extends NfcRoutingTableEntry {

    /** @hide */
    public RoutingTableAidEntry(int nfceeId, String value) {
        super(nfceeId);
        super(nfceeId, TYPE_AID);
        this.mValue = value;
    }

+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ public class RoutingTableProtocolEntry extends NfcRoutingTableEntry {

    /** @hide */
    public RoutingTableProtocolEntry(int nfceeId, @ProtocolValue int value) {
        super(nfceeId);
        super(nfceeId, TYPE_PROTOCOL);
        this.mValue = value;
    }

+4 −2
Original line number Diff line number Diff line
@@ -20,7 +20,9 @@ import android.annotation.NonNull;
import android.annotation.SystemApi;

/**
 * Represents a system code entry in current routing table.
 * Represents a system code entry in current routing table, where system codes are two-byte values
 * used in NFC-F technology (a type of NFC communication) to identify specific
 * device configurations.
 * @hide
 */
@FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION)
@@ -30,7 +32,7 @@ public class RoutingTableSystemCodeEntry extends NfcRoutingTableEntry {

    /** @hide */
    public RoutingTableSystemCodeEntry(int nfceeId, byte[] value) {
        super(nfceeId);
        super(nfceeId, TYPE_SYSTEM_CODE);
        this.mValue = value;
    }

Loading