aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Sigelbaum <sigelbaum@google.com>2017-06-16 14:46:49 -0700
committerDouglas Sigelbaum <sigelbaum@google.com>2017-07-10 14:49:38 +0000
commitc9e8b5246c599f6bbf5cbc71873f74b9df892ca1 (patch)
treed8c025a3951a00f5d6fe5f1a9827c9db95167049
parentfff04fe1616be519fc2a4af77761eac64ef911dc (diff)
downloadandroid-c9e8b5246c599f6bbf5cbc71873f74b9df892ca1.tar.gz
Autofill kotlin sample: fixing auth bug.
Bug: 38182790 Test: manual Change-Id: Icc6310d1dceb10dcce8824154341b4b28ecd94bf
-rw-r--r--input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/MyAutofillService.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/MyAutofillService.kt b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/MyAutofillService.kt
index ce2ce0d7..f74c5873 100644
--- a/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/MyAutofillService.kt
+++ b/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/MyAutofillService.kt
@@ -23,11 +23,13 @@ import android.service.autofill.FillResponse
import android.service.autofill.SaveCallback
import android.service.autofill.SaveRequest
import android.util.Log
+import android.view.autofill.AutofillId
import com.example.android.autofillframework.CommonUtil.TAG
import com.example.android.autofillframework.CommonUtil.bundleToString
import com.example.android.autofillframework.R
import com.example.android.autofillframework.multidatasetservice.datasource.SharedPrefsAutofillRepository
import com.example.android.autofillframework.multidatasetservice.settings.MyPreferences
+import java.util.Arrays
class MyAutofillService : AutofillService() {
@@ -45,7 +47,7 @@ class MyAutofillService : AutofillService() {
val responseBuilder = FillResponse.Builder()
// Check user's settings for authenticating Responses and Datasets.
val responseAuth = MyPreferences.isResponseAuth(this)
- if (responseAuth) {
+ if (responseAuth && autofillFields.autofillIds.size > 0) {
// If the entire Autofill Response is authenticated, AuthActivity is used
// to generate Response.
val sender = AuthActivity.getAuthIntentSenderForResponse(this)