Merge "Clear the ViewTranslationResponse on finishing UiTranslation." into sc-dev am: 2828678bd4

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14922772

Change-Id: I5bf07de96eda6f2a16e003714c0f17b072515ea7
This commit is contained in:
TreeHugger Robot
2021-06-14 01:26:52 +00:00
committed by Automerger Merge Worker
2 changed files with 11 additions and 0 deletions

View File

@@ -30928,6 +30928,16 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
mViewTranslationResponse = response;
}
/**
* Clears the ViewTranslationResponse stored by the default implementation of {@link
* #onViewTranslationResponse}.
*
* @hide
*/
public void clearViewTranslationResponse() {
mViewTranslationResponse = null;
}
/**
* Called when the content from {@link View#onCreateVirtualViewTranslationRequests} had been
* translated by the TranslationService.

View File

@@ -155,6 +155,7 @@ public class UiTranslationController {
destroyTranslators();
runForEachView((view, callback) -> {
callback.onClearTranslation(view);
view.clearViewTranslationResponse();
if (view.hasTranslationTransientState()) {
view.setHasTransientState(false);
view.setHasTranslationTransientState(false);