json.put("autofillHints", wrap(node.getAutofillHints())); json.put("autofillId", wrap(node.getAutofillId())); json.put("autofillOptions", wrap(node.getAutofillOptions())); json.put("autofillType", wrap(node.getAutofillType())); json.put("autofillValue", wrap(node.getAutofillValue()));
CharSequence[] options = node.getAutofillOptions(); builder.append(prefix).append("afType: ").append(getAutofillTypeAsString(node.getAutofillType())) .append("\tafValue:")
CharSequence[] options = node.getAutofillOptions(); builder.append(prefix).append("afType: ").append(getTypeAsString(node.getAutofillType())) .append("\tafValue:")
switch (autofillType) { case View.AUTOFILL_TYPE_LIST: CharSequence[] options = viewNode.getAutofillOptions(); int listValue = -1; if (options != null) { listValue = indexOf(viewNode.getAutofillOptions(), field.getTextValue());
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); }