summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Felipe Leme <felipeal@google.com> 2018-03-23 04:40:30 +0000
committer android-build-merger <android-build-merger@google.com> 2018-03-23 04:40:30 +0000
commit9518f6f957db971cd6f17df5fef3a281f8b6d64a (patch)
tree1e11dac58a7b7cccab8288c47a7dc9da6a1ee3b1
parent43c1b0c834ffa2089da76645ddcff48186422885 (diff)
parent307af3b7d234d8520266078e3e271cf7d79f3723 (diff)
Merge "Always set FLAG_SAVE_ON_ALL_VIEWS_INVISIBLE on SaveInfo when on compat mode." into pi-dev am: 0cdac33f8f
am: 307af3b7d2 Change-Id: I6a221dc1adc0d03bcfcae65dcebd532d412367a4
-rw-r--r--core/java/android/service/autofill/AutofillService.java3
-rw-r--r--services/autofill/java/com/android/server/autofill/Session.java7
2 files changed, 8 insertions, 2 deletions
diff --git a/core/java/android/service/autofill/AutofillService.java b/core/java/android/service/autofill/AutofillService.java
index 0f7cea21c052..60537a4ca3ec 100644
--- a/core/java/android/service/autofill/AutofillService.java
+++ b/core/java/android/service/autofill/AutofillService.java
@@ -527,6 +527,9 @@ import android.view.autofill.AutofillValue;
* <pre> &lt;autofill-service xmlns:android="http://schemas.android.com/apk/res/android"&gt;
* &lt;compatibility-package android:name="foo.bar.baz" android:maxLongVersionCode="1000000000"/&gt;
* &lt;/autofill-service&gt;</pre>
+ *
+ * <p>When using compatibility mode, the {@link SaveInfo.Builder#setFlags(int) SaveInfo flags}
+ * automatically include {@link SaveInfo#FLAG_SAVE_ON_ALL_VIEWS_INVISIBLE}.
*/
public abstract class AutofillService extends Service {
private static final String TAG = "AutofillService";
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index 1304d204109b..9d626b2b9b4e 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -2077,8 +2077,11 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
if (saveTriggerId != null) {
writeLog(MetricsEvent.AUTOFILL_EXPLICIT_SAVE_TRIGGER_DEFINITION);
}
- saveOnAllViewsInvisible =
- (saveInfo.getFlags() & SaveInfo.FLAG_SAVE_ON_ALL_VIEWS_INVISIBLE) != 0;
+ int flags = saveInfo.getFlags();
+ if (mCompatMode) {
+ flags |= SaveInfo.FLAG_SAVE_ON_ALL_VIEWS_INVISIBLE;
+ }
+ saveOnAllViewsInvisible = (flags & SaveInfo.FLAG_SAVE_ON_ALL_VIEWS_INVISIBLE) != 0;
// We only need to track views if we want to save once they become invisible.
if (saveOnAllViewsInvisible) {