├── Android.bp
├── AndroidProducts.mk
├── BoardConfig.mk
├── board-info.txt
├── config.fs
├── configs
├── audio
│ ├── audio_effects.xml
│ ├── audio_platform_info_qrd.xml
│ ├── audio_platform_info_yupikqrd.xml
│ ├── audio_policy_configuration.xml
│ ├── audio_policy_configuration_a2dp_offload_disabled.xml
│ └── mixer_paths_yupikqrd.xml
├── media
│ ├── media_codecs_performance_yupik_v1.xml
│ ├── media_codecs_yupik_v1.xml
│ ├── media_profiles.xml
│ ├── media_profiles_V1_0.xml
│ ├── media_profiles_vendor.xml
│ └── media_profiles_yupik_v1.xml
├── perf
│ └── powerhint.json
├── permissions
│ └── privapp-permissions-hotword.xml
├── public.libraries.txt
├── sensors
│ └── hals.conf
├── vintf
│ ├── manifest.xml
│ └── vendor_framework_compatibility_matrix.xml
└── wifi
│ ├── WCNSS_qcom_cfg.ini
│ ├── p2p_supplicant_overlay.conf
│ └── wpa_supplicant_overlay.conf
├── device.mk
├── extract-files.py
├── lineage.dependencies
├── lineage_Spacewar.mk
├── modules.load
├── modules.load.recovery
├── overlay-lineage
├── lineage-sdk
│ ├── lineage
│ │ └── res
│ │ │ └── res
│ │ │ └── values
│ │ │ └── config.xml
│ └── packages
│ │ └── LineageSettingsProvider
│ │ └── res
│ │ └── values
│ │ └── defaults.xml
└── packages
│ └── apps
│ ├── Aperture
│ └── app
│ │ └── src
│ │ └── main
│ │ └── res
│ │ └── values
│ │ └── config.xml
│ ├── Dialer
│ └── java
│ │ └── com
│ │ └── android
│ │ └── dialer
│ │ └── callrecord
│ │ └── res
│ │ └── values
│ │ └── config.xml
│ └── Settings
│ └── res
│ └── values
│ └── config.xml
├── overlay
├── frameworks
│ └── base
│ │ ├── core
│ │ └── res
│ │ │ └── res
│ │ │ ├── values-land
│ │ │ └── dimens.xml
│ │ │ ├── values
│ │ │ ├── config.xml
│ │ │ └── dimens.xml
│ │ │ └── xml
│ │ │ └── power_profile.xml
│ │ └── packages
│ │ ├── SettingsProvider
│ │ └── res
│ │ │ └── values
│ │ │ └── defaults.xml
│ │ └── SystemUI
│ │ └── res
│ │ ├── values-land
│ │ └── dimens.xml
│ │ └── values
│ │ ├── config.xml
│ │ └── dimens.xml
└── packages
│ ├── apps
│ └── Settings
│ │ └── res
│ │ └── values
│ │ └── config.xml
│ └── services
│ └── Telephony
│ └── res
│ └── values
│ └── config.xml
├── properties
├── odm.prop
├── product.prop
├── system.prop
├── system_ext.prop
└── vendor.prop
├── proprietary-files.txt
├── proprietary-firmware.txt
├── rootdir
├── Android.bp
├── bin
│ ├── init.class_main.sh
│ ├── init.kernel.post_boot.sh
│ ├── init.qcom.sh
│ └── init.qti.kernel.sh
└── etc
│ ├── fstab.default
│ ├── init.qcom.rc
│ ├── init.qti.kernel.rc
│ ├── init.recovery.qcom.rc
│ ├── init.target.rc
│ └── ueventd.qcom.rc
├── rro_overlays
├── CarrierConfigOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── xml
│ │ └── vendor.xml
└── WifiResCommon
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ └── values
│ └── config.xml
├── sensors
├── Android.bp
├── Sensor.cpp
├── Sensor.h
├── SensorsSubHal.cpp
└── SensorsSubHal.h
├── sepolicy
├── private
│ ├── dontaudit.te
│ ├── glyph_app.te
│ ├── odrefresh.te
│ ├── property_contexts
│ └── seapp_contexts
├── public
│ ├── glyph_app.te
│ └── property.te
└── vendor
│ ├── device.te
│ ├── file.te
│ ├── file_contexts
│ ├── genfs_contexts
│ ├── glyph_app.te
│ ├── hal_fingerprint_default.te
│ ├── hal_lineage_health.te
│ ├── hal_lineage_powershare_default.te
│ ├── hal_vibrator_default.te
│ ├── hwservice_contexts
│ ├── property_contexts
│ ├── tee.te
│ ├── vendor_init.te
│ └── vendor_qti_init_shell.te
├── setup-makefiles.py
├── udfps
├── Android.bp
└── UdfpsHandler.cpp
└── vibrator
├── .clang-format
├── Android.bp
├── Vibrator.cpp
├── Vibrator.h
├── aac_vibra_function.h
├── android.hardware.vibrator.service.spacewar.rc
├── android.hardware.vibrator.service.spacewar.xml
└── service.cpp
/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2021-2024 The LineageOS Project
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 | //
6 |
7 | soong_namespace {
8 | imports: [
9 | "hardware/nothing",
10 | "hardware/google/interfaces",
11 | "hardware/google/pixel",
12 | "vendor/nothing/Spacewar",
13 | ],
14 | }
15 |
16 | install_symlink {
17 | name: "firmware_WCNSS_qcom_cfg.ini_symlink",
18 | vendor: true,
19 | installed_location: "firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini",
20 | symlink_target: "/vendor/etc/wifi/qca6750/WCNSS_qcom_cfg.ini",
21 | }
22 |
--------------------------------------------------------------------------------
/AndroidProducts.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2022 The LineageOS Project
3 | #
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 |
7 | PRODUCT_MAKEFILES := \
8 | $(LOCAL_DIR)/lineage_Spacewar.mk
9 |
--------------------------------------------------------------------------------
/BoardConfig.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2022-2025 The LineageOS Project
3 | #
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 |
7 | DEVICE_PATH := device/nothing/Spacewar
8 |
9 | # A/B
10 | AB_OTA_PARTITIONS += \
11 | boot \
12 | dtbo \
13 | odm \
14 | product \
15 | system \
16 | system_ext \
17 | vbmeta \
18 | vbmeta_system \
19 | vendor \
20 | vendor_dlkm \
21 | vendor_boot
22 |
23 | # Architecture
24 | TARGET_ARCH := arm64
25 | TARGET_ARCH_VARIANT := armv8-2a-dotprod
26 | TARGET_CPU_ABI := arm64-v8a
27 | TARGET_CPU_ABI2 :=
28 | TARGET_CPU_VARIANT := cortex-a76
29 |
30 | TARGET_2ND_ARCH := arm
31 | TARGET_2ND_ARCH_VARIANT := armv8-a
32 | TARGET_2ND_CPU_ABI := armeabi-v7a
33 | TARGET_2ND_CPU_ABI2 := armeabi
34 | TARGET_2ND_CPU_VARIANT := cortex-a76
35 |
36 | # Bootloader
37 | TARGET_BOOTLOADER_BOARD_NAME := Spacewar
38 | TARGET_NO_BOOTLOADER := true
39 |
40 | # Kernel
41 | BOARD_BOOT_HEADER_VERSION := 3
42 | BOARD_KERNEL_CMDLINE := \
43 | androidboot.hardware=qcom \
44 | androidboot.memcg=1 \
45 | lpm_levels.sleep_disabled=1 \
46 | service_locator.enable=1 \
47 | androidboot.usbcontroller=a600000.dwc3 \
48 | swiotlb=0 \
49 | loop.max_part=7 \
50 | cgroup.memory=nokmem,nosocket \
51 | pcie_ports=compat \
52 | iptable_raw.raw_before_defrag=1 \
53 | ip6table_raw.raw_before_defrag=1
54 |
55 | BOARD_KERNEL_IMAGE_NAME := Image
56 | BOARD_KERNEL_BASE := 0x00000000
57 | BOARD_KERNEL_PAGESIZE := 4096
58 | BOARD_KERNEL_SEPARATED_DTBO := true
59 | BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION)
60 | BOARD_RAMDISK_USE_LZ4 := true
61 | TARGET_KERNEL_SOURCE := kernel/nothing/sm7325
62 | TARGET_KERNEL_CONFIG := vendor/lahaina-qgki_defconfig vendor/debugfs.config
63 | TARGET_KERNEL_NO_GCC := true
64 |
65 | BOARD_VENDOR_KERNEL_MODULES_LOAD := $(strip $(shell cat $(DEVICE_PATH)/modules.load))
66 | BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD := $(strip $(shell cat $(DEVICE_PATH)/modules.load.recovery))
67 | BOOT_KERNEL_MODULES := $(BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD)
68 | TARGET_MODULE_ALIASES += wlan.ko:qca_cld3_qca6750.ko
69 |
70 | # Platform
71 | TARGET_BOARD_PLATFORM := lahaina
72 |
73 | # ANT+
74 | BOARD_ANT_WIRELESS_DEVICE := "qualcomm-hidl"
75 |
76 | # Audio
77 | AUDIO_FEATURE_ENABLED_DLKM := true
78 | AUDIO_FEATURE_ENABLED_EXTENDED_COMPRESS_FORMAT := true
79 | AUDIO_FEATURE_ENABLED_GEF_SUPPORT := true
80 | AUDIO_FEATURE_ENABLED_GKI := true
81 | AUDIO_FEATURE_ENABLED_INSTANCE_ID := true
82 | AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true
83 | AUDIO_FEATURE_ENABLED_SSR := true
84 | AUDIO_FEATURE_ENABLED_SVA_MULTI_STAGE := true
85 | BOARD_SUPPORTS_OPENSOURCE_STHAL := true
86 | BOARD_SUPPORTS_SOUND_TRIGGER := true
87 | BOARD_USES_ALSA_AUDIO := true
88 |
89 | # Display
90 | TARGET_SCREEN_DENSITY := 420
91 | TARGET_RECOVERY_UI_MARGIN_HEIGHT := 107
92 | TARGET_USES_COLOR_METADATA := true
93 | TARGET_USES_DISPLAY_RENDER_INTENTS := true
94 |
95 | # Filesystem
96 | TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/config.fs
97 |
98 | # Fingerprint
99 | TARGET_USES_FOD_ZPOS := true
100 |
101 | # HIDL
102 | DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \
103 | $(DEVICE_PATH)/configs/vintf/vendor_framework_compatibility_matrix.xml \
104 | hardware/qcom-caf/common/vendor_framework_compatibility_matrix.xml \
105 | vendor/lineage/config/device_framework_matrix.xml
106 | DEVICE_MATRIX_FILE := hardware/qcom-caf/common/compatibility_matrix.xml
107 | DEVICE_MANIFEST_FILE := $(DEVICE_PATH)/configs/vintf/manifest.xml
108 |
109 | # Metadata
110 | BOARD_USES_METADATA_PARTITION := true
111 |
112 | # Partitions
113 | -include vendor/lineage/config/BoardConfigReservedSize.mk
114 | BOARD_BOOTIMAGE_PARTITION_SIZE := 100663296
115 | BOARD_DTBOIMG_PARTITION_SIZE := 25165824
116 | BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 100663296
117 |
118 | BOARD_SUPER_PARTITION_SIZE := 6442450944
119 | BOARD_SUPER_PARTITION_GROUPS := qti_dynamic_partitions
120 | BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST := odm product system system_ext vendor vendor_dlkm
121 | BOARD_QTI_DYNAMIC_PARTITIONS_SIZE := 6438256640
122 |
123 | BOARD_FLASH_BLOCK_SIZE := 262144
124 |
125 | BOARD_ODMIMAGE_FILE_SYSTEM_TYPE := erofs
126 | BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
127 | BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
128 | BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := erofs
129 | BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE := erofs
130 |
131 | TARGET_COPY_OUT_ODM := odm
132 | TARGET_COPY_OUT_PRODUCT := product
133 | TARGET_COPY_OUT_SYSTEM_EXT := system_ext
134 | TARGET_COPY_OUT_VENDOR := vendor
135 | TARGET_COPY_OUT_VENDOR_DLKM := vendor_dlkm
136 |
137 | # Properties
138 | TARGET_ODM_PROP += $(DEVICE_PATH)/properties/odm.prop
139 | TARGET_PRODUCT_PROP += $(DEVICE_PATH)/properties/product.prop
140 | TARGET_SYSTEM_EXT_PROP += $(DEVICE_PATH)/properties/system_ext.prop
141 | TARGET_SYSTEM_PROP += $(DEVICE_PATH)/properties/system.prop
142 | TARGET_VENDOR_PROP += $(DEVICE_PATH)/properties/vendor.prop
143 |
144 | # QCOM
145 | BOARD_USES_QCOM_HARDWARE := true
146 |
147 | # Recovery
148 | BOARD_INCLUDE_DTB_IN_BOOTIMG := true
149 | BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT := true
150 | TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.default
151 | TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888
152 | TARGET_USERIMAGES_USE_EXT4 := true
153 | TARGET_USERIMAGES_USE_F2FS := true
154 |
155 | # RIL
156 | ENABLE_VENDOR_RIL_SERVICE := true
157 |
158 | # Security patch level
159 | VENDOR_SECURITY_PATCH := 2025-03-03
160 |
161 | # SELinux
162 | include device/qcom/sepolicy_vndr/SEPolicy.mk
163 |
164 | BOARD_VENDOR_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor
165 | SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/public
166 | SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/private
167 |
168 | # Verified Boot
169 | BOARD_AVB_ENABLE := true
170 | BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3
171 | BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT := true
172 |
173 | BOARD_AVB_VBMETA_SYSTEM := product system system_ext
174 | BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA4096
175 | BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
176 | BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
177 | BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 1
178 |
179 | # WiFi
180 | BOARD_WLAN_DEVICE := qcwcn
181 | BOARD_HOSTAPD_DRIVER := NL80211
182 | BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
183 | BOARD_WPA_SUPPLICANT_DRIVER := NL80211
184 | BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
185 | BOARD_WPA_SUPPLICANT_PRIVATE_LIB_EVENT := "ON"
186 | WIFI_DRIVER_STATE_CTRL_PARAM := "/dev/wlan"
187 | WIFI_DRIVER_STATE_OFF := "OFF"
188 | WIFI_DRIVER_STATE_ON := "ON"
189 | WIFI_HIDL_FEATURE_AWARE := true
190 | WIFI_HIDL_FEATURE_DUAL_INTERFACE := true
191 | WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true
192 | WPA_SUPPLICANT_VERSION := VER_0_8_X
193 |
194 | CONFIG_IEEE80211AC := true
195 | CONFIG_IEEE80211AX := true
196 |
197 | # Include the proprietary files BoardConfig.
198 | include vendor/nothing/Spacewar/BoardConfigVendor.mk
199 |
--------------------------------------------------------------------------------
/board-info.txt:
--------------------------------------------------------------------------------
1 | require board=lahaina|Spacewar
2 |
--------------------------------------------------------------------------------
/config.fs:
--------------------------------------------------------------------------------
1 | [AID_VENDOR_QTI_DIAG]
2 | value:2901
3 |
4 | [AID_VENDOR_QDSS]
5 | value:2902
6 |
7 | [AID_VENDOR_RFS]
8 | value:2903
9 |
10 | [AID_VENDOR_RFS_SHARED]
11 | value:2904
12 |
13 | [AID_VENDOR_ADPL_ODL]
14 | value:2905
15 |
16 | [AID_VENDOR_QRTR]
17 | value:2906
18 |
19 | [AID_VENDOR_THERMAL]
20 | value:2907
21 |
22 | [AID_VENDOR_FASTRPC]
23 | value:2908
24 |
25 | [AID_VENDOR_QTR]
26 | value:2909
27 |
28 | [vendor/bin/wcnss_filter]
29 | mode: 0755
30 | user: AID_BLUETOOTH
31 | group: AID_BLUETOOTH
32 | caps: BLOCK_SUSPEND
33 |
34 | [system/vendor/bin/wcnss_filter]
35 | mode: 0755
36 | user: AID_BLUETOOTH
37 | group: AID_BLUETOOTH
38 | caps: BLOCK_SUSPEND
39 |
40 | [vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
41 | mode: 0755
42 | user: AID_BLUETOOTH
43 | group: AID_BLUETOOTH
44 | caps: BLOCK_SUSPEND NET_ADMIN
45 |
46 | [system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
47 | mode: 0755
48 | user: AID_SYSTEM
49 | group: AID_SYSTEM
50 | caps: BLOCK_SUSPEND NET_ADMIN
51 |
52 | [vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy]
53 | mode: 0755
54 | user: AID_BLUETOOTH
55 | group: AID_BLUETOOTH
56 | caps: BLOCK_SUSPEND NET_ADMIN
57 |
58 | [system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy]
59 | mode: 0755
60 | user: AID_SYSTEM
61 | group: AID_SYSTEM
62 | caps: BLOCK_SUSPEND NET_ADMIN
63 |
64 | [system/bin/cnss-daemon]
65 | mode: 0755
66 | user: AID_BLUETOOTH
67 | group: AID_BLUETOOTH
68 | caps: NET_BIND_SERVICE
69 |
70 | [vendor/bin/pm-service]
71 | mode: 0755
72 | user: AID_SYSTEM
73 | group: AID_SYSTEM
74 | caps: NET_BIND_SERVICE
75 |
76 | [system/vendor/bin/pm-service]
77 | mode: 0755
78 | user: AID_SYSTEM
79 | group: AID_SYSTEM
80 | caps: NET_BIND_SERVICE
81 |
82 | [system/bin/pm-service]
83 | mode: 0755
84 | user: AID_SYSTEM
85 | group: AID_SYSTEM
86 | caps: NET_BIND_SERVICE
87 |
88 | [vendor/bin/pd-mapper]
89 | mode: 0755
90 | user: AID_SYSTEM
91 | group: AID_SYSTEM
92 | caps: NET_BIND_SERVICE
93 |
94 | [system/vendor/bin/pd-mapper]
95 | mode: 0755
96 | user: AID_SYSTEM
97 | group: AID_SYSTEM
98 | caps: NET_BIND_SERVICE
99 |
100 | [system/bin/pd-mapper]
101 | mode: 0755
102 | user: AID_SYSTEM
103 | group: AID_SYSTEM
104 | caps: NET_BIND_SERVICE
105 |
106 | [vendor/bin/imsdatadaemon]
107 | mode: 0755
108 | user: AID_RADIO
109 | group: AID_RADIO
110 | caps: NET_BIND_SERVICE
111 |
112 | [system/vendor/bin/imsdatadaemon]
113 | mode: 0755
114 | user: AID_RADIO
115 | group: AID_RADIO
116 | caps: NET_BIND_SERVICE
117 |
118 | [vendor/bin/ims_rtp_daemon]
119 | mode: 0755
120 | user: AID_RADIO
121 | group: AID_RADIO
122 | caps: NET_BIND_SERVICE
123 |
124 | [system/vendor/bin/ims_rtp_daemon]
125 | mode: 0755
126 | user: AID_RADIO
127 | group: AID_RADIO
128 | caps: NET_BIND_SERVICE
129 |
130 | [vendor/bin/imsrcsd]
131 | mode: 0755
132 | user: AID_RADIO
133 | group: AID_RADIO
134 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
135 |
136 | [system/vendor/bin/imsrcsd]
137 | mode: 0755
138 | user: AID_RADIO
139 | group: AID_RADIO
140 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
141 |
142 | [vendor/bin/imsdaemon]
143 | mode: 0755
144 | user: AID_RADIO
145 | group: AID_RADIO
146 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
147 |
148 | [vendor/bin/cnd]
149 | mode: 0755
150 | user: AID_SYSTEM
151 | group: AID_SYSTEM
152 | caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN
153 |
154 | [system/vendor/bin/cnd]
155 | mode: 0755
156 | user: AID_SYSTEM
157 | group: AID_SYSTEM
158 | caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN
159 |
160 | [vendor/bin/slim_daemon]
161 | mode: 0755
162 | user: AID_GPS
163 | group: AID_GPS
164 | caps: NET_BIND_SERVICE
165 |
166 | [system/vendor/bin/slim_daemon]
167 | mode: 0755
168 | user: AID_GPS
169 | group: AID_GPS
170 | caps: NET_BIND_SERVICE
171 |
172 | [vendor/bin/loc_launcher]
173 | mode: 0755
174 | user: AID_GPS
175 | group: AID_GPS
176 | caps: SETUID SETGID
177 |
178 | [system/vendor/bin/loc_launcher]
179 | mode: 0755
180 | user: AID_GPS
181 | group: AID_GPS
182 | caps: SETUID SETGID
183 |
184 | [vendor/bin/xtwifi-client]
185 | mode: 0755
186 | user: AID_GPS
187 | group: AID_GPS
188 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
189 |
190 | [vendor/bin/sensors.qti]
191 | mode: 0755
192 | user: AID_SYSTEM
193 | group: AID_SYSTEM
194 | caps: NET_BIND_SERVICE
195 |
196 | [firmware/]
197 | mode: 0771
198 | user: AID_SYSTEM
199 | group: AID_SYSTEM
200 | caps: 0
201 |
202 | [firmware/image/*]
203 | mode: 0771
204 | user: AID_SYSTEM
205 | group: AID_SYSTEM
206 | caps: 0
207 |
208 | [vendor/firmware_mnt/image/*]
209 | mode: 0771
210 | user: AID_SYSTEM
211 | group: AID_SYSTEM
212 | caps: 0
213 |
214 | [bt_firmware/]
215 | mode: 0771
216 | user: AID_SYSTEM
217 | group: AID_SYSTEM
218 | caps: 0
219 |
220 | [persist/]
221 | mode: 0771
222 | user: AID_SYSTEM
223 | group: AID_SYSTEM
224 | caps: 0
225 |
226 | [dsp/]
227 | mode: 0771
228 | user: AID_MEDIA
229 | group: AID_MEDIA
230 | caps: 0
231 |
--------------------------------------------------------------------------------
/configs/audio/audio_effects.xml:
--------------------------------------------------------------------------------
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 |
111 |
112 |
113 |
114 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
--------------------------------------------------------------------------------
/configs/media/media_codecs_performance_yupik_v1.xml:
--------------------------------------------------------------------------------
1 |
2 |
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 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
--------------------------------------------------------------------------------
/configs/media/media_codecs_yupik_v1.xml:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 |
44 |
45 |
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 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
--------------------------------------------------------------------------------
/configs/perf/powerhint.json:
--------------------------------------------------------------------------------
1 | {
2 | "Nodes": [
3 | {
4 | "Name": "CPULittleClusterMaxFreq",
5 | "Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq",
6 | "Values": [
7 | "9999999",
8 | "1516800"
9 | ],
10 | "DefaultIndex": 0,
11 | "ResetOnInit": true
12 | },
13 | {
14 | "Name": "CPULittleClusterMinFreq",
15 | "Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq",
16 | "Values": [
17 | "9999999",
18 | "1324800",
19 | "691200"
20 | ],
21 | "ResetOnInit": true
22 | },
23 | {
24 | "Name": "CPUBigClusterMaxFreq",
25 | "Path": "/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq",
26 | "Values": [
27 | "9999999",
28 | "1651200"
29 | ],
30 | "DefaultIndex": 0,
31 | "ResetOnInit": true
32 | },
33 | {
34 | "Name": "CPUBigClusterMinFreq",
35 | "Path": "/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq",
36 | "Values": [
37 | "9999999",
38 | "1516800",
39 | "691200"
40 | ],
41 | "ResetOnInit": true
42 | },
43 | {
44 | "Name": "CPUBigPlusClusterMaxFreq",
45 | "Path": "/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq",
46 | "Values": [
47 | "9999999",
48 | "1516800"
49 | ],
50 | "DefaultIndex": 0,
51 | "ResetOnInit": true
52 | },
53 | {
54 | "Name": "CPUBigPlusClusterMinFreq",
55 | "Path": "/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq",
56 | "Values": [
57 | "9999999",
58 | "806400"
59 | ],
60 | "ResetOnInit": true
61 | },
62 | {
63 | "Name": "UclampTAMin",
64 | "Path": "/dev/cpuctl/top-app/cpu.uclamp.min",
65 | "Values": [
66 | "0",
67 | "30",
68 | "50"
69 | ],
70 | "DefaultIndex": 0,
71 | "ResetOnInit": true
72 | },
73 | {
74 | "Name": "SchedBoost",
75 | "Path": "/proc/sys/kernel/sched_boost",
76 | "Values": [
77 | "2",
78 | "1",
79 | "0"
80 | ],
81 | "ResetOnInit": true
82 | },
83 | {
84 | "Name": "GPUMaxFreq",
85 | "Path": "/sys/class/kgsl/kgsl-3d0/max_pwrlevel",
86 | "Values": [
87 | "0",
88 | "2"
89 | ],
90 | "Comments": [
91 | "0 => 550000000",
92 | "2 => 320000000"
93 | ],
94 | "DefaultIndex": 0,
95 | "ResetOnInit": true
96 | },
97 | {
98 | "Name": "GPUMinFreq",
99 | "Path": "/sys/class/kgsl/kgsl-3d0/min_pwrlevel",
100 | "Values": [
101 | "1",
102 | "3"
103 | ],
104 | "Comments": [
105 | "1 => 450000000",
106 | "3 => 180000000"
107 | ],
108 | "ResetOnInit": true
109 | },
110 | {
111 | "Name": "GPUForceRailOn",
112 | "Path": "/sys/class/kgsl/kgsl-3d0/force_rail_on",
113 | "Values": [
114 | "1",
115 | "0"
116 | ],
117 | "ResetOnInit": true
118 | },
119 | {
120 | "Name": "GPUForceClkOn",
121 | "Path": "/sys/class/kgsl/kgsl-3d0/force_clk_on",
122 | "Values": [
123 | "1",
124 | "0"
125 | ],
126 | "ResetOnInit": true
127 | },
128 | {
129 | "Name": "GPUIdleTimer",
130 | "Path": "/sys/class/kgsl/kgsl-3d0/idle_timer",
131 | "Values": [
132 | "10000",
133 | "58"
134 | ],
135 | "ResetOnInit": true
136 | },
137 | {
138 | "Name": "CPUBWHystTriggerCount",
139 | "Path": "/sys/class/devfreq/soc:qcom,cpu-cpu-llcc-bw/bw_hwmon/hyst_trigger_count",
140 | "Values": [
141 | "0",
142 | "3"
143 | ],
144 | "ResetOnInit": true
145 | },
146 | {
147 | "Name": "CPUBWHistMemory",
148 | "Path": "/sys/class/devfreq/soc:qcom,cpu-cpu-llcc-bw/bw_hwmon/hist_memory",
149 | "Values": [
150 | "0",
151 | "20"
152 | ],
153 | "ResetOnInit": true
154 | },
155 | {
156 | "Name": "CPUBWHystLength",
157 | "Path": "/sys/class/devfreq/soc:qcom,cpu-cpu-llcc-bw/bw_hwmon/hyst_length",
158 | "Values": [
159 | "0",
160 | "10"
161 | ],
162 | "ResetOnInit": true
163 | },
164 | {
165 | "Name": "CPUBWMinFreq",
166 | "Path": "/sys/class/devfreq/soc:qcom,cpu-cpu-llcc-bw/min_freq",
167 | "Values": [
168 | "16265",
169 | "7110",
170 | "2288"
171 | ],
172 | "ResetOnInit": true
173 | },
174 | {
175 | "Name": "LLCCBWMinFreq",
176 | "Path": "/sys/class/devfreq/soc:qcom,cpu-llcc-ddr-bw/min_freq",
177 | "Values": [
178 | "12191",
179 | "5931",
180 | "762"
181 | ],
182 | "ResetOnInit": true
183 | },
184 | {
185 | "Name": "PowerHALMainState",
186 | "Path": "vendor.powerhal.state",
187 | "Values": [
188 | "SUSTAINED_PERFORMANCE",
189 | ""
190 | ],
191 | "Type": "Property"
192 | },
193 | {
194 | "Name": "PowerHALRenderingState",
195 | "Path": "vendor.powerhal.rendering",
196 | "Values": [
197 | "EXPENSIVE_RENDERING",
198 | ""
199 | ],
200 | "Type": "Property"
201 | }
202 | ],
203 | "Actions": [
204 | {
205 | "PowerHint": "INTERACTION",
206 | "Node": "UclampTAMin",
207 | "Duration": 0,
208 | "Value": "30"
209 | },
210 | {
211 | "PowerHint": "INTERACTION",
212 | "Node": "CPULittleClusterMinFreq",
213 | "Duration": 0,
214 | "Value": "1324800"
215 | },
216 | {
217 | "PowerHint": "INTERACTION",
218 | "Node": "CPUBigClusterMinFreq",
219 | "Duration": 0,
220 | "Value": "1516800"
221 | },
222 | {
223 | "PowerHint": "INTERACTION",
224 | "Node": "SchedBoost",
225 | "Duration": 0,
226 | "Value": "2"
227 | },
228 | {
229 | "PowerHint": "INTERACTION",
230 | "Node": "CPUBWHystTriggerCount",
231 | "Duration": 0,
232 | "Value": "0"
233 | },
234 | {
235 | "PowerHint": "INTERACTION",
236 | "Node": "CPUBWHystLength",
237 | "Duration": 0,
238 | "Value": "0"
239 | },
240 | {
241 | "PowerHint": "INTERACTION",
242 | "Node": "CPUBWHistMemory",
243 | "Duration": 0,
244 | "Value": "0"
245 | },
246 | {
247 | "PowerHint": "INTERACTION",
248 | "Node": "CPUBWMinFreq",
249 | "Duration": 0,
250 | "Value": "7110"
251 | },
252 | {
253 | "PowerHint": "INTERACTION",
254 | "Node": "LLCCBWMinFreq",
255 | "Duration": 0,
256 | "Value": "5931"
257 | },
258 | {
259 | "PowerHint": "LAUNCH",
260 | "Node": "CPUBigClusterMinFreq",
261 | "Duration": 3000,
262 | "Value": "9999999"
263 | },
264 | {
265 | "PowerHint": "LAUNCH",
266 | "Node": "CPUBigPlusClusterMinFreq",
267 | "Duration": 3000,
268 | "Value": "9999999"
269 | },
270 | {
271 | "PowerHint": "LAUNCH",
272 | "Node": "CPULittleClusterMinFreq",
273 | "Duration": 3000,
274 | "Value": "9999999"
275 | },
276 | {
277 | "PowerHint": "LAUNCH",
278 | "Node": "UclampTAMin",
279 | "Duration": 3000,
280 | "Value": "50"
281 | },
282 | {
283 | "PowerHint": "LAUNCH",
284 | "Node": "SchedBoost",
285 | "Duration": 3000,
286 | "Value": "1"
287 | },
288 | {
289 | "PowerHint": "LAUNCH",
290 | "Node": "CPUBWHystTriggerCount",
291 | "Duration": 3000,
292 | "Value": "0"
293 | },
294 | {
295 | "PowerHint": "LAUNCH",
296 | "Node": "CPUBWHystLength",
297 | "Duration": 3000,
298 | "Value": "0"
299 | },
300 | {
301 | "PowerHint": "LAUNCH",
302 | "Node": "CPUBWHistMemory",
303 | "Duration": 3000,
304 | "Value": "0"
305 | },
306 | {
307 | "PowerHint": "LAUNCH",
308 | "Node": "CPUBWMinFreq",
309 | "Duration": 3000,
310 | "Value": "16265"
311 | },
312 | {
313 | "PowerHint": "LAUNCH",
314 | "Node": "LLCCBWMinFreq",
315 | "Duration": 3000,
316 | "Value": "12191"
317 | },
318 | {
319 | "PowerHint": "LAUNCH",
320 | "Node": "GPUForceClkOn",
321 | "Duration": 3000,
322 | "Value": "1"
323 | },
324 | {
325 | "PowerHint": "LAUNCH",
326 | "Node": "GPUForceRailOn",
327 | "Duration": 3000,
328 | "Value": "1"
329 | },
330 | {
331 | "PowerHint": "LAUNCH",
332 | "Node": "GPUIdleTimer",
333 | "Duration": 3000,
334 | "Value": "10000"
335 | },
336 | {
337 | "PowerHint": "EXPENSIVE_RENDERING",
338 | "Node": "PowerHALRenderingState",
339 | "Duration": 0,
340 | "Value": "EXPENSIVE_RENDERING"
341 | },
342 | {
343 | "PowerHint": "EXPENSIVE_RENDERING",
344 | "Node": "GPUMinFreq",
345 | "Duration": 0,
346 | "Value": "1"
347 | },
348 | {
349 | "PowerHint": "SUSTAINED_PERFORMANCE",
350 | "Node": "PowerHALMainState",
351 | "Duration": 0,
352 | "Value": "SUSTAINED_PERFORMANCE"
353 | },
354 | {
355 | "PowerHint": "SUSTAINED_PERFORMANCE",
356 | "Node": "CPUBigClusterMaxFreq",
357 | "Duration": 0,
358 | "Value": "1651200"
359 | },
360 | {
361 | "PowerHint": "SUSTAINED_PERFORMANCE",
362 | "Node": "CPUBigPlusClusterMaxFreq",
363 | "Duration": 0,
364 | "Value": "1516800"
365 | },
366 | {
367 | "PowerHint": "SUSTAINED_PERFORMANCE",
368 | "Node": "CPULittleClusterMaxFreq",
369 | "Duration": 0,
370 | "Value": "1516800"
371 | },
372 | {
373 | "PowerHint": "SUSTAINED_PERFORMANCE",
374 | "Node": "GPUMaxFreq",
375 | "Duration": 0,
376 | "Value": "2"
377 | }
378 | ]
379 | }
380 |
--------------------------------------------------------------------------------
/configs/permissions/privapp-permissions-hotword.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/configs/public.libraries.txt:
--------------------------------------------------------------------------------
1 | libadsprpc.so
2 | libcdsprpc.so
3 | libsdsprpc.so
4 | libfastcvopt.so
5 | liblistensoundmodel2.so
6 | libOpenCL.so
7 | libcamxextension_night.so
--------------------------------------------------------------------------------
/configs/sensors/hals.conf:
--------------------------------------------------------------------------------
1 | sensors.ssc.so
2 | sensors.nothing.so
3 |
--------------------------------------------------------------------------------
/configs/vintf/manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.audio
4 | hwbinder
5 | @6.0::IDevicesFactory/default
6 |
7 |
8 | android.hardware.audio.effect
9 | hwbinder
10 | @6.0::IEffectsFactory/default
11 |
12 |
13 | android.hardware.bluetooth
14 | hwbinder
15 | @1.0::IBluetoothHci/default
16 |
17 |
18 | android.hardware.camera.provider
19 | hwbinder
20 | @2.4::ICameraProvider/legacy/0
21 |
22 |
23 | android.hardware.gatekeeper
24 | hwbinder
25 | @1.0::IGatekeeper/default
26 |
27 |
28 | android.hardware.keymaster
29 | hwbinder
30 | @4.1::IKeymasterDevice/default
31 |
32 |
33 | android.hardware.radio
34 | hwbinder
35 | @1.2::ISap/slot1
36 | @1.2::ISap/slot2
37 | @1.5::IRadio/slot1
38 | @1.5::IRadio/slot2
39 |
40 |
41 | android.hardware.radio.config
42 | hwbinder
43 | @1.1::IRadioConfig/default
44 |
45 |
46 | android.hardware.soundtrigger
47 | hwbinder
48 | @2.3::ISoundTriggerHw/default
49 |
50 |
51 | android.hardware.tetheroffload.config
52 | hwbinder
53 | @1.0::IOffloadConfig/default
54 |
55 |
56 | android.hardware.tetheroffload.control
57 | hwbinder
58 | @1.1::IOffloadControl/default
59 |
60 |
61 | com.dsi.ant
62 | hwbinder
63 | @1.0::IAnt/default
64 |
65 |
66 | com.qualcomm.qti.dpm.api
67 | hwbinder
68 | @1.0::IdpmQmi/dpmQmiService
69 |
70 |
71 | com.qualcomm.qti.imscmservice
72 | hwbinder
73 | @2.2::IImsCmService/qti.ims.connectionmanagerservice
74 |
75 |
76 | com.qualcomm.qti.uceservice
77 | hwbinder
78 | @2.3::IUceService/com.qualcomm.qti.uceservice
79 |
80 |
81 | vendor.goodix.hardware.biometrics.fingerprint
82 | hwbinder
83 | @2.1::IGoodixFingerprintDaemon/default
84 |
85 |
86 | vendor.qti.data.factory
87 | hwbinder
88 | @2.3::IFactory/default
89 |
90 |
91 | vendor.qti.esepowermanager
92 | hwbinder
93 | @1.1::IEsePowerManager/default
94 |
95 |
96 | vendor.qti.hardware.alarm
97 | hwbinder
98 | @1.0::IAlarm/default
99 |
100 |
101 | vendor.qti.hardware.bluetooth_audio
102 | hwbinder
103 | @2.1::IBluetoothAudioProvidersFactory/default
104 |
105 |
106 | vendor.qti.hardware.bluetooth_sar
107 | hwbinder
108 | @1.1::IBluetoothSar/default
109 |
110 |
111 | vendor.qti.hardware.btconfigstore
112 | hwbinder
113 | @2.0::IBTConfigStore/default
114 |
115 |
116 | vendor.qti.hardware.cacert
117 | hwbinder
118 | @1.0::IService/default
119 |
120 |
121 | vendor.qti.hardware.camera.postproc
122 | hwbinder
123 | @1.0::IPostProcService/camerapostprocservice
124 |
125 |
126 | vendor.qti.hardware.capabilityconfigstore
127 | hwbinder
128 | @1.0::ICapabilityConfigStore/default
129 |
130 |
131 | vendor.qti.hardware.data.connection
132 | hwbinder
133 | @1.1::IDataConnection/slot1
134 | @1.1::IDataConnection/slot2
135 |
136 |
137 | vendor.qti.hardware.data.iwlan
138 | hwbinder
139 | @1.0::IIWlan/slot1
140 | @1.0::IIWlan/slot2
141 |
142 |
143 | vendor.qti.hardware.data.latency
144 | hwbinder
145 | @1.0::ILinkLatency/default
146 |
147 |
148 | vendor.qti.hardware.dsp
149 | hwbinder
150 | @1.0::IDspService/dspservice
151 |
152 |
153 | vendor.qti.hardware.fm
154 | hwbinder
155 | @1.0::IFmHci/default
156 |
157 |
158 | vendor.qti.hardware.qseecom
159 | hwbinder
160 | @1.0::IQSEECom/default
161 |
162 |
163 | vendor.qti.hardware.qteeconnector
164 | hwbinder
165 | @1.0::IAppConnector/default
166 | @1.0::IGPAppConnector/default
167 |
168 |
169 | vendor.qti.hardware.radio.am
170 | hwbinder
171 | @1.0::IQcRilAudio/slot1
172 | @1.0::IQcRilAudio/slot2
173 |
174 |
175 | vendor.qti.hardware.radio.ims
176 | hwbinder
177 | @1.7::IImsRadio/imsradio0
178 | @1.7::IImsRadio/imsradio1
179 |
180 |
181 | vendor.qti.hardware.radio.internal.deviceinfo
182 | hwbinder
183 | @1.0::IDeviceInfo/deviceinfo
184 |
185 |
186 | vendor.qti.hardware.radio.lpa
187 | hwbinder
188 | @1.2::IUimLpa/UimLpa0
189 | @1.2::IUimLpa/UimLpa1
190 |
191 |
192 | vendor.qti.hardware.radio.qcrilhook
193 | hwbinder
194 | @1.0::IQtiOemHook/oemhook0
195 | @1.0::IQtiOemHook/oemhook1
196 |
197 |
198 | vendor.qti.hardware.radio.qtiradio
199 | hwbinder
200 | @1.0::IQtiRadio/slot1
201 | @1.0::IQtiRadio/slot2
202 |
203 |
204 | vendor.qti.hardware.radio.qtiradio
205 | hwbinder
206 | @2.6::IQtiRadio/slot1
207 | @2.6::IQtiRadio/slot2
208 |
209 |
210 | vendor.qti.hardware.radio.uim
211 | hwbinder
212 | @1.2::IUim/Uim0
213 | @1.2::IUim/Uim1
214 |
215 |
216 | vendor.qti.hardware.radio.uim_remote_client
217 | hwbinder
218 | @1.0::IUimRemoteServiceClient/uimRemoteClient0
219 | @1.0::IUimRemoteServiceClient/uimRemoteClient1
220 |
221 |
222 | vendor.qti.hardware.radio.uim_remote_server
223 | hwbinder
224 | @1.0::IUimRemoteServiceServer/uimRemoteServer0
225 | @1.0::IUimRemoteServiceServer/uimRemoteServer1
226 |
227 |
228 | vendor.qti.hardware.sensorscalibrate
229 | hwbinder
230 | @1.0::ISensorsCalibrate/default
231 |
232 |
233 | vendor.qti.hardware.soter
234 | hwbinder
235 | @1.0::ISoter/default
236 |
237 |
238 | vendor.qti.hardware.tui_comm
239 | hwbinder
240 | @1.0::ITuiComm/default
241 |
242 |
243 | vendor.qti.hardware.vpp
244 | hwbinder
245 | @2.0::IHidlVppService/vppService
246 |
247 |
248 | vendor.qti.hardware.wifidisplaysession
249 | hwbinder
250 | @1.0::IWifiDisplaySession/wifidisplaysession
251 | @1.0::IWifiDisplaySessionAudioTrack/wifidisplaysessionaudiotrack
252 | @1.0::IWifiDisplaySessionImageTrack/wifidisplaysessionimagetrack
253 | @1.0::IWifiDisplaySessionVideoTrack/wifidisplaysessionvideotrack
254 |
255 |
256 | vendor.qti.ims.callinfo
257 | hwbinder
258 | @1.0::IService/default
259 |
260 |
261 | vendor.qti.ims.factory
262 | hwbinder
263 | @1.1::IImsFactory/default
264 |
265 |
266 | vendor.qti.imsrtpservice
267 | hwbinder
268 | @3.0::IRTPService/imsrtpservice
269 |
270 |
271 |
--------------------------------------------------------------------------------
/configs/vintf/vendor_framework_compatibility_matrix.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | vendor.goodix.hardware.biometrics.fingerprint
4 | hwbinder
5 | 2.1
6 |
7 | IGoodixFingerprintDaemon
8 | default
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/configs/wifi/WCNSS_qcom_cfg.ini:
--------------------------------------------------------------------------------
1 | # This file allows user to override the factory
2 | # defaults for the WLAN Driver
3 |
4 | # guanyuan.huang_contractor@nothing.tech bug fix ABR13T-63 @{
5 | # Root cause: Read RingBuffer too slow. blocked wifi thread.
6 | gEnableRingBuffer=0
7 | # @}
8 |
9 | # Enable PCI gen switch
10 | g_enable_pci_gen=1
11 |
12 | # Phy Mode (auto, b, g, n, etc)
13 | # Valid values are 0-9, with 0 = Auto, 4 = 11n, 9 = 11ac
14 | # 1 = 11abg, 2 = 11b, 3 = 11g, 5 = 11g only, 6 = 11n only
15 | # 7 = 11b only 8 = 11ac only.
16 | gDot11Mode=0
17 |
18 | # UAPSD service interval for VO,VI, BE, BK traffic
19 | InfraUapsdVoSrvIntv=0
20 | InfraUapsdViSrvIntv=0
21 | InfraUapsdBeSrvIntv=0
22 | InfraUapsdBkSrvIntv=0
23 |
24 | # Flag to allow STA send AddTspec even when ACM is Off
25 | gAddTSWhenACMIsOff=1
26 |
27 | #Enable OBSS protection
28 | gEnableApOBSSProt=1
29 |
30 | # RTS threshold
31 | RTSThreshold=1048576
32 |
33 | # Intra-BSS forward
34 | gDisableIntraBssFwd=0
35 |
36 | # 802.11d support
37 | g11dSupportEnabled=0
38 |
39 | # DFS Master Capability
40 | gEnableDFSMasterCap=1
41 |
42 | # enable SRD
43 | etsi13_srd_chan_in_master_mode=1
44 |
45 | gNeighborScanTimerPeriod=200
46 | gNeighborLookupThreshold=76
47 |
48 | # Legacy (non-ESE, non-802.11r) Fast Roaming Support
49 | # To enable, set FastRoamEnabled=1
50 | # To disable, set FastRoamEnabled=0
51 | FastRoamEnabled=1
52 |
53 | #Channel Bonding
54 | gChannelBondingMode5GHz=1
55 |
56 | # Enable DFS channel roam
57 | # 0: DISABLE, 1: ENABLED_NORMAL, 2: ENABLED_ACTIVE
58 | gAllowDFSChannelRoam=1
59 |
60 | # Set txchainmask and rxchainmask
61 | # These parameters are used only if gEnable2x2 is 0
62 | # Valid values are 1,2
63 | # Set gSetTxChainmask1x1=1 or gSetRxChainmask1x1=1 to select chain0.
64 | # Set gSetTxChainmask1x1=2 or gSetRxChainmask1x1=2 to select chain1.
65 | gSetTxChainmask1x1=1
66 | gSetRxChainmask1x1=1
67 |
68 | # MCC to SCC Switch mode:
69 | # 0-Disable
70 | # 1-Enable
71 | # 2-Force SCC if same band, with SAP restart
72 | # 3-Force SCC if same band, without SAP restart by sending (E)CSA
73 | # 4-Force SCC if same band (or) use SAP mandatory channel for DBS,
74 | # without SAP restart by sending (E)CSA
75 | gWlanMccToSccSwitchMode = 0
76 |
77 | # 1=enable tx STBC; 0=disable
78 | gEnableTXSTBC=1
79 |
80 | # 1=enable rx LDPC; 0=disable
81 | gEnableRXLDPC=1
82 |
83 | #Enable/Disable Tx beamformee in SAP mode
84 | gEnableTxBFeeSAP=1
85 |
86 | # Enable Tx beamforming in VHT20MHz
87 | # Valid values are 0,1. If commented out, the default value is 0.
88 | # 0=disable, 1=enable
89 | gEnableTxBFin20MHz=1
90 |
91 | #Enable/Disable SU Tx beamformer support.
92 | gEnableTxSUBeamformer=1
93 |
94 | # 802.11K support
95 | gRrmEnable=1
96 |
97 | # Firmware log mode
98 | # Valid values are 0,1,2
99 | # 0=Disable, 1=WMI, 2=DIAG
100 | gEnablefwlog=0
101 |
102 | # Maximum Receive AMPDU size (VHT only. Valid values:
103 | # 0->8k 1->16k 2->32k 3->64k 4->128k)
104 | gVhtAmpduLenExponent=7
105 |
106 | # Maximum MPDU length (VHT only. Valid values:
107 | # 0->3895 octets, 1->7991 octets, 2->11454 octets)
108 | gVhtMpduLen=2
109 |
110 | #Enable or Disable p2p device address administered
111 | isP2pDeviceAddrAdministrated=0
112 |
113 | #Enable VHT on 2.4Ghz
114 | gEnableVhtFor24GHzBand=1
115 |
116 | # controlling the following offload patterns
117 | # through ini parameter. Default value is 1
118 | # to disable set it to zero. ssdp = 0
119 | # Setup multicast pattern for mDNS 224.0.0.251,
120 | # SSDP 239.255.255.250 and LLMNR 224.0.0.252
121 | ssdp=0
122 |
123 | # RA filtering rate limit param, the current value would not
124 | # help if the lifetime in RA is less than 3*60=3min. Then
125 | # we need to change it, though it is uncommon.
126 | # gRAFilterEnable=0
127 | gRArateLimitInterval=600
128 |
129 | # Disable/Enable GreenAP
130 | # 0 to disable, 1 to enable, default: 1
131 | gEnableGreenAp=0
132 |
133 | #Enable/Disable LPASS support
134 | # 0 to disable, 1 to enable
135 | gEnableLpassSupport=1
136 |
137 | # Whether userspace country code setting shld have priority
138 | gCountryCodePriority=1
139 |
140 | # Enable or Disable Multi-user MIMO
141 | # 1=Enable (default), 0=Disable
142 | gEnableMuBformee=1
143 |
144 | # Inactivity time (in ms) to end TX Service Period while in IBSS power save mode
145 | gIbssTxSpEndInactivityTime=10
146 |
147 | # Enable TDLS External Control. That is, user space application has to
148 | # first configure a peer MAC in wlan driver towards which TDLS is desired.
149 | # Device will establish TDLS only towards those configured peers whenever
150 | # TDLS criteria (throughput and RSSI threshold) is met and teardown TDLS
151 | # when teardown criteria (idle packet count and RSSI) is met. However,
152 | # device will accept TDLS connection if it is initiated from any other peer,
153 | # even if that peer is not configured.
154 | # 0 - disable
155 | # 1 - enable
156 | # For TDLS External Control, Implicit Trigger must also be enabled.
157 | gTDLSExternalControl=1
158 |
159 | # VHT Tx/Rx MCS values
160 | # Valid values are 0,1,2. If commented out, the default value is 0.
161 | # 0=MCS0-7, 1=MCS0-8, 2=MCS0-9
162 | gVhtRxMCS=2
163 | gVhtTxMCS=2
164 |
165 | # VHT Tx/Rx MCS values for 2x2
166 | # Valid values are 0,1,2. If commented out, the default value is 0.
167 | # 0=MCS0-7, 1=MCS0-8, 2=MCS0-9
168 | gEnable2x2=1
169 | gVhtRxMCS2x2=2
170 | gVhtTxMCS2x2=2
171 |
172 | #IPA config is a bit mask and following are the configurations.
173 | #bit0 IPA Enable
174 | #bit1 IPA PRE Filter enable
175 | #bit2 IPv6 enable
176 | #bit3 IPA Resource Manager (RM) enable
177 | #bit4 IPA Clock scaling enable
178 | #bit5 IPA uC ENABLE
179 | #bit6 IPA uC STA ENABLE
180 | #bit8 IPA Real Time Debugging
181 | gIPAConfig=0x7d
182 |
183 | # Set IPA bandwidth levels in mbps
184 | gIPALowBandwidthMbps=100
185 | gIPAMediumBandwidthMbps=400
186 | gIPAHighBandwidthMbps=800
187 |
188 | # Set CPU mask for RPS Rx queue
189 | rpsRxQueueCpuMapList=07
190 |
191 | # Enable/Disable RX full reorder offload
192 | gReorderOffloadSupported=1
193 |
194 | # Enable Rx handling options
195 | # Rx_thread=1 RPS=2(default for ROME) NAPI=4(default for ihelium)
196 | rx_mode=20
197 |
198 | # Enable(Tx) fastpath for data traffic.
199 | # 1 - enable(default) 0 - disable
200 | gEnableFastPath=1
201 |
202 | # Enable TCP Segmentation Offload
203 | # 1 - enable 0 - disable
204 | TSOEnable=1
205 |
206 | # Enable Generic Receive Offload
207 | # 1 - enable(default) 0 - disable
208 | GROEnable=1
209 |
210 | # Enable HT MPDU Density
211 | # 4 for 2 micro sec
212 | ght_mpdu_density=4
213 |
214 | # Enable flow steering to enable multiple CEs for Rx flows.
215 | # Multiple Rx CEs<==>Multiple Rx IRQs<==>probably different CPUs.
216 | # Parallel Rx paths.
217 | # 1 - enable 0 - disable(default)
218 | gEnableFlowSteering=1
219 |
220 | # Maximum number of MSDUs the firmware will pack in one HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
221 | maxMSDUsPerRxInd=8
222 |
223 | # Enable NUD tracking feature
224 | # 1 - enable 0 - disable(default)
225 | gEnableNUDTracking=1
226 |
227 | ################ Datapath feature set End ################
228 |
229 | ################ NAN feature set start ###################
230 |
231 | # Enable NAN discovery (NAN 1.0)
232 | # 1 - enable 0 - disable(default)
233 | gEnableNanSupport=1
234 | # Enable NAN Datapath
235 | genable_nan_datapath=1
236 |
237 | ################ NAN feature set end #####################
238 |
239 | hostscan_adaptive_dwell_mode=1
240 |
241 | # Enable/Disable rtt sta mac randomization
242 | enable_rtt_mac_randomization=1
243 |
244 | #Enable/Disable SNR monitoring
245 | gEnableSNRMonitoring=1
246 |
247 | # Enable Runtime PM
248 | gRuntimePM=2
249 | gRuntimePMDelay=500
250 |
251 | # Rx thread affinity mask in UL case
252 | RX_THREAD_UL_CPU_AFFINITY_MASK=0xc0
253 |
254 | AutoChannelSelectWeight=0x00fafafa
255 |
256 | bcast_twt=1
257 |
258 | dp_tx_ring_size=3072
259 |
260 | gWmiCreditCount=1
261 |
262 | # Enable RX buffer pool
263 | dp_rx_buff_prealloc_pool=1
264 |
265 | #Enable RX FISA
266 | dp_rx_fisa_enable=1
267 | dp_rx_flow_search_table_size=128
268 |
269 | legacy_mode_csum_disable=0
270 |
271 | #Enable Rx refill pool
272 | dp_rx_refill_buff_pool=1
273 |
274 | # Enable Software latency manager
275 | gEnableSWLM=1
276 |
277 | # Place FST in CMEM
278 | dp_rx_fst_in_cmem=1
279 |
280 | # Use QMI path to get LL and station stats
281 | send_ll_and_get_station_stats_over_qmi=1
282 |
283 | # Enable/Disable SAR version conversion
284 | gEnableSARV1toSARV2=1
285 |
286 | #enable 6GHz support for RTT/LOWI
287 | oem_6g_support_disable=0
288 |
289 | #enable/disable Self Recovery
290 | gEnableSelfRecovery=1
291 | END
292 |
293 | # Note: Configuration parser would not read anything past the END marker
294 |
--------------------------------------------------------------------------------
/configs/wifi/p2p_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
2 | p2p_no_group_iface=1
3 | persistent_reconnect=1
4 | bss_max_count=400
5 | p2p_go_he=1
6 | p2p_6ghz_disable=1
7 |
--------------------------------------------------------------------------------
/configs/wifi/wpa_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
2 | p2p_disabled=1
3 | tdls_external_control=1
4 | wowlan_triggers=magic_pkt
5 | bss_max_count=400
6 | interworking=1
7 | config_methods=virtual_display virtual_push_button keypad
8 | driver_param="no_rrm=1 use_p2p_group_interface=1"
9 |
--------------------------------------------------------------------------------
/extract-files.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
2 | #
3 | # SPDX-FileCopyrightText: 2024 The LineageOS Project
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 |
7 | from extract_utils.fixups_blob import (
8 | blob_fixup,
9 | blob_fixups_user_type,
10 | )
11 | from extract_utils.fixups_lib import (
12 | lib_fixups,
13 | lib_fixups_user_type,
14 | )
15 | from extract_utils.main import (
16 | ExtractUtils,
17 | ExtractUtilsModule,
18 | )
19 |
20 | namespace_imports = [
21 | 'vendor/nothing/Spacewar',
22 | 'hardware/qcom-caf/sm8350',
23 | 'hardware/qcom-caf/wlan',
24 | 'hardware/nothing',
25 | 'vendor/qcom/opensource/commonsys-intf/display',
26 | 'vendor/qcom/opensource/commonsys/display',
27 | 'vendor/qcom/opensource/dataservices',
28 | 'vendor/qcom/opensource/display',
29 | ]
30 |
31 | def lib_fixup_vendor_suffix(lib: str, partition: str, *args, **kwargs):
32 | return f'{lib}_{partition}' if partition == 'vendor' else None
33 |
34 | lib_fixups: lib_fixups_user_type = {
35 | **lib_fixups,
36 | (
37 | 'com.qualcomm.qti.dpm.api@1.0',
38 | 'libmmosal',
39 | 'vendor.qti.hardware.wifidisplaysession@1.0',
40 | 'vendor.qti.imsrtpservice@3.0',
41 | ): lib_fixup_vendor_suffix,
42 | }
43 |
44 | blob_fixups: blob_fixups_user_type = {
45 | ('vendor/lib64/libwvhidl.so', 'vendor/lib/mediadrm/libwvdrmengine.so', 'vendor/lib64/mediadrm/libwvdrmengine.so'): blob_fixup()
46 | .add_needed('libcrypto_shim.so'),
47 | ('vendor/lib64/libgf_hal.so'): blob_fixup()
48 | .sig_replace('72 6F 2E 62 6F 6F 74 2E 66 6C 61 73 68 2E 6C 6F 63 6B 65 64', '72 6F 2E 62 6F 6F 74 6C 6F 61 64 65 72 2E 6C 6F 63 6B 65 64'),
49 | 'system_ext/bin/wfdservice': blob_fixup()
50 | .add_needed('libwfdservice_shim.so'),
51 | ('system_ext/lib/libwfdservice.so', 'system_ext/lib64/libwfdservice.so'): blob_fixup()
52 | .replace_needed('android.media.audio.common.types-V2-cpp.so', 'android.media.audio.common.types-V4-cpp.so'),
53 | } # fmt: skip
54 |
55 | module = ExtractUtilsModule(
56 | 'Spacewar',
57 | 'nothing',
58 | blob_fixups=blob_fixups,
59 | lib_fixups=lib_fixups,
60 | namespace_imports=namespace_imports,
61 | add_firmware_proprietary_file=True,
62 | )
63 |
64 | if __name__ == '__main__':
65 | utils = ExtractUtils.device(module)
66 | utils.run()
67 |
--------------------------------------------------------------------------------
/lineage.dependencies:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "repository": "android_kernel_nothing_sm7325",
4 | "target_path": "kernel/nothing/sm7325"
5 | },
6 | {
7 | "repository": "android_hardware_nothing",
8 | "target_path": "hardware/nothing"
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/lineage_Spacewar.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2024 The LineageOS Project
3 | #
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 |
7 | # Inherit from those products. Most specific first.
8 | $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
9 | TARGET_SUPPORTS_OMX_SERVICE := false
10 | $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
11 |
12 | # Inherit from Spacewar device
13 | $(call inherit-product, device/nothing/Spacewar/device.mk)
14 |
15 | # Inherit some common Lineage stuff.
16 | $(call inherit-product, vendor/lineage/config/common_full_phone.mk)
17 |
18 | # Device identifier. This must come after all inclusions.
19 | PRODUCT_NAME := lineage_Spacewar
20 | PRODUCT_DEVICE := Spacewar
21 | PRODUCT_BRAND := Nothing
22 | PRODUCT_MODEL := A063
23 | PRODUCT_MANUFACTURER := Nothing
24 |
25 | PRODUCT_CHARACTERISTICS := nosdcard
26 |
27 | PRODUCT_GMS_CLIENTID_BASE := android-nothing
28 |
29 | PRODUCT_BUILD_PROP_OVERRIDES += \
30 | DeviceProduct=Spacewar \
31 | BuildFingerprint="Nothing/Spacewar/Spacewar:12/SKQ1.211230.001/1666412462:user/release-keys"
32 |
--------------------------------------------------------------------------------
/modules.load:
--------------------------------------------------------------------------------
1 | adsp_loader_dlkm.ko
2 | apr_dlkm.ko
3 | bolero_cdc_dlkm.ko
4 | bt_fm_slim.ko
5 | btpower.ko
6 | e4000.ko
7 | fc0011.ko
8 | fc0012.ko
9 | fc0013.ko
10 | fc2580.ko
11 | fts_tp.ko
12 | goodix_fp.ko
13 | hdmi_dlkm.ko
14 | hid-aksys.ko
15 | it913x.ko
16 | llcc_perfmon.ko
17 | m88rs6000t.ko
18 | machine_dlkm.ko
19 | max2165.ko
20 | mbhc_dlkm.ko
21 | mc44s803.ko
22 | msi001.ko
23 | mt2060.ko
24 | mt2063.ko
25 | mt20xx.ko
26 | mt2131.ko
27 | mt2266.ko
28 | mxl301rf.ko
29 | mxl5005s.ko
30 | mxl5007t.ko
31 | native_dlkm.ko
32 | pinctrl_lpi_dlkm.ko
33 | pinctrl_wcd_dlkm.ko
34 | platform_dlkm.ko
35 | q6_dlkm.ko
36 | q6_notifier_dlkm.ko
37 | q6_pdr_dlkm.ko
38 | qca_cld3_qca6750.ko
39 | qcom_edac.ko
40 | qm1d1b0004.ko
41 | qm1d1c0042.ko
42 | qt1010.ko
43 | r820t.ko
44 | rdbg.ko
45 | rmnet_core.ko
46 | rmnet_ctl.ko
47 | rmnet_offload.ko
48 | rmnet_shs.ko
49 | rx_macro_dlkm.ko
50 | si2157.ko
51 | slimbus.ko
52 | slimbus-ngd.ko
53 | snd_event_dlkm.ko
54 | stub_dlkm.ko
55 | swr_ctrl_dlkm.ko
56 | swr_dlkm.ko
57 | swr_dmic_dlkm.ko
58 | swr_haptics_dlkm.ko
59 | tda18212.ko
60 | tda18218.ko
61 | tda18250.ko
62 | tda9887.ko
63 | tea5761.ko
64 | tea5767.ko
65 | tfa98xx_dlkm.ko
66 | tua9001.ko
67 | tuner-simple.ko
68 | tuner-types.ko
69 | tuner-xc2028.ko
70 | tx_macro_dlkm.ko
71 | va_macro_dlkm.ko
72 | wcd938x_dlkm.ko
73 | wcd938x_slave_dlkm.ko
74 | wcd9xxx_dlkm.ko
75 | wcd_core_dlkm.ko
76 | wsa883x_dlkm.ko
77 | wsa_macro_dlkm.ko
78 | xc4000.ko
79 | xc5000.ko
80 |
--------------------------------------------------------------------------------
/modules.load.recovery:
--------------------------------------------------------------------------------
1 | fts_tp.ko
2 |
--------------------------------------------------------------------------------
/overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 | - org.lineageos.aperture
7 | - org.lineageos.aperture.dev
8 |
9 |
10 |
11 | true
12 |
13 |
14 |
15 | - restart
16 | - restart_recovery
17 | - restart_bootloader
18 | - restart_fastboot
19 |
20 |
21 |
22 | true
23 |
24 |
--------------------------------------------------------------------------------
/overlay-lineage/lineage-sdk/packages/LineageSettingsProvider/res/values/defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | true
5 |
6 |
--------------------------------------------------------------------------------
/overlay-lineage/packages/apps/Aperture/app/src/main/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | true
9 |
10 |
31 |
32 | - 0
- sd|hd|fhd
- 60
33 | - 0
- uhd
- 30
34 | - 2
- sd|hd|fhd
- 60
35 | - 2
- uhd
- 30
36 |
37 |
38 |
--------------------------------------------------------------------------------
/overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | 4
5 |
6 |
--------------------------------------------------------------------------------
/overlay-lineage/packages/apps/Settings/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 | 254
10 |
11 |
12 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 | 36.0dip
6 |
7 |
10 | @dimen/status_bar_height_default
11 |
12 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 107px
5 |
6 |
7 | 63px
8 |
9 |
11 | 48.0dip
12 |
13 |
16 | @dimen/status_bar_height_default
17 |
18 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/xml/power_profile.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | - 0
4 | - 102
5 | - 75
6 |
7 | 4
8 | 3
9 | 1
10 |
11 |
12 | 300000
13 | 403200
14 | 499200
15 | 595200
16 | 691200
17 | 806400
18 | 902400
19 | 998400
20 | 1094400
21 | 1209600
22 | 1305600
23 | 1401600
24 | 1497600
25 | 1612800
26 | 1708800
27 | 1804800
28 |
29 |
30 | 5
31 | 7
32 | 8
33 | 9
34 | 10
35 | 14
36 | 16
37 | 18
38 | 21
39 | 23
40 | 24
41 | 27
42 | 29
43 | 31
44 | 32
45 | 35
46 |
47 |
48 | 710400
49 | 844800
50 | 960000
51 | 1075200
52 | 1209600
53 | 1324800
54 | 1440000
55 | 1555200
56 | 1670400
57 | 1766400
58 | 1881600
59 | 1996800
60 | 2112000
61 | 2227200
62 | 2342400
63 | 2419200
64 |
65 |
66 | 31
67 | 39
68 | 47
69 | 59
70 | 70
71 | 81
72 | 94
73 | 103
74 | 122
75 | 137
76 | 160
77 | 182
78 | 192
79 | 220
80 | 270
81 | 317
82 |
83 |
84 | 844800
85 | 960000
86 | 1075200
87 | 1190400
88 | 1305600
89 | 1420800
90 | 1555200
91 | 1670400
92 | 1785600
93 | 1900800
94 | 2035200
95 | 2150400
96 | 2265600
97 | 2380800
98 | 2496000
99 | 2611200
100 | 2726400
101 | 2841600
102 |
103 |
104 | 49
105 | 59
106 | 69
107 | 82
108 | 96
109 | 113
110 | 133
111 | 157
112 | 172
113 | 182
114 | 210
115 | 247
116 | 289
117 | 332
118 | 374
119 | 471
120 | 516
121 | 583
122 |
123 | - 7.7
124 | - 0.1
125 | - 0
126 | - 4500
127 | - 0.1
128 | - 160
129 | - 1.2
130 | - 24
131 | - 66
132 | - 600
133 | - 368
134 | - 13.7
135 | - 180
136 | - 4.7
137 |
138 | 2
139 | 2
140 |
141 | - 6
142 | - 180
143 | - 186
144 | - 3700
145 |
146 | 17
147 |
148 | - 1
149 | - 176
150 | - 200
151 | 1
152 | - 3700
153 |
154 | .0001
155 | .001
156 | .01
157 | .1
158 | 1
159 |
160 | - 130
161 | - 0.7
162 | - 3700
163 |
164 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Nothing Phone (1)
5 |
6 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 8dp
5 |
6 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | true
5 |
6 |
8 | - 63.18
9 |
10 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 0dp
5 |
6 |
7 | 107px
8 | 107px
9 | 107px
10 |
11 |
12 | 16dp
13 |
14 |
16 | 965px
17 |
18 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Settings/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 | - Alive
8 | - Natural
9 | - Boosted
10 | - Saturated
11 |
12 |
13 |
16 |
17 | - 260
18 | - 0
19 | - 1
20 | - 2
21 |
22 |
23 |
24 | true
25 |
26 |
40 | 3
41 |
42 |
43 | 99
44 |
45 |
--------------------------------------------------------------------------------
/overlay/packages/services/Telephony/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | true
5 |
6 |
10 |
11 | true
12 |
13 |
14 |
15 | true
16 |
17 |
18 |
19 | true
20 |
21 |
22 | org.codeaurora.ims
23 |
24 |
25 | org.codeaurora.ims
26 |
27 |
--------------------------------------------------------------------------------
/properties/odm.prop:
--------------------------------------------------------------------------------
1 | # ODM
2 | ro.vendor.qti.va_odm.support=1
3 |
--------------------------------------------------------------------------------
/properties/product.prop:
--------------------------------------------------------------------------------
1 | # Audio
2 | aaudio.hw_burst_min_usec=2000
3 | aaudio.mmap_exclusive_policy=2
4 | aaudio.mmap_policy=2
5 | af.fast_track_multiplier=1
6 | audio.deep_buffer.media=true
7 | audio.offload.min.duration.secs=30
8 | audio.offload.video=true
9 | ro.af.client_heap_size_kbyte=7168
10 |
11 | # Bluetooth
12 | bluetooth.device.class_of_device=90,2,12
13 | bluetooth.device.default_name=Nothing Phone (1)
14 | bluetooth.hardware.power.idle_cur_ma=6
15 | bluetooth.hardware.power.operating_voltage_mv=3700
16 | bluetooth.hardware.power.rx_cur_ma=28
17 | bluetooth.hardware.power.tx_cur_ma=36
18 | bluetooth.profile.a2dp.source.enabled?=true
19 | bluetooth.profile.asha.central.enabled?=true
20 | bluetooth.profile.avrcp.target.enabled?=true
21 | bluetooth.profile.bas.client.enabled?=true
22 | bluetooth.profile.gatt.enabled?=true
23 | bluetooth.profile.hfp.ag.enabled?=true
24 | bluetooth.profile.hid.device.enabled?=true
25 | bluetooth.profile.hid.host.enabled?=true
26 | bluetooth.profile.map.server.enabled?=true
27 | bluetooth.profile.opp.enabled?=true
28 | bluetooth.profile.pan.nap.enabled?=true
29 | bluetooth.profile.pan.panu.enabled?=true
30 | bluetooth.profile.pbap.server.enabled?=true
31 | bluetooth.profile.sap.server.enabled?=true
32 |
33 | # Thermal
34 | persist.vendor.thermal.config=/vendor/etc/thermal-engine.conf
35 |
--------------------------------------------------------------------------------
/properties/system.prop:
--------------------------------------------------------------------------------
1 | # Audio
2 | use.voice.path.for.pcm.voip=true
3 |
4 | # Bluetooth
5 | persist.vendor.bluetooth.modem_nv_support=true
6 |
7 | # Camera
8 | camera.disable_zsl_mode=true
9 |
10 | # CNE
11 | persist.vendor.cne.feature=1
12 |
13 | # Display
14 | debug.sf.enable_hwc_vds=1
15 | persist.sys.sf.native_mode=260
16 | sys.brightness.disable_gamma_conversion=true
17 |
18 | # Fingerprint
19 | ro.bootloader.locked=0
20 |
21 | # Media
22 | media.aac_51_output_enabled=true
23 | media.settings.xml=/vendor/etc/media_profiles_vendor.xml
24 | media.stagefright.enable-aac=true
25 | media.stagefright.enable-fma2dp=true
26 | media.stagefright.enable-http=true
27 | media.stagefright.enable-player=true
28 | media.stagefright.enable-qcp=true
29 | media.stagefright.enable-scan=true
30 | media.stagefright.thumbnail.prefer_hw_codecs=true
31 | ro.media.recorder-max-base-layer-fps=60
32 | vendor.mm.enable.qcom_parser=16777215
33 |
34 | # NetMgr
35 | ro.vendor.use_data_netmgrd=true
36 | persist.vendor.data.mode=concurrent
37 |
38 | # NFC
39 | ro.nfc.port=I2C
40 |
41 | # Radio
42 | ril.subscription.types=NV,RUIM
43 | telephony.lteOnCdmaDevice=1
44 |
45 | # RmNet
46 | persist.rmnet.data.enable=true
47 | persist.data.wda.enable=true
48 | persist.data.df.dl_mode=5
49 | persist.data.df.agg.dl_pkt=10
50 | persist.data.df.agg.dl_size=4096
51 | persist.data.df.mux_count=8
52 | persist.data.df.iwlan_mux=9
53 | persist.data.df.dev_name=rmnet_usb0
54 |
55 | # Sensors
56 | persist.vendor.sensors.enable.mag_filter=true
57 |
58 | # Time
59 | persist.timed.enable=true
60 |
61 | # Vendor
62 | ro.vendor.qti.va_aosp.support=1
63 |
64 | # Nt Feature
65 | ro.build.nothing.feature.base=0x4458438124a040126b4247b97ffL
66 | ro.build.nothing.feature.diff.device.Spacewar=0x8a0042a4041a032c34800L
--------------------------------------------------------------------------------
/properties/system_ext.prop:
--------------------------------------------------------------------------------
1 | # Dalvik
2 | dalvik.vm.dex2oat64.enabled=true
3 |
4 | # DPM
5 | persist.vendor.dpm.feature=11
6 |
7 | # RIL
8 | telephony.active_modems.max_count=2
9 |
--------------------------------------------------------------------------------
/properties/vendor.prop:
--------------------------------------------------------------------------------
1 | # Audio
2 | persist.vendor.audio.ambisonic.auto.profile=false
3 | persist.vendor.audio.ambisonic.capture=false
4 | persist.vendor.audio.apptype.multirec.enabled=false
5 | persist.vendor.audio.avs.afe_api_version=9
6 | persist.vendor.audio.bcl.enabled=false
7 | persist.vendor.audio.fluence.speaker=true
8 | persist.vendor.audio.fluence.voicecall=true
9 | persist.vendor.audio.fluence.voicecomm=true
10 | persist.vendor.audio.ha_proxy.enabled=true
11 | persist.vendor.audio.voicecall.speaker.stereo=true
12 | ro.config.vc_call_vol_steps=7
13 | ro.vendor.audio.sdk.fluencetype=fluence
14 | vendor.audio_hal.in_period_size=144
15 | vendor.audio_hal.period_multiplier=3
16 | vendor.audio_hal.period_size=192
17 | vendor.audio.adm.buffering.ms=2
18 | vendor.audio.feature.a2dp_offload.enable=true
19 | vendor.audio.feature.afe_proxy.enable=true
20 | vendor.audio.feature.battery_listener.enable=true
21 | vendor.audio.feature.compress_in.enable=true
22 | vendor.audio.feature.compress_meta_data.enable=true
23 | vendor.audio.feature.concurrent_capture.enable=true
24 | vendor.audio.feature.custom_stereo.enable=true
25 | vendor.audio.feature.display_port.enable=true
26 | vendor.audio.feature.fluence.enable=true
27 | vendor.audio.feature.fm.enable=true
28 | vendor.audio.feature.hdmi_edid.enable=true
29 | vendor.audio.feature.hdmi_passthrough.enable=true
30 | vendor.audio.feature.hfp.enable=true
31 | vendor.audio.feature.incall_music.enable=true
32 | vendor.audio.feature.keep_alive.enable=true
33 | vendor.audio.feature.kpi_optimize.enable=false
34 | vendor.audio.feature.multi_voice_session.enable=true
35 | vendor.audio.feature.power_mode.enable=true
36 | vendor.audio.feature.ras.enable=true
37 | vendor.audio.feature.snd_mon.enable=true
38 | vendor.audio.feature.src_trkn.enable=true
39 | vendor.audio.feature.ssrec.enable=true
40 | vendor.audio.feature.usb_offload_burst_mode.enable=true
41 | vendor.audio.feature.usb_offload.enable=true
42 | vendor.audio.flac.sw.decoder.24bit=true
43 | vendor.audio.hal.boot.timeout.ms=20000
44 | vendor.audio.hal.output.suspend.supported=true
45 | vendor.audio.hw.aac.encoder=true
46 | vendor.audio.offload.buffer.size.kb=256
47 | vendor.audio.offload.gapless.enabled=true
48 | vendor.audio.offload.multiaac.enable=true
49 | vendor.audio.offload.track.enable=true
50 | vendor.audio.parser.ip.buffer.size=262144
51 | vendor.audio.spkr_prot.tx.sampling_rate=48000
52 | vendor.audio.use.sw.alac.decoder=true
53 | vendor.audio.use.sw.ape.decoder=true
54 | vendor.audio.use.sw.mpegh.decoder=true
55 | vendor.audio.volume.headset.gain.depcal=true
56 | vendor.voice.path.for.pcm.voip=true
57 |
58 | # APK Verity
59 | ro.apk_verity.mode=2
60 |
61 | # Bluetooth
62 | persist.vendor.bt.a2dp_offload_cap=sbc-aptx-aptxtws-aptxhd-aac-ldac
63 | persist.vendor.bt.aac_frm_ctl.enabled=true
64 | persist.vendor.bt.aac_vbr_frm_ctl.enabled=true
65 | persist.vendor.qcom.bluetooth.a2dp_offload_cap=sbc-aptx-aptxtws-aptxhd-aac-ldac-aptxadaptiver2
66 | persist.vendor.qcom.bluetooth.aac_frm_ctl.enabled=true
67 | persist.vendor.qcom.bluetooth.aac_vbr_ctl.enabled=true
68 | persist.vendor.qcom.bluetooth.aptxadaptiver2_1_support=true
69 | ro.bluetooth.a2dp_offload.supported=true
70 |
71 | # Crypto
72 | ro.crypto.dm_default_key.options_format.version=2
73 | ro.crypto.volume.metadata.method=dm-default-key
74 |
75 | # Display
76 | vendor.display.comp_mask=0
77 | vendor.display.disable_excl_rect=0
78 | vendor.display.disable_excl_rect_partial_fb=1
79 | vendor.display.disable_hw_recovery_dump=1
80 | vendor.display.disable_offline_rotator=1
81 | vendor.display.disable_scaler=0
82 | vendor.display.enable_async_powermode=1
83 | vendor.display.enable_early_wakeup=1
84 | vendor.display.enable_hdr10_gpu_target=1
85 | vendor.display.enable_optimize_refresh=1
86 | vendor.display.use_smooth_motion=1
87 | vendor.gralloc.disable_ubwc=0
88 |
89 | # DPM
90 | persist.vendor.dpm.idletimer.mode=default
91 | persist.vendor.dpmhalservice.enable=1
92 |
93 | # FRP
94 | ro.frp.pst=/dev/block/bootdevice/by-name/frp
95 |
96 | # FUSE passthrough
97 | persist.sys.fuse.passthrough.enable=true
98 |
99 | # Gatekeeper
100 | vendor.gatekeeper.disable_spu=true
101 |
102 | # Graphics
103 | debug.sf.predict_hwc_composition_strategy=0
104 | debug.sf.treat_170m_as_sRGB=1
105 | debug.sf.disable_client_composition_cache=1
106 | debug.sf.enable_advanced_sf_phase_offset=1
107 | debug.sf.enable_gl_backpressure=1
108 | debug.sf.frame_rate_multiple_threshold=60
109 | debug.sf.high_fps_early_gl_phase_offset_ns=-2000000
110 | debug.sf.high_fps_early_phase_offset_ns=-4000000
111 | debug.sf.high_fps_late_app_phase_offset_ns=1000000
112 | debug.sf.high_fps_late_sf_phase_offset_ns=-2000000
113 | debug.sf.auto_latch_unsignaled=0
114 | ro.hardware.egl=adreno
115 | ro.hardware.vulkan=adreno
116 | ro.opengles.version=196610
117 | ro.surface_flinger.enable_frame_rate_override=false
118 | ro.surface_flinger.force_hwc_copy_for_virtual_displays=true
119 | ro.surface_flinger.has_HDR_display=true
120 | ro.surface_flinger.has_wide_color_display=true
121 | ro.surface_flinger.max_frame_buffer_acquired_buffers=3
122 | ro.surface_flinger.max_virtual_display_dimension=4096
123 | ro.surface_flinger.protected_contents=true
124 | ro.surface_flinger.set_idle_timer_ms=4000
125 | ro.surface_flinger.set_touch_timer_ms=4000
126 | ro.surface_flinger.set_display_power_timer_ms=1000
127 | ro.surface_flinger.use_color_management=true
128 | ro.surface_flinger.use_content_detection_for_refresh_rate=true
129 | ro.surface_flinger.wcg_composition_dataspace=143261696
130 |
131 | # Incremental FS
132 | ro.incremental.enable=yes
133 |
134 | # Media
135 | debug.stagefright.c2inputsurface=-1
136 |
137 | # OEM Unlock
138 | ro.oem_unlock_supported=1
139 |
140 | # QTEE
141 | persist.vendor.qteeconnector.retrying_interval=30
142 | persist.vendor.qteeconnector.retrying_timeout=2000
143 |
144 | # Radio
145 | persist.radio.multisim.config=dsds
146 | persist.vendor.radio.apm_sim_not_pwdn=1
147 | persist.vendor.radio.custom_ecc=1
148 | persist.vendor.radio.enableadvancedscan=true
149 | persist.vendor.radio.procedure_bytes=SKIP
150 | persist.vendor.radio.rat_on=combine
151 | persist.vendor.radio.sib16_support=1
152 | ro.telephony.default_network=33,33
153 |
154 | # Sensors
155 | persist.vendor.sensors.allow_non_default_discovery=true
156 | persist.vendor.sensors.on_change_sample_period=true
157 | persist.vendor.sensors.sync_request=true
158 |
159 | # SoC
160 | ro.soc.manufacturer=QTI
161 |
162 | # Subsystem Restart
163 | persist.vendor.ssr.restart_level=ALL_ENABLE
164 |
165 | # USB
166 | sys.usb.mtp.batchcancel=1
167 | vendor.usb.diag.func.name=ffs
168 | vendor.usb.dpl.inst.name=dpl
169 | vendor.usb.qdss.inst.name=qdss_sw
170 | vendor.usb.rmnet.func.name=gsi
171 | vendor.usb.rmnet.inst.name=rmnet
172 | vendor.usb.rndis.func.name=gsi
173 | vendor.usb.product_string=Nothing Phone (1)
174 | vendor.usb.use_ffs_mtp=1
175 | vendor.usb.use_gadget_hal=0
176 |
177 | # WiFi
178 | wifi.aware.interface=wifi-aware0
179 |
180 | # Zygote
181 | zygote.critical_window.minute=10
182 |
--------------------------------------------------------------------------------
/proprietary-firmware.txt:
--------------------------------------------------------------------------------
1 | ## All proprietary files from this list, unless pinned and noted otherwise,
2 | ## are from Nothing Phone (1) (3.0).
3 |
4 | abl.img;AB
5 | aop.img;AB
6 | bluetooth.img;AB
7 | cpucp.img;AB
8 | devcfg.img;AB
9 | dsp.img;AB
10 | featenabler.img;AB
11 | hyp.img;AB
12 | imagefv.img;AB
13 | keymaster.img;AB
14 | modem.img;AB
15 | multiimgoem.img;AB
16 | qupfw.img;AB
17 | shrm.img;AB
18 | tz.img;AB
19 | uefisecapp.img;AB
20 | xbl.img;AB
21 | xbl_config.img;AB
22 |
--------------------------------------------------------------------------------
/rootdir/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2025 The LineageOS Project
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 | //
6 |
7 | // Init scripts
8 | sh_binary {
9 | name: "init.class_main.sh",
10 | src: "bin/init.class_main.sh",
11 | vendor: true,
12 | }
13 |
14 | sh_binary {
15 | name: "init.kernel.post_boot.sh",
16 | src: "bin/init.kernel.post_boot.sh",
17 | vendor: true,
18 | }
19 |
20 | sh_binary {
21 | name: "init.qcom.sh",
22 | src: "bin/init.qcom.sh",
23 | vendor: true,
24 | }
25 |
26 | sh_binary {
27 | name: "init.qti.kernel.sh",
28 | src: "bin/init.qti.kernel.sh",
29 | vendor: true,
30 | }
31 |
32 | // fstab
33 | prebuilt_etc {
34 | name: "fstab.default",
35 | src: "etc/fstab.default",
36 | vendor: true,
37 | vendor_ramdisk_available: true,
38 | }
39 |
40 | // Init configuration files
41 | prebuilt_etc {
42 | name: "init.qcom.rc",
43 | src: "etc/init.qcom.rc",
44 | sub_dir: "init/hw",
45 | vendor: true,
46 | }
47 |
48 | prebuilt_etc {
49 | name: "init.qti.kernel.rc",
50 | src: "etc/init.qti.kernel.rc",
51 | sub_dir: "init/hw",
52 | vendor: true,
53 | }
54 |
55 | prebuilt_etc {
56 | name: "init.recovery.qcom.rc",
57 | src: "etc/init.recovery.qcom.rc",
58 | sub_dir: "init",
59 | recovery: true,
60 | }
61 |
62 | prebuilt_etc {
63 | name: "init.target.rc",
64 | src: "etc/init.target.rc",
65 | sub_dir: "init/hw",
66 | vendor: true,
67 | }
68 |
69 | prebuilt_etc {
70 | name: "ueventd.qcom.rc",
71 | filename: "ueventd.rc",
72 | src: "etc/ueventd.qcom.rc",
73 | vendor: true,
74 | }
75 |
--------------------------------------------------------------------------------
/rootdir/bin/init.class_main.sh:
--------------------------------------------------------------------------------
1 | #! /vendor/bin/sh
2 | # Copyright (c) 2013-2014, 2019 The Linux Foundation. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | # * Redistributions of source code must retain the above copyright
7 | # notice, this list of conditions and the following disclaimer.
8 | # * Redistributions in binary form must reproduce the above copyright
9 | # notice, this list of conditions and the following disclaimer in the
10 | # documentation and/or other materials provided with the distribution.
11 | # * Neither the name of The Linux Foundation nor
12 | # the names of its contributors may be used to endorse or promote
13 | # products derived from this software without specific prior written
14 | # permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 | #
29 | # start ril-daemon only for targets on which radio is present
30 | #
31 | baseband=`getprop ro.baseband`
32 | sgltecsfb=`getprop persist.vendor.radio.sglte_csfb`
33 | datamode=`getprop persist.vendor.data.mode`
34 | low_ram=`getprop ro.config.low_ram`
35 | case "$baseband" in
36 | "apq" | "sda" | "qcs" )
37 | setprop ro.vendor.radio.noril yes
38 | stop vendor.ril-daemon
39 | stop vendor.qcrild
40 | esac
41 | case "$baseband" in
42 | "msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3" | "sdm" | "sdx" | "sm6")
43 | start vendor.qcrild
44 | case "$baseband" in
45 | "svlte2a" | "csfb")
46 | start qmiproxy
47 | ;;
48 | "sglte" | "sglte2" )
49 | if [ "x$sgltecsfb" != "xtrue" ]; then
50 | start qmiproxy
51 | else
52 | setprop persist.vendor.radio.voice.modem.index 0
53 | fi
54 | ;;
55 | esac
56 | multisim=`getprop persist.radio.multisim.config`
57 | if [ "$multisim" = "dsds" ] || [ "$multisim" = "dsda" ]; then
58 | start vendor.qcrild2
59 | elif [ "$multisim" = "tsts" ]; then
60 | start vendor.qcrild2
61 | start vendor.qcrild3
62 | fi
63 | case "$datamode" in
64 | "tethered")
65 | start vendor.dataqti
66 | if [ "$low_ram" != "true" ]; then
67 | start vendor.dataadpl
68 | fi
69 | ;;
70 | "concurrent")
71 | start vendor.dataqti
72 | if [ "$low_ram" != "true" ]; then
73 | start vendor.dataadpl
74 | fi
75 | ;;
76 | *)
77 | ;;
78 | esac
79 | esac
80 | #
81 | # Allow persistent faking of bms
82 | # User needs to set fake bms charge in persist.vendor.bms.fake_batt_capacity
83 | #
84 | fake_batt_capacity=`getprop persist.vendor.bms.fake_batt_capacity`
85 | case "$fake_batt_capacity" in
86 | "") ;; #Do nothing here
87 | * )
88 | echo "$fake_batt_capacity" > /sys/class/power_supply/battery/capacity
89 | ;;
90 | esac
--------------------------------------------------------------------------------
/rootdir/bin/init.kernel.post_boot.sh:
--------------------------------------------------------------------------------
1 | #=============================================================================
2 | # Copyright (c) 2020-2021 Qualcomm Technologies, Inc.
3 | # All Rights Reserved.
4 | # Confidential and Proprietary - Qualcomm Technologies, Inc.
5 | #
6 | # Copyright (c) 2009-2012, 2014-2019, The Linux Foundation. All rights reserved.
7 | #
8 | # Redistribution and use in source and binary forms, with or without
9 | # modification, are permitted provided that the following conditions are met:
10 | # * Redistributions of source code must retain the above copyright
11 | # notice, this list of conditions and the following disclaimer.
12 | # * Redistributions in binary form must reproduce the above copyright
13 | # notice, this list of conditions and the following disclaimer in the
14 | # documentation and/or other materials provided with the distribution.
15 | # * Neither the name of The Linux Foundation nor
16 | # the names of its contributors may be used to endorse or promote
17 | # products derived from this software without specific prior written
18 | # permission.
19 | #
20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
30 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | #=============================================================================
32 |
33 | function configure_zram_parameters() {
34 | MemTotalStr=`cat /proc/meminfo | grep MemTotal`
35 | MemTotal=${MemTotalStr:16:8}
36 |
37 | low_ram=`getprop ro.config.low_ram`
38 |
39 | # Zram disk - 75% for Go and < 2GB devices .
40 | # For >2GB Non-Go devices, size = 50% of RAM size. Limit the size to 4GB.
41 | # And enable lz4 zram compression for Go targets.
42 |
43 | let RamSizeGB="( $MemTotal / 1048576 ) + 1"
44 | diskSizeUnit=M
45 | if [ $RamSizeGB -le 2 ]; then
46 | let zRamSizeMB="( $RamSizeGB * 1024 ) * 3 / 4"
47 | else
48 | let zRamSizeMB="( $RamSizeGB * 1024 ) / 2"
49 | fi
50 |
51 | # use MB avoid 32 bit overflow
52 | if [ $zRamSizeMB -gt 4096 ]; then
53 | let zRamSizeMB=4096
54 | fi
55 |
56 | if [ "$low_ram" == "true" ]; then
57 | echo lz4 > /sys/block/zram0/comp_algorithm
58 | fi
59 |
60 | if [ -f /sys/block/zram0/disksize ]; then
61 | if [ -f /sys/block/zram0/use_dedup ]; then
62 | echo 1 > /sys/block/zram0/use_dedup
63 | fi
64 | echo "$zRamSizeMB""$diskSizeUnit" > /sys/block/zram0/disksize
65 |
66 | # ZRAM may use more memory than it saves if SLAB_STORE_USER
67 | # debug option is enabled.
68 | if [ -e /sys/kernel/slab/zs_handle ]; then
69 | echo 0 > /sys/kernel/slab/zs_handle/store_user
70 | fi
71 | if [ -e /sys/kernel/slab/zspage ]; then
72 | echo 0 > /sys/kernel/slab/zspage/store_user
73 | fi
74 |
75 | mkswap /dev/block/zram0
76 | swapon /dev/block/zram0 -p 32758
77 | fi
78 | }
79 |
80 | function configure_read_ahead_kb_values() {
81 | MemTotalStr=`cat /proc/meminfo | grep MemTotal`
82 | MemTotal=${MemTotalStr:16:8}
83 |
84 | dmpts=$(ls /sys/block/*/queue/read_ahead_kb | grep -e dm -e mmc)
85 |
86 | # Set 128 for <= 3GB &
87 | # set 512 for >= 4GB targets.
88 | if [ $MemTotal -le 3145728 ]; then
89 | ra_kb=128
90 | else
91 | ra_kb=512
92 | fi
93 | if [ -f /sys/block/mmcblk0/bdi/read_ahead_kb ]; then
94 | echo $ra_kb > /sys/block/mmcblk0/bdi/read_ahead_kb
95 | fi
96 | if [ -f /sys/block/mmcblk0rpmb/bdi/read_ahead_kb ]; then
97 | echo $ra_kb > /sys/block/mmcblk0rpmb/bdi/read_ahead_kb
98 | fi
99 | for dm in $dmpts; do
100 | echo $ra_kb > $dm
101 | done
102 | }
103 |
104 | function configure_memory_parameters() {
105 | # Set Memory parameters.
106 | #
107 | # Set per_process_reclaim tuning parameters
108 | # All targets will use vmpressure range 50-70,
109 | # All targets will use 512 pages swap size.
110 | #
111 | # Set Low memory killer minfree parameters
112 | # 32 bit Non-Go, all memory configurations will use 15K series
113 | # 32 bit Go, all memory configurations will use uLMK + Memcg
114 | # 64 bit will use Google default LMK series.
115 | #
116 | # Set ALMK parameters (usually above the highest minfree values)
117 | # vmpressure_file_min threshold is always set slightly higher
118 | # than LMK minfree's last bin value for all targets. It is calculated as
119 | # vmpressure_file_min = (last bin - second last bin ) + last bin
120 | #
121 | # Set allocstall_threshold to 0 for all targets.
122 | #
123 |
124 | ProductName=`getprop ro.product.name`
125 |
126 | configure_zram_parameters
127 | configure_read_ahead_kb_values
128 | echo 100 > /proc/sys/vm/swappiness
129 |
130 | # Disable wsf beacause we are using efk.
131 | # wsf Range : 1..1000. So set to bare minimum value 1.
132 | echo 1 > /proc/sys/vm/watermark_scale_factor
133 |
134 | #Spawn 2 kswapd threads which can help in fast reclaiming of pages
135 | echo 2 > /proc/sys/vm/kswapd_threads
136 | }
137 |
138 | rev=`cat /sys/devices/soc0/revision`
139 | ddr_type=`od -An -tx /proc/device-tree/memory/ddr_device_type`
140 | ddr_type4="07"
141 | ddr_type5="08"
142 |
143 | # Core control parameters for gold
144 | # Prefer CPU4 for isolation based on the thermal characteristics.
145 | echo 1 0 0 > /sys/devices/system/cpu/cpu4/core_ctl/not_preferred
146 | echo 2 > /sys/devices/system/cpu/cpu4/core_ctl/min_cpus
147 | echo 60 > /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres
148 | echo 30 > /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres
149 | echo 100 > /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms
150 | echo 3 > /sys/devices/system/cpu/cpu4/core_ctl/task_thres
151 |
152 | # Core control parameters for gold+
153 | echo 0 > /sys/devices/system/cpu/cpu7/core_ctl/min_cpus
154 | echo 60 > /sys/devices/system/cpu/cpu7/core_ctl/busy_up_thres
155 | echo 30 > /sys/devices/system/cpu/cpu7/core_ctl/busy_down_thres
156 | echo 100 > /sys/devices/system/cpu/cpu7/core_ctl/offline_delay_ms
157 | echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/task_thres
158 |
159 | # Controls how many more tasks should be eligible to run on gold CPUs
160 | # w.r.t number of gold CPUs available to trigger assist (max number of
161 | # tasks eligible to run on previous cluster minus number of CPUs in
162 | # the previous cluster).
163 | #
164 | # Setting to 1 by default which means there should be at least
165 | # 4 tasks eligible to run on gold cluster (tasks running on gold cores
166 | # plus misfit tasks on silver cores) to trigger assitance from gold+.
167 | echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/nr_prev_assist_thresh
168 |
169 | # Disable Core control on silver
170 | echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/enable
171 |
172 | # Setting b.L scheduler parameters
173 | echo 71 95 > /proc/sys/kernel/sched_upmigrate
174 | echo 65 85 > /proc/sys/kernel/sched_downmigrate
175 | echo 100 > /proc/sys/kernel/sched_group_upmigrate
176 | echo 85 > /proc/sys/kernel/sched_group_downmigrate
177 | echo 1 > /proc/sys/kernel/sched_walt_rotate_big_tasks
178 |
179 |
180 | echo 0 > /proc/sys/kernel/sched_coloc_busy_hysteresis_enable_cpus
181 |
182 | # cpuset parameters
183 | echo 0-3 > /dev/cpuset/background/cpus
184 | echo 0-3 > /dev/cpuset/system-background/cpus
185 |
186 | # Turn off scheduler boost at the end
187 | echo 0 > /proc/sys/kernel/sched_boost
188 |
189 | # configure governor settings for silver cluster
190 | echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
191 | echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/down_rate_limit_us
192 | echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/up_rate_limit_us
193 | echo 1152000 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/hispeed_freq
194 | echo 691200 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
195 | echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/pl
196 |
197 | # configure input boost settings
198 | echo "0:1152000" > /sys/devices/system/cpu/cpu_boost/input_boost_freq
199 | echo 120 > /sys/devices/system/cpu/cpu_boost/input_boost_ms
200 |
201 | # configure governor settings for gold cluster
202 | echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor
203 | echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/down_rate_limit_us
204 | echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/up_rate_limit_us
205 | echo 1228800 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/hispeed_freq
206 | echo 691200 > /sys/devices/system/cpu/cpufreq/policy4/scaling_min_freq
207 | echo 85 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/hispeed_load
208 | echo -6 > /sys/devices/system/cpu/cpu4/sched_load_boost
209 | echo -6 > /sys/devices/system/cpu/cpu5/sched_load_boost
210 | echo -6 > /sys/devices/system/cpu/cpu6/sched_load_boost
211 | echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/rtg_boost_freq
212 | echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/pl
213 |
214 | # configure governor settings for gold+ cluster
215 | echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy7/scaling_governor
216 | echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/down_rate_limit_us
217 | echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/up_rate_limit_us
218 | echo 1324800 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/hispeed_freq
219 | echo 806400 > /sys/devices/system/cpu/cpufreq/policy7/scaling_min_freq
220 | echo 85 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/hispeed_load
221 | echo -6 > /sys/devices/system/cpu/cpu7/sched_load_boost
222 | echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/rtg_boost_freq
223 | echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/pl
224 |
225 | # colocation V3 settings
226 | echo 691200 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/rtg_boost_freq
227 | echo 51 > /proc/sys/kernel/sched_min_task_util_for_boost
228 | echo 35 > /proc/sys/kernel/sched_min_task_util_for_colocation
229 | echo 20000000 > /proc/sys/kernel/sched_task_unfilter_period
230 |
231 | # Enable conservative pl
232 | echo 1 > /proc/sys/kernel/sched_conservative_pl
233 |
234 | # configure RIMPS for L3 DCVS
235 | for c0_rimps_l3 in /sys/devices/system/cpu/memlat/c0_memlat/cpu0-cpu-l3-lat
236 | do
237 | cat $c0_rimps_l3/available_frequencies | cut -d " " -f 1 > $c0_rimps_l3/min_freq
238 | echo 400 > $c0_rimps_l3/ratio_ceil
239 | echo 3 > $c0_rimps_l3/sample_ms
240 | done
241 |
242 | for c4_rimps_l3 in /sys/devices/system/cpu/memlat/c4_memlat/cpu4-cpu-l3-lat
243 | do
244 | cat $c4_rimps_l3/available_frequencies | cut -d " " -f 1 > $c4_rimps_l3/min_freq
245 | echo 4000 > $c4_rimps_l3/ratio_ceil
246 | echo 3 > $c4_rimps_l3/sample_ms
247 | echo 60 > $c4_rimps_l3/l2wb_pct
248 | echo 25000 > $c4_rimps_l3/l2wb_filter
249 | done
250 |
251 | for c7_rimps_l3 in /sys/devices/system/cpu/memlat/c7_memlat/cpu7-cpu-l3-lat
252 | do
253 | cat $c7_rimps_l3/available_frequencies | cut -d " " -f 1 > $c7_rimps_l3/min_freq
254 | echo 20000 > $c7_rimps_l3/ratio_ceil
255 | echo 3 > $c7_rimps_l3/sample_ms
256 | echo 60 > $c7_rimps_l3/l2wb_pct
257 | echo 25000 > $c7_rimps_l3/l2wb_filter
258 | done
259 |
260 |
261 | # configure bus-dcvs
262 | for device in /sys/devices/platform/soc
263 | do
264 | for cpubw in $device/*cpu-cpu-llcc-bw/devfreq/*cpu-cpu-llcc-bw
265 | do
266 | cat $cpubw/available_frequencies | cut -d " " -f 1 > $cpubw/min_freq
267 | echo "2288 4577 7110 9155 12298 14236 15258" > $cpubw/bw_hwmon/mbps_zones
268 | echo 4 > $cpubw/bw_hwmon/sample_ms
269 | echo 68 > $cpubw/bw_hwmon/io_percent
270 | echo 20 > $cpubw/bw_hwmon/hist_memory
271 | echo 0 > $cpubw/bw_hwmon/hyst_length
272 | echo 80 > $cpubw/bw_hwmon/down_thres
273 | echo 0 > $cpubw/bw_hwmon/guard_band_mbps
274 | echo 250 > $cpubw/bw_hwmon/up_scale
275 | echo 1600 > $cpubw/bw_hwmon/idle_mbps
276 | echo 40 > $cpubw/polling_interval
277 | done
278 |
279 | for llccbw in $device/*cpu-llcc-ddr-bw/devfreq/*cpu-llcc-ddr-bw
280 | do
281 | cat $llccbw/available_frequencies | cut -d " " -f 1 > $llccbw/min_freq
282 | if [ ${ddr_type:4:2} == $ddr_type4 ]; then
283 | echo "1144 1720 2086 2929 3879 5931 6515 8136" > $llccbw/bw_hwmon/mbps_zones
284 | elif [ ${ddr_type:4:2} == $ddr_type5 ]; then
285 | echo "1144 1720 2086 2929 3879 5931 6515 7980 12191" > $llccbw/bw_hwmon/mbps_zones
286 | fi
287 | echo 4 > $llccbw/bw_hwmon/sample_ms
288 | echo 68 > $llccbw/bw_hwmon/io_percent
289 | echo 20 > $llccbw/bw_hwmon/hist_memory
290 | echo 0 > $llccbw/bw_hwmon/hyst_length
291 | echo 80 > $llccbw/bw_hwmon/down_thres
292 | echo 0 > $llccbw/bw_hwmon/guard_band_mbps
293 | echo 250 > $llccbw/bw_hwmon/up_scale
294 | echo 1600 > $llccbw/bw_hwmon/idle_mbps
295 | echo 48 > $llccbw/polling_interval
296 | done
297 |
298 | for l3bw in $device/*snoop-l3-bw/devfreq/*snoop-l3-bw
299 | do
300 | cat $l3bw/available_frequencies | cut -d " " -f 1 > $l3bw/min_freq
301 | echo 4 > $l3bw/bw_hwmon/sample_ms
302 | echo 10 > $l3bw/bw_hwmon/io_percent
303 | echo 20 > $l3bw/bw_hwmon/hist_memory
304 | echo 10 > $l3bw/bw_hwmon/hyst_length
305 | echo 0 > $l3bw/bw_hwmon/down_thres
306 | echo 0 > $l3bw/bw_hwmon/guard_band_mbps
307 | echo 0 > $l3bw/bw_hwmon/up_scale
308 | echo 1600 > $l3bw/bw_hwmon/idle_mbps
309 | echo 9155 > $l3bw/max_freq
310 | echo 40 > $l3bw/polling_interval
311 | done
312 |
313 | # configure mem_latency settings for LLCC and DDR scaling and qoslat
314 | for memlat in $device/*lat/devfreq/*lat
315 | do
316 | cat $memlat/available_frequencies | cut -d " " -f 1 > $memlat/min_freq
317 | echo 8 > $memlat/polling_interval
318 | echo 400 > $memlat/mem_latency/ratio_ceil
319 | done
320 |
321 | # configure compute settings for silver latfloor
322 | for latfloor in $device/*cpu0-cpu*latfloor/devfreq/*cpu0-cpu*latfloor
323 | do
324 | cat $latfloor/available_frequencies | cut -d " " -f 1 > $latfloor/min_freq
325 | echo 8 > $latfloor/polling_interval
326 | done
327 |
328 | # configure compute settings for gold latfloor
329 | for latfloor in $device/*cpu4-cpu*latfloor/devfreq/*cpu4-cpu*latfloor
330 | do
331 | cat $latfloor/available_frequencies | cut -d " " -f 1 > $latfloor/min_freq
332 | echo 8 > $latfloor/polling_interval
333 | done
334 |
335 | # configure mem_latency settings for prime latfloor
336 | for latfloor in $device/*cpu7-cpu*latfloor/devfreq/*cpu7-cpu*latfloor
337 | do
338 | cat $latfloor/available_frequencies | cut -d " " -f 1 > $latfloor/min_freq
339 | echo 8 > $latfloor/polling_interval
340 | echo 25000 > $latfloor/mem_latency/ratio_ceil
341 | done
342 |
343 | # qoslat ratio ceil
344 | for qoslat in $device/*qoslat/devfreq/*qoslat
345 | do
346 | echo 50 > $qoslat/mem_latency/ratio_ceil
347 | done
348 | done
349 |
350 | #Enable sleep and set s2idle as default suspend mode
351 | echo N > /sys/module/lpm_levels/parameters/sleep_disabled
352 | echo s2idle > /sys/power/mem_sleep
353 |
354 | configure_memory_parameters
355 |
356 | setprop vendor.post_boot.parsed 1
357 |
--------------------------------------------------------------------------------
/rootdir/bin/init.qcom.sh:
--------------------------------------------------------------------------------
1 | #! /vendor/bin/sh
2 |
3 | # Copyright (c) 2009-2016, The Linux Foundation. All rights reserved.
4 | #
5 | # Redistribution and use in source and binary forms, with or without
6 | # modification, are permitted provided that the following conditions are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of The Linux Foundation nor
13 | # the names of its contributors may be used to endorse or promote
14 | # products derived from this software without specific prior written
15 | # permission.
16 | #
17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | #
29 |
30 | #
31 | # Make modem config folder and copy firmware config to that folder for RIL
32 | #
33 | if [ -f /data/vendor/modem_config/ver_info.txt ]; then
34 | prev_version_info=`cat /data/vendor/modem_config/ver_info.txt`
35 | else
36 | prev_version_info=""
37 | fi
38 |
39 | cur_version_info=`cat /vendor/firmware_mnt/verinfo/ver_info.txt`
40 | if [ ! -f /vendor/firmware_mnt/verinfo/ver_info.txt -o "$prev_version_info" != "$cur_version_info" ]; then
41 | # add W for group recursively before delete
42 | chmod g+w -R /data/vendor/modem_config/*
43 | rm -rf /data/vendor/modem_config/*
44 | # preserve the read only mode for all subdir and files
45 | cp --preserve=m -dr /vendor/firmware_mnt/image/modem_pr/mcfg/configs/* /data/vendor/modem_config
46 | cp --preserve=m -d /vendor/firmware_mnt/verinfo/ver_info.txt /data/vendor/modem_config/
47 | cp --preserve=m -d /vendor/firmware_mnt/image/modem_pr/mbn_ota.txt /data/vendor/modem_config/
48 | # the group must be root, otherwise this script could not add "W" for group recursively
49 | chown -hR radio.root /data/vendor/modem_config/*
50 | fi
51 | chmod g-w /data/vendor/modem_config
52 | setprop ro.vendor.ril.mbn_copy_completed 1
53 |
54 | #add permission for block_size, mem_type, mem_size nodes to collect diag over QDSS by ODL
55 | #application by "oem_2902" group
56 | if [ -e /sys/devices/platform/soc/6048000.tmc/coresight-tmc-etr/block_size ]
57 | then
58 | chown -h root.oem_2902 /sys/devices/platform/soc/6048000.tmc/coresight-tmc-etr/block_size
59 | chmod 660 /sys/devices/platform/soc/6048000.tmc/coresight-tmc-etr/block_size
60 | fi
61 |
62 | #lei.wang add for ABR-4885 to setprop hwid_version
63 | if [ -f /proc/hwid ]; then
64 | hwid=`cat /proc/hwid`
65 | case "$hwid" in
66 | "T0")
67 | setprop persist.vendor.fastrpc.hwid_version T0
68 | ;;
69 | "EVT")
70 | setprop persist.vendor.fastrpc.hwid_version EVT
71 | ;;
72 | "DVT")
73 | setprop persist.vendor.fastrpc.hwid_version DVT
74 | ;;
75 | "PVT")
76 | setprop persist.vendor.fastrpc.hwid_version PVT
77 | ;;
78 | esac
79 | fi
80 |
81 | #wang.ya add for ABR-7525 to setprop efuse
82 | if [ -f /proc/secure_state ]; then
83 | efuse=`cat /proc/secure_state`
84 | case "$efuse" in
85 | "0")
86 | setprop vendor.fastrpc.efuse.state 0
87 | ;;
88 | "1")
89 | setprop vendor.fastrpc.efuse.state 1
90 | ;;
91 | esac
92 | fi
93 |
--------------------------------------------------------------------------------
/rootdir/bin/init.qti.kernel.sh:
--------------------------------------------------------------------------------
1 | #! /vendor/bin/sh
2 | #=============================================================================
3 | # Copyright (c) 2019-2020 Qualcomm Technologies, Inc.
4 | # All Rights Reserved.
5 | # Confidential and Proprietary - Qualcomm Technologies, Inc.
6 | #
7 | # Copyright (c) 2009-2012, 2014-2019, The Linux Foundation. All rights reserved.
8 | #
9 | # Redistribution and use in source and binary forms, with or without
10 | # modification, are permitted provided that the following conditions are met:
11 | # * Redistributions of source code must retain the above copyright
12 | # notice, this list of conditions and the following disclaimer.
13 | # * Redistributions in binary form must reproduce the above copyright
14 | # notice, this list of conditions and the following disclaimer in the
15 | # documentation and/or other materials provided with the distribution.
16 | # * Neither the name of The Linux Foundation nor
17 | # the names of its contributors may be used to endorse or promote
18 | # products derived from this software without specific prior written
19 | # permission.
20 | #
21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
25 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | #=============================================================================
33 |
34 | verify_pasr_support()
35 | {
36 | ddr_type=`od -An -tx /proc/device-tree/memory/ddr_device_type`
37 | ddr_type5="08"
38 |
39 | if [ -d /sys/kernel/mem-offline ]; then
40 | #only LPDDR5 supports PAAR
41 | if [ ${ddr_type:4:2} != $ddr_type5 ]; then
42 | setprop vendor.pasr.activemode.enabled false
43 | fi
44 |
45 | setprop vendor.pasr.enabled true
46 | fi
47 | }
48 |
49 | start_msm_irqbalance()
50 | {
51 | if [ -f /vendor/bin/msm_irqbalance ]; then
52 | start vendor.msm_irqbalance
53 | fi
54 | }
55 | start_msm_irqbalance
56 | verify_pasr_support
57 |
--------------------------------------------------------------------------------
/rootdir/etc/fstab.default:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
2 | #
3 | # Redistribution and use in source and binary forms, with or without
4 | # modification, are permitted (subject to the limitations in the
5 | # disclaimer below) provided that the following conditions are met:
6 | #
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | #
10 | # * Redistributions in binary form must reproduce the above
11 | # copyright notice, this list of conditions and the following
12 | # disclaimer in the documentation and/or other materials provided
13 | # with the distribution.
14 | #
15 | # * Neither the name of The Linux Foundation nor the names of its
16 | # contributors may be used to endorse or promote products derived
17 | # from this software without specific prior written permission.
18 | #
19 | # NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
20 | # GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
21 | # HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
22 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27 | # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
29 | # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
31 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 |
33 | # Android fstab file.
34 | # The filesystem that contains the filesystem checker binary (typically /system) cannot
35 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
36 |
37 | #
38 | system /system ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey
39 | system_ext /system_ext ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
40 | product /product ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
41 | vendor /vendor erofs ro wait,slotselect,avb,logical,first_stage_mount
42 | vendor /vendor ext4 ro,barrier=1,discard wait,slotselect,avb,logical,first_stage_mount
43 | vendor_dlkm /vendor_dlkm erofs ro wait,slotselect,avb,logical,first_stage_mount
44 | vendor_dlkm /vendor_dlkm ext4 ro,barrier=1,discard wait,slotselect,avb,logical,first_stage_mount
45 | odm /odm erofs ro wait,slotselect,avb,logical,first_stage_mount
46 | odm /odm ext4 ro,barrier=1,discard wait,slotselect,avb,logical,first_stage_mount
47 | /dev/block/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard wait,check,formattable,first_stage_mount
48 | /dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait
49 | /dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,inlinecrypt,reserve_root=32768,resgid=1065,fsync_mode=nobarrier latemount,wait,check,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized+wrappedkey_v0,keydirectory=/metadata/vold/metadata_encryption,metadata_encryption=aes-256-xts:wrappedkey_v0,quota,reservedsize=128M,sysfs_path=/sys/devices/platform/soc/1d84000.ufshc,checkpoint=fs
50 | /dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
51 | /devices/platform/soc/8804000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
52 | /devices/platform/soc/1da4000.ufshc_card/host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
53 | /devices/platform/soc/*.ssusb/*.dwc3/xhci-hcd.*.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto
54 | /dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait,slotselect
55 | /dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait,slotselect
56 | /dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait,slotselect
57 | /dev/block/bootdevice/by-name/qmcs /mnt/vendor/qmcs vfat noatime,nosuid,nodev,context=u:object_r:vendor_qmcs_file:s0 wait,check,formattable
58 |
--------------------------------------------------------------------------------
/rootdir/etc/init.qti.kernel.rc:
--------------------------------------------------------------------------------
1 | #=============================================================================
2 | # Copyright (c) 2019-2021 Qualcomm Technologies, Inc.
3 | # All Rights Reserved.
4 | # Confidential and Proprietary - Qualcomm Technologies, Inc.
5 | #
6 | # Copyright (c) 2009-2012, 2014-2019, The Linux Foundation. All rights reserved.
7 | #
8 | # Redistribution and use in source and binary forms, with or without
9 | # modification, are permitted provided that the following conditions are met:
10 | # * Redistributions of source code must retain the above copyright
11 | # notice, this list of conditions and the following disclaimer.
12 | # * Redistributions in binary form must reproduce the above copyright
13 | # notice, this list of conditions and the following disclaimer in the
14 | # documentation and/or other materials provided with the distribution.
15 | # * Neither the name of The Linux Foundation nor
16 | # the names of its contributors may be used to endorse or promote
17 | # products derived from this software without specific prior written
18 | # permission.
19 | #
20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
30 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | #=============================================================================
32 | import /vendor/etc/init/hw/init.qti.kernel.test.rc
33 |
34 | on early-init
35 | # Mount tracefs in /sys/kernel/tracing as CONFIG_DEBUG_FS might be
36 | # disabled and /sys/kernel/debug/tracing might not be available
37 | mount tracefs tracefs /sys/kernel/tracing
38 | chmod 0755 /sys/kernel/tracing
39 |
40 | chown root system /dev/kmsg
41 | chmod 0620 /dev/kmsg
42 |
43 | write /proc/sys/kernel/sched_boost 1
44 |
45 | write /proc/sys/kernel/firmware_config/force_sysfs_fallback 1
46 |
47 | on init
48 | # Create cgroup mount point for memory
49 | mkdir /sys/fs/cgroup/memory/bg 0750 root system
50 | write /sys/fs/cgroup/memory/bg/memory.swappiness 140
51 | write /sys/fs/cgroup/memory/bg/memory.move_charge_at_immigrate 1
52 | chown root system /sys/fs/cgroup/memory/bg/tasks
53 | chmod 0660 /sys/fs/cgroup/memory/bg/tasks
54 |
55 | # update scheduler tunables
56 | write /dev/cpuctl/foreground/cpu.uclamp.sched_boost_no_override 1
57 | write /dev/cpuctl/top-app/cpu.uclamp.sched_boost_no_override 1
58 | write /dev/cpuctl/background/cpu.uclamp.colocate 0
59 | write /dev/cpuctl/foreground/cpu.uclamp.colocate 0
60 | write /dev/cpuctl/top-app/cpu.uclamp.colocate 1
61 |
62 | on early-boot
63 | # Allow subsystem (modem etc) debugging
64 | write /sys/kernel/boot_adsp/boot 1
65 | write /sys/kernel/boot_cdsp/boot 1
66 | write /sys/kernel/boot_slpi/boot 1
67 | write /sys/devices/virtual/cvp/cvp/boot 1
68 |
69 | on boot
70 | # Set the console loglevel to < KERN_WARN
71 | # Set the default message loglevel to KERN_INFO
72 | write /proc/sys/kernel/printk "4 6 1 7"
73 |
74 | # Allow access to emmc rawdump block partition and dload sysfs node
75 | chown root system /dev/block/bootdevice/by-name/rawdump
76 | chmod 0660 /dev/block/bootdevice/by-name/rawdump
77 | chown root system /sys/kernel/dload/emmc_dload
78 | chmod 0660 /sys/kernel/dload/emmc_dload
79 | chown root system /dev/block/bootdevice/by-name/ramdump
80 | chmod 0660 /dev/block/bootdevice/by-name/ramdump
81 | chown root system /sys/kernel/dload/dload_mode
82 | chmod 0660 /sys/kernel/dload/dload_mode
83 |
84 | # set the io-scheduler to bfq on all mq support devices
85 | write /sys/block/sda/queue/scheduler bfq
86 | write /sys/block/sdb/queue/scheduler bfq
87 | write /sys/block/sdc/queue/scheduler bfq
88 | write /sys/block/sdd/queue/scheduler bfq
89 | write /sys/block/sde/queue/scheduler bfq
90 | write /sys/block/sdf/queue/scheduler bfq
91 | write /sys/block/sdg/queue/scheduler bfq
92 | write /sys/block/sdh/queue/scheduler bfq
93 | write /sys/class/block/mmcblk0/queue/scheduler bfq
94 | write /sys/class/block/mmcblk1/queue/scheduler bfq
95 |
96 | # update io-scheduler tunables
97 | write /sys/block/sda/queue/iosched/slice_idle 0
98 | write /sys/block/sdb/queue/iosched/slice_idle 0
99 | write /sys/block/sdc/queue/iosched/slice_idle 0
100 | write /sys/block/sdd/queue/iosched/slice_idle 0
101 | write /sys/block/sde/queue/iosched/slice_idle 0
102 | write /sys/block/sdf/queue/iosched/slice_idle 0
103 | write /sys/block/sdg/queue/iosched/slice_idle 0
104 | write /sys/block/sdh/queue/iosched/slice_idle 0
105 | write /sys/class/block/mmcblk0/queue/iosched/slice_idle 0
106 | write /sys/class/block/mmcblk1/queue/iosched/slice_idle 0
107 |
108 | on post-fs-data
109 | # Create directory used for dump collection
110 | mkdir /data/vendor/ssrdump 0770 root system
111 |
112 | on property:persist.sys.ssr.enable_debug=*
113 | write /sys/module/subsys_pil_tz/parameters/enable_debug ${persist.sys.ssr.enable_debug}
114 |
115 | on property:persist.sys.mba_boot_timeout=*
116 | write /sys/module/pil_msa/parameters/pbl_mba_boot_timeout_ms ${persist.sys.mba_boot_timeout}
117 |
118 | on property:persist.sys.modem_auth_timeout=*
119 | write /sys/module/pil_msa/parameters/modem_auth_timeout_ms ${persist.sys.modem_auth_timeout}
120 |
121 | on property:persist.sys.pil_proxy_timeout=*
122 | write /sys/module/peripheral_loader/parameters/proxy_timeout_ms ${persist.sys.pil_proxy_timeout}
123 |
124 | on property:persist.vendor.ssr.enable_ramdumps=1
125 | write /sys/module/subsystem_restart/parameters/enable_ramdumps 1
126 |
127 | on property:persist.vendor.ssr.enable_ramdumps=0
128 | write /sys/module/subsystem_restart/parameters/enable_ramdumps 0
129 |
130 | on property:persist.vendor.sys.rawdump_copy=1
131 | write /sys/kernel/dload/emmc_dload 1
132 |
133 | on property:persist.vendor.sys.rawdump_copy=0
134 | write /sys/kernel/dload/emmc_dload 0
135 |
136 | service kernel-boot /vendor/bin/sh /vendor/bin/init.qti.kernel.sh
137 | class core
138 | user root
139 | group root
140 | disabled
141 | oneshot
142 |
143 | service kernel-post-boot /vendor/bin/sh /vendor/bin/init.kernel.post_boot.sh
144 | class core
145 | user root
146 | group root system wakelock graphics
147 | disabled
148 | oneshot
149 |
150 | on property:sys.boot_completed=1
151 | write /dev/kmsg "Boot completed "
152 | write /proc/sys/vm/page-cluster 0
153 | start kernel-boot
154 | start kernel-post-boot
155 |
156 | service vendor.msm_irqbalance /vendor/bin/msm_irqbalance -f /system/vendor/etc/msm_irqbalance.conf
157 | class core
158 | user root
159 | group root
160 | disabled
161 |
--------------------------------------------------------------------------------
/rootdir/etc/init.recovery.qcom.rc:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2017-2018,2020 The Linux Foundation. All rights reserved.
2 | #
3 | # Redistribution and use in source and binary forms, with or without
4 | # modification, are permitted provided that the following conditions are met:
5 | # * Redistributions of source code must retain the above copyright
6 | # notice, this list of conditions and the following disclaimer.
7 | # * Redistributions in binary form must reproduce the above copyright
8 | # notice, this list of conditions and the following disclaimer in the
9 | # documentation and/or other materials provided with the distribution.
10 | # * Neither the name of The Linux Foundation nor
11 | # the names of its contributors may be used to endorse or promote
12 | # products derived from this software without specific prior written
13 | # permission.
14 | #
15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | #
27 |
28 | on init
29 | write /sys/class/backlight/panel0-backlight/brightness 200
30 | setprop sys.usb.configfs 1
31 |
32 | on property:ro.boot.usbcontroller=*
33 | setprop sys.usb.controller ${ro.boot.usbcontroller}
34 | write /sys/class/udc/${ro.boot.usbcontroller}/device/../mode peripheral
35 |
36 | on fs
37 | wait /dev/block/platform/soc/${ro.boot.bootdevice}
38 | symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
39 |
--------------------------------------------------------------------------------
/rro_overlays/CarrierConfigOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | runtime_resource_overlay {
2 | name: "CarrierConfigOverlay",
3 | theme: "CarrierConfigOverlay",
4 | product_specific: true,
5 | aaptflags: ["--keep-raw-values"],
6 | }
7 |
--------------------------------------------------------------------------------
/rro_overlays/CarrierConfigOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
21 |
22 |
26 |
27 |
--------------------------------------------------------------------------------
/rro_overlays/WifiResCommon/Android.bp:
--------------------------------------------------------------------------------
1 | runtime_resource_overlay {
2 | name: "WifiResCommon",
3 | product_specific: true,
4 | }
5 |
--------------------------------------------------------------------------------
/rro_overlays/WifiResCommon/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/rro_overlays/WifiResCommon/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | true
8 |
9 |
10 | true
11 |
12 |
16 | true
17 |
18 |
19 | true
20 |
21 |
22 | true
23 |
24 |
25 | true
26 |
27 |
28 | true
29 |
30 |
31 | true
32 |
33 |
34 | true
35 |
36 |
37 | true
38 |
39 |
40 | true
41 |
42 |
43 | true
44 |
45 |
46 | true
47 |
48 |
49 | true
50 |
51 |
53 | true
54 |
55 |
56 | true
57 |
58 |
59 | false
60 |
61 |
62 | true
63 |
64 |
65 | 1000
66 |
67 |
68 | 32
69 |
70 |
72 | 524288,1048576,2097152,524288,1048576,4194304
73 |
74 |
76 | true
77 |
78 |
94 |
95 |
96 | - -93
97 | - -82
98 | - -71
99 | - -65
100 |
101 |
102 |
103 |
104 | Nothing Phone (1)
105 |
106 |
--------------------------------------------------------------------------------
/sensors/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2022 The LineageOS Project
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 | //
6 |
7 | cc_library_shared {
8 | name: "sensors.nothing",
9 | defaults: ["hidl_defaults"],
10 | srcs: [
11 | "Sensor.cpp",
12 | "SensorsSubHal.cpp",
13 | ],
14 | shared_libs: [
15 | "android.hardware.sensors@1.0",
16 | "android.hardware.sensors@2.0",
17 | "android.hardware.sensors@2.0-ScopedWakelock",
18 | "android.hardware.sensors@2.1",
19 | "libcutils",
20 | "libfmq",
21 | "libhardware",
22 | "libhidlbase",
23 | "liblog",
24 | "libpower",
25 | "libutils",
26 | ],
27 | static_libs: [
28 | "android.hardware.sensors@1.0-convert",
29 | "android.hardware.sensors@2.X-multihal",
30 | ],
31 | cflags: [
32 | "-DLOG_TAG=\"sensors.nothing\"",
33 | ],
34 | vendor: true,
35 | }
36 |
--------------------------------------------------------------------------------
/sensors/Sensor.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include "Sensor.h"
18 |
19 | #include
20 | #include
21 | #include
22 |
23 | #include
24 |
25 | namespace {
26 |
27 | static bool readBool(int fd) {
28 | char c;
29 | int rc;
30 |
31 | rc = lseek(fd, 0, SEEK_SET);
32 | if (rc) {
33 | ALOGE("failed to seek fd, err: %d", rc);
34 | return false;
35 | }
36 |
37 | rc = read(fd, &c, sizeof(char));
38 | if (rc != 1) {
39 | ALOGE("failed to read bool from fd, err: %d", rc);
40 | return false;
41 | }
42 |
43 | return c != '0';
44 | }
45 |
46 | static bool readFpState(int fd, int& screenX, int& screenY) {
47 | char buffer[512];
48 | int state = 0;
49 | int rc;
50 |
51 | rc = lseek(fd, 0, SEEK_SET);
52 | if (rc) {
53 | ALOGE("failed to seek: %d", rc);
54 | return false;
55 | }
56 |
57 | rc = read(fd, &buffer, sizeof(buffer));
58 | if (rc < 0) {
59 | ALOGE("failed to read state: %d", rc);
60 | return false;
61 | }
62 |
63 | rc = sscanf(buffer, "%d,%d,%d", &screenX, &screenY, &state);
64 | if (rc < 0) {
65 | ALOGE("failed to parse fp state: %d", rc);
66 | return false;
67 | }
68 |
69 | return state > 0;
70 | }
71 |
72 | } // anonymous namespace
73 |
74 | namespace android {
75 | namespace hardware {
76 | namespace sensors {
77 | namespace V2_1 {
78 | namespace subhal {
79 | namespace implementation {
80 |
81 | using ::android::hardware::sensors::V1_0::MetaDataEventType;
82 | using ::android::hardware::sensors::V1_0::OperationMode;
83 | using ::android::hardware::sensors::V1_0::Result;
84 | using ::android::hardware::sensors::V1_0::SensorFlagBits;
85 | using ::android::hardware::sensors::V1_0::SensorStatus;
86 | using ::android::hardware::sensors::V2_1::Event;
87 | using ::android::hardware::sensors::V2_1::SensorInfo;
88 | using ::android::hardware::sensors::V2_1::SensorType;
89 |
90 | Sensor::Sensor(int32_t sensorHandle, ISensorsEventCallback* callback)
91 | : mIsEnabled(false),
92 | mSamplingPeriodNs(0),
93 | mLastSampleTimeNs(0),
94 | mCallback(callback),
95 | mMode(OperationMode::NORMAL) {
96 | mSensorInfo.sensorHandle = sensorHandle;
97 | mSensorInfo.vendor = "The LineageOS Project";
98 | mSensorInfo.version = 1;
99 | constexpr float kDefaultMaxDelayUs = 1000 * 1000;
100 | mSensorInfo.maxDelay = kDefaultMaxDelayUs;
101 | mSensorInfo.fifoReservedEventCount = 0;
102 | mSensorInfo.fifoMaxEventCount = 0;
103 | mSensorInfo.requiredPermission = "";
104 | mSensorInfo.flags = 0;
105 | mRunThread = std::thread(startThread, this);
106 | }
107 |
108 | Sensor::~Sensor() {
109 | // Ensure that lock is unlocked before calling mRunThread.join() or a
110 | // deadlock will occur.
111 | {
112 | std::unique_lock lock(mRunMutex);
113 | mStopThread = true;
114 | mIsEnabled = false;
115 | mWaitCV.notify_all();
116 | }
117 | mRunThread.join();
118 | }
119 |
120 | const SensorInfo& Sensor::getSensorInfo() const {
121 | return mSensorInfo;
122 | }
123 |
124 | void Sensor::batch(int32_t samplingPeriodNs) {
125 | samplingPeriodNs =
126 | std::clamp(samplingPeriodNs, mSensorInfo.minDelay * 1000, mSensorInfo.maxDelay * 1000);
127 |
128 | if (mSamplingPeriodNs != samplingPeriodNs) {
129 | mSamplingPeriodNs = samplingPeriodNs;
130 | // Wake up the 'run' thread to check if a new event should be generated now
131 | mWaitCV.notify_all();
132 | }
133 | }
134 |
135 | void Sensor::activate(bool enable) {
136 | std::lock_guard lock(mRunMutex);
137 | if (mIsEnabled != enable) {
138 | mIsEnabled = enable;
139 | mWaitCV.notify_all();
140 | }
141 | }
142 |
143 | Result Sensor::flush() {
144 | // Only generate a flush complete event if the sensor is enabled and if the sensor is not a
145 | // one-shot sensor.
146 | if (!mIsEnabled) {
147 | return Result::BAD_VALUE;
148 | }
149 |
150 | // Note: If a sensor supports batching, write all of the currently batched events for the sensor
151 | // to the Event FMQ prior to writing the flush complete event.
152 | Event ev;
153 | ev.sensorHandle = mSensorInfo.sensorHandle;
154 | ev.sensorType = SensorType::META_DATA;
155 | ev.u.meta.what = MetaDataEventType::META_DATA_FLUSH_COMPLETE;
156 | std::vector evs{ev};
157 | mCallback->postEvents(evs, isWakeUpSensor());
158 |
159 | return Result::OK;
160 | }
161 |
162 | void Sensor::startThread(Sensor* sensor) {
163 | sensor->run();
164 | }
165 |
166 | void Sensor::run() {
167 | std::unique_lock runLock(mRunMutex);
168 | constexpr int64_t kNanosecondsInSeconds = 1000 * 1000 * 1000;
169 |
170 | while (!mStopThread) {
171 | if (!mIsEnabled || mMode == OperationMode::DATA_INJECTION) {
172 | mWaitCV.wait(runLock, [&] {
173 | return ((mIsEnabled && mMode == OperationMode::NORMAL) || mStopThread);
174 | });
175 | } else {
176 | timespec curTime;
177 | clock_gettime(CLOCK_REALTIME, &curTime);
178 | int64_t now = (curTime.tv_sec * kNanosecondsInSeconds) + curTime.tv_nsec;
179 | int64_t nextSampleTime = mLastSampleTimeNs + mSamplingPeriodNs;
180 |
181 | if (now >= nextSampleTime) {
182 | mLastSampleTimeNs = now;
183 | nextSampleTime = mLastSampleTimeNs + mSamplingPeriodNs;
184 | mCallback->postEvents(readEvents(), isWakeUpSensor());
185 | }
186 |
187 | mWaitCV.wait_for(runLock, std::chrono::nanoseconds(nextSampleTime - now));
188 | }
189 | }
190 | }
191 |
192 | bool Sensor::isWakeUpSensor() {
193 | return mSensorInfo.flags & static_cast(SensorFlagBits::WAKE_UP);
194 | }
195 |
196 | std::vector Sensor::readEvents() {
197 | std::vector events;
198 | Event event;
199 | event.sensorHandle = mSensorInfo.sensorHandle;
200 | event.sensorType = mSensorInfo.type;
201 | event.timestamp = ::android::elapsedRealtimeNano();
202 | event.u.vec3.x = 0;
203 | event.u.vec3.y = 0;
204 | event.u.vec3.z = 0;
205 | event.u.vec3.status = SensorStatus::ACCURACY_HIGH;
206 | events.push_back(event);
207 | return events;
208 | }
209 |
210 | void Sensor::setOperationMode(OperationMode mode) {
211 | std::lock_guard lock(mRunMutex);
212 | if (mMode != mode) {
213 | mMode = mode;
214 | mWaitCV.notify_all();
215 | }
216 | }
217 |
218 | bool Sensor::supportsDataInjection() const {
219 | return mSensorInfo.flags & static_cast(SensorFlagBits::DATA_INJECTION);
220 | }
221 |
222 | Result Sensor::injectEvent(const Event& event) {
223 | Result result = Result::OK;
224 | if (event.sensorType == SensorType::ADDITIONAL_INFO) {
225 | // When in OperationMode::NORMAL, SensorType::ADDITIONAL_INFO is used to push operation
226 | // environment data into the device.
227 | } else if (!supportsDataInjection()) {
228 | result = Result::INVALID_OPERATION;
229 | } else if (mMode == OperationMode::DATA_INJECTION) {
230 | mCallback->postEvents(std::vector{event}, isWakeUpSensor());
231 | } else {
232 | result = Result::BAD_VALUE;
233 | }
234 | return result;
235 | }
236 |
237 | OneShotSensor::OneShotSensor(int32_t sensorHandle, ISensorsEventCallback* callback)
238 | : Sensor(sensorHandle, callback) {
239 | mSensorInfo.minDelay = -1;
240 | mSensorInfo.maxDelay = 0;
241 | mSensorInfo.flags |= SensorFlagBits::ONE_SHOT_MODE;
242 | }
243 |
244 | UdfpsSensor::UdfpsSensor(int32_t sensorHandle, ISensorsEventCallback* callback)
245 | : OneShotSensor(sensorHandle, callback) {
246 | mSensorInfo.name = "UDFPS Sensor";
247 | mSensorInfo.type =
248 | static_cast(static_cast(SensorType::DEVICE_PRIVATE_BASE) + 1);
249 | mSensorInfo.typeAsString = "org.lineageos.sensor.udfps";
250 | mSensorInfo.maxRange = 2048.0f;
251 | mSensorInfo.resolution = 1.0f;
252 | mSensorInfo.power = 0;
253 | mSensorInfo.flags |= SensorFlagBits::WAKE_UP;
254 |
255 | int rc;
256 |
257 | rc = pipe(mWaitPipeFd);
258 | if (rc < 0) {
259 | mWaitPipeFd[0] = -1;
260 | mWaitPipeFd[1] = -1;
261 | ALOGE("failed to open wait pipe: %d", rc);
262 | }
263 |
264 | mPollFd = open("/sys/class/spi_master/spi0/spi0.0/fts_gesture_fod_pressed", O_RDONLY);
265 | if (mPollFd < 0) {
266 | ALOGE("failed to open poll fd: %d", mPollFd);
267 | }
268 |
269 | if (mWaitPipeFd[0] < 0 || mWaitPipeFd[1] < 0 || mPollFd < 0) {
270 | mStopThread = true;
271 | return;
272 | }
273 |
274 | mPolls[0] = {
275 | .fd = mWaitPipeFd[0],
276 | .events = POLLIN,
277 | };
278 |
279 | mPolls[1] = {
280 | .fd = mPollFd,
281 | .events = POLLERR | POLLPRI,
282 | };
283 | }
284 |
285 | UdfpsSensor::~UdfpsSensor() {
286 | interruptPoll();
287 | }
288 |
289 | void UdfpsSensor::activate(bool enable) {
290 | std::lock_guard lock(mRunMutex);
291 |
292 | if (mIsEnabled != enable) {
293 | mIsEnabled = enable;
294 |
295 | interruptPoll();
296 | mWaitCV.notify_all();
297 | }
298 | }
299 |
300 | void UdfpsSensor::setOperationMode(OperationMode mode) {
301 | Sensor::setOperationMode(mode);
302 | interruptPoll();
303 | }
304 |
305 | void UdfpsSensor::run() {
306 | std::unique_lock runLock(mRunMutex);
307 |
308 | while (!mStopThread) {
309 | if (!mIsEnabled || mMode == OperationMode::DATA_INJECTION) {
310 | mWaitCV.wait(runLock, [&] {
311 | return ((mIsEnabled && mMode == OperationMode::NORMAL) || mStopThread);
312 | });
313 | } else {
314 | // Cannot hold lock while polling.
315 | runLock.unlock();
316 | int rc = poll(mPolls, 2, -1);
317 | runLock.lock();
318 |
319 | if (rc < 0) {
320 | ALOGE("failed to poll: %d", rc);
321 | mStopThread = true;
322 | continue;
323 | }
324 |
325 | if (mPolls[1].revents == mPolls[1].events && readFpState(mPollFd, mScreenX, mScreenY)) {
326 | mIsEnabled = false;
327 | mCallback->postEvents(readEvents(), isWakeUpSensor());
328 | } else if (mPolls[0].revents == mPolls[0].events) {
329 | char buf;
330 | read(mWaitPipeFd[0], &buf, sizeof(buf));
331 | }
332 | }
333 | }
334 | }
335 |
336 | std::vector UdfpsSensor::readEvents() {
337 | std::vector events;
338 | Event event;
339 | event.sensorHandle = mSensorInfo.sensorHandle;
340 | event.sensorType = mSensorInfo.type;
341 | event.timestamp = ::android::elapsedRealtimeNano();
342 | event.u.data[0] = mScreenX;
343 | event.u.data[1] = mScreenY;
344 | events.push_back(event);
345 | return events;
346 | }
347 |
348 | void UdfpsSensor::interruptPoll() {
349 | if (mWaitPipeFd[1] < 0) return;
350 |
351 | char c = '1';
352 | write(mWaitPipeFd[1], &c, sizeof(c));
353 | }
354 |
355 | SingleTapSensor::SingleTapSensor(int32_t sensorHandle, ISensorsEventCallback* callback)
356 | : OneShotSensor(sensorHandle, callback) {
357 | mSensorInfo.name = "Single Tap Sensor";
358 | mSensorInfo.type =
359 | static_cast(static_cast(SensorType::DEVICE_PRIVATE_BASE) + 2);
360 | mSensorInfo.typeAsString = "org.lineageos.sensor.single_touch";
361 | mSensorInfo.maxRange = 2048.0f;
362 | mSensorInfo.resolution = 1.0f;
363 | mSensorInfo.power = 0;
364 | mSensorInfo.flags |= SensorFlagBits::WAKE_UP;
365 |
366 | int rc;
367 |
368 | rc = pipe(mWaitPipeFd);
369 | if (rc < 0) {
370 | mWaitPipeFd[0] = -1;
371 | mWaitPipeFd[1] = -1;
372 | ALOGE("failed to open wait pipe: %d", rc);
373 | }
374 |
375 | mPollFd = open("/sys/class/spi_master/spi0/spi0.0/fts_gesture_single_tap_pressed", O_RDONLY);
376 | if (mPollFd < 0) {
377 | ALOGE("failed to open poll fd: %d", mPollFd);
378 | }
379 |
380 | if (mWaitPipeFd[0] < 0 || mWaitPipeFd[1] < 0 || mPollFd < 0) {
381 | mStopThread = true;
382 | return;
383 | }
384 |
385 | mPolls[0] = {
386 | .fd = mWaitPipeFd[0],
387 | .events = POLLIN,
388 | };
389 |
390 | mPolls[1] = {
391 | .fd = mPollFd,
392 | .events = POLLERR | POLLPRI,
393 | };
394 | }
395 |
396 | SingleTapSensor::~SingleTapSensor() {
397 | interruptPoll();
398 | }
399 |
400 | void SingleTapSensor::activate(bool enable) {
401 | std::lock_guard lock(mRunMutex);
402 |
403 | if (mIsEnabled != enable) {
404 | mIsEnabled = enable;
405 |
406 | interruptPoll();
407 | mWaitCV.notify_all();
408 | }
409 | }
410 |
411 | void SingleTapSensor::setOperationMode(OperationMode mode) {
412 | Sensor::setOperationMode(mode);
413 | interruptPoll();
414 | }
415 |
416 | void SingleTapSensor::run() {
417 | std::unique_lock runLock(mRunMutex);
418 |
419 | while (!mStopThread) {
420 | if (!mIsEnabled || mMode == OperationMode::DATA_INJECTION) {
421 | mWaitCV.wait(runLock, [&] {
422 | return ((mIsEnabled && mMode == OperationMode::NORMAL) || mStopThread);
423 | });
424 | } else {
425 | // Cannot hold lock while polling.
426 | runLock.unlock();
427 | int rc = poll(mPolls, 2, -1);
428 | runLock.lock();
429 |
430 | if (rc < 0) {
431 | ALOGE("failed to poll: %d", rc);
432 | mStopThread = true;
433 | continue;
434 | }
435 |
436 | if (mPolls[1].revents == mPolls[1].events && readBool(mPollFd)) {
437 | mIsEnabled = false;
438 | mCallback->postEvents(readEvents(), isWakeUpSensor());
439 | } else if (mPolls[0].revents == mPolls[0].events) {
440 | char buf;
441 | read(mWaitPipeFd[0], &buf, sizeof(buf));
442 | }
443 | }
444 | }
445 | }
446 |
447 | std::vector SingleTapSensor::readEvents() {
448 | std::vector events;
449 | Event event;
450 | event.sensorHandle = mSensorInfo.sensorHandle;
451 | event.sensorType = mSensorInfo.type;
452 | event.timestamp = ::android::elapsedRealtimeNano();
453 | events.push_back(event);
454 | return events;
455 | }
456 |
457 | void SingleTapSensor::interruptPoll() {
458 | if (mWaitPipeFd[1] < 0) return;
459 |
460 | char c = '1';
461 | write(mWaitPipeFd[1], &c, sizeof(c));
462 | }
463 |
464 | } // namespace implementation
465 | } // namespace subhal
466 | } // namespace V2_1
467 | } // namespace sensors
468 | } // namespace hardware
469 | } // namespace android
470 |
--------------------------------------------------------------------------------
/sensors/Sensor.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #pragma once
18 |
19 | #include
20 | #include
21 | #include
22 | #include
23 |
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 |
30 | using ::android::hardware::sensors::V1_0::OperationMode;
31 | using ::android::hardware::sensors::V1_0::Result;
32 | using ::android::hardware::sensors::V2_1::Event;
33 | using ::android::hardware::sensors::V2_1::SensorInfo;
34 | using ::android::hardware::sensors::V2_1::SensorType;
35 |
36 | namespace android {
37 | namespace hardware {
38 | namespace sensors {
39 | namespace V2_1 {
40 | namespace subhal {
41 | namespace implementation {
42 |
43 | class ISensorsEventCallback {
44 | public:
45 | virtual ~ISensorsEventCallback(){};
46 | virtual void postEvents(const std::vector& events, bool wakeup) = 0;
47 | };
48 |
49 | class Sensor {
50 | public:
51 | Sensor(int32_t sensorHandle, ISensorsEventCallback* callback);
52 | virtual ~Sensor();
53 |
54 | const SensorInfo& getSensorInfo() const;
55 | virtual void batch(int32_t samplingPeriodNs);
56 | virtual void activate(bool enable);
57 | virtual Result flush();
58 |
59 | virtual void setOperationMode(OperationMode mode);
60 | bool supportsDataInjection() const;
61 | Result injectEvent(const Event& event);
62 |
63 | protected:
64 | virtual void run();
65 | virtual std::vector readEvents();
66 | static void startThread(Sensor* sensor);
67 |
68 | bool isWakeUpSensor();
69 |
70 | bool mIsEnabled;
71 | int64_t mSamplingPeriodNs;
72 | int64_t mLastSampleTimeNs;
73 | SensorInfo mSensorInfo;
74 |
75 | std::atomic_bool mStopThread;
76 | std::condition_variable mWaitCV;
77 | std::mutex mRunMutex;
78 | std::thread mRunThread;
79 |
80 | ISensorsEventCallback* mCallback;
81 |
82 | OperationMode mMode;
83 | };
84 |
85 | class OneShotSensor : public Sensor {
86 | public:
87 | OneShotSensor(int32_t sensorHandle, ISensorsEventCallback* callback);
88 |
89 | virtual void batch(int32_t /* samplingPeriodNs */) override {}
90 |
91 | virtual Result flush() override { return Result::BAD_VALUE; }
92 | };
93 |
94 | class UdfpsSensor : public OneShotSensor {
95 | public:
96 | UdfpsSensor(int32_t sensorHandle, ISensorsEventCallback* callback);
97 | virtual ~UdfpsSensor() override;
98 |
99 | virtual void activate(bool enable) override;
100 | virtual void setOperationMode(OperationMode mode) override;
101 |
102 | protected:
103 | virtual void run() override;
104 | virtual std::vector readEvents();
105 |
106 | private:
107 | void interruptPoll();
108 |
109 | struct pollfd mPolls[2];
110 | int mWaitPipeFd[2];
111 | int mPollFd;
112 |
113 | int mScreenX;
114 | int mScreenY;
115 | };
116 |
117 | class SingleTapSensor : public OneShotSensor {
118 | public:
119 | SingleTapSensor(int32_t sensorHandle, ISensorsEventCallback* callback);
120 | virtual ~SingleTapSensor() override;
121 |
122 | virtual void activate(bool enable) override;
123 | virtual void setOperationMode(OperationMode mode) override;
124 |
125 | protected:
126 | virtual void run() override;
127 | virtual std::vector readEvents();
128 |
129 | private:
130 | void interruptPoll();
131 |
132 | struct pollfd mPolls[2];
133 | int mWaitPipeFd[2];
134 | int mPollFd;
135 | };
136 |
137 | } // namespace implementation
138 | } // namespace subhal
139 | } // namespace V2_1
140 | } // namespace sensors
141 | } // namespace hardware
142 | } // namespace android
143 |
--------------------------------------------------------------------------------
/sensors/SensorsSubHal.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include "SensorsSubHal.h"
18 |
19 | #include
20 | #include
21 |
22 | using ::android::hardware::sensors::V2_1::implementation::ISensorsSubHal;
23 | using ::android::hardware::sensors::V2_1::subhal::implementation::SensorsSubHal;
24 |
25 | namespace android {
26 | namespace hardware {
27 | namespace sensors {
28 | namespace V2_1 {
29 | namespace subhal {
30 | namespace implementation {
31 |
32 | using ::android::hardware::Void;
33 | using ::android::hardware::sensors::V2_0::implementation::ScopedWakelock;
34 |
35 | SensorsSubHal::SensorsSubHal() : mCallback(nullptr), mNextHandle(1) {
36 | AddSensor();
37 | AddSensor();
38 | }
39 |
40 | Return SensorsSubHal::getSensorsList_2_1(ISensors::getSensorsList_2_1_cb _hidl_cb) {
41 | std::vector sensors;
42 | for (const auto& sensor : mSensors) {
43 | sensors.push_back(sensor.second->getSensorInfo());
44 | }
45 | _hidl_cb(sensors);
46 | return Void();
47 | }
48 |
49 | Return SensorsSubHal::setOperationMode(OperationMode mode) {
50 | for (auto sensor : mSensors) {
51 | sensor.second->setOperationMode(mode);
52 | }
53 | mCurrentOperationMode = mode;
54 | return Result::OK;
55 | }
56 |
57 | Return SensorsSubHal::activate(int32_t sensorHandle, bool enabled) {
58 | auto sensor = mSensors.find(sensorHandle);
59 | if (sensor != mSensors.end()) {
60 | sensor->second->activate(enabled);
61 | return Result::OK;
62 | }
63 | return Result::BAD_VALUE;
64 | }
65 |
66 | Return SensorsSubHal::batch(int32_t sensorHandle, int64_t samplingPeriodNs,
67 | int64_t /* maxReportLatencyNs */) {
68 | auto sensor = mSensors.find(sensorHandle);
69 | if (sensor != mSensors.end()) {
70 | sensor->second->batch(samplingPeriodNs);
71 | return Result::OK;
72 | }
73 | return Result::BAD_VALUE;
74 | }
75 |
76 | Return SensorsSubHal::flush(int32_t sensorHandle) {
77 | auto sensor = mSensors.find(sensorHandle);
78 | if (sensor != mSensors.end()) {
79 | return sensor->second->flush();
80 | }
81 | return Result::BAD_VALUE;
82 | }
83 |
84 | Return SensorsSubHal::injectSensorData_2_1(const Event& event) {
85 | auto sensor = mSensors.find(event.sensorHandle);
86 | if (sensor != mSensors.end()) {
87 | return sensor->second->injectEvent(event);
88 | }
89 |
90 | return Result::BAD_VALUE;
91 | }
92 |
93 | Return SensorsSubHal::registerDirectChannel(const SharedMemInfo& /* mem */,
94 | ISensors::registerDirectChannel_cb _hidl_cb) {
95 | _hidl_cb(Result::INVALID_OPERATION, -1 /* channelHandle */);
96 | return Return();
97 | }
98 |
99 | Return SensorsSubHal::unregisterDirectChannel(int32_t /* channelHandle */) {
100 | return Result::INVALID_OPERATION;
101 | }
102 |
103 | Return SensorsSubHal::configDirectReport(int32_t /* sensorHandle */,
104 | int32_t /* channelHandle */, RateLevel /* rate */,
105 | ISensors::configDirectReport_cb _hidl_cb) {
106 | _hidl_cb(Result::INVALID_OPERATION, 0 /* reportToken */);
107 | return Return();
108 | }
109 |
110 | Return SensorsSubHal::debug(const hidl_handle& fd, const hidl_vec& args) {
111 | if (fd.getNativeHandle() == nullptr || fd->numFds < 1) {
112 | ALOGE("%s: missing fd for writing", __FUNCTION__);
113 | return Void();
114 | }
115 |
116 | FILE* out = fdopen(dup(fd->data[0]), "w");
117 |
118 | if (args.size() != 0) {
119 | fprintf(out,
120 | "Note: sub-HAL %s currently does not support args. Input arguments are "
121 | "ignored.\n",
122 | getName().c_str());
123 | }
124 |
125 | std::ostringstream stream;
126 | stream << "Available sensors:" << std::endl;
127 | for (auto sensor : mSensors) {
128 | SensorInfo info = sensor.second->getSensorInfo();
129 | stream << "Name: " << info.name << std::endl;
130 | stream << "Min delay: " << info.minDelay << std::endl;
131 | stream << "Flags: " << info.flags << std::endl;
132 | }
133 | stream << std::endl;
134 |
135 | fprintf(out, "%s", stream.str().c_str());
136 |
137 | fclose(out);
138 | return Return();
139 | }
140 |
141 | Return SensorsSubHal::initialize(const sp& halProxyCallback) {
142 | mCallback = halProxyCallback;
143 | setOperationMode(OperationMode::NORMAL);
144 | return Result::OK;
145 | }
146 |
147 | void SensorsSubHal::postEvents(const std::vector& events, bool wakeup) {
148 | ScopedWakelock wakelock = mCallback->createScopedWakelock(wakeup);
149 | mCallback->postEvents(events, std::move(wakelock));
150 | }
151 |
152 | } // namespace implementation
153 | } // namespace subhal
154 | } // namespace V2_1
155 | } // namespace sensors
156 | } // namespace hardware
157 | } // namespace android
158 |
159 | ISensorsSubHal* sensorsHalGetSubHal_2_1(uint32_t* version) {
160 | static SensorsSubHal subHal;
161 | *version = SUB_HAL_2_1_VERSION;
162 | return &subHal;
163 | }
164 |
--------------------------------------------------------------------------------
/sensors/SensorsSubHal.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #pragma once
18 |
19 | #include
20 |
21 | #include "Sensor.h"
22 | #include "V2_1/SubHal.h"
23 |
24 | namespace android {
25 | namespace hardware {
26 | namespace sensors {
27 | namespace V2_1 {
28 | namespace subhal {
29 | namespace implementation {
30 |
31 | using ::android::hardware::sensors::V1_0::OperationMode;
32 | using ::android::hardware::sensors::V1_0::RateLevel;
33 | using ::android::hardware::sensors::V1_0::Result;
34 | using ::android::hardware::sensors::V1_0::SharedMemInfo;
35 | using ::android::hardware::sensors::V2_1::Event;
36 | using ::android::hardware::sensors::V2_1::implementation::IHalProxyCallback;
37 | using ::android::hardware::sensors::V2_1::implementation::ISensorsSubHal;
38 |
39 | class SensorsSubHal : public ISensorsSubHal, public ISensorsEventCallback {
40 | public:
41 | SensorsSubHal();
42 |
43 | Return getSensorsList_2_1(ISensors::getSensorsList_2_1_cb _hidl_cb);
44 | Return injectSensorData_2_1(const Event& event);
45 | Return initialize(const sp& halProxyCallback);
46 |
47 | virtual Return setOperationMode(OperationMode mode);
48 |
49 | OperationMode getOperationMode() const { return mCurrentOperationMode; }
50 |
51 | Return activate(int32_t sensorHandle, bool enabled);
52 |
53 | Return batch(int32_t sensorHandle, int64_t samplingPeriodNs,
54 | int64_t maxReportLatencyNs);
55 |
56 | Return flush(int32_t sensorHandle);
57 |
58 | Return registerDirectChannel(const SharedMemInfo& mem,
59 | ISensors::registerDirectChannel_cb _hidl_cb);
60 |
61 | Return unregisterDirectChannel(int32_t channelHandle);
62 |
63 | Return configDirectReport(int32_t sensorHandle, int32_t channelHandle, RateLevel rate,
64 | ISensors::configDirectReport_cb _hidl_cb);
65 |
66 | Return debug(const hidl_handle& fd, const hidl_vec& args);
67 |
68 | const std::string getName() { return "FakeSubHal"; }
69 |
70 | void postEvents(const std::vector& events, bool wakeup) override;
71 |
72 | protected:
73 | template
74 | void AddSensor() {
75 | std::shared_ptr sensor =
76 | std::make_shared(mNextHandle++ /* sensorHandle */, this /* callback */);
77 | mSensors[sensor->getSensorInfo().sensorHandle] = sensor;
78 | }
79 |
80 | std::map> mSensors;
81 |
82 | sp mCallback;
83 |
84 | private:
85 | OperationMode mCurrentOperationMode = OperationMode::NORMAL;
86 |
87 | int32_t mNextHandle;
88 | };
89 |
90 | } // namespace implementation
91 | } // namespace subhal
92 | } // namespace V2_1
93 | } // namespace sensors
94 | } // namespace hardware
95 | } // namespace android
96 |
--------------------------------------------------------------------------------
/sepolicy/private/dontaudit.te:
--------------------------------------------------------------------------------
1 | # b/148033913
2 | dontaudit fsck self:capability kill;
3 |
4 | # b/151195350
5 | dontaudit linkerconfig self:capability kill;
6 |
7 | # b/152468658
8 | dontaudit vdc self:capability kill;
9 |
--------------------------------------------------------------------------------
/sepolicy/private/glyph_app.te:
--------------------------------------------------------------------------------
1 | typeattribute glyph_app mlstrustedsubject;
2 |
3 | app_domain(glyph_app)
4 |
5 | allow glyph_app {
6 | activity_service
7 | activity_task_service
8 | audio_service
9 | audioserver_service
10 | autofill_service
11 | batteryproperties_service
12 | batterystats_service
13 | content_capture_service
14 | game_service
15 | gpu_service
16 | hint_service
17 | media_session_service
18 | netstats_service
19 | sensorservice_service
20 | surfaceflinger_service
21 | vendor_perf_service
22 | vibrator_manager_service
23 | virtual_device_native_service
24 | }:service_manager find;
25 |
26 | allow glyph_app system_app_data_file:dir create_dir_perms;
27 | allow glyph_app system_app_data_file:{
28 | file
29 | lnk_file
30 | } create_file_perms;
31 |
32 | allow glyph_app sysfs_leds:dir r_dir_perms;
33 | allow glyph_app sysfs_leds:file rw_file_perms;
34 |
35 | allow glyph_app mnt_vendor_file:dir r_dir_perms;
36 | allow glyph_app mnt_vendor_file:file rw_file_perms;
37 | allow glyph_app thermal_service:service_manager find;
38 |
--------------------------------------------------------------------------------
/sepolicy/private/odrefresh.te:
--------------------------------------------------------------------------------
1 | allow odrefresh self:capability kill;
2 |
--------------------------------------------------------------------------------
/sepolicy/private/property_contexts:
--------------------------------------------------------------------------------
1 | # Camera
2 | ro.camera.req.fmq. u:object_r:exported_default_prop:s0
3 | ro.camera.res.fmq. u:object_r:exported_default_prop:s0
4 |
5 | # Fingerprint
6 | persist.vendor.overlay.fp_model u:object_r:system_fingerprint_prop:s0
7 | persist.vendor.overlay.fp_serial u:object_r:system_fingerprint_prop:s0
8 | persist.vendor.overlay.fp_vendor u:object_r:system_fingerprint_prop:s0
9 | ro.bootloader.locked u:object_r:system_fingerprint_prop:s0
10 |
--------------------------------------------------------------------------------
/sepolicy/private/seapp_contexts:
--------------------------------------------------------------------------------
1 | # Glyph
2 | user=system seinfo=platform isPrivApp=true name=co.aospa.glyph domain=glyph_app type=system_app_data_file levelFrom=all
3 |
--------------------------------------------------------------------------------
/sepolicy/public/glyph_app.te:
--------------------------------------------------------------------------------
1 | type glyph_app, domain;
--------------------------------------------------------------------------------
/sepolicy/public/property.te:
--------------------------------------------------------------------------------
1 | # Fingerprint
2 | vendor_internal_prop(system_fingerprint_prop)
3 |
4 | # PowerShare
5 | type sysfs_powershare, sysfs_type, fs_type;
6 |
--------------------------------------------------------------------------------
/sepolicy/vendor/device.te:
--------------------------------------------------------------------------------
1 | # Fingerprint
2 | type fingerprint_device, dev_type;
3 |
4 | # Vibrator
5 | type aac_richtap_dev_device, dev_type;
6 |
--------------------------------------------------------------------------------
/sepolicy/vendor/file.te:
--------------------------------------------------------------------------------
1 | # Fingerprint
2 | type fingerprint_data_file, data_file_type, file_type;
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/file_contexts:
--------------------------------------------------------------------------------
1 | # Camera
2 | /vendor/lib(64)?/libipebpsstriping\.so u:object_r:same_process_hal_file:s0
3 |
4 | # Devices
5 | /dev/goodix_fp u:object_r:fingerprint_device:s0
6 | /dev/pn553 u:object_r:nfc_device:s0
7 |
8 | # Fingerprint
9 | /data/vendor/goodix(/.*)? u:object_r:fingerprint_data_file:s0
10 |
11 | # HALs
12 | /vendor/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.3-service\.nothing u:object_r:hal_fingerprint_default_exec:s0
13 |
14 | # LEDs
15 | /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led(/.*)? u:object_r:sysfs_leds:s0
16 |
17 | # Vibrator
18 | /dev/aw8697_haptic u:object_r:aac_richtap_dev_device:s0
19 | /vendor/bin/hw/android.hardware.vibrator.service.spacewar u:object_r:hal_vibrator_default_exec:s0
20 |
--------------------------------------------------------------------------------
/sepolicy/vendor/genfs_contexts:
--------------------------------------------------------------------------------
1 | # Charging Control
2 | genfscon sysfs /class/qcom-battery/charging_enabled u:object_r:vendor_sysfs_usb_supply:s0
3 |
4 | # Display
5 | genfscon sysfs /devices/platform/soc/soc:qcom,dsi-display-primary u:object_r:vendor_sysfs_graphics:s0
6 |
7 | # Media
8 | genfscon sysfs /devices/platform/soc/aa00000.qcom,vidc/sku_version u:object_r:vendor_sysfs_sku:s0
9 |
10 | # Sensors
11 | genfscon sysfs /devices/platform/soc/a94000.spi/spi_master/spi0/spi0.0/fts_gesture_fod_pressed u:object_r:vendor_sysfs_sensors:s0
12 | genfscon sysfs /devices/platform/soc/a94000.spi/spi_master/spi0/spi0.0/fts_gesture_single_tap_pressed u:object_r:vendor_sysfs_sensors:s0
13 |
14 | # PowerShare
15 | genfscon sysfs /class/qcom-battery/wireless_boost_en u:object_r:sysfs_powershare:s0
16 | genfscon sysfs /class/qcom-battery/wls_reverse_status u:object_r:sysfs_powershare:s0
17 |
18 | # Wakeup
19 | genfscon sysfs /devices/platform/soc/984000.i2c/i2c-0/0-0020/wakeup u:object_r:sysfs_wakeup:s0
20 | genfscon sysfs /devices/platform/soc/a84000.i2c/i2c-2/2-0028/wakeup u:object_r:sysfs_wakeup:s0
21 | genfscon sysfs /devices/platform/soc/a94000.spi/spi_master/spi0/spi0.0/wakeup u:object_r:sysfs_wakeup:s0
22 | genfscon sysfs /devices/platform/soc/a98000.spi/spi_master/spi1/spi1.0/wakeup u:object_r:sysfs_wakeup:s0
23 | genfscon sysfs /devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-03/c440000.qcom,spmi:qcom,pm8350b@3:qcom,amoled/wakeup u:object_r:sysfs_wakeup:s0
24 |
--------------------------------------------------------------------------------
/sepolicy/vendor/glyph_app.te:
--------------------------------------------------------------------------------
1 | allow glyph_app vendor_sysfs_battery_supply:dir search;
2 | allow glyph_app vendor_sysfs_battery_supply:file { read open getattr };
3 | allow glyph_app sysfs_powershare:file rw_file_perms;
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_fingerprint_default.te:
--------------------------------------------------------------------------------
1 | allow hal_fingerprint_default self:netlink_socket create_socket_perms_no_ioctl;
2 |
3 | allow hal_fingerprint_default {
4 | fingerprint_device
5 | tee_device
6 | }:chr_file rw_file_perms;
7 |
8 | set_prop(hal_fingerprint_default, system_fingerprint_prop)
9 | get_prop(hal_fingerprint_default, system_fingerprint_prop)
10 |
11 | r_dir_file(hal_fingerprint_default, vendor_sysfs_graphics)
12 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_lineage_health.te:
--------------------------------------------------------------------------------
1 | r_dir_file(hal_lineage_health_default, vendor_sysfs_battery_supply)
2 | allow hal_lineage_health_default vendor_sysfs_battery_supply:file rw_file_perms;
3 | allow hal_lineage_health_default vendor_sysfs_battery_supply:dir search;
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_lineage_powershare_default.te:
--------------------------------------------------------------------------------
1 | allow hal_lineage_powershare_default vendor_sysfs_battery_supply:dir search;
2 | allow hal_lineage_powershare_default vendor_sysfs_battery_supply:file { read open getattr };
3 | allow hal_lineage_powershare_default sysfs_powershare:file rw_file_perms;
4 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_vibrator_default.te:
--------------------------------------------------------------------------------
1 | allow hal_vibrator_default aac_richtap_dev_device:chr_file rw_file_perms;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hwservice_contexts:
--------------------------------------------------------------------------------
1 | # Fingerprint
2 | vendor.goodix.hardware.biometrics.fingerprint::IGoodixFingerprintDaemon u:object_r:hal_fingerprint_hwservice:s0
3 |
4 | # NFC
5 | vendor.nxp.nxpnfc::INxpNfc u:object_r:hal_nfc_hwservice:s0
6 | vendor.nxp.nxpnfclegacy::INxpNfcLegacy u:object_r:hal_nfc_hwservice:s0
7 |
--------------------------------------------------------------------------------
/sepolicy/vendor/property_contexts:
--------------------------------------------------------------------------------
1 | # ADSP
2 | persist.vendor.fastrpc.hwid_version u:object_r:vendor_adsprpc_prop:s0
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/tee.te:
--------------------------------------------------------------------------------
1 | allow tee mnt_vendor_file:dir rw_dir_perms;
2 | allow tee mnt_vendor_file:file r_file_perms;
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vendor_init.te:
--------------------------------------------------------------------------------
1 | get_prop(vendor_init, bootanim_system_prop)
2 |
3 | # Allow vendor init to set SSR property
4 | set_prop(vendor_init, vendor_ssr_prop)
5 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vendor_qti_init_shell.te:
--------------------------------------------------------------------------------
1 | allow vendor_qti_init_shell vendor_sysfs_qdss_dev:file setattr;
2 |
3 | allow vendor_qti_init_shell proc_watermark_scale_factor:file w_file_perms;
4 |
5 | allow vendor_qti_init_shell vendor_qti_init_shell:capability { kill };
6 |
7 | set_prop(vendor_qti_init_shell, vendor_adsprpc_prop)
8 |
--------------------------------------------------------------------------------
/setup-makefiles.py:
--------------------------------------------------------------------------------
1 | #!./extract-files.py --regenerate_makefiles
2 |
--------------------------------------------------------------------------------
/udfps/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2023 The LineageOS Project
3 | //
4 | // SPDX-License-Identifier: Apache-2.0
5 | //
6 |
7 | cc_library {
8 | name: "libudfpshandler",
9 | vendor: true,
10 | srcs: ["UdfpsHandler.cpp"],
11 | shared_libs: [
12 | "libbase",
13 | ],
14 | header_libs: [
15 | "//hardware/nothing:nothingfingerprint_headers",
16 | ],
17 | }
18 |
--------------------------------------------------------------------------------
/udfps/UdfpsHandler.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 The LineageOS Project
3 | *
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | #define LOG_TAG "UdfpsHandler.nothing_Spacewar"
8 |
9 | #include "UdfpsHandler.h"
10 |
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 |
17 | #define FOD_UI_PATH "/sys/devices/platform/soc/soc:qcom,dsi-display-primary/fod_ui"
18 |
19 | static bool readBool(int fd) {
20 | char c;
21 | int rc;
22 |
23 | rc = lseek(fd, 0, SEEK_SET);
24 | if (rc) {
25 | LOG(ERROR) << "failed to seek fd, err: " << rc;
26 | return false;
27 | }
28 |
29 | rc = read(fd, &c, sizeof(char));
30 | if (rc != 1) {
31 | LOG(ERROR) << "failed to seek fd, err: " << rc;
32 | return false;
33 | }
34 |
35 | return c != '0';
36 | }
37 |
38 | class NothingUdfpsHander : public UdfpsHandler {
39 | public:
40 | void init(fingerprint_device_t *device) {
41 | mDevice = device;
42 |
43 | std::thread([this]() {
44 | int fd = open(FOD_UI_PATH, O_RDONLY);
45 | if (fd < 0) {
46 | LOG(ERROR) << "failed to open fd, err: " << fd;
47 | return;
48 | }
49 |
50 | struct pollfd fodUiPoll = {
51 | .fd = fd,
52 | .events = POLLERR | POLLPRI,
53 | .revents = 0,
54 | };
55 |
56 | while (true) {
57 | int rc = poll(&fodUiPoll, 1, -1);
58 | if (rc < 0) {
59 | LOG(ERROR) << "failed to poll fd, err: " << rc;
60 | continue;
61 | }
62 |
63 | mDevice->goodixExtCmd(mDevice, readBool(fd) ? 1 : 0, 0);
64 | }
65 | }).detach();
66 | }
67 |
68 | void onFingerDown(uint32_t /*x*/, uint32_t /*y*/, float /*minor*/, float /*major*/) {
69 | // nothing
70 | }
71 |
72 | void onFingerUp() {
73 | // nothing
74 | }
75 |
76 | void onAcquired(int32_t /*result*/, int32_t /*vendorCode*/) {
77 | // nothing
78 | }
79 |
80 | void cancel() {
81 | // nothing
82 | }
83 |
84 | private:
85 | fingerprint_device_t *mDevice;
86 | };
87 |
88 | static UdfpsHandler* create() {
89 | return new NothingUdfpsHander();
90 | }
91 |
92 | static void destroy(UdfpsHandler* handler) {
93 | delete handler;
94 | }
95 |
96 | extern "C" UdfpsHandlerFactory UDFPS_HANDLER_FACTORY = {
97 | .create = create,
98 | .destroy = destroy,
99 | };
100 |
--------------------------------------------------------------------------------
/vibrator/.clang-format:
--------------------------------------------------------------------------------
1 | BasedOnStyle: Google
2 | AccessModifierOffset: -2
3 | AllowShortFunctionsOnASingleLine: Inline
4 | ColumnLimit: 100
5 | CommentPragmas: NOLINT:.*
6 | DerivePointerAlignment: false
7 | IndentWidth: 4
8 | PointerAlignment: Left
9 | TabWidth: 4
10 | UseTab: Never
11 | PenaltyExcessCharacter: 32
12 |
--------------------------------------------------------------------------------
/vibrator/Android.bp:
--------------------------------------------------------------------------------
1 | cc_binary {
2 | name: "android.hardware.vibrator.service.spacewar",
3 | vendor: true,
4 | cflags: [
5 | "-Wall",
6 | "-Werror",
7 | "-DLOG_TAG=\"android.hardware.vibrator.service.spacewar\"",
8 | ],
9 | relative_install_path: "hw",
10 | init_rc: ["android.hardware.vibrator.service.spacewar.rc"],
11 | vintf_fragments: [
12 | "android.hardware.vibrator.service.spacewar.xml",
13 | ],
14 | srcs: [
15 | "service.cpp",
16 | "Vibrator.cpp",
17 | ],
18 | shared_libs: [
19 | "libcutils",
20 | "libutils",
21 | "liblog",
22 | "libbase",
23 | "libbinder_ndk",
24 | "libaacvibrator",
25 | "android.hardware.vibrator-V2-ndk",
26 | ],
27 | }
28 |
--------------------------------------------------------------------------------
/vibrator/Vibrator.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2025 The LineageOS Project
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | #include "Vibrator.h"
7 |
8 | #include
9 | #include
10 | #include
11 |
12 | #include
13 |
14 | #include "aac_vibra_function.h"
15 |
16 | #define RICHTAP_LIGHT_STRENGTH 69
17 | #define RICHTAP_MEDIUM_STRENGTH 89
18 | #define RICHTAP_STRONG_STRENGTH 99
19 |
20 | namespace aidl {
21 | namespace android {
22 | namespace hardware {
23 | namespace vibrator {
24 |
25 | Vibrator::Vibrator() {
26 | uint32_t deviceType = 0;
27 |
28 | int32_t ret = aac_vibra_init(&deviceType);
29 | if (ret) {
30 | ALOGE("AAC init failed: %d\n", ret);
31 | return;
32 | }
33 |
34 | aac_vibra_looper_start();
35 |
36 | ALOGI("AAC init success: %u\n", deviceType);
37 | }
38 |
39 | ndk::ScopedAStatus Vibrator::getCapabilities(int32_t* _aidl_return) {
40 | *_aidl_return = IVibrator::CAP_ON_CALLBACK | IVibrator::CAP_PERFORM_CALLBACK |
41 | IVibrator::CAP_AMPLITUDE_CONTROL;
42 |
43 | return ndk::ScopedAStatus::ok();
44 | }
45 |
46 | ndk::ScopedAStatus Vibrator::off() {
47 | int32_t ret = aac_vibra_off();
48 | if (ret) {
49 | ALOGE("AAC off failed: %d\n", ret);
50 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_SERVICE_SPECIFIC));
51 | }
52 |
53 | return ndk::ScopedAStatus::ok();
54 | }
55 |
56 | ndk::ScopedAStatus Vibrator::on(int32_t timeoutMs,
57 | const std::shared_ptr& callback) {
58 | int32_t ret = aac_vibra_looper_on(timeoutMs);
59 | if (ret < 0) {
60 | ALOGE("AAC on failed: %d\n", ret);
61 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_SERVICE_SPECIFIC));
62 | }
63 |
64 | if (callback != nullptr) {
65 | std::thread([=] {
66 | usleep(ret * 1000);
67 | callback->onComplete();
68 | }).detach();
69 | }
70 |
71 | return ndk::ScopedAStatus::ok();
72 | }
73 |
74 | ndk::ScopedAStatus Vibrator::perform(Effect effect, EffectStrength es,
75 | const std::shared_ptr& callback,
76 | int32_t* _aidl_return) {
77 | int32_t strength;
78 |
79 | if (effect < Effect::CLICK || effect > Effect::HEAVY_CLICK)
80 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
81 |
82 | switch (es) {
83 | case EffectStrength::LIGHT:
84 | strength = RICHTAP_LIGHT_STRENGTH;
85 | break;
86 | case EffectStrength::MEDIUM:
87 | strength = RICHTAP_MEDIUM_STRENGTH;
88 | break;
89 | case EffectStrength::STRONG:
90 | strength = RICHTAP_STRONG_STRENGTH;
91 | break;
92 | default:
93 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
94 | }
95 |
96 | int32_t ret = aac_vibra_looper_prebaked_effect(static_cast(effect), strength);
97 | if (ret < 0) {
98 | ALOGE("AAC perform failed: %d\n", ret);
99 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_SERVICE_SPECIFIC));
100 | }
101 |
102 | if (callback != nullptr) {
103 | std::thread([=] {
104 | usleep(ret * 1000);
105 | callback->onComplete();
106 | }).detach();
107 | }
108 |
109 | *_aidl_return = ret;
110 |
111 | return ndk::ScopedAStatus::ok();
112 | }
113 |
114 | ndk::ScopedAStatus Vibrator::getSupportedEffects(std::vector* _aidl_return) {
115 | *_aidl_return = {Effect::CLICK, Effect::DOUBLE_CLICK, Effect::TICK,
116 | Effect::THUD, Effect::POP, Effect::HEAVY_CLICK};
117 |
118 | return ndk::ScopedAStatus::ok();
119 | }
120 |
121 | ndk::ScopedAStatus Vibrator::setAmplitude(float amplitude) {
122 | uint8_t tmp = (uint8_t)(amplitude * 0xff);
123 |
124 | int32_t ret = aac_vibra_setAmplitude(tmp);
125 | if (ret) {
126 | ALOGE("AAC set amplitude failed: %d\n", ret);
127 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_SERVICE_SPECIFIC));
128 | }
129 |
130 | return ndk::ScopedAStatus::ok();
131 | }
132 |
133 | ndk::ScopedAStatus Vibrator::setExternalControl(bool enabled __unused) {
134 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
135 | }
136 |
137 | ndk::ScopedAStatus Vibrator::getCompositionDelayMax(int32_t* maxDelayMs __unused) {
138 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
139 | }
140 |
141 | ndk::ScopedAStatus Vibrator::getCompositionSizeMax(int32_t* maxSize __unused) {
142 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
143 | }
144 |
145 | ndk::ScopedAStatus Vibrator::getSupportedPrimitives(
146 | std::vector* supported __unused) {
147 | return ndk::ScopedAStatus::ok();
148 | }
149 |
150 | ndk::ScopedAStatus Vibrator::getPrimitiveDuration(CompositePrimitive primitive __unused,
151 | int32_t* durationMs __unused) {
152 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
153 | }
154 |
155 | ndk::ScopedAStatus Vibrator::compose(const std::vector& composite __unused,
156 | const std::shared_ptr& callback __unused) {
157 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
158 | }
159 |
160 | ndk::ScopedAStatus Vibrator::getSupportedAlwaysOnEffects(std::vector* _aidl_return __unused) {
161 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
162 | }
163 |
164 | ndk::ScopedAStatus Vibrator::alwaysOnEnable(int32_t id __unused, Effect effect __unused,
165 | EffectStrength strength __unused) {
166 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
167 | }
168 |
169 | ndk::ScopedAStatus Vibrator::alwaysOnDisable(int32_t id __unused) {
170 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
171 | }
172 |
173 | ndk::ScopedAStatus Vibrator::getResonantFrequency(float* resonantFreqHz __unused) {
174 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
175 | }
176 |
177 | ndk::ScopedAStatus Vibrator::getQFactor(float* qFactor __unused) {
178 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
179 | }
180 |
181 | ndk::ScopedAStatus Vibrator::getFrequencyResolution(float* freqResolutionHz __unused) {
182 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
183 | }
184 |
185 | ndk::ScopedAStatus Vibrator::getFrequencyMinimum(float* freqMinimumHz __unused) {
186 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
187 | }
188 |
189 | ndk::ScopedAStatus Vibrator::getBandwidthAmplitudeMap(std::vector* _aidl_return __unused) {
190 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
191 | }
192 |
193 | ndk::ScopedAStatus Vibrator::getPwlePrimitiveDurationMax(int32_t* durationMs __unused) {
194 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
195 | }
196 |
197 | ndk::ScopedAStatus Vibrator::getPwleCompositionSizeMax(int32_t* maxSize __unused) {
198 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
199 | }
200 |
201 | ndk::ScopedAStatus Vibrator::getSupportedBraking(std::vector* supported __unused) {
202 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
203 | }
204 |
205 | ndk::ScopedAStatus Vibrator::composePwle(const std::vector& composite __unused,
206 | const std::shared_ptr& callback __unused) {
207 | return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_UNSUPPORTED_OPERATION));
208 | }
209 |
210 | } // namespace vibrator
211 | } // namespace hardware
212 | } // namespace android
213 | } // namespace aidl
214 |
--------------------------------------------------------------------------------
/vibrator/Vibrator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2025 The LineageOS Project
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | #include
7 |
8 | namespace aidl {
9 | namespace android {
10 | namespace hardware {
11 | namespace vibrator {
12 |
13 | class Vibrator : public BnVibrator {
14 | public:
15 | Vibrator();
16 |
17 | ndk::ScopedAStatus getCapabilities(int32_t* _aidl_return) override;
18 | ndk::ScopedAStatus off() override;
19 | ndk::ScopedAStatus on(int32_t timeoutMs,
20 | const std::shared_ptr& callback) override;
21 | ndk::ScopedAStatus perform(Effect effect, EffectStrength strength,
22 | const std::shared_ptr& callback,
23 | int32_t* _aidl_return) override;
24 | ndk::ScopedAStatus getSupportedEffects(std::vector* _aidl_return) override;
25 | ndk::ScopedAStatus setAmplitude(float amplitude) override;
26 | ndk::ScopedAStatus setExternalControl(bool enabled) override;
27 | ndk::ScopedAStatus getCompositionDelayMax(int32_t* maxDelayMs);
28 | ndk::ScopedAStatus getCompositionSizeMax(int32_t* maxSize);
29 | ndk::ScopedAStatus getSupportedPrimitives(std::vector* supported) override;
30 | ndk::ScopedAStatus getPrimitiveDuration(CompositePrimitive primitive,
31 | int32_t* durationMs) override;
32 | ndk::ScopedAStatus compose(const std::vector& composite,
33 | const std::shared_ptr& callback) override;
34 | ndk::ScopedAStatus getSupportedAlwaysOnEffects(std::vector* _aidl_return) override;
35 | ndk::ScopedAStatus alwaysOnEnable(int32_t id, Effect effect, EffectStrength strength) override;
36 | ndk::ScopedAStatus alwaysOnDisable(int32_t id) override;
37 | ndk::ScopedAStatus getResonantFrequency(float* resonantFreqHz) override;
38 | ndk::ScopedAStatus getQFactor(float* qFactor) override;
39 | ndk::ScopedAStatus getFrequencyResolution(float* freqResolutionHz) override;
40 | ndk::ScopedAStatus getFrequencyMinimum(float* freqMinimumHz) override;
41 | ndk::ScopedAStatus getBandwidthAmplitudeMap(std::vector* _aidl_return) override;
42 | ndk::ScopedAStatus getPwlePrimitiveDurationMax(int32_t* durationMs) override;
43 | ndk::ScopedAStatus getPwleCompositionSizeMax(int32_t* maxSize) override;
44 | ndk::ScopedAStatus getSupportedBraking(std::vector* supported) override;
45 | ndk::ScopedAStatus composePwle(const std::vector& composite,
46 | const std::shared_ptr& callback) override;
47 | };
48 |
49 | } // namespace vibrator
50 | } // namespace hardware
51 | } // namespace android
52 | } // namespace aidl
53 |
--------------------------------------------------------------------------------
/vibrator/aac_vibra_function.h:
--------------------------------------------------------------------------------
1 | #ifndef _AAC_VIBRA_FUNCTION_H_
2 | #define _AAC_VIBRA_FUNCTION_H_
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | #include
11 | using namespace std;
12 |
13 | enum PATTERN_PERFORM_STATE {
14 | PATTERN_PERFORM_START = 1,
15 | PATTERN_PERFORM_INTERRUPT, //
16 | PATTERN_PERFORM_RESUME,
17 | PATTERN_PERFORM_BUSY,
18 | PATTERN_PERFORM_END,
19 | INVALID_PATTERN_STATUS,
20 | };
21 | #ifdef __cplusplus
22 | extern "C" {
23 | #endif
24 |
25 | extern int aac_vibra_init(uint32_t* deviceType);
26 | extern int aac_vibra_on(unsigned int timeout_ms);
27 | extern int aac_vibra_off();
28 | extern int aac_vibra_setAmplitude(uint8_t amplitude);
29 | extern int aac_vibra_perform(uint32_t effect, uint32_t strength, uint32_t* timeout_ms);
30 | extern int aac_vibra_performEnvelope(void* vib_info, bool fast_flag);
31 | extern int aac_vibra_performRtp(int fd, uint32_t* timeout_ms);
32 | extern int aac_vibra_performPattern(void* pattern);
33 | extern int aac_vibra_performHe(void* he);
34 | extern int aac_vibra_performHe_with_len(void* he, int32_t len);
35 | extern int aac_vibra_dynamic_scale(uint8_t scale);
36 | extern int aac_vibra_setting_f0(int f0);
37 | extern int aac_vibra_stop(int32_t* index);
38 | #ifdef __cplusplus
39 | }
40 | #endif
41 |
42 | extern void aac_vibra_looper_start();
43 | extern int32_t aac_vibra_looper_post(const int32_t* pattern, int32_t patternLen, int32_t intervalMs,
44 | int32_t loopNum, int32_t amplitude, int32_t freq);
45 |
46 | extern bool aac_vibra_looper_performParam(int32_t intervalMs, int32_t amplitude, int32_t freq);
47 |
48 | extern bool aac_vibra_looper_stopPerformHe(void);
49 |
50 | // new api
51 | extern int32_t aac_vibra_looper_on(uint32_t time_out);
52 | extern int32_t aac_vibra_looper_prebaked_effect(uint32_t effect_id, int32_t strength);
53 | extern int32_t aac_vibra_looper_envelope(const int32_t* envelope_data, uint32_t data_len,
54 | bool fastFlag);
55 | extern int32_t aac_vibra_looper_rtp(int32_t fd);
56 | #endif // _HARDWARE_VIBRATOR_H
57 |
--------------------------------------------------------------------------------
/vibrator/android.hardware.vibrator.service.spacewar.rc:
--------------------------------------------------------------------------------
1 | on late-fs
2 | chown system system /dev/aw8697_haptic
3 | chmod 0600 /dev/aw8697_haptic
4 |
5 | service vendor.vibrator /vendor/bin/hw/android.hardware.vibrator.service.spacewar
6 | class hal
7 | user system
8 | group system input
9 | setenv RICHTAP_DEVICE_PATH /dev/aw8697_haptic
10 | setenv ENV_RICHTAP_CONFIG_PATH /odm/etc/aac_richtap.config
11 |
--------------------------------------------------------------------------------
/vibrator/android.hardware.vibrator.service.spacewar.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 | android.hardware.vibrator
8 | 2
9 | IVibrator/default
10 |
11 |
12 |
--------------------------------------------------------------------------------
/vibrator/service.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2025 The LineageOS Project
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | #include "Vibrator.h"
11 |
12 | using aidl::android::hardware::vibrator::Vibrator;
13 |
14 | int main() {
15 | ABinderProcess_setThreadPoolMaxThreadCount(0);
16 | std::shared_ptr vib = ndk::SharedRefBase::make();
17 |
18 | const std::string instance = std::string() + Vibrator::descriptor + "/default";
19 | binder_status_t status = AServiceManager_addService(vib->asBinder().get(), instance.c_str());
20 | CHECK(status == STATUS_OK);
21 |
22 | ABinderProcess_joinThreadPool();
23 | return EXIT_FAILURE; // should not reach
24 | }
25 |
--------------------------------------------------------------------------------