Merge "Migrate Statsd to the apex"
diff --git a/apex/Android.bp b/apex/Android.bp
index 0e93110..3b19692 100644
--- a/apex/Android.bp
+++ b/apex/Android.bp
@@ -22,13 +22,13 @@
     native_shared_libs: [
         "libstats_jni",
     ],
-    // binaries: ["vold"],
+    binaries: ["statsd"],
     java_libs: [
         "framework-statsd",
         "service-statsd",
     ],
     compile_multilib: "both",
-    // prebuilts: ["my_prebuilt"],
+    prebuilts: ["com.android.os.statsd.init.rc"],
     name: "com.android.os.statsd-defaults",
     key: "com.android.os.statsd.key",
     certificate: ":com.android.os.statsd.certificate",
@@ -47,6 +47,12 @@
     certificate: "com.android.os.statsd",
 }
 
+prebuilt_etc {
+    name: "com.android.os.statsd.init.rc",
+    src: "statsd.rc",
+    filename: "init.rc",
+    installable: false,
+}
 
 // JNI library for StatsLog.write
 cc_library_shared {
diff --git a/apex/statsd.rc b/apex/statsd.rc
new file mode 100644
index 0000000..605da2a
--- /dev/null
+++ b/apex/statsd.rc
@@ -0,0 +1,20 @@
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+service statsd /apex/com.android.os.statsd/bin/statsd
+    class main
+    socket statsdw dgram+passcred 0222 statsd statsd
+    user statsd
+    group statsd log
+    writepid /dev/cpuset/system-background/tasks