summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Simranjit Kohli <simranjit@google.com> 2023-05-22 11:21:31 -0700
committer Simranjit Kohli <simranjit@google.com> 2023-05-24 13:55:42 +0000
commit2373682ff3cbe3d25233fef8b0622c4c84d25111 (patch)
treea7ef25d62332b2fd323471f50d3143b7245d66e3
parentec8f827230d31d097f4a55deb7ffda1265f0eeee (diff)
[Autofill PCC Detection] Provide detection info during save.
Provide detection info during save, so that the provider can trigger save properly in the case of misdeteciton. Otherwise, provider may save it for wrong fields, or may decide not to save at all. Test: atest CtsAutoFillServiceTestCases. Some tests were failing, but they were failing irrespective of this change. Bug: 277538115 Change-Id: I8a78e1c483339cb3ba8086224942108a77a93c55
-rw-r--r--services/autofill/java/com/android/server/autofill/Session.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index 0a8f474fd4cc..c83f5784a97a 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -224,6 +224,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
private static final String EXTRA_REQUEST_ID = "android.service.autofill.extra.REQUEST_ID";
private static final String PCC_HINTS_DELIMITER = ",";
+ public static final String EXTRA_KEY_DETECTIONS = "detections";
final Object mLock;
@@ -3646,6 +3647,17 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
final ArrayList<FillContext> contexts = mergePreviousSessionLocked( /* forSave= */ true);
+ FieldClassificationResponse fieldClassificationResponse =
+ mClassificationState.mLastFieldClassificationResponse;
+ if (mService.isPccClassificationEnabled()
+ && fieldClassificationResponse != null
+ && !fieldClassificationResponse.getClassifications().isEmpty()) {
+ if (mClientState == null) {
+ mClientState = new Bundle();
+ }
+ mClientState.putParcelableArrayList(EXTRA_KEY_DETECTIONS, new ArrayList<>(
+ fieldClassificationResponse.getClassifications()));
+ }
final SaveRequest saveRequest =
new SaveRequest(contexts, mClientState, mSelectedDatasetIds);
mRemoteFillService.onSaveRequest(saveRequest);