Merge "Don't start AttentionService if not configured"

This commit is contained in:
Alex Salo
2019-03-20 16:20:15 +00:00
committed by Android (Google) Code Review
4 changed files with 30 additions and 8 deletions

View File

@@ -1230,6 +1230,7 @@ public final class SystemServer {
}
startContentCaptureService(context);
startAttentionService(context);
// App prediction manager service
traceBeginAndSlog("StartAppPredictionService");
@@ -1284,10 +1285,6 @@ public final class SystemServer {
traceEnd();
}
traceBeginAndSlog("StartAttentionManagerService");
mSystemServiceManager.startService(AttentionManagerService.class);
traceEnd();
traceBeginAndSlog("StartNetworkScoreService");
mSystemServiceManager.startService(NetworkScoreService.Lifecycle.class);
traceEnd();
@@ -2260,6 +2257,17 @@ public final class SystemServer {
traceEnd();
}
private void startAttentionService(@NonNull Context context) {
if (!AttentionManagerService.isServiceConfigured(context)) {
Slog.d(TAG, "AttentionService is not configured on this device");
return;
}
traceBeginAndSlog("StartAttentionManagerService");
mSystemServiceManager.startService(AttentionManagerService.class);
traceEnd();
}
static final void startSystemUi(Context context, WindowManagerService windowManager) {
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.android.systemui",