1#
2# Copyright (C) 2016 The Android Open-Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17on init
18    chmod 666 /dev/diag
19
20on post-fs-data
21    # Modem logging collection
22    mkdir /data/vendor/radio 0777 radio radio
23    mkdir /data/vendor/radio/diag_logs 0777 system system
24    rm /data/vendor/radio/diag_logs/logs/diag_poweron_log.qmdl
25    # WLAN logging collection
26    mkdir /data/vendor/wifi 0777 system system
27    mkdir /data/vendor/wifi/cnss_diag 0777 system system
28	mkdir /data/vendor/wifi/wlan_logs 0770 wifi wifi
29
30service diag_mdlog_start /vendor/bin/diag_mdlog
31    class late_start
32    user shell
33    group system diag media_rw
34    socket diag_router stream 0666 system system
35    disabled
36    oneshot
37
38service diag_mdlog_stop /vendor/bin/diag_mdlog -k
39    class late_start
40    user shell
41    group system diag media_rw
42    disabled
43    oneshot
44
45on boot && property:persist.vendor.sys.modem.diag.mdlog=*
46    rm /data/vendor/radio/diag_logs/diag_mdlog_pid
47    setprop vendor.sys.modem.diag.mdlog ${persist.vendor.sys.modem.diag.mdlog}
48
49on property:vendor.sys.modem.diag.mdlog=true
50    start diag_mdlog_start
51
52on property:vendor.sys.modem.diag.mdlog=false
53    start diag_mdlog_stop
54
55on property:persist.vendor.sys.cnss.diag_qxdm=true
56    start vendor.cnss_diag
57
58on property:persist.vendor.sys.cnss.diag_qxdm=false
59    stop vendor.cnss_diag
60
61on property:persist.vendor.sys.cnss.diag_txt=true
62    start vendor.cnss_diag_txt
63
64on property:persist.vendor.sys.cnss.diag_txt=false
65    stop vendor.cnss_diag_txt
66
67service vendor.cnss_diag /vendor/bin/cnss_diag -q -u -w
68    class late_start
69    user system
70    group system
71    disabled
72    oneshot
73
74service vendor.cnss_diag_txt /vendor/bin/cnss_diag -s -f -m /data/vendor/wifi/cnss_diag/cnss_diag.conf
75    class late_start
76    user system
77    group system
78    disabled
79    oneshot
80
81on property:vendor.debug.ramdump.force_crash=true
82    write /proc/sysrq-trigger "c"
83
84on property:ro.vendor.bluetooth.ftm_enabled=true
85    start ftmd
86
87service ftmd /vendor/bin/ftmdaemon
88    class late_start
89    user root
90    group bluetooth net_bt_admin misc diag net_bt
91    disabled
92    oneshot
93
94on property:vendor.sys.logger.bluetooth=true
95   setprop persist.vendor.service.bdroid.snooplog true
96   setprop persist.vendor.service.bdroid.fwsnoop true
97
98on property:vendor.sys.logger.bluetooth=false
99   setprop persist.vendor.service.bdroid.snooplog false
100   setprop persist.vendor.service.bdroid.fwsnoop false
101
102on property:persist.bluetooth.btsnoopenable=true
103   setprop persist.vendor.service.bdroid.soclog true
104
105on property:persist.bluetooth.btsnoopenable=false
106   setprop persist.vendor.service.bdroid.soclog false
107
108on property:vendor.usb.config=*
109   start usbd
110
111on property:persist.vendor.usb.usbradio.config=*
112   start usbd
113