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

Commit 8284eac1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add Test method to inject HCE data" into main

parents 6905fe84 af9d1b2a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ interface INfcAdapter

    void notifyPollingLoop(in PollingFrame frame);
    void notifyHceDeactivated();
    void notifyTestHceData(in int technology, in byte[] data);
    int sendVendorNciMessage(int mt, int gid, int oid, in byte[] payload);
    void registerVendorExtensionCallback(in INfcVendorNciCallback callbacks);
    void unregisterVendorExtensionCallback(in INfcVendorNciCallback callbacks);
+27 −0
Original line number Diff line number Diff line
@@ -2856,6 +2856,33 @@ public final class NfcAdapter {
        }
    }

   /**
     * Notifies the system of new HCE data for tests.
     *
     * @hide
     */
    @FlaggedApi(Flags.FLAG_NFC_READ_POLLING_LOOP)
    public void notifyTestHceData(int technology, byte[] data) {
        try {
            if (sService == null) {
                attemptDeadServiceRecovery(null);
            }
            sService.notifyTestHceData(technology, data);
        } catch (RemoteException e) {
            attemptDeadServiceRecovery(e);
            // Try one more time
            if (sService == null) {
                Log.e(TAG, "Failed to recover NFC Service.");
                return;
            }
            try {
                sService.notifyTestHceData(technology, data);
            } catch (RemoteException e2) {
                Log.e(TAG, "Failed to recover NFC Service.");
            }
        }
    }

   /**
     * Notifies the system of a an HCE session being deactivated.
     *     *