From c9e8b5246c599f6bbf5cbc71873f74b9df892ca1 Mon Sep 17 00:00:00 2001 From: Douglas Sigelbaum Date: Fri, 16 Jun 2017 14:46:49 -0700 Subject: Autofill kotlin sample: fixing auth bug. Bug: 38182790 Test: manual Change-Id: Icc6310d1dceb10dcce8824154341b4b28ecd94bf --- .../autofillframework/multidatasetservice/MyAutofillService.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'input/autofill/AutofillFramework/kotlinApp/Application/src') 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) -- cgit v1.2.3