SELinux: Use custom ADB over network property
* Use a custom system property to trigger the real one, so we avoid
running afoul of any SELinux CTS requirements.
Change-Id: If5e7a275f492631a673284408f1e430a12358380
diff --git a/prebuilt/common/etc/init.local.rc b/prebuilt/common/etc/init.local.rc
index 3868785..e29b015 100644
--- a/prebuilt/common/etc/init.local.rc
+++ b/prebuilt/common/etc/init.local.rc
@@ -139,6 +139,9 @@
keycodes 114 115 116
# adb over network
+on property:adb.network.port=*
+ setprop service.adb.tcp.port ${adb.network.port}
+
on property:service.adb.tcp.port=5555
stop adbd
start adbd
diff --git a/sepolicy/adbd.te b/sepolicy/adbd.te
deleted file mode 100644
index 39a87aa..0000000
--- a/sepolicy/adbd.te
+++ /dev/null
@@ -1 +0,0 @@
-allow adbd adbtcp_prop:property_service set;
diff --git a/sepolicy/property_contexts b/sepolicy/property_contexts
index d6beeb2..ce5c71a 100644
--- a/sepolicy/property_contexts
+++ b/sepolicy/property_contexts
@@ -1,4 +1,4 @@
-service.adb.tcp.port u:object_r:adbtcp_prop:s0
+adb.network.port u:object_r:adbtcp_prop:s0
recovery.perf.mode u:object_r:recovery_prop:s0
adb.secure u:object_r:recovery_prop:s0
cm.userinit.active u:object_r:userinit_prop:s0
diff --git a/sepolicy/shell.te b/sepolicy/shell.te
deleted file mode 100644
index 48b4777..0000000
--- a/sepolicy/shell.te
+++ /dev/null
@@ -1 +0,0 @@
-allow shell adbtcp_prop:property_service set;