OSDN Git Service

init.sh: disable Bluetooth if no hci interface
authorChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 29 Mar 2018 06:09:28 +0000 (14:09 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 29 Mar 2018 06:09:28 +0000 (14:09 +0800)
This should avoid some unnecessary Bluetooth crashing.

init.sh

diff --git a/init.sh b/init.sh
index 0ae2135..ccd1058 100644 (file)
--- a/init.sh
+++ b/init.sh
@@ -377,6 +377,8 @@ function do_netconsole()
 
 function do_bootcomplete()
 {
 
 function do_bootcomplete()
 {
+       hciconfig | grep -q hci || pm disable com.android.bluetooth
+
        init_cpu_governor
 
        [ -z "$(getprop persist.sys.root_access)" ] && setprop persist.sys.root_access 3
        init_cpu_governor
 
        [ -z "$(getprop persist.sys.root_access)" ] && setprop persist.sys.root_access 3