Return all previous FillContexts onFill
Test: CtsAutoFillServiceTestCases
Fixes: 37673341
Change-Id: I80feb5bd8d6027fb4ec2dd32f5c486dae7c6bc4c
diff --git a/core/java/android/service/autofill/AutofillService.java b/core/java/android/service/autofill/AutofillService.java
index cb47c10..edb9098 100644
--- a/core/java/android/service/autofill/AutofillService.java
+++ b/core/java/android/service/autofill/AutofillService.java
@@ -34,6 +34,7 @@
import com.android.internal.os.SomeArgs;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -118,8 +119,10 @@
try {
onFillRequest(request, cancellation, fillCallback);
} catch (AbstractMethodError e) {
- onFillRequest(request.getStructure(), request.getClientState(),
- request.getFlags(), cancellation, fillCallback);
+ final ArrayList<FillContext> contexts = request.getFillContexts();
+ onFillRequest(contexts.get(contexts.size() - 1).getStructure(),
+ request.getClientState(), request.getFlags(), cancellation,
+ fillCallback);
}
break;
} case MSG_ON_SAVE_REQUEST: {