Software Encryption issue fixed

1. Changing the class for mpdecision from
   default to main. This is required as
   mpdecision access /data folder, so that
   when we start encryption vold signals all
   main services to stop. In the class default
   case mpdecision would still run and keep the
   data partition busy, which would cause the
   encryption to fail.

2. Provide 16K for footer region of data partition
   /data should have 16K data for the encryption footer.
   In "fstab.qcom" we specify this by adding
   "encryptable=footer" option for the /data parition.
   However after factory reset these paritions will
   be wiped out and mounted using the parition tables
   mentioned in "recovery.fstab".
   In this case the /data should again leave the 16K for
   the encryption footer. So "length=-16384" needs to be
   added for the /data parition for the encryption to
   work after factory reset is done. Similarly BoardConfig
   is changed for userdata partition by reducing it by
   16kb.

Change-Id: I188ee4ea959bb8eb791b9387fc6adf299ffdc498
diff --git a/BoardConfig.mk b/BoardConfig.mk
index bb87c6e..d044099 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -72,7 +72,7 @@
 BOARD_BOOTIMAGE_PARTITION_SIZE := 0x01000000
 BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x01000000
 BOARD_SYSTEMIMAGE_PARTITION_SIZE := 838860800
-BOARD_USERDATAIMAGE_PARTITION_SIZE := 5066702848
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 5066686464
 BOARD_CACHEIMAGE_PARTITION_SIZE := 33554432
 BOARD_PERSISTIMAGE_PARTITION_SIZE := 5242880
 BOARD_TOMBSTONESIMAGE_PARTITION_SIZE := 73400320
diff --git a/init.target.rc b/init.target.rc
index 4501691..56070f7 100644
--- a/init.target.rc
+++ b/init.target.rc
@@ -88,6 +88,7 @@
    group root
 
 service mpdecision /system/bin/mpdecision --avg_comp
+   class main
    user root
    disabled
 
diff --git a/recovery.fstab b/recovery.fstab
index e4b056c..e162c3f 100644
--- a/recovery.fstab
+++ b/recovery.fstab
@@ -29,7 +29,7 @@
 
 /dev/block/platform/msm_sdcc.1/by-name/system       /system         ext4    ro,barrier=1                                                    wait
 /dev/block/platform/msm_sdcc.1/by-name/cache        /cache          ext4    noatime,nosuid,nodev,barrier=1,data=ordered                     wait,check
-/dev/block/platform/msm_sdcc.1/by-name/userdata     /data           ext4    noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc     wait,check
+/dev/block/platform/msm_sdcc.1/by-name/userdata     /data           ext4    noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc     wait,check,length=-16384
 /dev/block/mmcblk1p1                              /sdcard           vfat    nosuid,nodev,barrier=1,data=ordered,nodelalloc                  wait
 /dev/block/platform/msm_sdcc.1/by-name/boot         /boot           emmc    defaults                                                        defaults
 /dev/block/platform/msm_sdcc.1/by-name/recovery     /recovery       emmc    defaults                                                        defaults