summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorJoanne Chung <joannechung@google.com>2021-04-15 18:40:56 +0800
committerJoanne Chung <joannechung@google.com>2021-04-20 14:00:36 +0000
commit108cec2f17d8db796d10df4539ac0157512927ca (patch)
treefb5d4a10beb65b6df19e9b3242daae766e5a289e /core/java
parentad73e49262a1010f53078cd147707a6a392a4b03 (diff)
Remove the deprecated APIs in UiTranslationManager.
We introduced some APIs for initial demo but we dropped these APIs. To avoid to break the client app, we keep the API until the client moves to new APIs. It's ok to delete these API now. Bug: 185448758 Test: manual Test: atest android.translation.cts.UiTranslationManagerTest Change-Id: I5ea71d4658246f52610e1f62412d60c6c58bb31e
Diffstat (limited to 'core/java')
-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}