Rename setTransactionsAllowed() to setObserveModeEnabled per API
feedback

Bug: b/321265135
Test: tested in CTS
Change-Id: Ieb25ee59f3c793328c0ff87c6f5ea8a1bc5ad9c2
diff --git a/nfc/api/current.txt b/nfc/api/current.txt
index e244520..7b53ca6 100644
--- a/nfc/api/current.txt
+++ b/nfc/api/current.txt
@@ -82,7 +82,7 @@
     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);
+    method @FlaggedApi("android.nfc.nfc_observe_mode") public boolean setObserveModeEnabled(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";
diff --git a/nfc/java/android/nfc/NfcAdapter.java b/nfc/java/android/nfc/NfcAdapter.java
index e5752d1..0ebc3f5 100644
--- a/nfc/java/android/nfc/NfcAdapter.java
+++ b/nfc/java/android/nfc/NfcAdapter.java
@@ -1250,16 +1250,16 @@
      * and simply observe and notify the APDU service of polling loop frames. See
      * {@link #isObserveModeSupported()} for a description of observe mode.
      *
-     * @param allowed true disables observe mode to allow the transaction to proceed while false
+     * @param enabled false disables observe mode to allow the transaction to proceed while true
      *                enables observe mode and does not allow transactions to proceed.
      *
      * @return boolean indicating success or failure.
      */
 
     @FlaggedApi(Flags.FLAG_NFC_OBSERVE_MODE)
-    public boolean setTransactionAllowed(boolean allowed) {
+    public boolean setObserveModeEnabled(boolean enabled) {
         try {
-            return sService.setObserveMode(!allowed);
+            return sService.setObserveMode(enabled);
         } catch (RemoteException e) {
             attemptDeadServiceRecovery(e);
             return false;
diff --git a/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java b/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java
index 32dba5f..5242a7d 100644
--- a/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java
+++ b/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java
@@ -682,7 +682,7 @@
     /**
      * Add a Polling Loop Filter. Custom NFC polling frames that match this filter will cause the
      * device to exit observe mode, just as if
-     * {@link android.nfc.NfcAdapter#setTransactionAllowed(boolean)} had been called with true,
+     * {@link android.nfc.NfcAdapter#setObserveModeEnabled(boolean)} had been called with true,
      * allowing transactions to proceed. The matching frame will also be delivered to
      * {@link HostApduService#processPollingFrames(List)}. Adding a key with this or
      * {@link  ApduServiceInfo#addPollingLoopFilter(String)} multiple times will