allow system server to set log.tag.WifiHAL
On eng and userdebug builds (only), allow system server
to change the value of log.tag.WifiHAL. WifiStateMachine
will set this property to 'D' by default. If/when a user
enables "Developer options -> Enable Wi-Fi Verbose Logging",
WifiStateMachine change log.tag.WifiHAL to 'V'.
BUG=27857554
TEST=manual (see below)
Test detail
1. on user build:
$ adb shell setprop log.tag.WifiHAL V
$ adb shell getprop log.tag.WifiHAL
<blank line>
$ adb bugreport | grep log.tag.WifiHAL
<11>[ 141.918517] init: avc: denied { set } for property=log.tag.WifiHAL pid=4583 uid=2000 gid=2000 scontext=u:r:shell:s0 tcontext=u:object_r:wifi_log_prop:s0 tclass=property_service permissive=0
<11>[ 141.918566] init: sys_prop: permission denied uid:2000 name:log.tag.WifiHAL
2. on userdebug build:
$ adb shell getprop log.tag.WifiHAL
$ <blank line>
$ adb shell setprop log.tag.WifiHAL V
$ adb shell getprop log.tag.WifiHAL
V
3. on userdebug build with modified WifiStateMachine:
$ adb shell getprop log.tag.WifiHAL
D
Change-Id: I9cdd52a2b47a3dd1065262ea8c329130b7b044db
diff --git a/property.te b/property.te
index a7370ae..d2a238b 100644
--- a/property.te
+++ b/property.te
@@ -12,6 +12,7 @@
type system_radio_prop, property_type, core_property_type;
type system_prop, property_type, core_property_type;
type vold_prop, property_type, core_property_type;
+type wifi_log_prop, property_type, log_property_type;
type ctl_bootanim_prop, property_type;
type ctl_default_prop, property_type;
type ctl_dumpstate_prop, property_type;
diff --git a/property_contexts b/property_contexts
index e634165..70a8080 100644
--- a/property_contexts
+++ b/property_contexts
@@ -33,6 +33,7 @@
debug.db. u:object_r:debuggerd_prop:s0
dumpstate. u:object_r:dumpstate_prop:s0
log. u:object_r:log_prop:s0
+log.tag.WifiHAL u:object_r:wifi_log_prop:s0
service.adb.root u:object_r:shell_prop:s0
service.adb.tcp.port u:object_r:shell_prop:s0
diff --git a/shell.te b/shell.te
index ad610b4..d8c6dd4 100644
--- a/shell.te
+++ b/shell.te
@@ -64,6 +64,7 @@
set_prop(shell, debug_prop)
set_prop(shell, powerctl_prop)
userdebug_or_eng(`set_prop(shell, log_prop)')
+userdebug_or_eng(`set_prop(shell, wifi_log_prop)')
# systrace support - allow atrace to run
allow shell debugfs_tracing:dir r_dir_perms;
diff --git a/system_server.te b/system_server.te
index 1d2677e..3c45981 100644
--- a/system_server.te
+++ b/system_server.te
@@ -319,6 +319,7 @@
set_prop(system_server, powerctl_prop)
set_prop(system_server, fingerprint_prop)
set_prop(system_server, device_logging_prop)
+userdebug_or_eng(`set_prop(system_server, wifi_log_prop)')
# ctl interface
set_prop(system_server, ctl_default_prop)