summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Brad Lassey <lassey@google.com> 2024-01-02 09:29:07 -0500
committer Brad Lassey <lassey@google.com> 2024-01-17 22:12:01 -0500
commit3ea82ea3eed76f3ba4e6bebe3b903e9829add41f (patch)
treea2277769e5e3c49ca3b33b6aef50e24c9d81cef6
parentfdbabfc434f18e9ae4218668abddad6ece3ce4a0 (diff)
Test for delivery of polling loop fingerprints to the default payment provider and foreground service.
Test: Ran these tests locally Bug: b/304831696 Change-Id: Ib19b9038915a2be9c26f6e07e2d2ee65801461d1
-rw-r--r--nfc/java/android/nfc/INfcAdapter.aidl2
-rw-r--r--nfc/java/android/nfc/NfcAdapter.java34
2 files changed, 36 insertions, 0 deletions
diff --git a/nfc/java/android/nfc/INfcAdapter.aidl b/nfc/java/android/nfc/INfcAdapter.aidl
index 286cf2890eea..1faaf1b9883a 100644
--- a/nfc/java/android/nfc/INfcAdapter.aidl
+++ b/nfc/java/android/nfc/INfcAdapter.aidl
@@ -97,4 +97,6 @@ interface INfcAdapter
WlcLDeviceInfo getWlcLDeviceInfo();
void updateDiscoveryTechnology(IBinder b, int pollFlags, int listenFlags);
+
+ void notifyPollingLoop(in Bundle frame);
}
diff --git a/nfc/java/android/nfc/NfcAdapter.java b/nfc/java/android/nfc/NfcAdapter.java
index 8219d2f873de..d50a9a2b2397 100644
--- a/nfc/java/android/nfc/NfcAdapter.java
+++ b/nfc/java/android/nfc/NfcAdapter.java
@@ -26,6 +26,7 @@ import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.annotation.UserIdInt;
import android.app.Activity;
import android.app.PendingIntent;
@@ -2752,6 +2753,38 @@ public final class NfcAdapter {
}
}
+ /**
+ * Notifies the system of a new polling loop.
+ *
+ * @param frame is the new frame.
+ *
+ * @hide
+ */
+ @TestApi
+ @FlaggedApi(Flags.FLAG_NFC_READ_POLLING_LOOP)
+ public void notifyPollingLoop(@NonNull Bundle frame) {
+ try {
+ if (sService == null) {
+ attemptDeadServiceRecovery(null);
+ }
+ sService.notifyPollingLoop(frame);
+ } catch (RemoteException e) {
+ attemptDeadServiceRecovery(e);
+ // Try one more time
+ if (sService == null) {
+ Log.e(TAG, "Failed to recover NFC Service.");
+ return;
+ }
+ try {
+ sService.notifyPollingLoop(frame);
+ } catch (RemoteException ee) {
+ Log.e(TAG, "Failed to recover NFC Service.");
+ }
+ }
+ }
+
+
+
/**
* Sets NFC charging feature.
* <p>This API is for the Settings application.
@@ -2767,6 +2800,7 @@ public final class NfcAdapter {
}
try {
return sService.enableWlc(enable);
+
} catch (RemoteException e) {
attemptDeadServiceRecovery(e);
// Try one more time