1# Tokay specific init.rc
2import /vendor/etc/init/hw/init.${ro.board.platform}.board.rc
3
4on init && property:ro.vendor.factory=1
5    import /vendor/etc/init/hw/init.factory.rc
6
7on init && property:ro.boot.hardware.platform=zuma
8    setprop vendor.powerhal.config powerhint-proto.json
9
10on init
11    # eSE streset tool name
12    setprop persist.vendor.se.streset libstreset24
13# No se_chip_en for P1.0
14on late-init && property:ro.boot.hardware.revision=PROTO1.0
15    setprop persist.vendor.se.reset.chip_en false
16
17on early-boot
18    # Wait for insmod_sh to finish all common modules
19    wait_for_prop vendor.common.modules.ready 1
20    start insmod_sh_tokay
21
22service insmod_sh_tokay /vendor/bin/insmod.sh /vendor_dlkm/etc/init.insmod.${ro.hardware}.cfg
23    class main
24    user root
25    group root system
26    disabled
27    oneshot
28
29on property:vendor.mfgapi.touchpanel.permission=1
30    chmod 0600 /sys/devices/virtual/sec/tsp/cmd
31    chown system system /sys/devices/virtual/sec/tsp/cmd
32
33# WiFi
34on post-fs-data
35    setprop wifi.direct.interface p2p-dev-wlan0
36    setprop wifi.aware.interface aware_nmi0
37
38    # Speaker amp permission
39    chmod 644 /mnt/vendor/persist/audio/speaker.cal
40
41# Bluetooth
42on post-fs-data
43    chown bluetooth system /proc/bluetooth/timesync
44
45# Thermal
46on late-init && property:ro.boot.hardware.revision=PROTO1.0
47    setprop vendor.thermal.config "thermal_info_config_proto.json"
48
49on late-init && property:ro.boot.hardware.revision=PROTO1.1
50    setprop vendor.thermal.config "thermal_info_config_proto.json"
51
52# Toggle high_sensitivity according to touch_sensitivity_mode
53on property:persist.vendor.touch_sensitivity_mode=0 && property:sys.boot_completed=1
54    write /sys/devices/virtual/goog_touch_interface/gti.0/screen_protector_mode_enabled 0
55
56on property:persist.vendor.touch_sensitivity_mode=1 && property:sys.boot_completed=1
57    write /sys/devices/virtual/goog_touch_interface/gti.0/screen_protector_mode_enabled 1
58
59# ODPM
60on early-boot && property:ro.boot.hardware.sku=GUR25
61    write /sys/bus/iio/devices/iio:device0/enabled_rails "CH11=BUCK12S"
62    write /sys/bus/iio/devices/iio:device1/enabled_rails "CH11=BUCK12S"
63on early-boot && property:ro.boot.hardware.sku=G1B60
64    write /sys/bus/iio/devices/iio:device0/enabled_rails "CH11=BUCK12S"
65    write /sys/bus/iio/devices/iio:device1/enabled_rails "CH11=BUCK12S"
66
67# Start the twoshay touch service
68on property:sys.boot_completed=1
69    chown system input /dev/touch_offload
70    chmod 660 /dev/touch_offload
71    start twoshay
72
73# Permissions for display
74on fs
75    # Permission for SSC mode enable
76    chown system system /sys/class/backlight/panel0-backlight/ssc_en
77    chmod 664 /sys/class/backlight/panel0-backlight/ssc_en
78
79# For Japan sku, always enforce camera shutter sound
80# Since this property is read by the audio server in system service,
81# it should be written by the system init.
82on property:ro.boot.hardware.sku=G1B60
83    setprop audio.camerasound.force true
84
85# Check serial no. from specific TK4 devices for audio.
86on property:ro.boot.serialno=*
87    setprop vendor.audio_hal.device.serialno ${ro.boot.serialno}
88