1# Husky specific init.rc
2import /vendor/etc/init/hw/init.zuma.rc
3
4on init && property:ro.vendor.factory=1
5    import /vendor/etc/init/hw/init.factory.rc
6
7on init
8    # NFC streset tool name
9    setprop persist.vendor.nfc.streset libstreset23
10    setprop persist.vendor.se.streset libstreset23
11
12on early-boot
13    # Wait for insmod_sh to finish all common modules
14    wait_for_prop vendor.common.modules.ready 1
15    start insmod_sh_husky
16
17service insmod_sh_husky /vendor/bin/insmod.sh /vendor_dlkm/etc/init.insmod.${ro.hardware}.cfg
18    class main
19    user root
20    group root system
21    disabled
22    oneshot
23
24on property:vendor.mfgapi.touchpanel.permission=1
25    chmod 0600 /sys/devices/virtual/sec/tsp/cmd
26    chown system system /sys/devices/virtual/sec/tsp/cmd
27
28# Permissions for display
29on fs
30    chown system system /sys/class/backlight/panel0-backlight/acl_mode
31
32# WiFi
33on post-fs-data
34    setprop wifi.direct.interface p2p-dev-wlan0
35    setprop wifi.aware.interface aware_nmi0
36
37    # Speaker amp permission
38    chmod 644 /mnt/vendor/persist/audio/speaker.cal
39    chmod 644 /mnt/vendor/persist/audio/speaker.diag
40
41# Bluetooth
42on post-fs-data
43    chown bluetooth system /proc/bluetooth/timesync
44
45# Start the twoshay touch service
46on property:vendor.device.modules.ready=1
47    start twoshay
48
49# Toggle high_sensitivity according to touch_sensitivity_mode
50on property:persist.vendor.touch_sensitivity_mode=0 && property:sys.boot_completed=1
51    write /sys/devices/virtual/goog_touch_interface/gti.0/screen_protector_mode_enabled 0
52
53on property:persist.vendor.touch_sensitivity_mode=1 && property:sys.boot_completed=1
54    write /sys/devices/virtual/goog_touch_interface/gti.0/screen_protector_mode_enabled 1
55
56# Haptics
57on property:vendor.all.modules.ready=1
58    mkdir /mnt/vendor/persist/haptics 0770 system system
59    chmod 770 /mnt/vendor/persist/haptics
60    chmod 440 /mnt/vendor/persist/haptics/cs40l26.cal
61    chown system system /mnt/vendor/persist/haptics
62    chown system system /mnt/vendor/persist/haptics/cs40l26.cal
63
64    chown system system /sys/bus/i2c/devices/0-0043/calibration/f0_stored
65    chown system system /sys/bus/i2c/devices/0-0043/calibration/q_stored
66    chown system system /sys/bus/i2c/devices/0-0043/calibration/redc_stored
67    chown system system /sys/bus/i2c/devices/0-0043/default/vibe_state
68    chown system system /sys/bus/i2c/devices/0-0043/default/num_waves
69    chown system system /sys/bus/i2c/devices/0-0043/default/f0_offset
70    chown system system /sys/bus/i2c/devices/0-0043/default/owt_free_space
71    chown system system /sys/bus/i2c/devices/0-0043/default/f0_comp_enable
72    chown system system /sys/bus/i2c/devices/0-0043/default/redc_comp_enable
73    chown system system /sys/bus/i2c/devices/0-0043/default/delay_before_stop_playback_us
74    chown system system /sys/bus/i2c/devices/0-0043/dbc/dbc_env_rel_coef
75    chown system system /sys/bus/i2c/devices/0-0043/dbc/dbc_rise_headroom
76    chown system system /sys/bus/i2c/devices/0-0043/dbc/dbc_fall_headroom
77    chown system system /sys/bus/i2c/devices/0-0043/dbc/dbc_enable
78    chown system system /sys/bus/i2c/devices/0-0043/dbc/dbc_tx_lvl_thresh_fs
79    chown system system /sys/bus/i2c/devices/0-0043/dbc/dbc_tx_lvl_hold_off_ms
80    chown system system /sys/bus/i2c/devices/0-0043/default/pm_active_timeout_ms
81
82    enable vendor.vibrator.cs40l26
83
84# For Japan sku, always enforce camera shutter sound
85# Since this property is read by the audio server in system service,
86# it should be written by the system init.
87on property:ro.boot.hardware.sku=GE9DP
88    setprop audio.camerasound.force true
89