diff options
author | Felipe Leme <felipeal@google.com> | 2017-09-21 11:01:46 -0700 |
---|---|---|
committer | Felipe Leme <felipeal@google.com> | 2017-09-21 11:02:14 -0700 |
commit | d25621d892a1601aebe9224ff92131674aa3f67b (patch) | |
tree | d185147e77a2de877ecac10e2f9f9878ba397de8 /input/autofill/AutofillFramework | |
parent | 85a44dc0a2ed65f8a8a056abf9ada97ac6b11f05 (diff) | |
download | android-d25621d892a1601aebe9224ff92131674aa3f67b.tar.gz |
Autofill sample: Fixed CustomVirtualView preCondition and improved dump.
Bug: 38182790
Test: manual
Change-Id: Ic6c23c12ed333470403457cdac9ed8e89d1d5cf8
Diffstat (limited to 'input/autofill/AutofillFramework')
2 files changed, 5 insertions, 4 deletions
diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/CommonUtil.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/CommonUtil.java index 1c00dd7f..84b5a976 100644 --- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/CommonUtil.java +++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/CommonUtil.java @@ -104,12 +104,10 @@ public final class CommonUtil { private static void dumpNode(String prefix, ViewNode node) { StringBuilder builder = new StringBuilder(); - String[] hints = node.getAutofillHints(); builder.append(prefix) .append("autoFillId: ").append(node.getAutofillId()) .append("\tidEntry: ").append(node.getIdEntry()) .append("\tid: ").append(node.getId()) - .append("\thints: ").append(hints == null ? "N/A" : Arrays.toString(hints)) .append("\tclassName: ").append(node.getClassName()) .append('\n'); @@ -117,7 +115,8 @@ public final class CommonUtil { .append("focused: ").append(node.isFocused()) .append("\tvisibility").append(node.getVisibility()) .append("\tchecked: ").append(node.isChecked()) - .append("\tURL: ").append(node.getWebDomain()) + .append("\twebDomain: ").append(node.getWebDomain()) + .append("\thint: ").append(node.getHint()) .append('\n'); HtmlInfo htmlInfo = node.getHtmlInfo(); @@ -129,11 +128,13 @@ public final class CommonUtil { .append('\n'); } + String[] afHints = node.getAutofillHints(); CharSequence[] options = node.getAutofillOptions(); 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)) .append("\tinputType:").append(node.getInputType()) .append('\n'); diff --git a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/CustomVirtualView.java b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/CustomVirtualView.java index df616f90..13d59ea3 100644 --- a/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/CustomVirtualView.java +++ b/input/autofill/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/CustomVirtualView.java @@ -287,7 +287,7 @@ public class CustomVirtualView extends View { */ public Partition addPartition(String name) { Preconditions.checkNotNull(name, "Name cannot be null."); - Preconditions.checkArgument(mPartitionsByName.containsKey(name), + Preconditions.checkArgument(!mPartitionsByName.containsKey(name), "Partition with such name already exists."); Partition partition = new Partition(name); mPartitionsByName.put(name, partition); |