Fix wrong parameter fieldIndex caused IndexOutOfBoundsException

The inline authentication change ag/10235929 changes the parameter of
createInlineSuggestion from fieldIndex to datasetIndex. However, the
passed parameter forget to change to datasetIndex. It is possible to
trigger IndexOutOfBoundsException when we have multiple fields but
only one dataset.

Bug: 149891961
Test: atest android.autofillservice.cts.inline.InlineAuthenticationTest
Test: Manual test by local sample
Change-Id: Iec074b14f2aa3fdb7de918ad684192921b9c5d65
This commit is contained in:
Joanne Chung
2020-02-24 23:52:42 +08:00
parent 14ebab3b19
commit b0b721bbe0

View File

@@ -162,7 +162,8 @@ public final class InlineSuggestionFactory {
continue;
}
InlineSuggestion inlineSuggestion = createInlineSuggestion(isAugmented, dataset,
fieldIndex, mergedInlinePresentation(request, datasetIndex, inlinePresentation),
datasetIndex,
mergedInlinePresentation(request, datasetIndex, inlinePresentation),
onClickFactory, remoteRenderService, onErrorCallback,
request.getHostInputToken());