Fixed missing auto-fill save callbacks on TextView.
It was accidentally broken during a previous commit where the CTS test failure was ignored by a known issue being fixed in another change - this change fixes both problems. Bug: 33550221 Bug: 3380254 Test: CtsAutoFillServiceTestCases pass (for real now :-) Change-Id: I5b2aa6060995ca255e51d85aa6ec93a886fa522f
This commit is contained in:
@@ -5220,6 +5220,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
||||
|
||||
if (needEditableForNotification) {
|
||||
sendAfterTextChanged((Editable) text);
|
||||
} else {
|
||||
// Always notify AutoFillManager - it will return right away if auto-fill is disabled.
|
||||
notifyAutoFillManagerAfterTextChanged();
|
||||
}
|
||||
|
||||
// SelectionModifierCursorController depends on textCanBeSelected, which depends on text
|
||||
@@ -9112,15 +9115,19 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
||||
}
|
||||
|
||||
// Always notify AutoFillManager - it will return right away if auto-fill is disabled.
|
||||
notifyAutoFillManagerAfterTextChanged();
|
||||
|
||||
hideErrorIfUnchanged();
|
||||
}
|
||||
|
||||
private void notifyAutoFillManagerAfterTextChanged() {
|
||||
final AutoFillManager afm = mContext.getSystemService(AutoFillManager.class);
|
||||
if (afm != null) {
|
||||
if (DEBUG_AUTOFILL) {
|
||||
Log.v(LOG_TAG, "sendAfterTextChanged(): notify AFM for text=" + text);
|
||||
Log.v(LOG_TAG, "sendAfterTextChanged(): notify AFM for text=" + mText);
|
||||
}
|
||||
afm.valueChanged(TextView.this);
|
||||
}
|
||||
|
||||
hideErrorIfUnchanged();
|
||||
}
|
||||
|
||||
void updateAfterEdit() {
|
||||
|
||||
@@ -726,7 +726,7 @@ final class AutoFillManagerServiceImpl {
|
||||
Slog.d(TAG, "finishSessionLocked(): found a change on " + id + ": "
|
||||
+ state.mAutoFillValue);
|
||||
}
|
||||
mUi.showSaveUi();
|
||||
getUiForShowing().showSaveUi();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,9 +75,11 @@ final class AutoFillUI {
|
||||
|
||||
void setCallbackLocked(AutoFillUiCallback callback, IBinder activityToken) {
|
||||
mHandler.post(() -> {
|
||||
hideAllUiThread();
|
||||
mCallback = callback;
|
||||
mActivityToken = activityToken;
|
||||
if (callback != mCallback && activityToken != mActivityToken) {
|
||||
hideAllUiThread();
|
||||
mCallback = callback;
|
||||
mActivityToken = activityToken;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user