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

Commit 9f13e690 authored by Brad Lassey's avatar Brad Lassey
Browse files

Rename api according to API Council guidance.

Bug: b/305248939
Test: Ran CTS tests locally.
Change-Id: I84b5719e620928dce9f0e886169f673b318d410a
parent 003f4e2b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -64,10 +64,8 @@ package android.nfc {
  }

  public final class NfcAdapter {
    method @FlaggedApi("android.nfc.nfc_observe_mode") public boolean allowTransaction();
    method public void disableForegroundDispatch(android.app.Activity);
    method public void disableReaderMode(android.app.Activity);
    method @FlaggedApi("android.nfc.nfc_observe_mode") public boolean disallowTransaction();
    method public void enableForegroundDispatch(android.app.Activity, android.app.PendingIntent, android.content.IntentFilter[], String[][]);
    method public void enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle);
    method public static android.nfc.NfcAdapter getDefaultAdapter(android.content.Context);
@@ -83,6 +81,7 @@ package android.nfc {
    method @FlaggedApi("android.nfc.enable_nfc_charging") public boolean isWlcEnabled();
    method @FlaggedApi("android.nfc.enable_nfc_set_discovery_tech") public void resetDiscoveryTechnology(@NonNull android.app.Activity);
    method @FlaggedApi("android.nfc.enable_nfc_set_discovery_tech") public void setDiscoveryTechnology(@NonNull android.app.Activity, int, int);
    method @FlaggedApi("android.nfc.nfc_observe_mode") public boolean setTransactionAllowed(boolean);
    field public static final String ACTION_ADAPTER_STATE_CHANGED = "android.nfc.action.ADAPTER_STATE_CHANGED";
    field public static final String ACTION_NDEF_DISCOVERED = "android.nfc.action.NDEF_DISCOVERED";
    field @RequiresPermission(android.Manifest.permission.NFC_PREFERRED_PAYMENT_INFO) public static final String ACTION_PREFERRED_PAYMENT_CHANGED = "android.nfc.action.PREFERRED_PAYMENT_CHANGED";
+11 −27
Original line number Diff line number Diff line
@@ -1205,36 +1205,20 @@ public final class NfcAdapter {
    }

    /**
    * Disables observe mode to allow the transaction to proceed. See
    * {@link #isObserveModeSupported()} for a description of observe mode and
    * use {@link #disallowTransaction()} to enable observe mode and block
    * transactions again.
     * Controls whether the NFC adapter will allow transactions to proceed or be in observe mode
     * and simply observe and notify the APDU service of polling loop frames. See
     * {@link #isObserveModeSupported()} for a description of observe mode.
     *
    * @return boolean indicating success or failure.
    */
    @FlaggedApi(Flags.FLAG_NFC_OBSERVE_MODE)
    public boolean allowTransaction() {
        try {
            return sService.setObserveMode(false);
        } catch (RemoteException e) {
            attemptDeadServiceRecovery(e);
            return false;
        }
    }

    /**
    * Signals that the transaction has completed and observe mode may be
    * reenabled. See {@link #isObserveModeSupported()} for a description of
    * observe mode and use {@link #allowTransaction()} to disable observe
    * mode and allow transactions to proceed.
     * @param allowed true disables observe mode to allow the transaction to proceed while false
     *                enables observe mode and does not allow transactions to proceed.
     *
     * @return boolean indicating success or failure.
     */

    @FlaggedApi(Flags.FLAG_NFC_OBSERVE_MODE)
    public boolean disallowTransaction() {
    public boolean setTransactionAllowed(boolean allowed) {
        try {
            return sService.setObserveMode(true);
            return sService.setObserveMode(!allowed);
        } catch (RemoteException e) {
            attemptDeadServiceRecovery(e);
            return false;