Set up StatsCompanionService.java
Introduces StatsCompanionService.java and sets it up as a system service.
This service is a helper for statsd. It will be responsible for setting
and cancelling alarms related to polling stats and anomaly detection.
It currently does not have selinux permission, so must be started
manually (or with selinux temporarily disabled).
Test: disable enforcing selinux, then set and cancel alarms and make
sure they work.
Change-Id: I3bd73acdd998ee424696cce40965134c14220d8f
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 57271fa..d411c74 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -103,6 +103,7 @@
import com.android.server.security.KeyAttestationApplicationIdProviderService;
import com.android.server.security.KeyChainSystemService;
import com.android.server.soundtrigger.SoundTriggerService;
+import com.android.server.stats.StatsCompanionService;
import com.android.server.statusbar.StatusBarManagerService;
import com.android.server.storage.DeviceStorageMonitorService;
import com.android.server.telecom.TelecomLoaderService;
@@ -1536,6 +1537,11 @@
traceEnd();
}
+ // Statsd helper
+ traceBeginAndSlog("StartStatsCompanionService");
+ mSystemServiceManager.startService(StatsCompanionService.Lifecycle.class);
+ traceEnd();
+
// Before things start rolling, be sure we have decided whether
// we are in safe mode.
final boolean safeMode = wm.detectSafeMode();