aboutsummaryrefslogtreecommitdiff
path: root/input
diff options
context:
space:
mode:
authorFelipe Leme <felipeal@google.com>2018-09-26 10:59:43 -0700
committerFelipe Leme <felipeal@google.com>2018-09-26 11:01:20 -0700
commit4dc2b9ef3a282cfcbc915621b4404ec4583b81a3 (patch)
treee76006cd14acda4bfda6bd863ea9fa9dd0e22681 /input
parent250596f58b7292ab4a27400127cd5bcf73581861 (diff)
downloadandroid-4dc2b9ef3a282cfcbc915621b4404ec4583b81a3.tar.gz
Change HeuristicsService to always provide a hint.
This is helpful to help app developers visualize when autofill is triggered when it shouldn't (for example, in a chat conversation window), so they can mark the root view of such activities with android:importantForAutofill=noExcludeDescendants Bug: 114236837 Test: manual verification Change-Id: I33e18e0ed6a274d7918b363e03f90f7decd902b9
Diffstat (limited to 'input')
-rw-r--r--input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/simple/HeuristicsService.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/simple/HeuristicsService.java b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/simple/HeuristicsService.java
index e19288e3..5931d4e4 100644
--- a/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/simple/HeuristicsService.java
+++ b/input/autofill/AutofillFramework/afservice/src/main/java/com/example/android/autofill/service/simple/HeuristicsService.java
@@ -239,7 +239,11 @@ public class HeuristicsService extends AutofillService {
if (string.contains("name")) return View.AUTOFILL_HINT_NAME;
if (string.contains("phone")) return View.AUTOFILL_HINT_PHONE;
- return null;
+ // When everything else fails, return the full string - this is helpful to help app
+ // developers visualize when autofill is triggered when it shouldn't (for example, in a
+ // chat conversation window), so they can mark the root view of such activities with
+ // android:importantForAutofill=noExcludeDescendants
+ return string;
}
static FillResponse createResponse(@NonNull Context context,