smartlist: set Autofill hints

Prevent the wrong autofill hints to be shown to users.
On Pixel XL the default suggestion is my credit card number,
and this is not wanted since the text is used to perform a
query on ns.ring.cx.

Change-Id: I3845df9d2068c71cde8ac5c315117ed13be6ca0a
diff --git a/ring-android/app/src/main/java/cx/ring/fragments/SmartListFragment.java b/ring-android/app/src/main/java/cx/ring/fragments/SmartListFragment.java
index 022de60..88c51e5 100644
--- a/ring-android/app/src/main/java/cx/ring/fragments/SmartListFragment.java
+++ b/ring-android/app/src/main/java/cx/ring/fragments/SmartListFragment.java
@@ -24,6 +24,7 @@
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.net.Uri;
+import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
 import android.support.annotation.Nullable;
@@ -43,6 +44,7 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.inputmethod.EditorInfo;
+import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.ProgressBar;
 import android.widget.TextView;
@@ -152,6 +154,12 @@
         mSearchView.setQueryHint(getString(R.string.searchbar_hint));
         mSearchView.setLayoutParams(new Toolbar.LayoutParams(Toolbar.LayoutParams.MATCH_PARENT, Toolbar.LayoutParams.MATCH_PARENT));
         mSearchView.setImeOptions(EditorInfo.IME_ACTION_GO);
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+            EditText editText = mSearchView.findViewById(R.id.search_src_text);
+            if (editText != null) {
+                editText.setAutofillHints(View.AUTOFILL_HINT_USERNAME);
+            }
+        }
 
         Intent intent = getActivity().getIntent();
         if (intent != null && intent.getAction() != null) {
diff --git a/ring-android/app/src/main/res/layout/frag_acc_profile_create.xml b/ring-android/app/src/main/res/layout/frag_acc_profile_create.xml
index 943daa2..db36a35 100644
--- a/ring-android/app/src/main/res/layout/frag_acc_profile_create.xml
+++ b/ring-android/app/src/main/res/layout/frag_acc_profile_create.xml
@@ -97,6 +97,7 @@
                 android:id="@+id/user_name"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:autofillHints="name"
                 android:hint="@string/profile_name_hint"
                 android:inputType="textCapWords"
                 android:maxLines="1"
diff --git a/ring-android/app/src/main/res/layout/frag_acc_ring_create.xml b/ring-android/app/src/main/res/layout/frag_acc_ring_create.xml
index 58af943..a9cf16e 100644
--- a/ring-android/app/src/main/res/layout/frag_acc_ring_create.xml
+++ b/ring-android/app/src/main/res/layout/frag_acc_ring_create.xml
@@ -62,6 +62,7 @@
                         android:id="@+id/ring_username"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
+                        android:autofillHints="username"
                         android:hint="@string/prompt_new_username"
                         android:imeOptions="actionNext"
                         android:inputType="text"