aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-12-10 03:16:40 -0500
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-03-22 11:45:54 -0700
commit79b05485659b33da05780cd84955d6e8e21a5999 (patch)
treeca2666de1d8650da0a0d49438c357b4829d44fa8
parent7f6d711ee082d06a4f1b9c1a97e9cba83c47beb6 (diff)
msm8916: Call btnvtool using a service
* To get in line with upstream SELinux changes Change-Id: I1e69b2ce4f3850fe3e2746200edb5d3c6a8deb0d
-rw-r--r--rootdir/etc/init.qcom.bt.sh7
-rw-r--r--rootdir/etc/init.qcom.rc7
-rw-r--r--sepolicy/bluetooth_loader.te13
3 files changed, 7 insertions, 20 deletions
diff --git a/rootdir/etc/init.qcom.bt.sh b/rootdir/etc/init.qcom.bt.sh
index 92ff22b..d03e33e 100644
--- a/rootdir/etc/init.qcom.bt.sh
+++ b/rootdir/etc/init.qcom.bt.sh
@@ -51,12 +51,6 @@ failed ()
exit $2
}
-program_bdaddr ()
-{
- /system/bin/btnvtool -O
- logi "Bluetooth Address programmed successfully"
-}
-
#
# enable bluetooth profiles dynamically
#
@@ -215,7 +209,6 @@ kill_hciattach ()
logi "init.qcom.bt.sh config = $config"
case "$config" in
"onboot")
- program_bdaddr
config_bt
exit 0
;;
diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc
index 464eee8..5a10d9a 100644
--- a/rootdir/etc/init.qcom.rc
+++ b/rootdir/etc/init.qcom.rc
@@ -290,6 +290,7 @@ on property:bluetooth.isEnabled=true
write /sys/class/bluetooth/hci0/idle_timeout 7000
on property:vold.decrypt=trigger_restart_framework
+ start config_bt_addr
start config_bluetooth
on property:persist.env.fastdorm.enabled=true
@@ -309,6 +310,12 @@ service rfs_access /system/bin/rfs_access
user system
group system net_raw
+service config_bt_addr /system/bin/btnvtool -O
+ class core
+ user bluetooth
+ group bluetooth radio
+ oneshot
+
service config_bluetooth /system/bin/sh /system/etc/init.qcom.bt.sh "onboot"
class core
user root
diff --git a/sepolicy/bluetooth_loader.te b/sepolicy/bluetooth_loader.te
index 1e59dda..fc2ecca 100644
--- a/sepolicy/bluetooth_loader.te
+++ b/sepolicy/bluetooth_loader.te
@@ -16,15 +16,6 @@ allow bluetooth_loader devpts:chr_file rw_file_perms;
domain_auto_trans(bluetooth_loader, hci_attach_exec, hci_attach)
allow hci_attach bluetooth_loader:fd use;
-# Read mac address from persist partition
-allow bluetooth_loader persist_file:dir search;
-r_dir_file(bluetooth_loader, bluetooth_data_file)
-allow bluetooth_loader self:capability { dac_override dac_read_search chown };
-
-# It may write a random mac here
-allow bluetooth_loader persist_file:dir { add_name write };
-allow bluetooth_loader persist_file:file { create_file_perms };
-
# Talk to init over the property socket
unix_socket_connect(bluetooth_loader, property, init)
# Set persist.service.bdroid.* and bluetooth.* property values
@@ -40,7 +31,3 @@ allow bluetooth_loader hci_attach_dev:chr_file rw_file_perms;
allow bluetooth_loader qmuxd_socket:dir { write add_name remove_name search };
allow bluetooth_loader qmuxd_socket:sock_file { create setattr getattr write unlink };
allow bluetooth_loader qmuxd:unix_stream_socket { connectto };
-
-# btnvtool
-allow bluetooth_loader btnvtool_exec:file rx_file_perms;
-