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