Merge "Send empty response to IME when autofill session is destroyed" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
756740d9f4
@@ -77,8 +77,8 @@ final class AutofillInlineSessionController {
|
|||||||
if (mSession != null) {
|
if (mSession != null) {
|
||||||
// Destroy the existing session.
|
// Destroy the existing session.
|
||||||
mSession.destroySessionLocked();
|
mSession.destroySessionLocked();
|
||||||
mInlineFillUi = null;
|
|
||||||
}
|
}
|
||||||
|
mInlineFillUi = null;
|
||||||
// TODO(b/151123764): consider reusing the same AutofillInlineSession object for the
|
// TODO(b/151123764): consider reusing the same AutofillInlineSession object for the
|
||||||
// same field.
|
// same field.
|
||||||
mSession = new AutofillInlineSuggestionsRequestSession(mInputMethodManagerInternal, mUserId,
|
mSession = new AutofillInlineSuggestionsRequestSession(mInputMethodManagerInternal, mUserId,
|
||||||
@@ -86,6 +86,22 @@ final class AutofillInlineSessionController {
|
|||||||
mSession.onCreateInlineSuggestionsRequestLocked();
|
mSession.onCreateInlineSuggestionsRequestLocked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroys the current session. May send an empty response to IME to clear the suggestions if
|
||||||
|
* the focus didn't change to a different field.
|
||||||
|
*
|
||||||
|
* @param autofillId the currently focused view from the autofill session
|
||||||
|
*/
|
||||||
|
@GuardedBy("mLock")
|
||||||
|
void destroyLocked(@NonNull AutofillId autofillId) {
|
||||||
|
if (mSession != null) {
|
||||||
|
mSession.onInlineSuggestionsResponseLocked(InlineFillUi.emptyUi(autofillId));
|
||||||
|
mSession.destroySessionLocked();
|
||||||
|
mSession = null;
|
||||||
|
}
|
||||||
|
mInlineFillUi = null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link InlineSuggestionsRequest} provided by IME for the last request.
|
* Returns the {@link InlineSuggestionsRequest} provided by IME for the last request.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -3702,6 +3702,9 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
|
|||||||
unlinkClientVultureLocked();
|
unlinkClientVultureLocked();
|
||||||
mUi.destroyAll(mPendingSaveUi, this, true);
|
mUi.destroyAll(mPendingSaveUi, this, true);
|
||||||
mUi.clearCallback(this);
|
mUi.clearCallback(this);
|
||||||
|
if (mCurrentViewId != null) {
|
||||||
|
mInlineSessionController.destroyLocked(mCurrentViewId);
|
||||||
|
}
|
||||||
mDestroyed = true;
|
mDestroyed = true;
|
||||||
|
|
||||||
// Log metrics
|
// Log metrics
|
||||||
|
|||||||
Reference in New Issue
Block a user