summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/SystemServer.java
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2019-10-30 14:33:01 -0700
committerXin Li <delphij@google.com>2019-10-30 14:33:01 -0700
commit6f48900f503afcc976a079d8aaed4643e37e75cc (patch)
treead343070a9ef9cacc84e7e00257665d02a058304 /services/java/com/android/server/SystemServer.java
parent02e3db14995c7da89f1ab57d288fd2a6d31082a3 (diff)
parentc5a675dbaadffa7088766fec9b04d2b21cfb6df4 (diff)
DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master
Bug: 142003500 Change-Id: If5056a73ede668b0048ca107b686413695e5b3b6
Diffstat (limited to 'services/java/com/android/server/SystemServer.java')
-rw-r--r--services/java/com/android/server/SystemServer.java35
1 files changed, 23 insertions, 12 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index f465855017cd..b2c9e593c0dc 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -23,6 +23,7 @@ import static android.os.IServiceManager.DUMP_FLAG_PROTO;
import static android.view.Display.DEFAULT_DISPLAY;
import android.annotation.NonNull;
+import android.annotation.StringRes;
import android.app.ActivityThread;
import android.app.INotificationManager;
import android.app.usage.UsageStatsManagerInternal;
@@ -38,6 +39,7 @@ import android.database.sqlite.SQLiteCompatibilityWalFlags;
import android.database.sqlite.SQLiteGlobal;
import android.hardware.display.DisplayManagerInternal;
import android.net.ConnectivityModuleConnector;
+import android.net.Network;
import android.net.NetworkStackClient;
import android.os.BaseBundle;
import android.os.Binder;
@@ -1264,14 +1266,22 @@ public final class SystemServer {
startSystemCaptionsManagerService(context);
// App prediction manager service
- traceBeginAndSlog("StartAppPredictionService");
- mSystemServiceManager.startService(APP_PREDICTION_MANAGER_SERVICE_CLASS);
- traceEnd();
+ if (deviceHasConfigString(context, R.string.config_defaultAppPredictionService)) {
+ traceBeginAndSlog("StartAppPredictionService");
+ mSystemServiceManager.startService(APP_PREDICTION_MANAGER_SERVICE_CLASS);
+ traceEnd();
+ } else {
+ Slog.d(TAG, "AppPredictionService not defined by OEM");
+ }
// Content suggestions manager service
- traceBeginAndSlog("StartContentSuggestionsService");
- mSystemServiceManager.startService(CONTENT_SUGGESTIONS_SERVICE_CLASS);
- traceEnd();
+ if (deviceHasConfigString(context, R.string.config_defaultContentSuggestionsService)) {
+ traceBeginAndSlog("StartContentSuggestionsService");
+ mSystemServiceManager.startService(CONTENT_SUGGESTIONS_SERVICE_CLASS);
+ traceEnd();
+ } else {
+ Slog.d(TAG, "ContentSuggestionsService not defined by OEM");
+ }
traceBeginAndSlog("InitConnectivityModuleConnector");
try {
@@ -2262,10 +2272,13 @@ public final class SystemServer {
}, BOOT_TIMINGS_TRACE_LOG);
}
+ private boolean deviceHasConfigString(@NonNull Context context, @StringRes int resId) {
+ String serviceName = context.getString(resId);
+ return !TextUtils.isEmpty(serviceName);
+ }
+
private void startSystemCaptionsManagerService(@NonNull Context context) {
- String serviceName = context.getString(
- com.android.internal.R.string.config_defaultSystemCaptionsManagerService);
- if (TextUtils.isEmpty(serviceName)) {
+ if (!deviceHasConfigString(context, R.string.config_defaultSystemCaptionsManagerService)) {
Slog.d(TAG, "SystemCaptionsManagerService disabled because resource is not overlaid");
return;
}
@@ -2292,9 +2305,7 @@ public final class SystemServer {
// Then check if OEM overlaid the resource that defines the service.
if (!explicitlyEnabled) {
- final String serviceName = context
- .getString(com.android.internal.R.string.config_defaultContentCaptureService);
- if (TextUtils.isEmpty(serviceName)) {
+ if (!deviceHasConfigString(context, R.string.config_defaultContentCaptureService)) {
Slog.d(TAG, "ContentCaptureService disabled because resource is not overlaid");
return;
}