Add system service for slices

Will be used to manage permissions and possibly pinned state for slices.

Test: manual
Change-Id: Ie53f4988f817ac5b920087567dbac751e2857dbf
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 33f4e34..4c994b9 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -215,6 +215,9 @@
             "com.android.server.timezone.RulesManagerService$Lifecycle";
     private static final String IOT_SERVICE_CLASS =
             "com.google.android.things.services.IoTSystemService";
+    private static final String SLICE_MANAGER_SERVICE_CLASS =
+            "com.android.server.slice.SliceManagerService$Lifecycle";
+
     private static final String PERSISTENT_DATA_BLOCK_PROP = "ro.frp.pst";
 
     private static final String UNCRYPT_PACKAGE_FILE = "/cache/recovery/uncrypt_file";
@@ -730,6 +733,7 @@
         boolean disableVrManager = SystemProperties.getBoolean("config.disable_vrmanager", false);
         boolean disableCameraService = SystemProperties.getBoolean("config.disable_cameraservice",
                 false);
+        boolean disableSlices = SystemProperties.getBoolean("config.disable_slices", false);
         boolean enableLeftyService = SystemProperties.getBoolean("config.enable_lefty", false);
 
         boolean isEmulator = SystemProperties.get("ro.kernel.qemu").equals("1");
@@ -1523,6 +1527,12 @@
             }
         }
 
+        if (!disableSlices) {
+            traceBeginAndSlog("StartSliceManagerService");
+            mSystemServiceManager.startService(SLICE_MANAGER_SERVICE_CLASS);
+            traceEnd();
+        }
+
         if (!disableCameraService) {
             traceBeginAndSlog("StartCameraServiceProxy");
             mSystemServiceManager.startService(CameraServiceProxy.class);