Merge changes from topic 'adb_shell_prework'

* changes:
  adb: create shell protocol class.
  adb: refactor subprocess code.
  adb: move shell service to a separate file.
diff --git a/adb/Android.mk b/adb/Android.mk
index 81d94ed..b0dcfac 100644
--- a/adb/Android.mk
+++ b/adb/Android.mk
@@ -274,8 +274,6 @@
 
 LOCAL_MODULE := adbd
 
-LOCAL_INIT_RC := adbd.rc
-
 LOCAL_FORCE_STATIC_EXECUTABLE := true
 LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
 LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
diff --git a/adb/adbd.rc b/adb/adbd.rc
deleted file mode 100644
index b91d8b5..0000000
--- a/adb/adbd.rc
+++ /dev/null
@@ -1,14 +0,0 @@
-on post-fs-data
-    mkdir /data/misc/adb 02750 system shell
-    mkdir /data/adb 0700 root root
-
-# adbd is controlled via property triggers in init.<platform>.usb.rc
-service adbd /sbin/adbd --root_seclabel=u:r:su:s0
-    class core
-    socket adbd stream 660 system system
-    disabled
-    seclabel u:r:adbd:s0
-
-# adbd on at boot in emulator
-on property:ro.kernel.qemu=1
-    start adbd
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 7a806f5..5f1169d 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -493,13 +493,3 @@
 service flash_recovery /system/bin/install-recovery.sh
     class main
     oneshot
-
-service uncrypt /system/bin/uncrypt
-    class main
-    disabled
-    oneshot
-
-service pre-recovery /system/bin/uncrypt --reboot
-    class main
-    disabled
-    oneshot
diff --git a/rootdir/init.usb.rc b/rootdir/init.usb.rc
index e290ca4..4e6f2a8 100644
--- a/rootdir/init.usb.rc
+++ b/rootdir/init.usb.rc
@@ -8,6 +8,19 @@
     chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file
     chown system system /sys/class/android_usb/android0/f_rndis/ethaddr
     chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr
+    mkdir /data/misc/adb 02750 system shell
+    mkdir /data/adb 0700 root root
+
+# adbd is controlled via property triggers in init.<platform>.usb.rc
+service adbd /sbin/adbd --root_seclabel=u:r:su:s0
+    class core
+    socket adbd stream 660 system system
+    disabled
+    seclabel u:r:adbd:s0
+
+# adbd on at boot in emulator
+on property:ro.kernel.qemu=1
+    start adbd
 
 # Used to disable USB when switching states
 on property:sys.usb.config=none