init.shamu.rc:  Add "mdm_helper_proxy" to add a vote for mdm to power up

Add mdm_helper_proxy which can vote for MDM to stay powered up in case
of runtime restart (decryption).

It needs to do this only after RIL is running to avoid racing with
mdm_helper proper.

Bug: 17411623 took a long time to camp on network
Change-Id: I88b6d049b673c972d4717fe9f40c2e80cfb33863
diff --git a/init.shamu.rc b/init.shamu.rc
index a445935..16e3f84 100644
--- a/init.shamu.rc
+++ b/init.shamu.rc
@@ -567,3 +567,20 @@
     disabled
     oneshot
     keycodes 114 115 116
+
+service mdm_helper_proxy /system/bin/mdm_helper_proxy
+    class core
+    user system
+    group system
+    disabled
+
+# Stop mdm_helper_proxy in case of shutdown
+on property:sys.shutdown.requested=*
+    stop mdm_helper_proxy
+
+# Start mdm_helper_proxy after RIL.
+on property:ro.mdm_helper_proxy_req=true
+    start mdm_helper_proxy
+
+on property:init.svc.ril-daemon=running
+    setprop ro.mdm_helper_proxy_req true
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index 1760361..7240e24 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -113,6 +113,7 @@
 /system/bin/irsc_util           u:object_r:irsc_util_exec:s0
 /system/bin/ks                  u:object_r:mdm_helper_exec:s0
 /system/bin/mdm_helper          u:object_r:mdm_helper_exec:s0
+/system/bin/mdm_helper_proxy    u:object_r:mdm_helper_exec:s0
 /system/bin/mm-qcamera-daemon   u:object_r:camera_exec:s0
 /system/bin/mpdecision          u:object_r:mpdecision_exec:s0
 /system/bin/netmgrd             u:object_r:netmgrd_exec:s0