private void parseAutofillFields()

in AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/data/ClientAutofillDataBuilder.java [85:114]


    private void parseAutofillFields(AssistStructure.ViewNode viewNode,
            DatasetWithFilledAutofillFields datasetWithFilledAutofillFields, int partition) {
        String[] hints = viewNode.getAutofillHints();
        if (hints == null || hints.length == 0) {
            return;
        }
        AutofillValue autofillValue = viewNode.getAutofillValue();
        String textValue = null;
        Long dateValue = null;
        Boolean toggleValue = null;
        CharSequence[] autofillOptions = null;
        Integer listIndex = null;
        if (autofillValue != null) {
            if (autofillValue.isText()) {
                // Using toString of AutofillValue.getTextValue in order to save it to
                // SharedPreferences.
                textValue = autofillValue.getTextValue().toString();
            } else if (autofillValue.isDate()) {
                dateValue = autofillValue.getDateValue();
            } else if (autofillValue.isList()) {
                autofillOptions = viewNode.getAutofillOptions();
                listIndex = autofillValue.getListValue();
            } else if (autofillValue.isToggle()) {
                toggleValue = autofillValue.getToggleValue();
            }
        }
        appendViewMetadata(datasetWithFilledAutofillFields,
                hints, partition, textValue, dateValue, toggleValue,
                autofillOptions, listIndex);
    }