From 9891861a90807248004153e46d698cedfb19721a Mon Sep 17 00:00:00 2001 From: Lakshman Annadorai Date: Wed, 29 Mar 2023 16:10:57 -0700 Subject: [PATCH] Start CpuMonitorService as part of the core services startup on debuggable builds. - CpuMonitorService is currently used to report the CPU stats for debugging in bugreport. So, enable this service only on debuggable builds. - Once the Android JobScheduler starts using this service, the CpuMonitorService will be started on all builds and not just on debuggable builds. Test: m Bug: 242722241 Change-Id: I8b701c8c1e8bfc35023ca8f4bd6247aa8bf385ab --- services/java/com/android/server/SystemServer.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 492d477fe23a4..b1d613109e09c 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -125,6 +125,7 @@ import com.android.server.compat.PlatformCompatNative; import com.android.server.connectivity.PacProxyService; import com.android.server.contentcapture.ContentCaptureManagerInternal; import com.android.server.coverage.CoverageService; +import com.android.server.cpu.CpuMonitorService; import com.android.server.devicepolicy.DevicePolicyManagerService; import com.android.server.devicestate.DeviceStateManagerService; import com.android.server.display.DisplayManagerService; @@ -1405,6 +1406,15 @@ public final class SystemServer implements Dumpable { mSystemServiceManager.startService(RemoteProvisioningService.class); t.traceEnd(); + // TODO(b/277600174): Start CpuMonitorService on all builds and not just on debuggable + // builds once the Android JobScheduler starts using this service. + if (Build.IS_DEBUGGABLE || Build.IS_ENG) { + // Service for CPU monitor. + t.traceBegin("CpuMonitorService"); + mSystemServiceManager.startService(CpuMonitorService.class); + t.traceEnd(); + } + t.traceEnd(); // startCoreServices }