ronnie
2022-10-14 1504bb53e29d3d46222c0b3ea994fc494b48e153
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
on boot
    # UART device
    chmod 0660 ${persist.vendor.bluetooth_port}
    chown bluetooth net_bt_admin ${persist.vendor.bluetooth_port}
 
    # bluetooth power up/down interface
    chmod 0660 /sys/class/rfkill/rfkill0/state
    chmod 0660 /sys/class/rfkill/rfkill0/type
    chown bluetooth net_bt_admin /sys/class/rfkill/rfkill0/state
    chown bluetooth net_bt_admin /sys/class/rfkill/rfkill0/type
    write /sys/class/rfkill/rfkill0/state 0
 
    # bluetooth MAC address programming
    chown bluetooth net_bt_admin ${ro.bt.bdaddr_path}
 
on property:persist.vendor.overlay.bluetooth_vendor=broadcom
    insmod /vendor/modules/bcm_btlpm.ko
    setprop vendor.init.lpm.load 1
 
on property:persist.vendor.overlay.bluetooth_vendor=realtek
    insmod /vendor/modules/rtl_btlpm.ko
    setprop vendor.init.lpm.load 1
 
on property:persist.vendor.overlay.bluetooth_vendor=xradio
    insmod /vendor/modules/xradio_btlpm.ko assert_level=3
    setprop vendor.init.lpm.load 1
 
on property:persist.vendor.overlay.bluetooth_vendor=sprd
    insmod /vendor/modules/uwe5622_bsp_sdio.ko
    insmod /vendor/modules/sprdbt_tty.ko
    setprop vendor.init.lpm.load 1
 
on property:persist.vendor.overlay.bluetooth_vendor=aic
    insmod /vendor/modules/aic8800_bsp.ko
    insmod /vendor/modules/aic8800_btsdio.ko
    setprop vendor.init.lpm.load 1
 
on property:vendor.driver.lpm.load=1
    setprop vendor.init.lpm.load 1
 
on property:vendor.init.lpm.load=1
    chmod 0660 /proc/bluetooth/sleep/lpm
    chmod 0660 /proc/bluetooth/sleep/btwrite
    chmod 0660 /proc/bluetooth/sleep/btwake
    chown bluetooth net_bt_admin /proc/bluetooth/sleep/lpm
    chown bluetooth net_bt_admin /proc/bluetooth/sleep/btwrite
    chown bluetooth net_bt_admin /proc/bluetooth/sleep/btwake
 
    # only for sprd device
    chmod 0666 /sys/devices/platform/mtty/rfkill/rfkill1/state
    chmod 0666 /sys/devices/platform/mtty/rfkill/rfkill1/type
    chmod 0660 /dev/ttyBT0
    chown bluetooth net_bt_admin /dev/ttyBT0
    # only for aic device
    chmod 0666 /sys/devices/platform/aic-bt/rfkill/rfkill1/state
    chmod 0666 /sys/devices/platform/aic-bt/rfkill/rfkill1/type
 
on property:persist.vendor.overlay.bluetooth_vendor=realtek && property:sys.boot_completed=1
    setprop persist.vendor.bluetooth.rtkcoex true
 
on property:persist.vendor.overlay.bluetooth_vendor=realtek && property:sys.boot_completed=0
    setprop persist.vendor.bluetooth.rtkcoex false
 
on property:persist.vendor.overlay.bluetooth_vendor=xradio && property:vold.post_fs_data_done=1
    mkdir /data/vendor/bluetooth 0771 bluetooth bluetooth
    mkdir /data/vendor/bluetooth/sdd 0770 bluetooth bluetooth