diff --git a/core/java/android/view/translation/UiTranslationController.java b/core/java/android/view/translation/UiTranslationController.java index 2c17545502975..a8335918cc843 100644 --- a/core/java/android/view/translation/UiTranslationController.java +++ b/core/java/android/view/translation/UiTranslationController.java @@ -26,7 +26,6 @@ import android.annotation.WorkerThread; import android.app.Activity; import android.app.assist.ActivityId; import android.content.Context; -import android.os.Build; import android.os.Handler; import android.os.HandlerThread; import android.os.Process; @@ -63,10 +62,7 @@ import java.util.function.BiConsumer; */ public class UiTranslationController { - // TODO(b/182433547): remove Build.IS_DEBUGGABLE before ship. Enable the logging in debug build - // to help the debug during the development phase - public static final boolean DEBUG = Log.isLoggable(UiTranslationManager.LOG_TAG, Log.DEBUG) - || Build.IS_DEBUGGABLE; + public static final boolean DEBUG = Log.isLoggable(UiTranslationManager.LOG_TAG, Log.DEBUG); private static final String TAG = "UiTranslationController"; @NonNull @@ -238,9 +234,7 @@ public class UiTranslationController { } pw.print(outerPrefix); pw.print("padded views: "); pw.println(mViewsToPadContent); } - // TODO(b/182433547): we will remove debug rom condition before S release then we change - // change this back to "DEBUG" - if (Log.isLoggable(UiTranslationManager.LOG_TAG, Log.DEBUG)) { + if (DEBUG) { dumpViewByTraversal(outerPrefix, pw); } } @@ -414,7 +408,6 @@ public class UiTranslationController { for (int i = 0; i < resultCount; i++) { final ViewTranslationResponse response = translatedResult.valueAt(i); if (DEBUG) { - // TODO(b/182433547): remove before S release Log.v(TAG, "onTranslationCompleted: " + sanitizedViewTranslationResponse(response)); } @@ -635,8 +628,8 @@ public class UiTranslationController { for (int i = 0; i < viewCounts; i++) { final View view = views.valueAt(i).get(); if (DEBUG) { - // TODO(b/182433547): remove before S release - Log.d(TAG, "runForEachView: view= " + view); + Log.d(TAG, "runForEachView for autofillId = " + (view != null + ? view.getAutofillId() : " null")); } if (view == null || view.getViewTranslationCallback() == null) { if (DEBUG) { @@ -697,8 +690,6 @@ public class UiTranslationController { } } - // TODO(b/182433547): maybe remove below before S release - /** * Returns a sanitized string representation of {@link ViewTranslationRequest}; */ diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 37374ef37adaa..87301dcaa5dd5 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -13901,7 +13901,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener public void onCreateViewTranslationRequest(@NonNull int[] supportedFormats, @NonNull Consumer requestsCollector) { if (supportedFormats == null || supportedFormats.length == 0) { - // TODO(b/182433547): remove before S release if (UiTranslationController.DEBUG) { Log.w(LOG_TAG, "Do not provide the support translation formats."); } @@ -13912,7 +13911,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener // Support Text translation if (ArrayUtils.contains(supportedFormats, TranslationSpec.DATA_FORMAT_TEXT)) { if (mText == null || mText.length() == 0) { - // TODO(b/182433547): remove before S release if (UiTranslationController.DEBUG) { Log.w(LOG_TAG, "Cannot create translation request for the empty text."); } @@ -13926,7 +13924,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener // it, it needs broader changes to text APIs, we only allow to translate non selectable // and editable text in S. if (isTextEditable() || isPassword || isTextSelectable()) { - // TODO(b/182433547): remove before S release if (UiTranslationController.DEBUG) { Log.w(LOG_TAG, "Cannot create translation request. editable = " + isTextEditable() + ", isPassword = " + isPassword + ", selectable = " diff --git a/core/java/android/widget/TextViewTranslationCallback.java b/core/java/android/widget/TextViewTranslationCallback.java index e1b04f8957e5f..9d60009031f97 100644 --- a/core/java/android/widget/TextViewTranslationCallback.java +++ b/core/java/android/widget/TextViewTranslationCallback.java @@ -22,7 +22,6 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.content.res.ColorStateList; import android.graphics.Color; -import android.os.Build; import android.text.TextUtils; import android.text.method.TransformationMethod; import android.text.method.TranslationTransformationMethod; @@ -43,10 +42,7 @@ public class TextViewTranslationCallback implements ViewTranslationCallback { private static final String TAG = "TextViewTranslationCb"; - // TODO(b/182433547): remove Build.IS_DEBUGGABLE before ship. Enable the logging in debug build - // to help the debug during the development phase - private static final boolean DEBUG = Log.isLoggable(UiTranslationManager.LOG_TAG, Log.DEBUG) - || Build.IS_DEBUGGABLE; + private static final boolean DEBUG = Log.isLoggable(UiTranslationManager.LOG_TAG, Log.DEBUG); private TranslationTransformationMethod mTranslationTransformation; private boolean mIsShowingTranslation = false; @@ -124,7 +120,6 @@ public class TextViewTranslationCallback implements ViewTranslationCallback { } } else { if (DEBUG) { - // TODO(b/182433547): remove before S release Log.w(TAG, "onHideTranslation(): no translated text."); } return false; @@ -145,7 +140,6 @@ public class TextViewTranslationCallback implements ViewTranslationCallback { mContentDescription = null; } else { if (DEBUG) { - // TODO(b/182433547): remove before S release Log.w(TAG, "onClearTranslation(): no translated text."); } return false;