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

Commit ead78c5c authored by Roshan Pius's avatar Roshan Pius
Browse files

nfc(api): Address API council feedback

Add @IntDef to return values of getAdapterState.

Bug: 315228674
Test: Compiles
Change-Id: I8134a68c36950e89cd65c2b4ab9dd9cefb2cb7b4
parent 0b50679b
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -283,6 +283,20 @@ public final class NfcAdapter {
    public static final int STATE_ON = 3;
    public static final int STATE_TURNING_OFF = 4;

    /**
     * Possible states from {@link #getAdapterState}.
     *
     * @hide
     */
    @IntDef(prefix = { "STATE_" }, value = {
            STATE_OFF,
            STATE_TURNING_ON,
            STATE_ON,
            STATE_TURNING_OFF
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface AdapterState{}

    /**
     * Flag for use with {@link #enableReaderMode(Activity, ReaderCallback, int, Bundle)}.
     * <p>
@@ -948,7 +962,7 @@ public final class NfcAdapter {
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_ENABLE_NFC_MAINLINE)
    public int getAdapterState() {
    public @AdapterState int getAdapterState() {
        try {
            return sService.getState();
        } catch (RemoteException e) {