summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Felipe Leme <felipeal@google.com> 2017-06-20 00:48:15 +0000
committer android-build-merger <android-build-merger@google.com> 2017-06-20 00:48:15 +0000
commitd10a1a372fac97596ebf5a46c26939a70414ebcd (patch)
treef20832560415130be99288632d0169e57c542990
parentf913dd5252dd9b493161a00bf7fa6edd283d0f06 (diff)
parent26474a4043e97e155aecfc7a41e3ffbe90afecf3 (diff)
Merge "Fixed updateAutofillValue() when mText is not set." into oc-dev am: 4eaba84065 am: b7e80c9350
am: 26474a4043 Change-Id: I7180414c0296c45852c63710021d8edc8ee11e83
-rw-r--r--core/java/android/app/assist/AssistStructure.java3
-rw-r--r--core/java/android/service/autofill/AutofillService.java9
2 files changed, 8 insertions, 4 deletions
diff --git a/core/java/android/app/assist/AssistStructure.java b/core/java/android/app/assist/AssistStructure.java
index 266fa7e24b2c..4e8277c388de 100644
--- a/core/java/android/app/assist/AssistStructure.java
+++ b/core/java/android/app/assist/AssistStructure.java
@@ -1051,6 +1051,9 @@ public class AssistStructure implements Parcelable {
public void updateAutofillValue(AutofillValue value) {
mAutofillValue = value;
if (value.isText()) {
+ if (mText == null) {
+ mText = new ViewNodeText();
+ }
mText.mText = value.getTextValue();
}
}
diff --git a/core/java/android/service/autofill/AutofillService.java b/core/java/android/service/autofill/AutofillService.java
index 9df315b7deab..a90ee93d9852 100644
--- a/core/java/android/service/autofill/AutofillService.java
+++ b/core/java/android/service/autofill/AutofillService.java
@@ -25,7 +25,6 @@ import android.app.Activity;
import android.app.Service;
import android.app.assist.AssistStructure;
import android.content.Intent;
-import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.IBinder;
import android.os.ICancellationSignal;
@@ -35,9 +34,6 @@ import android.view.autofill.AutofillManager;
import com.android.internal.os.SomeArgs;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* Top-level service of the current autofill service for a given user.
*
@@ -192,6 +188,11 @@ public abstract class AutofillService extends Service {
* {@link SaveCallback#onSuccess()} or {@link SaveCallback#onFailure(CharSequence)})
* to notify the result of the request.
*
+ * <p><b>NOTE: </b>to retrieve the actual value of the field, the service should call
+ * {@link android.app.assist.AssistStructure.ViewNode#getAutofillValue()}; if it calls
+ * {@link android.app.assist.AssistStructure.ViewNode#getText()} or other methods, there is no
+ * guarantee such method will return the most recent value of the field.
+ *
* @param request the {@link SaveRequest request} to handle.
* See {@link FillResponse} for examples of multiple-sections requests.
* @param callback object used to notify the result of the request.