cm: Add CMAudioService the platform

 * Also brings JNI to CMSDK

Change-Id: I599964a1f9200a8d2ecdad0bb8c4d8593e6d7415
diff --git a/config/cmsdk_common.mk b/config/cmsdk_common.mk
index b1fa533..7856371 100644
--- a/config/cmsdk_common.mk
+++ b/config/cmsdk_common.mk
@@ -1,6 +1,7 @@
 # Permissions for cmsdk services
 PRODUCT_COPY_FILES += \
     vendor/cm/config/permissions/org.cyanogenmod.appsuggest.xml:system/etc/permissions/org.cyanogenmod.appsuggest.xml \
+    vendor/cm/config/permissions/org.cyanogenmod.audio.xml:system/etc/permissions/org.cyanogenmod.audio.xml \
     vendor/cm/config/permissions/org.cyanogenmod.livedisplay.xml:system/etc/permissions/org.cyanogenmod.livedisplay.xml \
     vendor/cm/config/permissions/org.cyanogenmod.livelockscreen.xml:system/etc/permissions/org.cyanogenmod.livelockscreen.xml \
     vendor/cm/config/permissions/org.cyanogenmod.partner.xml:system/etc/permissions/org.cyanogenmod.partner.xml \
@@ -22,6 +23,10 @@
     org.cyanogenmod.hardware \
     org.cyanogenmod.hardware.xml
 
+# JNI Libraries
+PRODUCT_PACKAGES += \
+    libcmsdk_platform_jni
+
 ifndef CM_PLATFORM_SDK_VERSION
   # This is the canonical definition of the SDK version, which defines
   # the set of APIs and functionality available in the platform.  It
diff --git a/config/permissions/org.cyanogenmod.audio.xml b/config/permissions/org.cyanogenmod.audio.xml
new file mode 100644
index 0000000..1a5d122
--- /dev/null
+++ b/config/permissions/org.cyanogenmod.audio.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The CyanogenMod 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.
+-->
+
+<permissions>
+    <!-- The feature listed here coincides with the PerformanceManagerService declared as
+        part of the external cm service init in SystemServer. If this xml isn't present
+        on the device, the service will not be published as a binder service!
+    -->
+    <feature name="org.cyanogenmod.audio" />
+</permissions>
diff --git a/sepolicy/service.te b/sepolicy/service.te
index c839590..c7ad50f 100644
--- a/sepolicy/service.te
+++ b/sepolicy/service.te
@@ -14,3 +14,4 @@
 type cm_livelockscreen_service, system_api_service, system_server_service, service_manager_type;
 type cm_weather_service, system_api_service, system_server_service, service_manager_type;
 type cm_livedisplay_service, system_api_service, system_server_service, service_manager_type;
+type cm_audio_service, system_api_service, system_server_service, service_manager_type;
diff --git a/sepolicy/service_contexts b/sepolicy/service_contexts
index cb76ef1..90f21c9 100644
--- a/sepolicy/service_contexts
+++ b/sepolicy/service_contexts
@@ -14,3 +14,4 @@
 cmlivelockscreen                          u:object_r:cm_livelockscreen_service:s0
 cmweather                                 u:object_r:cm_weather_service:s0
 cmlivedisplay                             u:object_r:cm_livedisplay_service:s0               
+cmaudio                                   u:object_r:cm_audio_service:s0