summaryrefslogtreecommitdiff
path: root/conf/init.lynx.rc
blob: 154bba4a17ff10207eae96f7abe2049445fdd4e2 (plain)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Lynx specific init.rc
import /vendor/etc/init/hw/init.gs201.rc

on init
    # NFC streset tool name
    setprop persist.vendor.nfc.streset libstreset21
    setprop persist.vendor.se.streset libstreset21
    setprop dalvik.vm.dexopt.thermal-cutoff 1

# When ro.build.flavor=factory_lynx-userdebug, add vendor/bin/factory to default path
on init && property:ro.build.flavor=factory_lynx-userdebug
    export PATH /product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin:/vendor/bin/factory

on early-boot
    # Wait for insmod_sh to finish all common modules
    wait_for_prop vendor.common.modules.ready 1
    start insmod_sh_lynx

service insmod_sh_lynx /vendor/bin/init.insmod.sh /vendor/etc/init.insmod.lynx.cfg
    class main
    user root
    group root system
    disabled
    oneshot

on boot && property:ro.build.flavor=factory_lynx-userdebug
    # FTM log folder
    mkdir /data/ftmlog 0775 system system

    # Audio test folder
    mkdir /data/AudioTest 0775 system system

# Start the twoshay touch service
on property:vendor.device.modules.ready=1
    start twoshay

on property:vendor.mfgapi.touchpanel.permission=1
    chmod 0600 /sys/devices/virtual/sec/tsp/cmd
    chown system system /sys/devices/virtual/sec/tsp/cmd

# Fingerprint
on post-fs-data
    chown system system /dev/goodix_fp
    exec_background - system shell -- /vendor/bin/trusty_apploader /vendor/firmware/g7.app

# SecureElement eSE2 cts mode
on property:persist.vendor.se.ese2.mode=ctsmode
    write /sys/class/st33spi/st33spi/st33spi_state 33

# Allow secure_element group to read / write ST33 SPI state
on post-fs-data
    chown secure_element secure_element  /sys/class/st33spi/st33spi/st33spi_state
    chmod 0660  /sys/class/st33spi/st33spi/st33spi_state

# Wifi
on property:sys.boot_completed=1
    write /sys/bus/platform/drivers/cnss2/qcom,cnss-qca6490/fs_ready 1

on property:vendor.all.modules.ready=1 && property:vendor.all.devices.ready=1
    write /sys/bus/platform/drivers/cnss2/qcom,cnss-qca6490/fs_ready 1
    # Create directories for wifihal services
    mkdir /dev/socket/wifihal 0770 wifi wifi
    chmod 2777 /dev/socket/wifihal
    # Create directories for Location services
    mkdir /dev/socket/location 0770 wifi wifi
    chmod 2777 /dev/socket/location
    mkdir /dev/socket/location/mq 0770 wifi wifi
    chmod 2777 /dev/socket/location/mq
    start vendor.loc_launcher

# Start loc_launcher to launch lowi-server
service vendor.loc_launcher /system/vendor/bin/loc_launcher
    class late_start
    user wifi
    group wifi
    disabled

# Start cnss-daemon for CHRE
service vendor.cnss-daemon /vendor/bin/cnss-daemon -n -l
   class late_start
   user system
   group system inet wifi

# Toggle high_sensitivity according to touch_sensitivity_mode
on property:persist.vendor.touch_sensitivity_mode=0 && property:sys.boot_completed=1
    write /sys/devices/virtual/goog_touch_interface/gti.0/screen_protector_mode_enabled 0

on property:persist.vendor.touch_sensitivity_mode=1 && property:sys.boot_completed=1
    write /sys/devices/virtual/goog_touch_interface/gti.0/screen_protector_mode_enabled 1

# Touch
on property:vendor.device.modules.ready=1
    chown system system /sys/devices/virtual/goog_touch_interface/gti.0/force_active
    chown system system /sys/devices/virtual/goog_touch_interface/gti.0/fw_ver
    chown system system /sys/devices/virtual/goog_touch_interface/gti.0/ms_base
    chown system system /sys/devices/virtual/goog_touch_interface/gti.0/ms_diff
    chown system system /sys/devices/virtual/goog_touch_interface/gti.0/ms_raw
    chown system system /sys/devices/virtual/goog_touch_interface/gti.0/self_test
    chown system system /sys/devices/virtual/goog_touch_interface/gti.0/ss_base
    chown system system /sys/devices/virtual/goog_touch_interface/gti.0/ss_diff
    chown system system /sys/devices/virtual/goog_touch_interface/gti.0/ss_raw

# Override SF and RE uclamps to 0 on boot after being set elsewhere, for adpf cpu hints
on property:sys.boot_completed=1
    trigger override-sf-uclamp

on property:vendor.powerhal.init=*
    write /dev/cpuset/background/cpus ${persist.device_config.vendor_system_native.background_cpuset:-0-3}

on override-sf-uclamp
    write /proc/vendor_sched/rt_uclamp_min 0
    write /proc/vendor_sched/sf_uclamp_min 0

# Route vibrator.adaptive_haptics.enabled to persist
on property:vibrator.adaptive_haptics.enabled=0
    setprop persist.vendor.vibrator.hal.context.enable false

on property:vibrator.adaptive_haptics.enabled=1
    setprop persist.vendor.vibrator.hal.context.enable true