merge in lmp-release history after reset to c0a9cc2accf22e8e035cd5100f9bb1f65ea92934
diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp
index 1370c33..f53d027 100644
--- a/camera/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp
@@ -670,11 +670,12 @@
         return rc;
     }
 
-    /* Create dummy stream if there is one single raw stream */
+    /* Create dummy stream if there is one single raw or jpeg stream */
     if (streamList->num_streams == 1 &&
             (streamList->streams[0]->format == HAL_PIXEL_FORMAT_RAW_OPAQUE ||
             streamList->streams[0]->format == HAL_PIXEL_FORMAT_RAW10 ||
-            streamList->streams[0]->format == HAL_PIXEL_FORMAT_RAW16)) {
+            streamList->streams[0]->format == HAL_PIXEL_FORMAT_RAW16 ||
+            streamList->streams[0]->format == HAL_PIXEL_FORMAT_BLOB)) {
         mSupportChannel = new QCamera3SupportChannel(
                 mCameraHandle->camera_handle,
                 mCameraHandle->ops,
diff --git a/device.mk b/device.mk
index f65fcc5..3ff80e2 100644
--- a/device.mk
+++ b/device.mk
@@ -222,7 +222,7 @@
     persist.radio.fsg_reload_on=1 \
 
 PRODUCT_PROPERTY_OVERRIDES += \
-    persist.radio.wait_srvcs_time=60 \
+    persist.radio.wait_srvcs_time=60
 
 # Camera configuration
 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
diff --git a/dumpstate/dumpstate.c b/dumpstate/dumpstate.c
index 1b047fd..15e992a 100644
--- a/dumpstate/dumpstate.c
+++ b/dumpstate/dumpstate.c
@@ -19,6 +19,7 @@
 void dumpstate_board()
 {
     dump_file("TZ ramoops annotation", "/sys/fs/pstore/annotate-ramoops");
+    dump_file("Recent panic log", "/sys/fs/pstore/dmesg-ramoops-0");
     dump_file("cpuinfo", "/proc/cpuinfo");
     dump_file("Interrupts", "/proc/interrupts");
     dump_file("Power Management Stats", "/proc/msm_pm_stats");
diff --git a/init.shamu.rc b/init.shamu.rc
index 4e7aa25..738b5ec 100644
--- a/init.shamu.rc
+++ b/init.shamu.rc
@@ -45,7 +45,6 @@
 
 on fs
     mount_all fstab.shamu
-    restorecon_recursive /persist
     setprop ro.crypto.fuse_sdcard true
 
     # Keeping following partitions outside fstab file. As user may not have
@@ -53,7 +52,8 @@
     # results in failure to launch late-start class.
 
     wait /dev/block/platform/msm_sdcc.1/by-name/persist
-    mount ext4 /dev/block/platform/msm_sdcc.1/by-name/persist /persist nosuid nodev barrier=1 defcontext=u:object_r:persist_file:s0
+    mount ext4 /dev/block/platform/msm_sdcc.1/by-name/persist /persist nosuid nodev barrier=1
+    restorecon_recursive /persist
 
     mkdir /fsg 0755 root root
     mount ext4 /dev/block/platform/msm_sdcc.1/by-name/mdm1m9kefs3 /fsg ro nosuid nodev barrier=0
diff --git a/releasetools.py b/releasetools.py
index 11470d4..d6c893e 100644
--- a/releasetools.py
+++ b/releasetools.py
@@ -211,23 +211,11 @@
   tf = target_modem_image
   sf = source_modem_image
 
-  patchfile_name = "radio.modem.img.p"
+  b = common.BlockDifference("modem", common.DataImage(tf.data),
+                             common.DataImage(sf.data))
 
-  diff = common.Difference(tf, sf, diff_program="bsdiff")
-  common.ComputeDifferences([diff])
-  _, _, d = diff.GetPatch()
-  if d is None or len(d) > tf.size * common.OPTIONS.patch_threshold:
-    # computing difference failed, or difference is nearly as
-    # big as the target:  simply send the target.
-    WritePartitionImage(info, tf, "radio")
-  else:
-    common.ZipWriteStr(info.output_zip, patchfile_name, d)
-    info.script.Print("Patching modem image...")
-    radio_type, radio_device = common.GetTypeAndDevice(
-      "/modem", info.info_dict)
-    info.script.ApplyPatch("%s:%s:%d:%s:%d:%s" % (radio_type, radio_device,
-                           sf.size, sf.sha1, tf.size, tf.sha1),
-                           "-", tf.size, tf.sha1, sf.sha1, patchfile_name)
+  b.WriteScript(info.script, info.output_zip)
+
 
 def WriteRadio(info, radio_img):
   info.script.Print("Writing radio...")
diff --git a/sepolicy/file.te b/sepolicy/file.te
index c777a9b..2aa73d3 100644
--- a/sepolicy/file.te
+++ b/sepolicy/file.te
@@ -14,3 +14,4 @@
 type sysfs_smdcntl_open_timeout, fs_type, sysfs_type;
 
 type persist_file, file_type;
+type persist_sensors_file, file_type;
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index 78e09b7..d522a8c 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -47,8 +47,9 @@
 
 /dev/sensors                    u:object_r:sensors_device:s0
 
+
 /dev/socket/adspdsock           u:object_r:adspd_socket:s0
-/dev/socket/sensor_ctl_socket          u:object_r:sensors_socket:s0
+/dev/socket/sensor_ctl_socket   u:object_r:sensors_socket:s0
 
 # Shared memory log
 /dev/smem_log                   u:object_r:shared_log_device:s0
@@ -76,6 +77,10 @@
 
 /dev/v4l-subdev[0-9]*           u:object_r:video_device:s0
 
+# Persist firmware filesystem
+/persist(/.*)?                  u:object_r:persist_file:s0
+/persist/sensors(/.*)?          u:object_r:persist_sensors_file:s0
+
 #/system binaries
 /system/bin/adspd               u:object_r:adspd_exec:s0
 /system/bin/bdAddrLoader        u:object_r:bluetooth_loader_exec:s0
diff --git a/sepolicy/sensors.te b/sepolicy/sensors.te
index b6eb161..950ab0f 100644
--- a/sepolicy/sensors.te
+++ b/sepolicy/sensors.te
@@ -2,12 +2,14 @@
 type sensors, domain;
 type sensors_exec, exec_type, file_type;
 
-# STOPSHIP: Permissive is not allowed. CTS violation!
-permissive sensors;
-
 # Started by init
 init_daemon_domain(sensors)
 
+# drop privileges
+allow sensors self:capability { dac_override sys_nice chown setuid setgid};
+
+allow sensors persist_sensors_file:dir setattr;
+
 allow sensors shared_log_device:chr_file rw_file_perms;
 
 # Access power management controls
@@ -17,3 +19,13 @@
 type_transition sensors socket_device:sock_file sensors_socket "sensor_ctl_socket";
 allow sensors sensors_socket:sock_file create_file_perms;
 allow sensors socket_device:dir { add_name write };
+
+# Wake lock access
+wakelock_use(sensors)
+
+# Access to /persist/sensors
+allow sensors persist_file:dir r_dir_perms;
+allow sensors persist_sensors_file:dir rw_dir_perms;
+allow sensors persist_sensors_file:file create_file_perms;
+
+allow sensors self:socket *;
\ No newline at end of file