Merge "Add CM Legal (1 of 2)" into cm-11.0
diff --git a/config/common.mk b/config/common.mk
index 609b45d..a4b9420 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -150,8 +150,7 @@
     LockClock \
     CMUpdater \
     CMFota \
-    CMAccount \
-    WhisperPush
+    CMAccount
 
 # CM Hardware Abstraction Framework
 PRODUCT_PACKAGES += \
@@ -273,6 +272,12 @@
     CM_EXTRAVERSION :=
 endif
 
+ifeq ($(CM_BUILDTYPE), UNOFFICIAL)
+    ifneq ($(TARGET_UNOFFICIAL_BUILD_ID),)
+        CM_EXTRAVERSION := "-$(TARGET_UNOFFICIAL_BUILD_ID)"
+    endif
+endif
+
 ifeq ($(CM_BUILDTYPE), RELEASE)
     ifndef TARGET_VENDOR_RELEASE_BUILD_ID
         CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(CM_BUILD)
diff --git a/config/telephony.mk b/config/telephony.mk
index 5f35a4a..cd21f2d 100644
--- a/config/telephony.mk
+++ b/config/telephony.mk
@@ -6,7 +6,8 @@
 PRODUCT_COPY_FILES += \
     vendor/cm/prebuilt/common/etc/spn-conf.xml:system/etc/spn-conf.xml
 
-# SIM Toolkit
+# Telephony packages
 PRODUCT_PACKAGES += \
     Mms \
-    Stk
+    Stk \
+    WhisperPush
diff --git a/overlay/common/frameworks/base/core/res/res/values/config.xml b/overlay/common/frameworks/base/core/res/res/values/config.xml
index 02ac6ab..126d435 100644
--- a/overlay/common/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/common/frameworks/base/core/res/res/values/config.xml
@@ -1,9 +1,20 @@
 <?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <!-- default to disabling the menu key. The CM setting to
-         do this is a no-op unless the below item is true -->
-    <bool name="config_disableMenuKeyInLockScreen">true</bool>
+<!--
+     Copyright (C) 2013 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string-array name="config_locationProviderPackageNames" translatable="false">
         <!-- The Google provider -->
         <item>com.google.android.gms</item>
@@ -11,12 +22,6 @@
         <item>com.android.location.fused</item>
     </string-array>
 
-    <!-- Package name for default keyguard appwidget [DO NOT TRANSLATE] -->
-    <string name="widget_default_package_name">com.cyanogenmod.lockclock</string>
-
-    <!-- Class name for default keyguard appwidget [DO NOT TRANSLATE] -->
-    <string name="widget_default_class_name">com.cyanogenmod.lockclock.ClockWidgetProvider</string>
-
     <bool name="config_cellBroadcastAppLinks">true</bool>
 
     <!-- Disable stock OTA components if installed -->
@@ -26,4 +31,3 @@
         <item>com.google.android.gsf/com.google.android.gsf.update.SystemUpdateService$Receiver</item>
     </string-array>
 </resources>
-
diff --git a/overlay/common/frameworks/base/packages/Keyguard/res/values/config.xml b/overlay/common/frameworks/base/packages/Keyguard/res/values/config.xml
new file mode 100644
index 0000000..b07d685
--- /dev/null
+++ b/overlay/common/frameworks/base/packages/Keyguard/res/values/config.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2013 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <!-- Package name for default keyguard appwidget [DO NOT TRANSLATE] -->
+    <string name="widget_default_package_name">com.cyanogenmod.lockclock</string>
+
+    <!-- Class name for default keyguard appwidget [DO NOT TRANSLATE] -->
+    <string name="widget_default_class_name">com.cyanogenmod.lockclock.ClockWidgetProvider</string>
+
+    <!-- default to disabling the menu key. The CM setting to
+         do this is a no-op unless the below item is true -->
+    <bool name="config_disableMenuKeyInLockScreen">true</bool>
+</resources>
diff --git a/prebuilt/common/etc/init.d/50selinuxrelabel b/prebuilt/common/etc/init.d/50selinuxrelabel
index 2fd4a02..9332f00 100644
--- a/prebuilt/common/etc/init.d/50selinuxrelabel
+++ b/prebuilt/common/etc/init.d/50selinuxrelabel
@@ -10,6 +10,7 @@
 
 LABELDATA=0
 LABELSYS=0
+LABELDALVIKCACHE=0
 
 # Test /data
 ls -Zd /data/system | grep -q unlabeled
@@ -30,6 +31,18 @@
   LABELSYS=1
 fi
 
+ls -Zd /data/dalvik-cache | grep -q unlabeled
+if [ $? -eq 0 ]; then
+  $L "dalvik-cache is unlabeled, fixing..."
+  LABELDALVIKCACHE=1
+fi
+
+ls -Zd /cache/dalvik-cache | grep -q unlabeled
+if [ $? -eq 0 ]; then
+  $L "dalvik-cache is unlabeled, fixing..."
+  LABELDALVIKCACHE=1
+fi
+
 
 if [ $LABELSYS = "1" ]; then
   busybox mount -o remount,rw /system
@@ -47,3 +60,10 @@
   restorecon -R /cache
   $L "/cache relabel complete"
 fi
+
+if [ $LABELDALVIKCACHE = "1" ]; then
+  $L "dalvik-cache relabel starting..."
+  restorecon -R /data/dalvik-cache
+  restorecon -R /cache/dalvik-cache
+  $L "dalvik-cache relabel complete"
+fi
diff --git a/sepolicy/vold.te b/sepolicy/vold.te
index 9877766..3082575 100644
--- a/sepolicy/vold.te
+++ b/sepolicy/vold.te
@@ -5,3 +5,9 @@
 relabelto_domain(vold)
 allow vold labeledfs:filesystem { relabelfrom };
 allow vold sdcard_external:filesystem { relabelfrom relabelto };
+
+# Allow vold to access fuse for fuse-based fs
+allow vold fuse_device:chr_file rw_file_perms;
+
+# NTFS-3g wants to drop permission
+allow vold self:capability { setgid setuid };