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
diff --git a/nfc/java/android/nfc/INfcAdapter.aidl b/nfc/java/android/nfc/INfcAdapter.aidl
index 286cf28..1faaf1b 100644
--- a/nfc/java/android/nfc/INfcAdapter.aidl
+++ b/nfc/java/android/nfc/INfcAdapter.aidl
@@ -97,4 +97,6 @@
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 8219d2f..d50a9a2 100644
--- a/nfc/java/android/nfc/NfcAdapter.java
+++ b/nfc/java/android/nfc/NfcAdapter.java
@@ -26,6 +26,7 @@
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 @@
}
}
+ /**
+ * 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 @@
}
try {
return sService.enableWlc(enable);
+
} catch (RemoteException e) {
attemptDeadServiceRecovery(e);
// Try one more time