Translate: Ignore duplicate translations. am: 02fe90bb42

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

Change-Id: I06dc3492f8d6fc0568c73f7e28b86ca4bfeadd3b
This commit is contained in:
Ahaan Ugale
2021-05-28 03:03:39 +00:00
committed by Automerger Merge Worker

View File

@@ -389,6 +389,14 @@ public class UiTranslationController {
continue;
}
mActivity.runOnUiThread(() -> {
if (view.getViewTranslationResponse() != null
&& view.getViewTranslationResponse().equals(response)) {
if (DEBUG) {
Log.d(TAG, "Duplicate ViewTranslationResponse for " + autofillId
+ ". Ignoring.");
}
return;
}
ViewTranslationCallback callback = view.getViewTranslationCallback();
if (callback == null) {
if (view instanceof TextView) {