summaryrefslogtreecommitdiff
path: root/com/android/server/autofill/Session.java
diff options
context:
space:
mode:
authorJustin Klaassen <justinklaassen@google.com>2018-04-15 00:41:15 -0400
committerJustin Klaassen <justinklaassen@google.com>2018-04-15 00:41:15 -0400
commitb8042fc9b036db0a6692ca853428fc6ab1e60892 (patch)
tree82669ea5d75238758e22d379a42baeada526219e /com/android/server/autofill/Session.java
parent4d01eeaffaa720e4458a118baa137a11614f00f7 (diff)
downloadandroid-28-b8042fc9b036db0a6692ca853428fc6ab1e60892.tar.gz
/google/data/ro/projects/android/fetch_artifact \ --bid 4719250 \ --target sdk_phone_armv7-win_sdk \ sdk-repo-linux-sources-4719250.zip AndroidVersion.ApiLevel has been modified to appear as 28 Change-Id: I9ec0a12c9251b8449dba0d86b0cfdbcca16b0a7c
Diffstat (limited to 'com/android/server/autofill/Session.java')
-rw-r--r--com/android/server/autofill/Session.java22
1 files changed, 16 insertions, 6 deletions
diff --git a/com/android/server/autofill/Session.java b/com/android/server/autofill/Session.java
index e14584f9..06707daa 100644
--- a/com/android/server/autofill/Session.java
+++ b/com/android/server/autofill/Session.java
@@ -99,6 +99,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
/**
@@ -1400,6 +1401,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
* the current values of all fields in the screen.
*/
if (saveInfo == null) {
+ if (sVerbose) Slog.w(TAG, "showSaveLocked(): no saveInfo from service");
return true;
}
@@ -1970,8 +1972,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
return;
}
- if (value != null && !value.equals(viewState.getCurrentValue())) {
- if (value.isEmpty()
+ if (!Objects.equals(value, viewState.getCurrentValue())) {
+ if ((value == null || value.isEmpty())
&& viewState.getCurrentValue() != null
&& viewState.getCurrentValue().isText()
&& viewState.getCurrentValue().getTextValue() != null
@@ -1992,18 +1994,26 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
// Must check if this update was caused by autofilling the view, in which
// case we just update the value, but not the UI.
final AutofillValue filledValue = viewState.getAutofilledValue();
- if (value.equals(filledValue)) {
+ if (filledValue != null && filledValue.equals(value)) {
+ if (sVerbose) {
+ Slog.v(TAG, "ignoring autofilled change on id " + id);
+ }
return;
}
// Update the internal state...
viewState.setState(ViewState.STATE_CHANGED);
//..and the UI
- if (value.isText()) {
- getUiForShowing().filterFillUi(value.getTextValue().toString(), this);
+ final String filterText;
+ if (value == null || !value.isText()) {
+ filterText = null;
} else {
- getUiForShowing().filterFillUi(null, this);
+ final CharSequence text = value.getTextValue();
+ // Text should never be null, but it doesn't hurt to check to avoid a
+ // system crash...
+ filterText = (text == null) ? null : text.toString();
}
+ getUiForShowing().filterFillUi(filterText, this);
}
break;
case ACTION_VIEW_ENTERED: