summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorJoanne Chung <joannechung@google.com>2021-04-21 00:48:53 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-04-21 00:48:53 +0000
commit497dadea9cea396dd0680fac1e9c7f80b871d750 (patch)
tree4328ecb134d3a81e691b871ea458d2516cabe05c /core/java/android
parent3deea321842572d81361796c395071c0a13c06d0 (diff)
parent108cec2f17d8db796d10df4539ac0157512927ca (diff)
Merge "Remove the deprecated APIs in UiTranslationManager." into sc-dev
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/translation/ITranslationManager.aidl3
-rw-r--r--core/java/android/view/translation/UiTranslationManager.java112
2 files changed, 0 insertions, 115 deletions
diff --git a/core/java/android/view/translation/ITranslationManager.aidl b/core/java/android/view/translation/ITranslationManager.aidl
index 9c53f461eb95..560edecc9da6 100644
--- a/core/java/android/view/translation/ITranslationManager.aidl
+++ b/core/java/android/view/translation/ITranslationManager.aidl
@@ -40,9 +40,6 @@ oneway interface ITranslationManager {
void updateUiTranslationState(int state, in TranslationSpec sourceSpec,
in TranslationSpec targetSpec, in List<AutofillId> viewIds, IBinder token, int taskId,
int userId);
- // deprecated
- void updateUiTranslationStateByTaskId(int state, in TranslationSpec sourceSpec,
- in TranslationSpec targetSpec, in List<AutofillId> viewIds, int taskId, int userId);
void registerUiTranslationStateCallback(in IRemoteCallback callback, int userId);
void unregisterUiTranslationStateCallback(in IRemoteCallback callback, int userId);
diff --git a/core/java/android/view/translation/UiTranslationManager.java b/core/java/android/view/translation/UiTranslationManager.java
index 130e07889d84..f66fac562895 100644
--- a/core/java/android/view/translation/UiTranslationManager.java
+++ b/core/java/android/view/translation/UiTranslationManager.java
@@ -120,42 +120,6 @@ public final class UiTranslationManager {
/**
* Request ui translation for a given Views.
*
- * NOTE: Please use {@code startTranslation(TranslationSpec, TranslationSpec, List<AutofillId>,
- * ActivityId)} instead.
- *
- * @param sourceSpec {@link TranslationSpec} for the data to be translated.
- * @param targetSpec {@link TranslationSpec} for the translated data.
- * @param viewIds A list of the {@link View}'s {@link AutofillId} which needs to be translated
- * @param taskId the Activity Task id which needs ui translation
- * @deprecated Use {@code startTranslation(TranslationSpec, TranslationSpec, List<AutofillId>,
- * ActivityId)} instead.
- *
- * @hide
- * @removed
- */
- @Deprecated
- @RequiresPermission(android.Manifest.permission.MANAGE_UI_TRANSLATION)
- @SystemApi
- public void startTranslation(@NonNull TranslationSpec sourceSpec,
- @NonNull TranslationSpec targetSpec, @NonNull List<AutofillId> viewIds,
- int taskId) {
- Objects.requireNonNull(sourceSpec);
- Objects.requireNonNull(targetSpec);
- Objects.requireNonNull(viewIds);
- if (viewIds.size() == 0) {
- throw new IllegalArgumentException("Invalid empty views: " + viewIds);
- }
- try {
- mService.updateUiTranslationStateByTaskId(STATE_UI_TRANSLATION_STARTED, sourceSpec,
- targetSpec, viewIds, taskId, mContext.getUserId());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Request ui translation for a given Views.
- *
* @param sourceSpec {@link TranslationSpec} for the data to be translated.
* @param targetSpec {@link TranslationSpec} for the translated data.
* @param viewIds A list of the {@link View}'s {@link AutofillId} which needs to be translated
@@ -193,32 +157,6 @@ public final class UiTranslationManager {
* Request to disable the ui translation. It will destroy all the {@link Translator}s and no
* longer to show to show the translated text.
*
- * NOTE: Please use {@code finishTranslation(ActivityId)} instead.
- *
- * @param taskId the Activity Task id which needs ui translation
- * @deprecated Use {@code finishTranslation(ActivityId)} instead.
- *
- * @hide
- * @removed
- *
- */
- @Deprecated
- @RequiresPermission(android.Manifest.permission.MANAGE_UI_TRANSLATION)
- @SystemApi
- public void finishTranslation(int taskId) {
- try {
- mService.updateUiTranslationStateByTaskId(STATE_UI_TRANSLATION_FINISHED,
- null /* sourceSpec */, null /* targetSpec */, null /* viewIds */, taskId,
- mContext.getUserId());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Request to disable the ui translation. It will destroy all the {@link Translator}s and no
- * longer to show to show the translated text.
- *
* @param activityId the identifier for the Activity which needs ui translation
* @throws NullPointerException the activityId or
* {@link android.app.assist.ActivityId#getToken()} is {@code null}
@@ -243,31 +181,6 @@ public final class UiTranslationManager {
* Request to pause the current ui translation's {@link Translator} which will switch back to
* the original language.
*
- * NOTE: Please use {@code pauseTranslation(ActivityId)} instead.
- *
- * @param taskId the Activity Task id which needs ui translation
- * @deprecated Use {@code pauseTranslation(ActivityId)} instead.
- *
- * @hide
- * @removed
- */
- @Deprecated
- @RequiresPermission(android.Manifest.permission.MANAGE_UI_TRANSLATION)
- @SystemApi
- public void pauseTranslation(int taskId) {
- try {
- mService.updateUiTranslationStateByTaskId(STATE_UI_TRANSLATION_PAUSED,
- null /* sourceSpec */, null /* targetSpec */, null /* viewIds */, taskId,
- mContext.getUserId());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Request to pause the current ui translation's {@link Translator} which will switch back to
- * the original language.
- *
* @param activityId the identifier for the Activity which needs ui translation
* @throws NullPointerException the activityId or
* {@link android.app.assist.ActivityId#getToken()} is {@code null}
@@ -292,31 +205,6 @@ public final class UiTranslationManager {
* Request to resume the paused ui translation's {@link Translator} which will switch to the
* translated language if the text had been translated.
*
- * NOTE: Please use {@code resumeTranslation(ActivityId)} instead.
- *
- * @param taskId the Activity Task id which needs ui translation
- * @deprecated Use {@code resumeTranslation(ActivityId)} instead.
- *
- * @hide
- * @removed
- */
- @Deprecated
- @RequiresPermission(android.Manifest.permission.MANAGE_UI_TRANSLATION)
- @SystemApi
- public void resumeTranslation(int taskId) {
- try {
- mService.updateUiTranslationStateByTaskId(STATE_UI_TRANSLATION_RESUMED,
- null /* sourceSpec */, null /* targetSpec */, null /* viewIds */,
- taskId, mContext.getUserId());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Request to resume the paused ui translation's {@link Translator} which will switch to the
- * translated language if the text had been translated.
- *
* @param activityId the identifier for the Activity which needs ui translation
* @throws NullPointerException the activityId or
* {@link android.app.assist.ActivityId#getToken()} is {@code null}