Remove translation service feature.
Currently, the Translation uses feature to determine if we need to start the translation system service. But our case is like the content capture not the autofill, the autofill can have the feature without any service defined and the user can install one later. But translation isn't, we should need to check config instead of feature. The feature will not be used anymore, it's safe to delete it. If we leave the removal to next OS, it is painful to delete it. Bug: 183360041 Test: atest CtsTranslationTestCases Change-Id: Ib6886a17965937abf064e526c36c67428af7398f
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user