json.put("autofillOptions", wrap(node.getAutofillOptions())); json.put("autofillType", wrap(node.getAutofillType())); json.put("autofillValue", wrap(node.getAutofillValue())); json.put("checkable", wrap(node.isCheckable())); json.put("checked", wrap(node.isChecked()));
builder.append(prefix).append("afType: ").append(getAutofillTypeAsString(node.getAutofillType())) .append("\tafValue:") .append(getAutofillValueAndTypeAsString(node.getAutofillValue())) .append("\tafOptions:").append(options == null ? "N/A" : Arrays.toString(options)) .append("\tafHints: ").append(afHints == null ? "N/A" : Arrays.toString(afHints))
builder.append(prefix).append("afType: ").append(getTypeAsString(node.getAutofillType())) .append("\tafValue:") .append(getAutofillValueAndTypeAsString(node.getAutofillValue())) .append("\tafOptions:").append(options == null ? "N/A" : Arrays.toString(options)) .append("\tafHints: ").append(afHints == null ? "N/A" : Arrays.toString(afHints))
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); }