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

Commit 82abaf1f authored by Brad Lassey's avatar Brad Lassey
Browse files

Rename setTransactionsAllowed() to setObserveModeEnabled per API

feedback

Bug: b/321265135
Test: tested in CTS
Change-Id: Ieb25ee59f3c793328c0ff87c6f5ea8a1bc5ad9c2
parent f69efbdc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,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);
    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";
+3 −3
Original line number Diff line number Diff line
@@ -1250,16 +1250,16 @@ public final class NfcAdapter {
     * 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;
+1 −1
Original line number Diff line number Diff line
@@ -682,7 +682,7 @@ public final class ApduServiceInfo implements Parcelable {
    /**
     * 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