Merge "Remove translation service feature." into sc-dev

This commit is contained in:
Joanne Chung
2021-04-12 16:01:05 +00:00
committed by Android (Google) Code Review
4 changed files with 3 additions and 13 deletions

View File

@@ -12733,7 +12733,6 @@ package android.content.pm {
field public static final String FEATURE_TOUCHSCREEN_MULTITOUCH = "android.hardware.touchscreen.multitouch";
field public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT = "android.hardware.touchscreen.multitouch.distinct";
field public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND = "android.hardware.touchscreen.multitouch.jazzhand";
field public static final String FEATURE_TRANSLATION = "android.software.translation";
field public static final String FEATURE_USB_ACCESSORY = "android.hardware.usb.accessory";
field public static final String FEATURE_USB_HOST = "android.hardware.usb.host";
field public static final String FEATURE_VERIFIED_BOOT = "android.software.verified_boot";

View File

@@ -3495,14 +3495,6 @@ public abstract class PackageManager {
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_AUTOFILL = "android.software.autofill";
/**
* Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}:
* The device supports translation of text-to-text in multiple languages via integration with
* the system {@link android.service.translation.TranslationService translation provider}.
*/
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_TRANSLATION = "android.software.translation";
/**
* Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}:
* The device implements headtracking suitable for a VR device.

View File

@@ -18,12 +18,10 @@ package android.view.translation;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresFeature;
import android.annotation.SystemService;
import android.annotation.WorkerThread;
import android.app.PendingIntent;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Handler;
import android.os.Looper;
import android.os.RemoteException;
@@ -53,7 +51,6 @@ import java.util.concurrent.atomic.AtomicInteger;
* the server {@link android.service.translation.TranslationService} </p>
*/
@SystemService(Context.TRANSLATION_MANAGER_SERVICE)
@RequiresFeature(PackageManager.FEATURE_TRANSLATION)
public final class TranslationManager {
private static final String TAG = "TranslationManager";

View File

@@ -2508,10 +2508,12 @@ public final class SystemServer implements Dumpable {
}
// Translation manager service
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_TRANSLATION)) {
if (deviceHasConfigString(context, R.string.config_defaultTranslationService)) {
t.traceBegin("StartTranslationManagerService");
mSystemServiceManager.startService(TRANSLATION_MANAGER_SERVICE_CLASS);
t.traceEnd();
} else {
Slog.d(TAG, "TranslationService not defined by OEM");
}
// NOTE: ClipboardService depends on ContentCapture and Autofill