Cyan_Hsieh | e7cfbb7 | 2021-12-06 17:48:44 +0800 | [diff] [blame] | 1 | # Felix specific init.rc |
| 2 | import /vendor/etc/init/hw/init.gs201.rc |
| 3 | |
Rick Yiu | 3c6c9d7 | 2022-11-03 07:48:38 +0000 | [diff] [blame] | 4 | on init && property:ro.vendor.factory=1 |
| 5 | import /vendor/etc/init/hw/init.factory.rc |
| 6 | |
eddielan | 31db954 | 2022-10-20 11:18:33 +0800 | [diff] [blame] | 7 | # SFPS Fingerprint |
eddielan | a8e685c | 2022-04-27 17:38:38 +0800 | [diff] [blame] | 8 | on post-fs-data |
Cyan_Hsieh | e7cfbb7 | 2021-12-06 17:48:44 +0800 | [diff] [blame] | 9 | chown system system /sys/devices/platform/odm/odm:fp_fpc1020/clk_enable |
| 10 | chown system system /sys/devices/platform/odm/odm:fp_fpc1020/hw_reset |
| 11 | chown system system /sys/devices/platform/odm/odm:fp_fpc1020/irq |
| 12 | chown system system /sys/devices/platform/odm/odm:fp_fpc1020/wakeup_enable |
eddielan | 31db954 | 2022-10-20 11:18:33 +0800 | [diff] [blame] | 13 | |
Cyan_Hsieh | e7cfbb7 | 2021-12-06 17:48:44 +0800 | [diff] [blame] | 14 | # Permissions for hwcomposer |
linpeter | 0bb86b2 | 2022-05-20 10:13:44 +0800 | [diff] [blame] | 15 | on fs |
Cyan_Hsieh | e7cfbb7 | 2021-12-06 17:48:44 +0800 | [diff] [blame] | 16 | chown system system /sys/class/backlight/panel1-backlight/als_table |
| 17 | chown system system /sys/class/backlight/panel1-backlight/brightness |
| 18 | chown system system /sys/class/backlight/panel1-backlight/dimming_on |
| 19 | chown system system /sys/class/backlight/panel1-backlight/hbm_mode |
linpeter | 73fc8f1 | 2022-05-24 19:04:01 +0800 | [diff] [blame] | 20 | chown system system /sys/class/backlight/panel1-backlight/local_hbm_mode |
| 21 | chown system system /sys/devices/platform/exynos-drm/secondary-panel/gamma |
| 22 | chown system system /sys/devices/platform/exynos-drm/secondary-panel/min_vrefresh |
| 23 | chown system system /sys/devices/platform/exynos-drm/secondary-panel/idle_delay_ms |
| 24 | chown system system /sys/devices/platform/exynos-drm/secondary-panel/panel_idle |
| 25 | chown system system /sys/devices/platform/exynos-drm/secondary-panel/panel_need_handle_idle_exit |
| 26 | chown system system /sys/class/dqe1/atc/ambient_light |
| 27 | chown system system /sys/class/dqe1/atc/st |
| 28 | chown system system /sys/class/dqe1/atc/en |
| 29 | chown system system /sys/class/dqe1/atc/lt |
| 30 | chown system system /sys/class/dqe1/atc/ns |
| 31 | chown system system /sys/class/dqe1/atc/dither |
| 32 | chown system system /sys/class/dqe1/atc/pl_w1 |
| 33 | chown system system /sys/class/dqe1/atc/pl_w2 |
| 34 | chown system system /sys/class/dqe1/atc/ctmode |
| 35 | chown system system /sys/class/dqe1/atc/pp_en |
| 36 | chown system system /sys/class/dqe1/atc/upgrade_on |
| 37 | chown system system /sys/class/dqe1/atc/tdr_max |
| 38 | chown system system /sys/class/dqe1/atc/tdr_min |
| 39 | chown system system /sys/class/dqe1/atc/back_light |
| 40 | chown system system /sys/class/dqe1/atc/dstep |
| 41 | chown system system /sys/class/dqe1/atc/scale_mode |
| 42 | chown system system /sys/class/dqe1/atc/threshold_1 |
| 43 | chown system system /sys/class/dqe1/atc/threshold_2 |
| 44 | chown system system /sys/class/dqe1/atc/threshold_3 |
| 45 | chown system system /sys/class/dqe1/atc/gain_limit |
| 46 | chown system system /sys/class/dqe1/atc/lt_calc_ab_shift |
| 47 | chown system system /sys/devices/platform/1c241000.drmdecon/early_wakeup |
| 48 | chmod 0660 /sys/devices/platform/1c241000.drmdecon/early_wakeup |
Cyan_Hsieh | e7cfbb7 | 2021-12-06 17:48:44 +0800 | [diff] [blame] | 49 | |
| 50 | # Touch |
| 51 | on property:vendor.device.modules.ready=1 |
| 52 | chown system input /dev/touch_offload_fts |
| 53 | chown system input /dev/touch_offload_fts_ext |
| 54 | chmod 660 /dev/touch_offload_fts |
| 55 | chmod 660 /dev/touch_offload_fts_ext |
| 56 | # Start the twoshay touch service |
Mark Chang | a73876f | 2022-10-11 06:13:20 +0000 | [diff] [blame] | 57 | start twoshay |
Cyan_Hsieh | e7cfbb7 | 2021-12-06 17:48:44 +0800 | [diff] [blame] | 58 | |
Mason Wang | fd8a7bc | 2022-11-23 08:53:23 +0800 | [diff] [blame] | 59 | # Toggle glove_mode according to touch_sensitivity_mode, only apply to outer panel |
Cyan_Hsieh | e7cfbb7 | 2021-12-06 17:48:44 +0800 | [diff] [blame] | 60 | on property:persist.vendor.touch_sensitivity_mode=0 && property:sys.boot_completed=1 |
Mason Wang | fd8a7bc | 2022-11-23 08:53:23 +0800 | [diff] [blame] | 61 | write /sys/devices/virtual/goog_touch_interface/gti.1/force_active 1 |
| 62 | write /sys/devices/virtual/goog_touch_interface/gti.1/screen_protector_mode_enabled 0 |
| 63 | write /sys/devices/virtual/goog_touch_interface/gti.1/force_active 0 |
Cyan_Hsieh | e7cfbb7 | 2021-12-06 17:48:44 +0800 | [diff] [blame] | 64 | |
| 65 | on property:persist.vendor.touch_sensitivity_mode=1 && property:sys.boot_completed=1 |
Mason Wang | fd8a7bc | 2022-11-23 08:53:23 +0800 | [diff] [blame] | 66 | write /sys/devices/virtual/goog_touch_interface/gti.1/force_active 1 |
| 67 | write /sys/devices/virtual/goog_touch_interface/gti.1/screen_protector_mode_enabled 1 |
| 68 | write /sys/devices/virtual/goog_touch_interface/gti.1/force_active 0 |
Cyan_Hsieh | e7cfbb7 | 2021-12-06 17:48:44 +0800 | [diff] [blame] | 69 | |
| 70 | # Load FPC's internal lib |
| 71 | on init |
| 72 | setprop ro.hardware.fingerprint "fpc" |
| 73 | # NFC streset tool name |
| 74 | setprop persist.vendor.nfc.streset libstreset21 |
| 75 | setprop persist.vendor.se.streset libstreset21 |
Rick Yiu | c6d5bb3 | 2022-11-07 13:52:23 +0000 | [diff] [blame] | 76 | setprop dalvik.vm.dexopt.thermal-cutoff 1 |
Cyan_Hsieh | e7cfbb7 | 2021-12-06 17:48:44 +0800 | [diff] [blame] | 77 | |
| 78 | # When ro.build.flavor=factory_felix-userdebug, add vendor/bin/factory to default path |
| 79 | on init && property:ro.build.flavor=factory_felix-userdebug |
| 80 | 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 |
| 81 | |
| 82 | on early-boot |
| 83 | # Wait for insmod_sh to finish all common modules |
| 84 | wait_for_prop vendor.common.modules.ready 1 |
| 85 | start insmod_sh_felix |
Jenny Ho | 977f246 | 2023-09-26 04:19:47 +0800 | [diff] [blame] | 86 | chown system system /sys/class/power_supply/dualbatt/dbatt_stats |
Cyan_Hsieh | e7cfbb7 | 2021-12-06 17:48:44 +0800 | [diff] [blame] | 87 | |
Adam Shih | 95ddbd2 | 2022-09-06 12:44:21 +0800 | [diff] [blame] | 88 | service insmod_sh_felix /vendor/bin/insmod.sh /vendor/etc/init.insmod.felix.cfg |
Cyan_Hsieh | e7cfbb7 | 2021-12-06 17:48:44 +0800 | [diff] [blame] | 89 | class main |
| 90 | user root |
| 91 | group root system |
| 92 | disabled |
| 93 | oneshot |
| 94 | |
| 95 | on boot && property:ro.build.flavor=factory_felix-userdebug |
| 96 | # FTM log folder |
| 97 | mkdir /data/ftmlog 0775 system system |
| 98 | |
| 99 | # Audio test folder |
| 100 | mkdir /data/AudioTest 0775 system system |
| 101 | |
| 102 | on property:vendor.mfgapi.touchpanel.permission=1 |
| 103 | chmod 0600 /sys/devices/virtual/sec/tsp/cmd |
| 104 | chown system system /sys/devices/virtual/sec/tsp/cmd |
| 105 | |
TeYuan Wang | fd349fa | 2022-12-19 20:14:17 +0800 | [diff] [blame] | 106 | # Thermal |
| 107 | on property:persist.device_config.vendor_system_native_boot.thermal_proactive_skin=1 |
| 108 | setprop vendor.thermal.config "thermal_info_config_proactive_skin.json" |
| 109 | |
TeYuan Wang | b486f5a | 2023-07-07 14:20:25 -0700 | [diff] [blame] | 110 | on property:vendor.thermal.link_ready=1 |
| 111 | write /dev/thermal/tz-by-name/skin_therm/trip_point_1_temp 61000 |
| 112 | write /dev/thermal/tz-by-name/skin_therm/trip_point_2_temp 63000 |
| 113 | |
Cyan_Hsieh | e7cfbb7 | 2021-12-06 17:48:44 +0800 | [diff] [blame] | 114 | # Bluetooth |
| 115 | on post-fs-data |
| 116 | chown bluetooth system /proc/bluetooth/timesync |
| 117 | |
Cyan_Hsieh | 687519c | 2022-02-25 17:40:15 +0800 | [diff] [blame] | 118 | # Speaker amp permission |
| 119 | chmod 644 /mnt/vendor/persist/audio/speaker.cal |
| 120 | |
Cyan_Hsieh | e7cfbb7 | 2021-12-06 17:48:44 +0800 | [diff] [blame] | 121 | # Hall sensor |
| 122 | on init && property:ro.bootmode=normal |
| 123 | write /sys/devices/platform/hall_sensor/enable 0 |
| 124 | |
Rick Chen | 508fa1b | 2023-06-29 15:02:18 +0800 | [diff] [blame] | 125 | on init && property:ro.bootmode=unknown |
| 126 | write /sys/devices/platform/hall_sensor/enable 0 |
| 127 | |
Rick Chen | f73ecea | 2022-04-08 10:53:01 +0800 | [diff] [blame] | 128 | on init && property:ro.bootmode=factory |
| 129 | write /sys/devices/platform/hall_sensor/enable 0 |
| 130 | |
Cyan_Hsieh | e7cfbb7 | 2021-12-06 17:48:44 +0800 | [diff] [blame] | 131 | # SecureElement eSE2 cts mode |
| 132 | on property:persist.vendor.se.ese2.mode=ctsmode |
| 133 | write /sys/class/st33spi/st33spi/st33spi_state 33 |
Cyan_Hsieh | 687519c | 2022-02-25 17:40:15 +0800 | [diff] [blame] | 134 | |
Lily Lin | 8b93bba | 2022-06-13 20:11:47 +0800 | [diff] [blame] | 135 | # Allow secure_element group to read / write ST33 SPI state |
| 136 | on post-fs-data |
| 137 | chown secure_element secure_element /sys/class/st33spi/st33spi/st33spi_state |
| 138 | chmod 0660 /sys/class/st33spi/st33spi/st33spi_state |
| 139 | |
Cyan_Hsieh | 687519c | 2022-02-25 17:40:15 +0800 | [diff] [blame] | 140 | # charger driver exposes now finer grain control, map demo mode to those properties |
| 141 | # NOTE: demo mode can only be exit wiping data (which reset the persist properties) |
| 142 | on property:sys.retaildemo.enabled=1 |
| 143 | setprop persist.vendor.charge.stop.level 35 |
| 144 | setprop persist.vendor.charge.start.level 30 |
Isaac Chiou | bc33412 | 2022-04-12 19:54:23 +0800 | [diff] [blame] | 145 | |
| 146 | # WiFi |
| 147 | on post-fs-data |
| 148 | setprop wifi.direct.interface p2p-dev-wlan0 |
| 149 | setprop wifi.aware.interface aware_nmi0 |
| 150 | |
Cyan_Hsieh | d0fe411 | 2022-09-29 14:24:08 +0800 | [diff] [blame] | 151 | # For Japan sku, always enforce camera shutter sound |
| 152 | # Since this property is read by the audio server in system service, |
| 153 | # it should be written by the system init. |
| 154 | on property:ro.boot.hardware.sku=G0B96 |
| 155 | setprop audio.camerasound.force true |