Merge "Fix Giffgaff APN" into kk4.4
diff --git a/config/common.mk b/config/common.mk
index d809ed5..2b76597 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -37,13 +37,6 @@
 PRODUCT_COPY_FILES += \
     vendor/slim/prebuilt/common/etc/init.d/50selinuxrelabel:system/etc/init.d/50selinuxrelabel
 
-# Compcache/Zram support
-PRODUCT_COPY_FILES += \
-    vendor/slim/prebuilt/common/bin/compcache:system/bin/compcache \
-    vendor/slim/prebuilt/common/bin/handle_compcache:system/bin/handle_compcache
-
-#LOCAL SLIM CHANGES  - END
-
 # Enable SIP+VoIP on all targets
 PRODUCT_COPY_FILES += \
     frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml
diff --git a/prebuilt/common/bin/compcache b/prebuilt/common/bin/compcache
deleted file mode 100644
index bb3a349..0000000
--- a/prebuilt/common/bin/compcache
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/system/bin/sh
-#
-# Compcache manager
-# shade@chemlab.org (cyanogen)
-#
-
-isramzswap="$(find /system/lib/modules/ -name ramzswap.ko 2>/dev/null)"
-isramzswapbuiltin="$(ls -l /dev/block/ramzswap0 2>/dev/null)"
-
-if [ -n "$isramzswap$isramzswapbuiltin" ] ; then
-    MODULE=ramzswap
-    DEV=/dev/block/ramzswap0
-else
-    DEV=/dev/block/zram0
-    MODULE=zram
-    SYSFS_PATH=/sys/block/zram0
-fi
-
-case "$1" in
-   start)
-      echo 3 > /proc/sys/vm/drop_caches
-      echo 30 > /proc/sys/vm/swappiness
-      modprobe $MODULE
-      if [ $MODULE = ramzswap ]; then
-          rzscontrol $DEV --disksize_kb=$2 --init
-      else
-          echo "$(($2 * 1024))" > $SYSFS_PATH/disksize
-          mkswap $DEV >/dev/null
-      fi
-      swapon $DEV
-   ;;
-
-   stop)
-      swapoff $DEV >/dev/null 2>&1
-      rmmod $MODULE >/dev/null 2>&1
-   ;;
-   stats)
-     if [ $MODULE = ramzswap ]; then
-         rzscontrol $DEV --stats
-     else
-         cd $SYSFS_PATH && for i in * ; do
-             echo -n "$i:" 
-             cat $i
-         done
-     fi
-   ;;
-   *)
-      echo "Usage: $0 {start <size>|stop|stats}"
-      exit 1
-esac
-
-exit 0
-
diff --git a/prebuilt/common/bin/handle_compcache b/prebuilt/common/bin/handle_compcache
deleted file mode 100644
index 21822d0..0000000
--- a/prebuilt/common/bin/handle_compcache
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/system/bin/sh
-#
-# Compcache handler
-# Decides whether or not Compcache is enabled
-#
-MEMTOTAL=$( awk '{ if ($1 eq "MemTotal:") print $2 ;exit }' </proc/meminfo )
-
-if [ `getprop persist.service.zram` == 1 ];
-then
-  PROP=`getprop ro.zram.default`
-  setprop persist.service.zram $PROP
-fi
-
-if [ -e /data/property/persist.service.zram ];
-then
-  PROP=`getprop persist.service.zram`
-else
-  PROP=`getprop ro.zram.default`
-  setprop persist.service.zram $PROP
-fi
-
-if [ $PROP != 0 ]
-then
-  CCSIZE=$(($(($MEMTOTAL * $PROP)) / 100))
-  `dirname $0`/compcache start $CCSIZE
-else
-  `dirname $0`/compcache stop
-fi
-
-exit 0
-
diff --git a/prebuilt/common/etc/init.d/50selinuxrelabel b/prebuilt/common/etc/init.d/50selinuxrelabel
index 2fd4a02..59b3894 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
@@ -18,6 +19,13 @@
   LABELDATA=1
 fi
 
+# Recheck other files under /data
+ls -Z /data/misc/wifi/wpa_supplicant.conf | grep -q "wifi_"
+if [ $? -eq 1 ]; then
+  $L "data is unlabeled, fixing..."
+  LABELDATA=1
+fi
+
 ls -Z /system/bin/surfaceflinger | grep -q unlabeled
 if [ $? -eq 0 ]; then
   $L "system is unlabeled, fixing... (You really should update your recovery)"
@@ -30,6 +38,11 @@
   LABELSYS=1
 fi
 
+ls -Zd /data/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/prebuilt/common/etc/init.local.rc b/prebuilt/common/etc/init.local.rc
index 2aab403..295d630 100644
--- a/prebuilt/common/etc/init.local.rc
+++ b/prebuilt/common/etc/init.local.rc
@@ -32,13 +32,6 @@
     stop adbd
     start adbd
 
-# Compcache - handle at boot
-service compcache /system/bin/handle_compcache
-    class main
-    user root
-    group root
-    oneshot
-
 # sysinit (/system/etc/init.d)
 service sysinit /system/bin/sysinit
     user root
diff --git a/tools/squisher b/tools/squisher
index 2385257..4b4c502 100755
--- a/tools/squisher
+++ b/tools/squisher
@@ -146,7 +146,7 @@
 elif [ "$DEVICELCD" = "320" ]; then
     sed -i 's/ro.sf.lcd_density=320/ro.sf.lcd_density=245/g' $OUT/system/build.prop
 elif [ "$DEVICELCD" = "480" ]; then
-    sed -i 's/ro.sf.lcd_density=480/ro.sf.lcd_density=361/g' $OUT/system/build.prop
+    sed -i 's/ro.sf.lcd_density=480/ro.sf.lcd_density=370/g' $OUT/system/build.prop
 elif [ "$DEVICELCD" = "213" ]; then
     sed -i 's/ro.sf.lcd_density=213/ro.sf.lcd_density=182/g' $OUT/system/build.prop
 fi