├── board-info.txt
├── configs
├── sensors
│ └── hals.conf
├── public.libraries.system_ext.txt
├── displayconfig
│ └── display_id_4630946480328692354.xml
└── WCNSS_qcom_cfg.ini
├── setup-makefiles.py
├── sensors
├── .clang-format
├── android.hardware.sensors@2.1-service.phone1-multihal.rc
├── android.hardware.sensors@2.1.phone1-multihal.xml
├── service.cpp
├── Android.bp
├── HalProxyCallback.cpp
├── SensorsSubHal.h
├── Sensor.h
├── SensorsSubHal.cpp
└── Sensor.cpp
├── sepolicy
├── private
│ ├── drmserver.te
│ ├── seapp_contexts
│ ├── property_contexts
│ └── glyph_app.te
└── vendor
│ ├── init.te
│ ├── property.te
│ ├── hal_vibrator_default.te
│ ├── file.te
│ ├── tee.te
│ ├── hal_nfc_default.te
│ ├── platform_app.te
│ ├── hal_camera_default.te
│ ├── vendor_init.te
│ ├── hal_fingerprint_default.te
│ ├── hwservice_contexts
│ ├── genfs_contexts
│ ├── property_contexts
│ └── file_contexts
├── product.prop
├── nothing-fwk
├── Android.bp
└── src
│ └── com
│ └── nothing
│ └── NtFeaturesUtils.java
├── init
├── ueventd.nothing.rc
├── init.phone1.display.rc
├── Android.bp
├── charger_fw_fstab.qti
├── init.qti.media.rc
├── init.qti.media.sh
├── fstab.default
└── init.target.rc
├── odm.prop
├── fingerprint
├── android.hardware.biometrics.fingerprint@2.3-service.phone1.rc
├── android.hardware.biometrics.fingerprint@2.3-service.phone1.xml
├── UdfpsExtension.cpp
├── Android.bp
├── service.cpp
├── BiometricsFingerprint.h
└── BiometricsFingerprint.cpp
├── system.prop
├── AndroidBoard.mk
├── overlay
├── Phone1Nfc
│ ├── Android.bp
│ ├── res
│ │ └── values
│ │ │ └── config.xml
│ └── AndroidManifest.xml
├── Phone1Settings
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── config.xml
├── Phone1SystemUI
│ ├── Android.bp
│ ├── res
│ │ ├── values-land
│ │ │ └── dimens.xml
│ │ └── values
│ │ │ ├── config.xml
│ │ │ └── dimens.xml
│ └── AndroidManifest.xml
├── Phone1Frameworks
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ ├── values
│ │ └── dimens.xml
│ │ └── xml
│ │ └── power_profile.xml
├── Phone1SystemUIAOSPA
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── config.xml
├── Phone1FrameworksAOSPA
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── config.xml
└── Phone1CarrierConfig
│ ├── Android.bp
│ └── AndroidManifest.xml
├── Android.mk
├── Android.bp
├── manifest_phone1.xml
├── NOTICE
├── phone1_vendor_framework_compatibility_matrix.xml
├── vendor.prop
├── update-sha1sums.py
├── BoardConfig.mk
├── radio
└── filesmap
├── extract-files.py
└── device.mk
/board-info.txt:
--------------------------------------------------------------------------------
1 | require board=lahaina|Spacewar
--------------------------------------------------------------------------------
/configs/sensors/hals.conf:
--------------------------------------------------------------------------------
1 | sensors.nothing.so
2 | sensors.ssc.so
3 |
--------------------------------------------------------------------------------
/setup-makefiles.py:
--------------------------------------------------------------------------------
1 | #!./extract-files.py --regenerate_makefiles
2 |
--------------------------------------------------------------------------------
/sensors/.clang-format:
--------------------------------------------------------------------------------
1 | ../../../build/soong/scripts/system-clang-format
--------------------------------------------------------------------------------
/configs/public.libraries.system_ext.txt:
--------------------------------------------------------------------------------
1 | libencoderjpeg_jni.so nopreload
2 |
--------------------------------------------------------------------------------
/sepolicy/private/drmserver.te:
--------------------------------------------------------------------------------
1 | allow drmserver media_rw_data_file:file w_file_perms;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/init.te:
--------------------------------------------------------------------------------
1 | # Fingerprint
2 | set_prop(init, vendor_fingerprint_prop)
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/property.te:
--------------------------------------------------------------------------------
1 | # Fingerprint
2 | vendor_internal_prop(vendor_fingerprint_prop)
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_vibrator_default.te:
--------------------------------------------------------------------------------
1 | allow hal_vibrator_default aac_richtap_dev_device:chr_file {ioctl read write getattr map open};
--------------------------------------------------------------------------------
/sepolicy/vendor/file.te:
--------------------------------------------------------------------------------
1 | # Fingerprint
2 | type fingerprint_device, dev_type;
3 |
4 | # Vibrator
5 | type aac_richtap_dev_device, dev_type;
6 |
--------------------------------------------------------------------------------
/product.prop:
--------------------------------------------------------------------------------
1 | # Camera
2 | ro.camerax.extensions.enabled=true
3 |
4 | # Thermal
5 | persist.vendor.thermal.config=/vendor/etc/thermal-engine.conf
6 |
--------------------------------------------------------------------------------
/sepolicy/vendor/tee.te:
--------------------------------------------------------------------------------
1 | allow tee fingerprint_vendor_data_file:dir rw_dir_perms;
2 | allow tee fingerprint_vendor_data_file:file create_file_perms;
3 |
--------------------------------------------------------------------------------
/nothing-fwk/Android.bp:
--------------------------------------------------------------------------------
1 | java_library {
2 | name: "nothing-fwk",
3 | installable: true,
4 |
5 | srcs: [
6 | "src/**/*.java",
7 | ],
8 | }
9 |
--------------------------------------------------------------------------------
/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/vendor/hal_nfc_default.te:
--------------------------------------------------------------------------------
1 | allow hal_nfc_default vendor_nfc_vendor_data_file:dir create_dir_perms;
2 | allow hal_nfc_default vendor_nfc_vendor_data_file:file create_file_perms;
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/platform_app.te:
--------------------------------------------------------------------------------
1 | # Allow Dirac App to read Dirac properties
2 | get_prop(platform_app, vendor_audio_prop)
3 |
4 | # Allow Nothing Camera to read audio properties
5 | get_prop(platform_app, audio_config_prop)
6 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_camera_default.te:
--------------------------------------------------------------------------------
1 | typeattribute hal_camera_default vendor_hal_qspmhal_client;
2 |
3 | allow hal_camera_default vendor_xdsp_device:chr_file r_file_perms;
4 |
5 | binder_call(hal_camera_default, vendor_hal_qspmhal_default)
6 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vendor_init.te:
--------------------------------------------------------------------------------
1 | # Allow init.target.rc to read bootanim props for Glyph
2 | get_prop(vendor_init, bootanim_system_prop)
3 |
4 | # Allow build.prop to set vendor.goodix.locked
5 | set_prop(vendor_init, vendor_fingerprint_prop)
6 |
--------------------------------------------------------------------------------
/init/ueventd.nothing.rc:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2022 Paranoid Android
3 | #
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 | firmware_directories /mnt/vendor/persist/
7 |
8 | # LEDs
9 | /dev/aw210xx_nf 0444 system system
10 |
--------------------------------------------------------------------------------
/init/init.phone1.display.rc:
--------------------------------------------------------------------------------
1 | # Override init.qti.display_boot.sh
2 | on early-boot
3 | setprop vendor.display.enable_rounded_corner 0
4 | setprop vendor.display.disable_rounded_corner_thread 1
5 | setprop vendor.display.enable_rc_support 0
6 |
--------------------------------------------------------------------------------
/sensors/android.hardware.sensors@2.1-service.phone1-multihal.rc:
--------------------------------------------------------------------------------
1 | service vendor.sensors-hal-2-1-multihal /vendor/bin/hw/android.hardware.sensors@2.1-service.phone1-multihal
2 | class hal
3 | user system
4 | group system wakelock context_hub
5 | writepid /dev/cpuset/system-background/tasks
6 | capabilities BLOCK_SUSPEND
7 | rlimit rtprio 10 10
8 |
--------------------------------------------------------------------------------
/odm.prop:
--------------------------------------------------------------------------------
1 | # Audio
2 | persist.vendor.audio.bcl.enabled=false
3 | persist.vendor.audio.speaker.prot.enable=false
4 | persist.vendor.audio.spv4.enable=false
5 | persist.vendor.audio.vbat.enabled=false
6 | vendor.audio.feature.dynamic_ecns.enable=false
7 | vendor.audio.feature.spkr_prot.enable=false
8 | vendor.audio.feature.vbat.enable=false
9 |
10 | # Display
11 | persist.sys.sf.color_mode=0
12 |
--------------------------------------------------------------------------------
/sensors/android.hardware.sensors@2.1.phone1-multihal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.sensors
4 | hwbinder
5 | 2.1
6 |
7 | ISensors
8 | default
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/fingerprint/android.hardware.biometrics.fingerprint@2.3-service.phone1.rc:
--------------------------------------------------------------------------------
1 | service vendor.fps_hal /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.3-service.phone1
2 | # "class hal" causes a race condition on some devices due to files created
3 | # in /data. As a workaround, postpone startup until later in boot once
4 | # /data is mounted.
5 | class late_start
6 | user system
7 | group system input uhid
8 |
--------------------------------------------------------------------------------
/system.prop:
--------------------------------------------------------------------------------
1 | # Bluetooth
2 | persist.vendor.bluetooth.modem_nv_support=true
3 | persist.vendor.btstack.enable.gatt_robust_caching=false
4 |
5 | # Display
6 | persist.sys.brightness.low.gamma=true
7 |
8 | # Nothing Features
9 | ro.build.nothing.feature.base=0x428124a040124b4247b97ffL
10 | ro.build.nothing.feature.diff.device.Spacewar=0x80002a4041a032c34800L
11 |
12 | # Sensors
13 | persist.vendor.sensors.enable.mag_filter=true
14 |
--------------------------------------------------------------------------------
/AndroidBoard.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | #----------------------------------------------------------------------
4 | # Radio image
5 | #----------------------------------------------------------------------
6 | ifeq ($(ADD_RADIO_FILES), true)
7 | radio_dir := $(LOCAL_PATH)/radio
8 | RADIO_FILES := $(notdir $(wildcard $(radio_dir)/*))
9 | $(foreach f, $(RADIO_FILES), \
10 | $(call add-radio-file,radio/$(f)))
11 | endif
12 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_fingerprint_default.te:
--------------------------------------------------------------------------------
1 | allow hal_fingerprint_default fingerprint_device:chr_file rw_file_perms;
2 | allow hal_fingerprint_default self:netlink_socket create_socket_perms_no_ioctl;
3 | allow hal_fingerprint_default tee_device:chr_file rw_file_perms;
4 | r_dir_file(hal_fingerprint_default, vendor_sysfs_graphics)
5 | get_prop(hal_fingerprint_default, vendor_fingerprint_prop)
6 | set_prop(hal_fingerprint_default, vendor_fingerprint_prop)
7 |
--------------------------------------------------------------------------------
/fingerprint/android.hardware.biometrics.fingerprint@2.3-service.phone1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.biometrics.fingerprint
4 | hwbinder
5 | 2.3
6 |
7 | IBiometricsFingerprint
8 | default
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/fingerprint/UdfpsExtension.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 The LineageOS Project
3 | *
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | #include
8 | #include
9 |
10 | uint32_t getUdfpsZOrder(uint32_t z, bool touched) {
11 | if (touched) {
12 | z |= FOD_PRESSED_LAYER_ZORDER;
13 | }
14 |
15 | return z;
16 | }
17 |
18 | uint64_t getUdfpsUsageBits(uint64_t usageBits, bool) {
19 | return usageBits;
20 | }
21 |
--------------------------------------------------------------------------------
/sepolicy/private/property_contexts:
--------------------------------------------------------------------------------
1 | # Camera
2 | NA u:object_r:exported_system_prop:s0
3 | persist.vendor.arcsoft. u:object_r:exported_system_prop:s0
4 | ro.camera. u:object_r:exported_system_prop:s0
5 | ro.vendor.gfx.32bit.target u:object_r:exported_system_prop:s0
6 | vendor.arcsoft. u:object_r:exported_system_prop:s0
7 | vendor.camera. u:object_r:exported_system_prop:s0
8 | vendor.flash_ratio u:object_r:exported_system_prop:s0
9 |
--------------------------------------------------------------------------------
/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 |
8 | # Vibrator
9 | vendor.aac.hardware.richtap.vibrator::IRichtapVibrator u:object_r:hal_vibrator_hwservice:s0
10 |
11 | # Sensor Extension
12 | vendor.noth.hardware.sensor.sensor_extension.ISensorExtension/default u:object_r:hal_sensors_hwservice:s0
13 |
--------------------------------------------------------------------------------
/overlay/Phone1Nfc/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 Paranoid Android
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | runtime_resource_overlay {
16 | name: "Phone1Nfc",
17 | vendor: true,
18 | }
19 |
--------------------------------------------------------------------------------
/overlay/Phone1Settings/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 Paranoid Android
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | runtime_resource_overlay {
16 | name: "Phone1Settings",
17 | device_specific: true,
18 | }
19 |
--------------------------------------------------------------------------------
/overlay/Phone1SystemUI/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 Paranoid Android
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | runtime_resource_overlay {
16 | name: "Phone1SystemUI",
17 | device_specific: true,
18 | }
19 |
--------------------------------------------------------------------------------
/overlay/Phone1Frameworks/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 Paranoid Android
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | runtime_resource_overlay {
16 | name: "Phone1Frameworks",
17 | device_specific: true,
18 | }
19 |
--------------------------------------------------------------------------------
/overlay/Phone1SystemUIAOSPA/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 Paranoid Android
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | runtime_resource_overlay {
16 | name: "Phone1SystemUIAOSPA",
17 | system_ext_specific: true,
18 | }
19 |
--------------------------------------------------------------------------------
/overlay/Phone1FrameworksAOSPA/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 Paranoid Android
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | runtime_resource_overlay {
16 | name: "Phone1FrameworksAOSPA",
17 | system_ext_specific: true,
18 | }
19 |
--------------------------------------------------------------------------------
/Android.mk:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 Paranoid Android
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | LOCAL_PATH := $(call my-dir)
16 |
17 | ifneq ($(filter phone1,$(TARGET_DEVICE)),)
18 |
19 | include $(call all-makefiles-under,$(LOCAL_PATH))
20 |
21 | endif
22 |
--------------------------------------------------------------------------------
/overlay/Phone1CarrierConfig/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 Paranoid Android
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | runtime_resource_overlay {
16 | aaptflags: ["--keep-raw-values"],
17 | name: "Phone1CarrierConfig",
18 | device_specific: true,
19 | }
20 |
--------------------------------------------------------------------------------
/overlay/Phone1SystemUI/res/values-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 | 8dp
21 |
22 |
23 |
--------------------------------------------------------------------------------
/sepolicy/vendor/genfs_contexts:
--------------------------------------------------------------------------------
1 | # Display
2 | genfscon sysfs /devices/platform/soc/ae00000.qcom,mdss_mdp/drm/card0/sde-conn-1-DSI-1/hbm_mode u:object_r:vendor_sysfs_graphics:s0
3 | genfscon sysfs /devices/platform/soc/soc:qcom,dsi-display-primary u:object_r:vendor_sysfs_graphics:s0
4 |
5 | # Gestures
6 | genfscon sysfs /devices/platform/soc/a94000.spi/spi_master/spi0/spi0.0/fts_gesture_fod_pressed u:object_r:vendor_sysfs_sensors:s0
7 | genfscon sysfs /devices/platform/soc/a94000.spi/spi_master/spi0/spi0.0/fts_gesture_single_tap_pressed u:object_r:vendor_sysfs_sensors:s0
8 |
9 | # PowerShare
10 | genfscon sysfs /class/qcom-battery/wireless_boost_en u:object_r:sysfs_powershare:s0
11 | genfscon sysfs /class/qcom-battery/wls_reverse_status u:object_r:sysfs_powershare:s0
12 |
--------------------------------------------------------------------------------
/overlay/Phone1Nfc/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | - ROW
21 | - EEA
22 |
23 |
24 | true
25 |
26 |
27 |
--------------------------------------------------------------------------------
/sepolicy/vendor/property_contexts:
--------------------------------------------------------------------------------
1 | # Audio
2 | ro.vendor.dirac. u:object_r:vendor_audio_prop:s0
3 | persist.vendor.dirac. u:object_r:vendor_audio_prop:s0
4 | vendor.dirac. u:object_r:vendor_audio_prop:s0
5 |
6 | # Fingerprint
7 | vendor.goodix.locked u:object_r:vendor_fingerprint_prop:s0
8 | persist.vendor.overlay.fp_model u:object_r:vendor_fingerprint_prop:s0
9 | persist.vendor.overlay.fp_serial u:object_r:vendor_fingerprint_prop:s0
10 | persist.vendor.overlay.fp_vendor u:object_r:vendor_fingerprint_prop:s0
11 |
--------------------------------------------------------------------------------
/overlay/Phone1Frameworks/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
18 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/overlay/Phone1FrameworksAOSPA/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
18 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/overlay/Phone1Settings/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
18 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/overlay/Phone1SystemUI/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
18 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/overlay/Phone1SystemUIAOSPA/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
18 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/overlay/Phone1CarrierConfig/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
18 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/overlay/Phone1Nfc/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
18 |
19 |
24 |
25 |
--------------------------------------------------------------------------------
/fingerprint/Android.bp:
--------------------------------------------------------------------------------
1 | cc_binary {
2 | name: "android.hardware.biometrics.fingerprint@2.3-service.phone1",
3 | defaults: ["hidl_defaults"],
4 | init_rc: ["android.hardware.biometrics.fingerprint@2.3-service.phone1.rc"],
5 | vintf_fragments: ["android.hardware.biometrics.fingerprint@2.3-service.phone1.xml"],
6 | vendor: true,
7 | relative_install_path: "hw",
8 | srcs: [
9 | "BiometricsFingerprint.cpp",
10 | "service.cpp",
11 | ],
12 |
13 | shared_libs: [
14 | "libbase",
15 | "libcutils",
16 | "liblog",
17 | "libhidlbase",
18 | "libhardware",
19 | "libutils",
20 | "android.hardware.biometrics.fingerprint@2.1",
21 | "android.hardware.biometrics.fingerprint@2.2",
22 | "android.hardware.biometrics.fingerprint@2.3",
23 | ],
24 | }
25 |
26 | cc_library_static {
27 | name: "libudfps_extension.phone1",
28 | srcs: ["UdfpsExtension.cpp"],
29 | include_dirs: [
30 | "frameworks/native/services/surfaceflinger/CompositionEngine/include"
31 | ],
32 | header_libs: [
33 | "qti_kernel_headers",
34 | ],
35 | }
36 |
--------------------------------------------------------------------------------
/sepolicy/private/glyph_app.te:
--------------------------------------------------------------------------------
1 | type glyph_app, domain;
2 | typeattribute glyph_app mlstrustedsubject;
3 |
4 | app_domain(glyph_app)
5 |
6 | allow glyph_app {
7 | activity_service
8 | activity_task_service
9 | audio_service
10 | audioserver_service
11 | autofill_service
12 | batteryproperties_service
13 | batterystats_service
14 | content_capture_service
15 | game_service
16 | gpu_service
17 | hint_service
18 | media_session_service
19 | netstats_service
20 | sensorservice_service
21 | surfaceflinger_service
22 | vendor_perf_service
23 | vibrator_manager_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 sysfs_powershare:dir r_dir_perms;
36 | allow glyph_app sysfs_powershare:file r_file_perms;
37 |
38 | allow glyph_app mnt_vendor_file:dir r_dir_perms;
39 | allow glyph_app mnt_vendor_file:file rw_file_perms;
40 | allow glyph_app thermal_service:service_manager find;
41 |
--------------------------------------------------------------------------------
/overlay/Phone1FrameworksAOSPA/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | Nothing/SpacewarEEA/Spacewar:12/SKQ1.211230.001/1663076289:user/release-keys
21 |
22 |
23 | true
24 |
25 |
26 | false
27 |
28 |
29 |
--------------------------------------------------------------------------------
/overlay/Phone1SystemUI/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | 15dp
21 |
22 |
23 | 989.0px
24 |
25 |
27 | true
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Android.bp:
--------------------------------------------------------------------------------
1 | soong_namespace {
2 | }
3 |
4 | install_symlink {
5 | name: "firmware_wlanmdsp.otaupdate_symlink",
6 | vendor: true,
7 | installed_location: "firmware/wlanmdsp.otaupdate",
8 | symlink_target: "/data/vendor/firmware/wlanmdsp.mbn",
9 | }
10 |
11 | install_symlink {
12 | name: "firmware_wlan_mac.bin_symlink",
13 | vendor: true,
14 | installed_location: "firmware/wlan/qca_cld/wlan_mac.bin",
15 | symlink_target: "/mnt/vendor/persist/qca6750/wlan_mac.bin",
16 | }
17 |
18 | prebuilt_hidl_interfaces {
19 | name: "hidl_dpmQmi_interface",
20 | interfaces: [
21 | "com.qualcomm.qti.dpm.api@1.0::IdpmQmi",
22 | ],
23 | }
24 |
25 | prebuilt_hidl_interfaces {
26 | name: "hidl_DspSerivce_interface",
27 | interfaces: [
28 | "vendor.qti.hardware.dsp@1.0::IDspService",
29 | ],
30 | }
31 |
32 | prebuilt_hidl_interfaces {
33 | name: "hidl_Factory_interface",
34 | interfaces: [
35 | "vendor.qti.hardware.factory@1.0::IFactory",
36 | "vendor.qti.hardware.factory@1.1::IFactory",
37 | ],
38 | }
39 |
40 | prebuilt_hidl_interfaces {
41 | name: "hidl_Limits_interface",
42 | interfaces: [
43 | "vendor.qti.hardware.limits@1.0::ILimits",
44 | ],
45 | }
46 |
47 | prebuilt_hidl_interfaces {
48 | name: "hidl_sigma_miracast_interface",
49 | interfaces: [
50 | "vendor.qti.hardware.sigma_miracast@1.0::Isigma_miracast",
51 | ],
52 | }
53 |
--------------------------------------------------------------------------------
/overlay/Phone1SystemUIAOSPA/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | #FFFFFF
21 |
22 |
26 | 0
27 |
28 |
29 | true
30 |
31 |
32 | true
33 |
34 |
35 | true
36 |
37 |
38 |
--------------------------------------------------------------------------------
/overlay/Phone1Frameworks/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | 107px
21 |
22 |
23 | 63px
24 |
25 |
27 | 48.0dip
28 |
29 |
31 | 36.0dip
32 |
33 |
34 |
--------------------------------------------------------------------------------
/sensors/service.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2020 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
18 | #include
19 | #include
20 | #include
21 | #include "HalProxy.h"
22 |
23 | using android::hardware::configureRpcThreadpool;
24 | using android::hardware::joinRpcThreadpool;
25 | using android::hardware::sensors::V2_1::ISensors;
26 | using android::hardware::sensors::V2_1::implementation::HalProxyV2_1;
27 |
28 | int main(int /* argc */, char** /* argv */) {
29 | configureRpcThreadpool(1, true);
30 |
31 | android::sp halProxy = new HalProxyV2_1();
32 | if (halProxy->registerAsService() != ::android::OK) {
33 | ALOGE("Failed to register Sensors HAL instance");
34 | return -1;
35 | }
36 |
37 | joinRpcThreadpool();
38 | return 1; // joinRpcThreadpool shouldn't exit
39 | }
40 |
--------------------------------------------------------------------------------
/init/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 Paranoid Android
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | prebuilt_etc {
16 | name: "charger_fw_fstab.qti",
17 | src: "charger_fw_fstab.qti",
18 | vendor: true,
19 | }
20 |
21 | prebuilt_etc {
22 | name: "fstab.default",
23 | src: "fstab.default",
24 | vendor: true,
25 | }
26 |
27 | prebuilt_etc {
28 | name: "init.phone1.display.rc",
29 | src: "init.phone1.display.rc",
30 | sub_dir: "init",
31 | vendor: true,
32 | }
33 |
34 | prebuilt_etc {
35 | name: "init.qti.media.rc",
36 | src: "init.qti.media.rc",
37 | sub_dir: "init",
38 | vendor: true,
39 | }
40 |
41 | sh_binary {
42 | name: "init.qti.media.sh",
43 | src: "init.qti.media.sh",
44 | vendor: true,
45 | }
46 |
47 | prebuilt_etc {
48 | name: "init.target.rc",
49 | src: "init.target.rc",
50 | sub_dir: "init/hw",
51 | vendor: true,
52 | }
53 |
54 | prebuilt_etc {
55 | name: "ueventd.nothing.rc",
56 | filename: "ueventd.rc",
57 | src: "ueventd.nothing.rc",
58 | device_specific: true,
59 | }
60 |
--------------------------------------------------------------------------------
/overlay/Phone1SystemUI/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 | 0dp
21 |
22 |
23 | 107px
24 | 107px
25 | 107px
26 |
27 |
30 | 19
31 |
32 |
34 | - 63.2
35 |
36 |
37 |
--------------------------------------------------------------------------------
/manifest_phone1.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 | vendor.goodix.hardware.biometrics.fingerprint
17 | hwbinder
18 | 2.1
19 |
20 | IGoodixFingerprintDaemon
21 | default
22 |
23 |
24 |
25 |
26 |
27 | vendor.nxp.nxpnfc
28 | hwbinder
29 | 2.0
30 |
31 | INxpNfc
32 | default
33 |
34 |
35 |
36 | vendor.nxp.nxpnfclegacy
37 | hwbinder
38 | 1.0
39 |
40 | INxpNfcLegacy
41 | default
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/NOTICE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015-2019 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 |
--------------------------------------------------------------------------------
/phone1_vendor_framework_compatibility_matrix.xml:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
19 | vendor.goodix.hardware.biometrics.fingerprint
20 | hwbinder
21 | 2.1
22 |
23 | IGoodixFingerprintDaemon
24 | default
25 |
26 |
27 |
28 |
29 |
30 | vendor.nxp.nxpnfc
31 | hwbinder
32 | 2.0
33 |
34 | INxpNfc
35 | default
36 |
37 |
38 |
39 |
40 |
41 | vendor.noth.hardware.sensor.sensor_extension
42 | hwbinder
43 | 1.0
44 |
45 | ISensorExtension
46 | default
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/fingerprint/service.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017-2022 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 | #define LOG_TAG "android.hardware.biometrics.fingerprint@2.3-service.phone1"
18 |
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include "BiometricsFingerprint.h"
25 |
26 | using android::hardware::biometrics::fingerprint::V2_3::IBiometricsFingerprint;
27 | using android::hardware::biometrics::fingerprint::V2_3::implementation::BiometricsFingerprint;
28 | using android::hardware::configureRpcThreadpool;
29 | using android::hardware::joinRpcThreadpool;
30 | using android::sp;
31 |
32 | int main() {
33 | android::sp bio = BiometricsFingerprint::getInstance();
34 |
35 | configureRpcThreadpool(1, true /*callerWillJoin*/);
36 |
37 | if (bio != nullptr) {
38 | if (::android::OK != bio->registerAsService()) {
39 | return 1;
40 | }
41 | } else {
42 | ALOGE("Can't create instance of BiometricsFingerprint, nullptr");
43 | }
44 |
45 | joinRpcThreadpool();
46 |
47 | return 0; // should never get here
48 | }
49 |
--------------------------------------------------------------------------------
/nothing-fwk/src/com/nothing/NtFeaturesUtils.java:
--------------------------------------------------------------------------------
1 | package com.nothing;
2 |
3 | import android.os.Build;
4 | import android.os.SystemProperties;
5 |
6 | import java.math.BigInteger;
7 | import java.util.BitSet;
8 |
9 | public class NtFeaturesUtils {
10 |
11 | private static final BitSet sFeatures = new BitSet(79);
12 |
13 | static {
14 | final String fullProp = SystemProperties.get("ro.build.nothing.feature.base", "0");
15 | final String productDiffProp = SystemProperties.get("ro.build.nothing.feature.diff.product." + Build.PRODUCT, "0");
16 | final String deviceDiffProp = SystemProperties.get("ro.build.nothing.feature.diff.device." + Build.DEVICE, "0");
17 |
18 | base(new BigInteger(replace(fullProp), 16));
19 | change(new BigInteger(replace(productDiffProp), 16));
20 | change(new BigInteger(replace(deviceDiffProp), 16));
21 | }
22 |
23 | public static boolean isSupport(int... features) {
24 | for (int feature : features) {
25 | if (feature < 0 || feature > 78) {
26 | return false;
27 | }
28 | if (!sFeatures.get(feature)) {
29 | return false;
30 | }
31 | }
32 | return true;
33 | }
34 |
35 | private static void base(BigInteger bi) {
36 | int index = 0;
37 | while (!bi.equals(BigInteger.ZERO)) {
38 | if (bi.testBit(0)) {
39 | sFeatures.set(index);
40 | }
41 | index++;
42 | bi = bi.shiftRight(1);
43 | }
44 | }
45 |
46 | private static void change(BigInteger bi) {
47 | int index = 0;
48 | while (!bi.equals(BigInteger.ZERO)) {
49 | if (bi.testBit(0)) {
50 | sFeatures.flip(index);
51 | }
52 | index++;
53 | bi = bi.shiftRight(1);
54 | }
55 | }
56 |
57 | private static String replace(String str) {
58 | if (str == null) {
59 | return "";
60 | }
61 | return str.replace("0x", "").replace("L", "");
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/vendor.prop:
--------------------------------------------------------------------------------
1 | # Audio
2 | ro.audio.monitorRotation=true
3 | ro.vendor.dirac.acs.forceAfm=true
4 | ro.vendor.dirac.acs.storeSettings=1
5 | ro.vendor.dirac.acs.ignore_error=1
6 | ro.vendor.dirac.acs.startAtBoot=3
7 |
8 | # Bluetooth
9 | persist.vendor.bluetooth.sar_in=0x26-0x26-0x26
10 | persist.vendor.bluetooth.sar_none_in=0x2c-0x2c-0x2c
11 | persist.vendor.qcom.bluetooth.a2dp_offload_cap=sbc-aptx-aptxtws-aptxhd-aac-ldac-aptxadaptiver2
12 | persist.vendor.qcom.bluetooth.aac_frm_ctl.enabled=true
13 | persist.vendor.qcom.bluetooth.twsp_state.enabled=false
14 | persist.vendor.qcom.bluetooth.a2dp_mcast_test.enabled=false
15 | persist.vendor.qcom.bluetooth.scram.enabled=false
16 | persist.vendor.qcom.bluetooth.aac_vbr_ctl.enabled=true
17 | persist.vendor.qcom.bluetooth.aptxadaptiver2_1_support=true
18 | persist.sys.fflag.override.settings_bluetooth_hearing_aid=true
19 |
20 | # Enable incremental fs
21 | ro.incremental.enable=yes
22 |
23 | # Crypto
24 | ro.crypto.dm_default_key.options_format.version=2
25 | ro.crypto.volume.metadata.method=dm-default-key
26 |
27 | # Display
28 | debug.sf.disable_backpressure=1
29 | persist.sys.sf.native_mode=260
30 | ro.surface_flinger.set_idle_timer_ms=4000
31 | ro.surface_flinger.set_touch_timer_ms=4000
32 | ro.surface_flinger.set_display_power_timer_ms=1000
33 | ro.surface_flinger.use_content_detection_for_refresh_rate=true
34 |
35 | # DRM
36 | drm.service.enabled=true
37 |
38 | # Factory Reset Protection
39 | ro.frp.pst=/dev/block/bootdevice/by-name/frp
40 |
41 | # Fingerprint
42 | vendor.goodix.locked=0
43 |
44 | # Hardware ID
45 | persist.vendor.fastrpc.hwid_version=PVT
46 |
47 | # Nothing Features
48 | ro.vendor.nothing.feature.base=0x428124a040124b4247b97ffL
49 | ro.vendor.nothing.feature.diff.device.Spacewar=0x80002a4041a032c34800L
50 |
51 | # qteeconnector settings
52 | persist.vendor.qteeconnector.retrying_interval=30
53 | persist.vendor.qteeconnector.retrying_timeout=2000
54 |
55 | # Sensors
56 | persist.vendor.sensors.sync_request=true
57 | persist.vendor.sensors.allow_non_default_discovery=true
58 | persist.vendor.sensors.on_change_sample_period=true
59 |
60 | # SOC manufacturer
61 | ro.soc.manufacturer=QTI
62 |
63 | # SPU
64 | vendor.gatekeeper.disable_spu=true
65 |
--------------------------------------------------------------------------------
/init/charger_fw_fstab.qti:
--------------------------------------------------------------------------------
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 provided that the following conditions are
5 | # 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
9 | # copyright notice, this list of conditions and the following
10 | # disclaimer in the documentation and/or other materials provided
11 | # with the distribution.
12 | # * Neither the name of The Linux Foundation nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |
28 | # Android fstab file.
29 | # The filesystem that contains the filesystem checker binary (typically /system) cannot
30 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
31 |
32 | #
33 | /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
34 | /dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait
35 |
--------------------------------------------------------------------------------
/update-sha1sums.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | # Copyright (C) 2016 The CyanogenMod Project
4 | # Copyright (C) 2017-2020 The LineageOS Project
5 | # Copyright (C) 2022 Paranoid Android
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | import os
21 | import sys
22 | from hashlib import sha1
23 |
24 | device='phone1'
25 | vendor='nothing'
26 |
27 | with open('proprietary-files.txt', 'r') as f:
28 | lines = f.read().splitlines()
29 | vendorPath = '../../../vendor/' + vendor + '/' + device + '/proprietary'
30 | needSHA1 = False
31 |
32 |
33 | def cleanup():
34 | for index, line in enumerate(lines):
35 | # Skip empty or commented lines
36 | if len(line) == 0 or line[0] == '#' or '|' not in line:
37 | continue
38 |
39 | # Drop SHA1 hash, if existing
40 | lines[index] = line.split('|')[0]
41 |
42 |
43 | def update():
44 | for index, line in enumerate(lines):
45 | # Skip empty lines
46 | if len(line) == 0:
47 | continue
48 |
49 | # Check if we need to set SHA1 hash for the next files
50 | if line[0] == '#':
51 | needSHA1 = (' - ' in line)
52 | continue
53 |
54 | if needSHA1:
55 | # Remove existing SHA1 hash
56 | line = line.split('|')[0]
57 |
58 | filePath = line.split(';')[0].split(':')[-1]
59 | if filePath[0] == '-':
60 | filePath = filePath[1:]
61 |
62 | with open(os.path.join(vendorPath, filePath), 'rb') as f:
63 | hash = sha1(f.read()).hexdigest()
64 |
65 | lines[index] = '%s|%s' % (line, hash)
66 |
67 |
68 | if len(sys.argv) == 2 and sys.argv[1] == '-c':
69 | cleanup()
70 | else:
71 | update()
72 |
73 | with open('proprietary-files.txt', 'w') as file:
74 | file.write('\n'.join(lines) + '\n')
75 |
--------------------------------------------------------------------------------
/sensors/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2020 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 | cc_binary {
17 | name: "android.hardware.sensors@2.1-service.phone1-multihal",
18 | defaults: [
19 | "hidl_defaults",
20 | ],
21 | vendor: true,
22 | relative_install_path: "hw",
23 | srcs: [
24 | "service.cpp",
25 | "HalProxy.cpp",
26 | "HalProxyCallback.cpp",
27 | ],
28 | init_rc: ["android.hardware.sensors@2.1-service.phone1-multihal.rc"],
29 | vintf_fragments: ["android.hardware.sensors@2.1.phone1-multihal.xml"],
30 | header_libs: [
31 | "android.hardware.sensors@2.X-shared-utils",
32 | ],
33 | shared_libs: [
34 | "android.hardware.sensors@2.0",
35 | "android.hardware.sensors@2.0-ScopedWakelock",
36 | "android.hardware.sensors@2.1",
37 | "libbase",
38 | "libcutils",
39 | "libfmq",
40 | "libhidlbase",
41 | "liblog",
42 | "libpower",
43 | "libutils",
44 | ],
45 | static_libs: [
46 | "android.hardware.sensors@1.0-convert",
47 | "android.hardware.sensors@2.X-multihal",
48 | ],
49 | }
50 |
51 | cc_library_shared {
52 | name: "sensors.nothing",
53 | defaults: ["hidl_defaults"],
54 | srcs: [
55 | "Sensor.cpp",
56 | "SensorsSubHal.cpp",
57 | ],
58 | shared_libs: [
59 | "android.hardware.sensors@1.0",
60 | "android.hardware.sensors@2.0",
61 | "android.hardware.sensors@2.0-ScopedWakelock",
62 | "android.hardware.sensors@2.1",
63 | "libcutils",
64 | "libfmq",
65 | "libhardware",
66 | "libhidlbase",
67 | "liblog",
68 | "libpower",
69 | "libutils",
70 | ],
71 | static_libs: [
72 | "android.hardware.sensors@1.0-convert",
73 | "android.hardware.sensors@2.X-multihal",
74 | ],
75 | cflags: [
76 | "-DLOG_TAG=\"sensors.nothing\"",
77 | ],
78 | vendor: true,
79 | }
80 |
--------------------------------------------------------------------------------
/init/init.qti.media.rc:
--------------------------------------------------------------------------------
1 | #==============================================================================
2 | # init.qti.media.rc
3 | #
4 | # Copyright (c) 2020 Qualcomm Technologies, Inc.
5 | # All Rights Reserved.
6 | # Confidential and Proprietary - Qualcomm Technologies, Inc.
7 | #
8 | # Copyright (c) 2020, The Linux Foundation. All rights reserved.
9 | #
10 | # Redistribution and use in source and binary forms, with or without
11 | # modification, are permitted provided that the following conditions are
12 | # met:
13 | # * Redistributions of source code must retain the above copyright
14 | # notice, this list of conditions and the following disclaimer.
15 | # * Redistributions in binary form must reproduce the above
16 | # copyright notice, this list of conditions and the following
17 | # disclaimer in the documentation and/or other materials provided
18 | # with the distribution.
19 | # * Neither the name of The Linux Foundation nor the names of its
20 | # contributors may be used to endorse or promote products derived
21 | # from this software without specific prior written permission.
22 | #
23 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
24 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
26 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
27 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
30 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
32 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
33 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 | #===============================================================================
35 | service qti-media /vendor/bin/init.qti.media.sh
36 | class main
37 | user media
38 | group media
39 | disabled
40 | oneshot
41 | seclabel u:r:vendor_qti_media:s0
42 |
43 | on post-fs
44 | setprop vendor.media.target.qssi ${vendor.sys.media.target.qssi}
45 | setprop vendor.media.system.build_codename ${ro.build.version.release_or_codename}
46 | start qti-media
47 |
48 | on post-fs-data
49 | setprop ro.media.xml_variant.codecs ${vendor.media.target_variant}
50 | setprop ro.media.xml_variant.codecs_performance ${vendor.media.target_variant}
51 |
52 | on property:vendor.netflix.bsp_rev=*
53 | setprop ro.netflix.bsp_rev ${vendor.netflix.bsp_rev}
54 |
--------------------------------------------------------------------------------
/configs/displayconfig/display_id_4630946480328692354.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 0.0
5 | 2.0
6 |
7 |
8 | 0.02442
9 | 2.7
10 |
11 |
12 | 0.04884
13 | 4.0
14 |
15 |
16 | 0.10012
17 | 10.0
18 |
19 |
20 | 0.25617
21 | 50.0
22 |
23 |
24 | 0.37705
25 | 100.0
26 |
27 |
28 | 0.54505
29 | 200.0
30 |
31 |
32 | 0.66764
33 | 300.0
34 |
35 |
36 | 0.858364
37 | 480.0
38 |
39 |
40 | 0.99975
41 | 672.0
42 |
43 |
44 | 1.0
45 | 1018.0
46 |
47 |
48 |
49 | 0.858364
50 | 6000.0
51 |
52 |
53 | 0
54 | 0
55 | 0
56 |
57 |
58 | critical
59 | 0.4
60 |
61 |
62 |
63 | 2.0
64 | 4.5
65 |
66 |
67 | 100.0
68 | 4.0
69 |
70 |
71 | 200.0
72 | 2.2
73 |
74 |
75 | 300.0
76 | 1.8
77 |
78 |
79 | 400.0
80 | 1.5
81 |
82 |
83 | 480.0
84 | 1.4
85 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/overlay/Phone1Settings/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
22 |
23 | - Alive
24 | - Natural
25 | - Boosted
26 | - Saturated
27 |
28 |
29 |
32 |
33 | - 260
34 | - 0
35 | - 1
36 | - 2
37 |
38 |
39 |
40 | true
41 |
42 |
56 | 3
57 |
58 |
59 | 100
60 |
61 |
62 | false
63 |
64 |
65 |
--------------------------------------------------------------------------------
/sensors/HalProxyCallback.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 "HalProxyCallback.h"
18 |
19 | #include
20 |
21 | namespace android {
22 | namespace hardware {
23 | namespace sensors {
24 | namespace V2_0 {
25 | namespace implementation {
26 |
27 | static constexpr int32_t kBitsAfterSubHalIndex = 24;
28 |
29 | /**
30 | * Set the subhal index as first byte of sensor handle and return this modified version.
31 | *
32 | * @param sensorHandle The sensor handle to modify.
33 | * @param subHalIndex The index in the hal proxy of the sub hal this sensor belongs to.
34 | *
35 | * @return The modified sensor handle.
36 | */
37 | int32_t setSubHalIndex(int32_t sensorHandle, size_t subHalIndex) {
38 | return sensorHandle | (static_cast(subHalIndex) << kBitsAfterSubHalIndex);
39 | }
40 |
41 | void HalProxyCallbackBase::postEvents(const std::vector& events,
42 | ScopedWakelock wakelock) {
43 | if (events.empty() || !mCallback->areThreadsRunning()) return;
44 | size_t numWakeupEvents;
45 | std::vector processedEvents = processEvents(events, &numWakeupEvents);
46 | if (numWakeupEvents > 0) {
47 | ALOG_ASSERT(wakelock.isLocked(),
48 | "Wakeup events posted while wakelock unlocked for subhal"
49 | " w/ index %" PRId32 ".",
50 | mSubHalIndex);
51 | } else {
52 | ALOG_ASSERT(!wakelock.isLocked(),
53 | "No Wakeup events posted but wakelock locked for subhal"
54 | " w/ index %" PRId32 ".",
55 | mSubHalIndex);
56 | }
57 | mCallback->postEventsToMessageQueue(processedEvents, numWakeupEvents, std::move(wakelock));
58 | }
59 |
60 | ScopedWakelock HalProxyCallbackBase::createScopedWakelock(bool lock) {
61 | ScopedWakelock wakelock(mRefCounter, lock);
62 | return wakelock;
63 | }
64 |
65 | std::vector HalProxyCallbackBase::processEvents(const std::vector& events,
66 | size_t* numWakeupEvents) const {
67 | *numWakeupEvents = 0;
68 | std::vector eventsOut;
69 | for (V2_1::Event event : events) {
70 | event.sensorHandle = setSubHalIndex(event.sensorHandle, mSubHalIndex);
71 | const V2_1::SensorInfo& sensor = mCallback->getSensorInfo(event.sensorHandle);
72 |
73 | if (sensor.type == V2_1::SensorType::PICK_UP_GESTURE
74 | && event.u.scalar != 1) {
75 | continue;
76 | }
77 |
78 | if ((sensor.flags & V1_0::SensorFlagBits::WAKE_UP) != 0) {
79 | (*numWakeupEvents)++;
80 | }
81 | eventsOut.push_back(event);
82 | }
83 | return eventsOut;
84 | }
85 |
86 | } // namespace implementation
87 | } // namespace V2_0
88 | } // namespace sensors
89 | } // namespace hardware
90 | } // namespace android
91 |
--------------------------------------------------------------------------------
/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/vendor/file_contexts:
--------------------------------------------------------------------------------
1 | # Camera
2 | /(vendor|system/vendor)/lib64/libarcsoft_aiscenedetection\.so u:object_r:same_process_hal_file:s0
3 | /(vendor|system/vendor)/lib64/libarcsoft_beautyshot\.so u:object_r:same_process_hal_file:s0
4 | /(vendor|system/vendor)/lib64/libarcsoft_dark_vision_raw\.so u:object_r:same_process_hal_file:s0
5 | /(vendor|system/vendor)/lib64/libarcsoft_dualcam_refocus_image\.so u:object_r:same_process_hal_file:s0
6 | /(vendor|system/vendor)/lib64/libarcsoft_dualcam_refocus_video\.so u:object_r:same_process_hal_file:s0
7 | /(vendor|system/vendor)/lib64/libarcsoft_hdr_detection\.so u:object_r:same_process_hal_file:s0
8 | /(vendor|system/vendor)/lib64/libarcsoft_high_dynamic_range\.so u:object_r:same_process_hal_file:s0
9 | /(vendor|system/vendor)/lib64/libarcsoft_low_light_hdr\.so u:object_r:same_process_hal_file:s0
10 | /(vendor|system/vendor)/lib64/libarcsoft_mf_superresolution\.so u:object_r:same_process_hal_file:s0
11 | /(vendor|system/vendor)/lib64/libarcsoft_portrait_distortion_correction\.so u:object_r:same_process_hal_file:s0
12 | /(vendor|system/vendor)/lib64/libarcsoft_portrait_super_night_raw\.so u:object_r:same_process_hal_file:s0
13 | /(vendor|system/vendor)/lib64/libarcsoft_singlecam_bokeh\.so u:object_r:same_process_hal_file:s0
14 | /(vendor|system/vendor)/lib64/libarcsoft_super_night_raw\.so u:object_r:same_process_hal_file:s0
15 | /(vendor|system/vendor)/lib64/libarcsoft_superportrait\.so u:object_r:same_process_hal_file:s0
16 | /(vendor|system/vendor)/lib64/libarcsoft_watermark\.so u:object_r:same_process_hal_file:s0
17 | /(vendor|system/vendor)/lib64/libcamxextension_algo\.so u:object_r:same_process_hal_file:s0
18 | /(vendor|system/vendor)/lib64/libcamxextension_night\.so u:object_r:same_process_hal_file:s0
19 | /(vendor|system/vendor)/lib64/libmfec\.so u:object_r:same_process_hal_file:s0
20 | /(vendor|system/vendor)/lib64/libmouth_mask_detection.arcsoft\.so u:object_r:same_process_hal_file:s0
21 | /(vendor|system/vendor)/lib64/libmpbase\.so u:object_r:same_process_hal_file:s0
22 |
23 | # Fingerprint
24 | /data/vendor/goodix(/.*)? u:object_r:fingerprint_vendor_data_file:s0
25 | /dev/goodix_fp u:object_r:fingerprint_device:s0
26 | /mnt/vendor/persist/goodix(/.*)? u:object_r:fingerprint_vendor_data_file:s0
27 | /(vendor|system/vendor)/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.3-service\.phone1 u:object_r:hal_fingerprint_default_exec:s0
28 |
29 | # LEDs
30 | /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led(/.*)? u:object_r:sysfs_leds:s0
31 |
32 | # NFC
33 | /dev/pn553 u:object_r:nfc_device:s0
34 | /dev/nxp-nci u:object_r:nfc_device:s0
35 | /(vendor|system/vendor)/bin/hw/android\.hardware\.nfc_snxxx@1\.2-service u:object_r:hal_nfc_default_exec:s0
36 |
37 | # Sensors
38 | /(vendor|system/vendor)/bin/hw/android.hardware.sensors@[0-9].[0-9]-service.phone1-multihal u:object_r:hal_sensors_default_exec:s0
39 |
40 | # Vibrator
41 | /dev/aw8697_haptic u:object_r:aac_richtap_dev_device:s0
42 | /(vendor|system/vendor)/bin/hw/vendor\.aac\.hardware\.richtap\.vibrator-service\.aac u:object_r:hal_vibrator_default_exec:s0
43 |
--------------------------------------------------------------------------------
/fingerprint/BiometricsFingerprint.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 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 | #ifndef ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_3_BIOMETRICSFINGERPRINT_H
18 | #define ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_3_BIOMETRICSFINGERPRINT_H
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 |
29 | namespace android {
30 | namespace hardware {
31 | namespace biometrics {
32 | namespace fingerprint {
33 | namespace V2_3 {
34 | namespace implementation {
35 |
36 | using ::android::hardware::biometrics::fingerprint::V2_3::IBiometricsFingerprint;
37 | using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback;
38 | using ::android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
39 | using ::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo;
40 | using ::android::hardware::biometrics::fingerprint::V2_1::FingerprintError;
41 | using ::android::hardware::Return;
42 | using ::android::hardware::Void;
43 | using ::android::hardware::hidl_vec;
44 | using ::android::hardware::hidl_string;
45 | using ::android::sp;
46 |
47 | struct BiometricsFingerprint : public IBiometricsFingerprint {
48 | public:
49 | BiometricsFingerprint();
50 | ~BiometricsFingerprint();
51 |
52 | // Method to wrap legacy HAL with BiometricsFingerprint class
53 | static IBiometricsFingerprint* getInstance();
54 |
55 | // Methods from ::android::hardware::biometrics::fingerprint::V2_3::IBiometricsFingerprint follow.
56 | Return setNotify(const sp& clientCallback) override;
57 | Return preEnroll() override;
58 | Return enroll(const hidl_array& hat, uint32_t gid, uint32_t timeoutSec) override;
59 | Return postEnroll() override;
60 | Return getAuthenticatorId() override;
61 | Return cancel() override;
62 | Return enumerate() override;
63 | Return remove(uint32_t gid, uint32_t fid) override;
64 | Return setActiveGroup(uint32_t gid, const hidl_string& storePath) override;
65 | Return authenticate(uint64_t operationId, uint32_t gid) override;
66 | Return isUdfps(uint32_t sensorID) override;
67 | Return onFingerDown(uint32_t x, uint32_t y, float minor, float major) override;
68 | Return onFingerUp() override;
69 |
70 | private:
71 | static fingerprint_device_t* openHal();
72 | static void notify(const fingerprint_msg_t *msg); /* Static callback for legacy HAL implementation */
73 | static Return ErrorFilter(int32_t error);
74 | static FingerprintError VendorErrorFilter(int32_t error, int32_t* vendorCode);
75 | static FingerprintAcquiredInfo VendorAcquiredFilter(int32_t error, int32_t* vendorCode);
76 | static BiometricsFingerprint* sInstance;
77 |
78 | std::mutex mClientCallbackMutex;
79 | sp mClientCallback;
80 | fingerprint_device_t *mDevice;
81 | int32_t(*goodixExtCmd)(int64_t, int32_t, int32_t);
82 | };
83 |
84 | } // namespace implementation
85 | } // namespace V2_3
86 | } // namespace fingerprint
87 | } // namespace biometrics
88 | } // namespace hardware
89 | } // namespace android
90 |
91 | #endif // ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_3_BIOMETRICSFINGERPRINT_H
92 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/BoardConfig.mk:
--------------------------------------------------------------------------------
1 | # Architecture
2 | TARGET_ARCH := arm64
3 | TARGET_ARCH_VARIANT := armv8-2a-dotprod
4 | TARGET_CPU_ABI := arm64-v8a
5 | TARGET_CPU_ABI2 :=
6 | TARGET_CPU_VARIANT := cortex-a76
7 |
8 | TARGET_2ND_ARCH := arm
9 | TARGET_2ND_ARCH_VARIANT := armv8-2a
10 | TARGET_2ND_CPU_ABI := armeabi-v7a
11 | TARGET_2ND_CPU_ABI2 := armeabi
12 | TARGET_2ND_CPU_VARIANT := cortex-a76
13 |
14 | # AVB - Disable Verification
15 | BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3
16 |
17 | # AVB - Recovery
18 | BOARD_AVB_RECOVERY_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
19 | BOARD_AVB_RECOVERY_ALGORITHM := SHA256_RSA4096
20 | BOARD_AVB_RECOVERY_ROLLBACK_INDEX := 1
21 | BOARD_AVB_RECOVERY_ROLLBACK_INDEX_LOCATION := 1
22 |
23 | # AVB - VBMeta System
24 | BOARD_AVB_VBMETA_SYSTEM := system system_ext product
25 | BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
26 | BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048
27 | BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
28 | BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 2
29 |
30 | # Board Info
31 | TARGET_BOARD_INFO_FILE := $(DEVICE_PATH)/board-info.txt
32 |
33 | # Boot
34 | BOARD_INCLUDE_DTB_IN_BOOTIMG := true
35 | BOARD_BOOT_HEADER_VERSION := 3
36 | BOARD_MKBOOTIMG_ARGS := --header_version $(BOARD_BOOT_HEADER_VERSION)
37 |
38 | # Build
39 | BUILD_BROKEN_DUP_RULES := true
40 | BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
41 | BUILD_BROKEN_VENDOR_PROPERTY_NAMESPACE := true
42 |
43 | # Display
44 | TARGET_SCREEN_DENSITY := 420
45 | TARGET_RECOVERY_UI_MARGIN_HEIGHT := 107
46 |
47 | # DTBO
48 | BOARD_KERNEL_SEPARATED_DTBO := true
49 | BOARD_INCLUDE_RECOVERY_DTBO := true
50 |
51 | # Fingerprint
52 | TARGET_SURFACEFLINGER_UDFPS_LIB := //$(DEVICE_PATH):libudfps_extension.phone1
53 |
54 | # Kernel
55 | BOARD_KERNEL_BASE := 0x00000000
56 | BOARD_KERNEL_CMDLINE := \
57 | androidboot.hardware=qcom \
58 | androidboot.memcg=1 \
59 | lpm_levels.sleep_disabled=1 \
60 | msm_rtb.filter=0x237 \
61 | service_locator.enable=1 \
62 | androidboot.usbcontroller=a600000.dwc3 \
63 | swiotlb=0 \
64 | loop.max_part=7 \
65 | cgroup.memory=nokmem,nosocket \
66 | pcie_ports=compat \
67 | iptable_raw.raw_before_defrag=1 \
68 | ip6table_raw.raw_before_defrag=1
69 | BOARD_KERNEL_PAGESIZE := 4096
70 | BOARD_RAMDISK_USE_LZ4 := true
71 | KERNEL_DEFCONFIG := phone1_defconfig
72 | KERNEL_FULL_LLVM := true
73 |
74 | # OTA
75 | TARGET_OTA_ASSERT_DEVICE := Spacewar|spacewar
76 |
77 | # Partitions - A/B
78 | AB_OTA_PARTITIONS := boot dtbo odm product system system_ext vendor vendor_boot vbmeta vbmeta_system
79 | AB_OTA_UPDATER := true
80 |
81 | # Partitions - Dynamic
82 | BOARD_SUPER_PARTITION_GROUPS := qti_dynamic_partitions
83 | BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST := product system system_ext odm vendor
84 |
85 | # Partitions - Filesystems
86 | BOARD_EXT4_SHARE_DUP_BLOCKS := true
87 | BOARD_ODMIMAGE_FILE_SYSTEM_TYPE := ext4
88 | BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
89 | BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := ext4
90 | BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
91 | BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
92 | TARGET_USERIMAGES_USE_F2FS := true
93 |
94 | # Partitions - Metadata
95 | BOARD_USES_METADATA_PARTITION := true
96 |
97 | # Partitions - Paths
98 | TARGET_COPY_OUT_ODM := odm
99 | TARGET_COPY_OUT_PRODUCT := product
100 | TARGET_COPY_OUT_SYSTEM_EXT := system_ext
101 | TARGET_COPY_OUT_VENDOR := vendor
102 |
103 | # Partitions - Sizes
104 | BOARD_BOOTIMAGE_PARTITION_SIZE := 0x06000000
105 | BOARD_DTBOIMG_PARTITION_SIZE := 0x1800000
106 | BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 32)
107 | BOARD_KERNEL-GKI_BOOTIMAGE_PARTITION_SIZE := $(BOARD_BOOTIMAGE_PARTITION_SIZE)
108 | BOARD_QTI_DYNAMIC_PARTITIONS_SIZE := 6438256640
109 | BOARD_SUPER_PARTITION_SIZE := 6442450944
110 | BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 0x06000000
111 |
112 | # PowerShare
113 | TARGET_POWERSHARE_NODE := /sys/class/qcom-battery/wireless_boost_en
114 |
115 | # Radio
116 | ADD_RADIO_FILES := false
117 |
118 | # Recovery
119 | BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT := true
120 | TARGET_NO_RECOVERY := true
121 | TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/init/fstab.default
122 |
123 | # SELinux
124 | BOARD_VENDOR_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor
125 | SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/private
126 |
127 | # UFS
128 | #namespace definition for librecovery_updater
129 | #differentiate legacy 'sg' or 'bsg' framework
130 | SOONG_CONFIG_NAMESPACES += ufsbsg
131 | SOONG_CONFIG_ufsbsg += ufsframework
132 | SOONG_CONFIG_ufsbsg_ufsframework := bsg
133 |
--------------------------------------------------------------------------------
/radio/filesmap:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2019, 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
5 | # 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
9 | # copyright notice, this list of conditions and the following
10 | # disclaimer in the documentation and/or other materials provided
11 | # with the distribution.
12 | # * Neither the name of The Linux Foundation nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |
28 | # filename partition
29 |
30 | NON-HLOS.bin /dev/block/bootdevice/by-name/modem
31 | BTFM.bin /dev/block/bootdevice/by-name/bluetooth
32 | dspso.bin /dev/block/bootdevice/by-name/dsp
33 | mdtpsecapp.mbn /dev/block/bootdevice/by-name/mdtpsecapp
34 | mdtp.img /dev/block/bootdevice/by-name/mdtp
35 |
36 | xbl.elf /dev/block/bootdevice/by-name/xbl
37 | xbl_config.elf /dev/block/bootdevice/by-name/xbl_config
38 | tz.mbn /dev/block/bootdevice/by-name/tz
39 | aop.mbn /dev/block/bootdevice/by-name/aop
40 | hyp.mbn /dev/block/bootdevice/by-name/hyp
41 | keymaster64.mbn /dev/block/bootdevice/by-name/keymaster
42 | cmnlib.mbn /dev/block/bootdevice/by-name/cmnlib
43 | cmnlib64.mbn /dev/block/bootdevice/by-name/cmnlib64
44 | abl.elf /dev/block/bootdevice/by-name/abl
45 | devcfg.mbn /dev/block/bootdevice/by-name/devcfg
46 | qupv3fw.elf /dev/block/bootdevice/by-name/qupfw
47 | storsec.mbn /dev/block/bootdevice/by-name/storsec
48 | imagefv.elf /dev/block/bootdevice/by-name/ImageFv
49 | vbmeta.img /dev/block/bootdevice/by-name/vbmeta
50 | dtbo.img /dev/block/bootdevice/by-name/dtbo
51 | vbmeta_system.img /dev/block/bootdevice/by-name/vbmeta_system
52 | multiimgoem.img /dev/block/bootdevice/by-name/multiimgoem
53 | multiimgqti.img /dev/block/bootdevice/by-name/multiimgqti
54 | vm-linux.img /dev/block/bootdevice/by-name/vm-linux
55 | vm-bootsys.img /dev/block/bootdevice/by-name/vm-bootsys
56 |
57 | # filename + .bak backup partition
58 |
59 | xbl.elf.bak /dev/block/bootdevice/by-name/xblbak
60 | xbl_config.elf.bak /dev/block/bootdevice/by-name/xbl_configbak
61 | tz.mbn.bak /dev/block/bootdevice/by-name/tzbak
62 | aop.mbn.bak /dev/block/bootdevice/by-name/aopbak
63 | hyp.mbn.bak /dev/block/bootdevice/by-name/hypbak
64 | keymaster64.mbn.bak /dev/block/bootdevice/by-name/keymasterbak
65 | cmnlib.mbn.bak /dev/block/bootdevice/by-name/cmnlibbak
66 | cmnlib64.mbn.bak /dev/block/bootdevice/by-name/cmnlib64bak
67 | abl.elf.bak /dev/block/bootdevice/by-name/ablbak
68 | devcfg.mbn.bak /dev/block/bootdevice/by-name/devcfgbak
69 | qupv3fw.elf.bak /dev/block/bootdevice/by-name/qupfwbak
70 | storsec.mbn.bak /dev/block/bootdevice/by-name/storsecbak
71 | vbmeta.img.bak /dev/block/bootdevice/by-name/vbmetabak
72 | dtbo.img.bak /dev/block/bootdevice/by-name/dtbobak
73 | imagefv.elf.bak /dev/block/bootdevice/by-name/ImageFvbak
74 | multiimgoem.img.bak /dev/block/bootdevice/by-name/multiimgoembak
75 | multiimgqti.img.bak /dev/block/bootdevice/by-name/multiimgqtibak
76 | vm-linux.img.bak /dev/block/bootdevice/by-name/vm-linuxbak
77 | vbmeta_system.img.bak /dev/block/bootdevice/by-name/vbmeta_systembak
78 |
79 | # For multiple file firmware images that differ from *.mbn and *.bin
80 | # you can specify filename.* to direct all files to the same location.
81 | # For example for modem.mdt, modem.b00, modem.b01,... modem.bxx files
82 | # writting 'modem.* location' will direct all files to 'location'.
83 | # If still some files need to go to different location give the full
84 | # file name also, for example 'modem.b01 other_location'
85 |
86 | # filename location
87 |
88 | modem.* /dev/block/bootdevice/by-name/modem
89 | wcnss.* /dev/block/bootdevice/by-name/modem
90 | widevine.* /dev/block/bootdevice/by-name/modem
91 | adsp.* /dev/block/bootdevice/by-name/modem
92 |
--------------------------------------------------------------------------------
/init/init.qti.media.sh:
--------------------------------------------------------------------------------
1 | #! /vendor/bin/sh
2 | #==============================================================================
3 | # init.qti.media.sh
4 | #
5 | # Copyright (c) 2020-2022, Qualcomm Technologies, Inc.
6 | # All Rights Reserved.
7 | # Confidential and Proprietary - Qualcomm Technologies, Inc.
8 | #
9 | # Copyright (c) 2020, The Linux Foundation. All rights reserved.
10 | #
11 | # Redistribution and use in source and binary forms, with or without
12 | # modification, are permitted provided that the following conditions are
13 | # met:
14 | # * Redistributions of source code must retain the above copyright
15 | # notice, this list of conditions and the following disclaimer.
16 | # * Redistributions in binary form must reproduce the above
17 | # copyright notice, this list of conditions and the following
18 | # disclaimer in the documentation and/or other materials provided
19 | # with the distribution.
20 | # * Neither the name of The Linux Foundation nor the names of its
21 | # contributors may be used to endorse or promote products derived
22 | # from this software without specific prior written permission.
23 | #
24 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
25 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
27 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
28 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
33 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
34 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 | #===============================================================================
36 |
37 | if [ -f /sys/devices/soc0/soc_id ]; then
38 | soc_hwid=`cat /sys/devices/soc0/soc_id` 2> /dev/null
39 | else
40 | soc_hwid=`cat /sys/devices/system/soc/soc0/id` 2> /dev/null
41 | fi
42 |
43 | target_qssi=`getprop vendor.media.target.qssi`
44 | target=`getprop ro.board.platform`
45 | build_codename=`getprop vendor.media.system.build_codename`
46 | product=`getprop ro.build.product`
47 |
48 | case "$target" in
49 | "lahaina")
50 | case "$soc_hwid" in
51 | 475|515)
52 | setprop vendor.media.target_variant "_yupik_v0"
53 | setprop vendor.netflix.bsp_rev "Q7325-SPY-33758-1"
54 | sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc/sku_version` 2> /dev/null
55 | if [ $sku_ver -eq 1 ]; then
56 | setprop vendor.media.target_variant "_yupik_v1"
57 | fi
58 | ;;
59 | 450)
60 | setprop vendor.media.target_variant "_shima_v3"
61 | setprop vendor.netflix.bsp_rev "Q875-32774-1"
62 | sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc/sku_version` 2> /dev/null
63 | if [ $sku_ver -eq 1 ]; then
64 | setprop vendor.media.target_variant "_shima_v1"
65 | elif [ $sku_ver -eq 2 ]; then
66 | setprop vendor.media.target_variant "_shima_v2"
67 | fi
68 | ;;
69 | 497|498|575|576)
70 | setprop vendor.media.target_variant "_yupik_iot"
71 | ;;
72 | *)
73 | if [ $target_qssi == "true" ]; then
74 | setprop vendor.media.target_variant "_lahaina_vendor"
75 | else
76 | setprop vendor.media.target_variant "_lahaina"
77 | fi
78 | setprop vendor.netflix.bsp_rev "Q875-32408-1"
79 | ;;
80 | esac
81 | ;;
82 | "holi")
83 | case "$soc_hwid" in
84 | 507|565)
85 | setprop vendor.media.target_variant "_blair"
86 | setprop vendor.netflix.bsp_rev "Q4350-32962-1"
87 | ;;
88 | 578)
89 | setprop vendor.media.target_variant "_blair_lite"
90 | ;;
91 | 454|472)
92 | setprop vendor.media.target_variant "_holi"
93 | setprop vendor.netflix.bsp_rev "Q4350-32962-1"
94 | ;;
95 | esac
96 | ;;
97 | "msmnile")
98 | setprop vendor.media.target_variant "_msmnile"
99 | if [ $product == "msmnile_gvmq" ]; then
100 | case "$soc_hwid" in
101 | 460)
102 | setprop vendor.media.target_variant "_direwolf"
103 | ;;
104 | 377)
105 | setprop vendor.media.target_variant "_sm6150"
106 | ;;
107 | 362|405)
108 | setprop vendor.media.target_variant "_msmnile"
109 | ;;
110 | esac
111 | fi
112 | ;;
113 | "sm6150")
114 | setprop vendor.media.target_variant "_sm6150"
115 | ;;
116 | "direwolf")
117 | setprop vendor.media.target_variant "_direwolf"
118 | ;;
119 | esac
120 |
--------------------------------------------------------------------------------
/init/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 noatime,ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
39 | system_ext /system_ext ext4 noatime,ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
40 | product /product ext4 noatime,ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
41 | vendor /vendor ext4 noatime,ro,barrier=1,discard wait,slotselect,avb,logical,first_stage_mount
42 | odm /odm ext4 noatime,ro,barrier=1,discard wait,slotselect,avb,logical,first_stage_mount
43 | /dev/block/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard wait,check,formattable,first_stage_mount
44 | /dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait
45 | /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
46 | /dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
47 | /devices/platform/soc/8804000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
48 | /devices/platform/soc/1da4000.ufshc_card/host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
49 | /devices/platform/soc/*.ssusb/*.dwc3/xhci-hcd.*.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto
50 | /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
51 | /dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 noatime,ro,nosuid,nodev,barrier=1 wait,slotselect
52 | #/dev/block/bootdevice/by-name/vm-bootsys /vendor/vm-system ext4 noatime,ro,nosuid,nodev,barrier=1 wait,slotselect
53 | /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
54 | /dev/block/bootdevice/by-name/qmcs /mnt/vendor/qmcs vfat noatime,nosuid,nodev,context=u:object_r:vendor_qmcs_file:s0 wait,check,formattable
55 |
--------------------------------------------------------------------------------
/overlay/Phone1Frameworks/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.5
128 | - 417.4
129 | - 53
130 | - 64
131 | - 31
132 | - 150
133 | - 570
134 | - 61
135 | - 180
136 | - 4.7
137 |
138 | 2
139 | 2
140 |
141 | - 6
142 | - 180
143 | - 186
144 | - 3700
145 |
146 | 17
147 |
148 | - 0.5
149 | - 275.3
150 | - 559.6
151 | 1
152 | - 4190
153 |
154 | 5.8
155 | 5.8
156 | 5.8
157 | 5.8
158 | 5.8
159 |
160 | - 61
161 | - 0.8
162 | - 3700
163 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 blob_fixup, blob_fixups_user_type
8 | from extract_utils.fixups_lib import (
9 | lib_fixup_remove,
10 | lib_fixups,
11 | lib_fixups_user_type,
12 | )
13 | from extract_utils.main import ExtractUtils, ExtractUtilsModule
14 |
15 | namespace_imports = [
16 | 'hardware/qcom/display',
17 | 'hardware/qcom/display/gralloc',
18 | 'vendor/qcom/common/vendor/adreno-r',
19 | 'vendor/qcom/common/vendor/display/5.4',
20 | 'vendor/qcom/common/vendor/gps-legacy',
21 | 'vendor/qcom/common/vendor/media-5.4',
22 | ]
23 |
24 |
25 | def lib_fixup_vendor_suffix(lib: str, partition: str, *args, **kwargs):
26 | return f'{lib}_{partition}' if partition == 'vendor' else None
27 |
28 |
29 | lib_fixups: lib_fixups_user_type = {
30 | **lib_fixups,
31 | (
32 | 'com.qualcomm.qti.dpm.api@1.0',
33 | 'com.qualcomm.qti.imscmservice@2.0',
34 | 'com.qualcomm.qti.imscmservice@2.1',
35 | 'com.qualcomm.qti.imscmservice@2.2',
36 | 'com.qualcomm.qti.uceservice@2.0',
37 | 'com.qualcomm.qti.uceservice@2.1',
38 | 'com.qualcomm.qti.uceservice@2.2',
39 | 'com.qualcomm.qti.uceservice@2.3',
40 | 'libmmosal',
41 | 'vendor.qti.data.factory@2.0',
42 | 'vendor.qti.data.factory@2.1',
43 | 'vendor.qti.data.factory@2.2',
44 | 'vendor.qti.data.factory@2.3',
45 | 'vendor.qti.data.mwqem@1.0',
46 | 'vendor.qti.data.slm@1.0',
47 | 'vendor.qti.diaghal@1.0',
48 | 'vendor.qti.hardware.data.cne.internal.api@1.0',
49 | 'vendor.qti.hardware.data.cne.internal.constants@1.0',
50 | 'vendor.qti.hardware.data.cne.internal.server@1.0',
51 | 'vendor.qti.hardware.data.connection@1.0',
52 | 'vendor.qti.hardware.data.connection@1.1',
53 | 'vendor.qti.hardware.data.dynamicdds@1.0',
54 | 'vendor.qti.hardware.data.iwlan@1.0',
55 | 'vendor.qti.hardware.data.latency@1.0',
56 | 'vendor.qti.hardware.data.lce@1.0',
57 | 'vendor.qti.hardware.data.qmi@1.0',
58 | 'vendor.qti.hardware.embmssl@1.0',
59 | 'vendor.qti.hardware.embmssl@1.1',
60 | 'vendor.qti.hardware.limits@1.0',
61 | 'vendor.qti.hardware.mwqemadapter@1.0',
62 | 'vendor.qti.hardware.radio.am@1.0',
63 | 'vendor.qti.hardware.radio.atcmdfwd@1.0',
64 | 'vendor.qti.hardware.radio.ims@1.0',
65 | 'vendor.qti.hardware.radio.ims@1.1',
66 | 'vendor.qti.hardware.radio.ims@1.2',
67 | 'vendor.qti.hardware.radio.ims@1.3',
68 | 'vendor.qti.hardware.radio.ims@1.4',
69 | 'vendor.qti.hardware.radio.ims@1.5',
70 | 'vendor.qti.hardware.radio.ims@1.6',
71 | 'vendor.qti.hardware.radio.ims@1.7',
72 | 'vendor.qti.hardware.radio.ims@1.8',
73 | 'vendor.qti.hardware.radio.ims@1.9',
74 | 'vendor.qti.hardware.radio.internal.deviceinfo@1.0',
75 | 'vendor.qti.hardware.radio.lpa@1.0',
76 | 'vendor.qti.hardware.radio.lpa@1.1',
77 | 'vendor.qti.hardware.radio.lpa@1.2',
78 | 'vendor.qti.hardware.radio.qcrilhook@1.0',
79 | 'vendor.qti.hardware.radio.qtiradio@1.0',
80 | 'vendor.qti.hardware.radio.qtiradio@2.0',
81 | 'vendor.qti.hardware.radio.qtiradio@2.1',
82 | 'vendor.qti.hardware.radio.qtiradio@2.2',
83 | 'vendor.qti.hardware.radio.qtiradio@2.3',
84 | 'vendor.qti.hardware.radio.qtiradio@2.4',
85 | 'vendor.qti.hardware.radio.qtiradio@2.5',
86 | 'vendor.qti.hardware.radio.qtiradio@2.6',
87 | 'vendor.qti.hardware.radio.qtiradio@2.7',
88 | 'vendor.qti.hardware.radio.uim@1.0',
89 | 'vendor.qti.hardware.radio.uim@1.1',
90 | 'vendor.qti.hardware.radio.uim@1.2',
91 | 'vendor.qti.hardware.radio.uim_remote_client@1.0',
92 | 'vendor.qti.hardware.radio.uim_remote_client@1.1',
93 | 'vendor.qti.hardware.radio.uim_remote_client@1.2',
94 | 'vendor.qti.hardware.radio.uim_remote_server@1.0',
95 | 'vendor.qti.hardware.wifidisplaysession@1.0',
96 | 'vendor.qti.ims.callcapability@1.0',
97 | 'vendor.qti.ims.callinfo@1.0',
98 | 'vendor.qti.ims.configservice@1.0',
99 | 'vendor.qti.ims.configservice@1.1',
100 | 'vendor.qti.ims.connection@1.0',
101 | 'vendor.qti.ims.factory@1.0',
102 | 'vendor.qti.ims.factory@1.1',
103 | 'vendor.qti.ims.factory@2.0',
104 | 'vendor.qti.ims.factory@2.1',
105 | 'vendor.qti.ims.factory@2.2',
106 | 'vendor.qti.ims.rcsconfig@1.0',
107 | 'vendor.qti.ims.rcsconfig@1.1',
108 | 'vendor.qti.ims.rcsconfig@2.0',
109 | 'vendor.qti.ims.rcsconfig@2.1',
110 | 'vendor.qti.ims.rcssip@1.0',
111 | 'vendor.qti.ims.rcssip@1.1',
112 | 'vendor.qti.ims.rcssip@1.2',
113 | 'vendor.qti.ims.rcsuce@1.0',
114 | 'vendor.qti.ims.rcsuce@1.1',
115 | 'vendor.qti.ims.rcsuce@1.2',
116 | 'vendor.qti.imsrtpservice@3.0',
117 | 'vendor.qti.latency@2.0',
118 | 'vendor.qti.latency@2.1',
119 | ): lib_fixup_vendor_suffix,
120 | (
121 | 'libOmxCore',
122 | 'libwpa_client',
123 | ): lib_fixup_remove,
124 | }
125 |
126 | blob_fixups: blob_fixups_user_type = {
127 | ('vendor/bin/hw/vendor.qti.hardware.vibrator.service', 'vendor/lib64/vendor.qti.hardware.vibrator.impl.so'): blob_fixup()
128 | .replace_needed('android.hardware.vibrator-V1-ndk_platform.so', 'android.hardware.vibrator-V2-ndk.so'),
129 | ('vendor/etc/media_codecs.xml', 'vendor/etc/media_codecs_yupik_v0.xml', 'vendor/etc/media_codecs_yupik_v1.xml'): blob_fixup()
130 | .regex_replace('.*media_codecs_(google_audio|google_c2|google_telephony|vendor_audio).*\n', ''),
131 | 'vendor/etc/seccomp_policy/atfwd@2.0.policy': blob_fixup()
132 | .add_line_if_missing('gettid: 1'),
133 | ('vendor/lib64/libgf_hal.so'): blob_fixup()
134 | .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'),
135 | ('vendor/lib64/libwvhidl.so', 'vendor/lib64/mediadrm/libwvdrmengine.so'): blob_fixup()
136 | .add_needed('libcrypto_shim.so'),
137 | } # fmt: skip
138 |
139 | module = ExtractUtilsModule(
140 | 'phone1',
141 | 'nothing',
142 | blob_fixups=blob_fixups,
143 | lib_fixups=lib_fixups,
144 | namespace_imports=namespace_imports,
145 | )
146 |
147 | if __name__ == '__main__':
148 | utils = ExtractUtils.device(module)
149 | utils.run()
150 |
--------------------------------------------------------------------------------
/device.mk:
--------------------------------------------------------------------------------
1 | DEVICE_PATH := device/nothing/phone1
2 |
3 | # A/B
4 | $(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/launch_with_vendor_ramdisk.mk)
5 |
6 | PRODUCT_PACKAGES += \
7 | android.hardware.boot-service.qti \
8 | android.hardware.boot-service.qti.recovery \
9 | checkpoint_gc \
10 | otapreopt_script \
11 | update_engine \
12 | update_engine_client \
13 | update_engine_sideload \
14 | update_verifier
15 |
16 | AB_OTA_POSTINSTALL_CONFIG += \
17 | RUN_POSTINSTALL_system=true \
18 | POSTINSTALL_PATH_system=system/bin/otapreopt_script \
19 | FILESYSTEM_TYPE_system=ext4 \
20 | POSTINSTALL_OPTIONAL_system=true
21 |
22 | AB_OTA_POSTINSTALL_CONFIG += \
23 | RUN_POSTINSTALL_vendor=true \
24 | POSTINSTALL_PATH_vendor=bin/checkpoint_gc \
25 | FILESYSTEM_TYPE_vendor=ext4 \
26 | POSTINSTALL_OPTIONAL_vendor=true
27 |
28 | # API
29 | BOARD_SHIPPING_API_LEVEL := 30
30 | PRODUCT_SHIPPING_API_LEVEL := 30
31 |
32 | # Architecture
33 | TARGET_BOARD_PLATFORM := lahaina
34 | TARGET_BOOTLOADER_BOARD_NAME := lahaina
35 |
36 | # Authsecret
37 | PRODUCT_PACKAGES += \
38 | android.hardware.authsecret@1.0.vendor
39 |
40 | # AVB
41 | BOARD_AVB_ENABLE := true
42 |
43 | # Audio
44 | PRODUCT_COPY_FILES += \
45 | $(DEVICE_PATH)/configs/mixer_paths_yupikqrd.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_yupik/mixer_paths_yupikqrd.xml
46 |
47 | # Camera
48 | PRODUCT_COPY_FILES += \
49 | $(DEVICE_PATH)/configs/public.libraries.system_ext.txt:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/public.libraries.txt \
50 | frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \
51 | frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \
52 | frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \
53 | frameworks/native/data/etc/android.hardware.camera.raw.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml
54 |
55 | PRODUCT_PACKAGES += \
56 | android.hardware.camera.provider@2.4-impl \
57 | android.hardware.camera.provider@2.4-service_64 \
58 | libcamera2ndk_vendor \
59 | vendor.qti.hardware.camera.postproc@1.0.vendor
60 |
61 | # Dalvik
62 | $(call inherit-product, frameworks/native/build/phone-xhdpi-6144-dalvik-heap.mk)
63 |
64 | # Display
65 | PRODUCT_COPY_FILES += \
66 | $(LOCAL_PATH)/configs/displayconfig/display_id_4630946480328692354.xml:$(TARGET_COPY_OUT_VENDOR)/etc/displayconfig/display_id_4630946480328692354.xml
67 |
68 | # DRM
69 | PRODUCT_PACKAGES += \
70 | android.hardware.drm@1.4.vendor \
71 | android.hardware.drm@1.4-service.clearkey \
72 | libcrypto_shim
73 |
74 | # Emulated Storage
75 | $(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
76 |
77 | # Filesystem
78 | PRODUCT_PACKAGES += \
79 | fs_config_files
80 |
81 | # Fingerprint
82 | PRODUCT_COPY_FILES += \
83 | frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml
84 |
85 | PRODUCT_PACKAGES += \
86 | android.hardware.biometrics.fingerprint@2.3-service.phone1 \
87 | android.hardware.biometrics.fingerprint@2.3.vendor
88 |
89 | TARGET_USES_FOD_ZPOS := true
90 |
91 | # FM
92 | BOARD_HAVE_QCOM_FM := false
93 |
94 | # FUSE Passthrough
95 | PRODUCT_VENDOR_PROPERTIES += \
96 | persist.sys.fuse.passthrough.enable=true
97 |
98 | # Gatekeeper
99 | PRODUCT_PACKAGES += \
100 | android.hardware.gatekeeper@1.0 \
101 | android.hardware.gatekeeper@1.0.vendor
102 |
103 | # Generic Kernel Headers
104 | TARGET_HAS_GENERIC_KERNEL_HEADERS := true
105 |
106 | # HIDL
107 | PRODUCT_PACKAGES += \
108 | android.hidl.memory.block@1.0.vendor
109 |
110 | # Init
111 | PRODUCT_PACKAGES += \
112 | charger_fw_fstab.qti \
113 | fstab.default \
114 | init.phone1.display.rc \
115 | init.qti.media.rc \
116 | init.qti.media.sh \
117 | init.target.rc \
118 | ueventd.nothing.rc
119 |
120 | # Kernel
121 | PRODUCT_ENABLE_UFFD_GC := false
122 |
123 | # Keymaster
124 | PRODUCT_PACKAGES += \
125 | android.hardware.keymaster@4.1 \
126 | android.hardware.keymaster@4.1.vendor
127 |
128 | # Manifests
129 | DEVICE_MANIFEST_FILE += \
130 | $(DEVICE_PATH)/manifest_yupik.xml \
131 | $(DEVICE_PATH)/manifest_phone1.xml
132 |
133 | DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE += \
134 | $(DEVICE_PATH)/phone1_vendor_framework_compatibility_matrix.xml
135 |
136 | # Namespaces
137 | PRODUCT_SOONG_NAMESPACES += \
138 | $(DEVICE_PATH)
139 |
140 | # Neural networks
141 | PRODUCT_PACKAGES += \
142 | android.hardware.neuralnetworks@1.3.vendor
143 |
144 | # NFC
145 | PRODUCT_PACKAGES += \
146 | android.hardware.nfc@1.2.vendor \
147 | android.hardware.nfc@1.0-impl:64 \
148 | NfcNci \
149 | Tag
150 |
151 | PRODUCT_COPY_FILES += \
152 | frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/com.nxp.mifare.xml \
153 | frameworks/native/data/etc/android.hardware.nfc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.xml \
154 | frameworks/native/data/etc/android.hardware.nfc.hce.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.hce.xml \
155 | frameworks/native/data/etc/android.hardware.nfc.hcef.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.hcef.xml \
156 | frameworks/native/data/etc/android.hardware.nfc.ese.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.ese.xml \
157 | frameworks/native/data/etc/android.hardware.nfc.uicc.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.nfc.uicc.xml \
158 |
159 | # Nothing-fwk
160 | PRODUCT_PACKAGES += \
161 | nothing-fwk
162 |
163 | PRODUCT_BOOT_JARS += \
164 | nothing-fwk
165 |
166 | # Overlays
167 | PRODUCT_PACKAGES += \
168 | Phone1CarrierConfig \
169 | Phone1Frameworks \
170 | Phone1FrameworksAOSPA \
171 | Phone1Nfc \
172 | Phone1Settings \
173 | Phone1SystemUI \
174 | Phone1SystemUIAOSPA
175 |
176 | # Paranoid Glyph
177 | PRODUCT_PACKAGES += \
178 | ParanoidGlyphPhone1
179 |
180 | # Partitions - Dynamic
181 | PRODUCT_BUILD_ODM_IMAGE := true
182 | PRODUCT_USE_DYNAMIC_PARTITIONS := true
183 |
184 | PRODUCT_PACKAGES += \
185 | android.hardware.fastboot-service.example_recovery \
186 | fastbootd
187 |
188 | PRODUCT_COPY_FILES += $(DEVICE_PATH)/init/fstab.default:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/first_stage_ramdisk/fstab.default
189 |
190 | # Powershare
191 | PRODUCT_PACKAGES += \
192 | vendor.aospa.powershare-service
193 |
194 | # QTI Components
195 | TARGET_COMMON_QTI_COMPONENTS := \
196 | adreno \
197 | alarm \
198 | audio \
199 | av \
200 | bt \
201 | charging \
202 | display \
203 | gps \
204 | init \
205 | media \
206 | overlay \
207 | perf \
208 | telephony \
209 | usb \
210 | wfd \
211 | wlan
212 |
213 | # Sensors
214 | PRODUCT_COPY_FILES += \
215 | frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
216 | frameworks/native/data/etc/android.hardware.sensor.barometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.barometer.xml \
217 | frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \
218 | frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \
219 | frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml \
220 | frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \
221 | frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \
222 | frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml \
223 | $(DEVICE_PATH)/configs/sensors/hals.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/hals.conf
224 |
225 | PRODUCT_PACKAGES += \
226 | android.hardware.sensors@2.1-service.phone1-multihal \
227 | android.hardware.sensors@2.0-ScopedWakelock \
228 | libsensorndkbridge \
229 | sensors.nothing
230 |
231 | # Storage
232 | PRODUCT_CHARACTERISTICS := nosdcard
233 |
234 | # Thermal
235 | PRODUCT_PACKAGES += \
236 | android.hardware.thermal-service.qti
237 |
238 | # Treble
239 | PRODUCT_FULL_TREBLE_OVERRIDE := true
240 | PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true
241 |
242 | # System Helper
243 | PRODUCT_PACKAGES += \
244 | vendor.qti.hardware.systemhelper@1.0.vendor
245 |
246 | # Vibrator
247 | PRODUCT_PACKAGES += \
248 | android.hardware.vibrator-V1-ndk.vendor
249 |
250 | PRODUCT_COPY_FILES += \
251 | vendor/qcom/opensource/vibrator/excluded-input-devices.xml:$(TARGET_COPY_OUT_VENDOR)/etc/excluded-input-devices.xml
252 |
253 | # WLAN
254 | PRODUCT_PACKAGES += \
255 | firmware_wlanmdsp.otaupdate_symlink \
256 | firmware_wlan_mac.bin_symlink
257 |
258 | PRODUCT_COPY_FILES += \
259 | $(DEVICE_PATH)/configs/WCNSS_qcom_cfg.ini:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/WCNSS_qcom_cfg.ini
260 |
261 | # Proprietary Vendor
262 | $(call inherit-product, vendor/nothing/phone1/phone1-vendor.mk)
263 | $(call inherit-product, vendor/nothing/camera/nothing-camera.mk)
264 |
--------------------------------------------------------------------------------
/configs/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 IMPS or not
10 | gEnableImps=1
11 |
12 | # Enable BMPS or not
13 | gEnableBmps=1
14 |
15 | # Enable PCI gen switch
16 | g_enable_pci_gen=1
17 |
18 | # Phy Mode (auto, b, g, n, etc)
19 | # Valid values are 0-9, with 0 = Auto, 4 = 11n, 9 = 11ac
20 | # 1 = 11abg, 2 = 11b, 3 = 11g, 5 = 11g only, 6 = 11n only
21 | # 7 = 11b only 8 = 11ac only.
22 | gDot11Mode=0
23 |
24 | # UAPSD service interval for VO,VI, BE, BK traffic
25 | InfraUapsdVoSrvIntv=0
26 | InfraUapsdViSrvIntv=0
27 | InfraUapsdBeSrvIntv=0
28 | InfraUapsdBkSrvIntv=0
29 |
30 | # Flag to allow STA send AddTspec even when ACM is Off
31 | gAddTSWhenACMIsOff=1
32 |
33 |
34 | #Flag to enable HostARPOffload feature or not
35 | hostArpOffload=1
36 |
37 | #Flag to enable HostNSOffload feature or not
38 | hostNSOffload=1
39 |
40 | # 802.11n Protection flag
41 | gEnableApProt=1
42 |
43 | #Enable OBSS protection
44 | gEnableApOBSSProt=1
45 |
46 | #Enable/Disable UAPSD for SoftAP
47 | gEnableApUapsd=1
48 |
49 | # Maximum Tx power
50 | # gTxPowerCap=30
51 |
52 | # Fragmentation Threshold
53 | # gFragmentationThreshold=2346
54 |
55 | # RTS threshold
56 | RTSThreshold=1048576
57 |
58 | # Intra-BSS forward
59 | gDisableIntraBssFwd=0
60 |
61 | # WMM Enable/Disable
62 | WmmIsEnabled=0
63 |
64 | # 802.11d support
65 | g11dSupportEnabled=0
66 |
67 | # 802.11h support
68 | g11hSupportEnabled=1
69 |
70 | # DFS Master Capability
71 | gEnableDFSMasterCap=1
72 |
73 | # enable SRD
74 | etsi13_srd_chan_in_master_mode=1
75 |
76 | # ESE Support and fast transition
77 | EseEnabled=0
78 |
79 | ImplicitQosIsEnabled=0
80 |
81 | gNeighborScanTimerPeriod=200
82 | gNeighborLookupThreshold=76
83 | gNeighborScanChannelMinTime=20
84 |
85 | # Legacy (non-ESE, non-802.11r) Fast Roaming Support
86 | # To enable, set FastRoamEnabled=1
87 | # To disable, set FastRoamEnabled=0
88 | FastRoamEnabled=1
89 |
90 | # Check if the AP to which we are roaming is better than current AP in
91 | # terms of RSSI. Checking is disabled if set to Zero.Otherwise it will
92 | # use this value as to how better the RSSI of the new/roamable AP should
93 | # be for roaming
94 | RoamRssiDiff=5
95 |
96 | # To enable, set gRoamIntraBand=1 (Roaming within band)
97 | # To disable, set gRoamIntraBand=0 (Roaming across band)
98 | gRoamIntraBand=0
99 |
100 | #Short Guard Interval Enable/disable
101 | gShortGI20Mhz=1
102 | gShortGI40Mhz=1
103 |
104 | #Auto Shutdown wlan : Value in Seconds. 0 means disabled. Max 1 day = 86400 sec
105 | gWlanAutoShutdown = 0
106 |
107 | #Channel Bonding
108 | gChannelBondingMode5GHz=1
109 |
110 | #Say gGoKeepAlivePeriod(5 seconds) and gGoLinkMonitorPeriod(10 seconds).
111 | #For every 10 seconds DUT send Qos Null frame(i.e., Keep Alive frame if link
112 | #is idle for last 10 seconds.) For both active and power save clients.
113 |
114 | #Power save clients: DUT set TIM bit from 10th second onwards and till client
115 | #honors TIM bit. If doesn't honor for 5 seconds then DUT remove client.
116 |
117 | #Active clients: DUT send Qos Null frame for 10th seconds onwards if it is not
118 | #success still we try on 11th second if not tries on 12th and so on till 15th
119 | #second. Hence before disconnection DUT will send 5 NULL frames. Hence in any
120 | #case DUT will detect client got removed in (10+5) seconds.
121 | #i.e., (gGoKeepAlivePeriod + gGoLinkMonitorPeriod)..
122 |
123 | #gGoLinkMonitorPeriod/ gApLinkMonitorPeriod is period where link is idle and
124 | #it is period where we send NULL frame.
125 | #gApLinkMonitorPeriod = 10
126 | #gGoLinkMonitorPeriod = 10
127 |
128 | #gGoKeepAlivePeriod/gApKeepAlivePeriod is time to spend to check whether frame
129 | #are succeed to send or not. Hence total effective detection time is
130 | # (gGoLinkMonitorPeriod + gGoKeepAlivePeriod) /
131 | # (gApLinkMonitorPeriod + gApKeepAlivePeriod)
132 | gGoKeepAlivePeriod = 20
133 | gApKeepAlivePeriod = 20
134 |
135 | #If set to 0, will not scan DFS channels
136 | gEnableDFSChnlScan=1
137 |
138 | # Enable DFS channel roam
139 | # 0: DISABLE, 1: ENABLED_NORMAL, 2: ENABLED_ACTIVE
140 | gAllowDFSChannelRoam=1
141 |
142 | gVhtChannelWidth=2
143 |
144 | #Data Inactivity Timeout when in powersave (in ms)
145 | gDataInactivityTimeout=200
146 |
147 | # Set txchainmask and rxchainmask
148 | # These parameters are used only if gEnable2x2 is 0
149 | # Valid values are 1,2
150 | # Set gSetTxChainmask1x1=1 or gSetRxChainmask1x1=1 to select chain0.
151 | # Set gSetTxChainmask1x1=2 or gSetRxChainmask1x1=2 to select chain1.
152 | gSetTxChainmask1x1=1
153 | gSetRxChainmask1x1=1
154 |
155 | # Scan Timing Parameters
156 | # gPassiveMaxChannelTime=110
157 | # gPassiveMinChannelTime=60
158 | gActiveMaxChannelTime=40
159 |
160 | #If set to 0, MCC is not allowed.
161 | gEnableMCCMode=1
162 |
163 | # MCC to SCC Switch mode:
164 | # 0-Disable
165 | # 1-Enable
166 | # 2-Force SCC if same band, with SAP restart
167 | # 3-Force SCC if same band, without SAP restart by sending (E)CSA
168 | # 4-Force SCC if same band (or) use SAP mandatory channel for DBS,
169 | # without SAP restart by sending (E)CSA
170 | gWlanMccToSccSwitchMode = 0
171 |
172 | # 1=enable STBC; 0=disable STBC
173 | gEnableRXSTBC=1
174 |
175 | # 1=enable tx STBC; 0=disable
176 | gEnableTXSTBC=1
177 |
178 | # 1=enable rx LDPC; 0=disable
179 | gEnableRXLDPC=1
180 |
181 | #Enable/Disable Tx beamforming
182 | gTxBFEnable=1
183 |
184 | #Enable/Disable Tx beamformee in SAP mode
185 | gEnableTxBFeeSAP=1
186 |
187 | # Enable Tx beamforming in VHT20MHz
188 | # Valid values are 0,1. If commented out, the default value is 0.
189 | # 0=disable, 1=enable
190 | gEnableTxBFin20MHz=1
191 |
192 | #Enable/Disable SU Tx beamformer support.
193 | gEnableTxSUBeamformer=1
194 |
195 | gEnableFastRoamInConcurrency=1
196 |
197 | # 802.11K support
198 | gRrmEnable=1
199 |
200 | #Enable firmware uart print
201 | gEnablefwprint=0
202 |
203 | # Firmware log mode
204 | # Valid values are 0,1,2
205 | # 0=Disable, 1=WMI, 2=DIAG
206 | gEnablefwlog=1
207 |
208 | # Maximum Receive AMPDU size (VHT only. Valid values:
209 | # 0->8k 1->16k 2->32k 3->64k 4->128k)
210 | gVhtAmpduLenExponent=7
211 |
212 | # Maximum MPDU length (VHT only. Valid values:
213 | # 0->3895 octets, 1->7991 octets, 2->11454 octets)
214 | gVhtMpduLen=2
215 |
216 | # Maximum number of wow filters required
217 | #gMaxWoWFilters=22
218 |
219 | # WOW Enable/Disable.
220 | # 0 - Disable both magic pattern match and pattern byte match.
221 | # 1 - Enable magic pattern match on all interfaces.
222 | # 2 - Enable pattern byte match on all interfaces.
223 | # 3 - Enable both magic pattern and pattern byte match on all interfaces.
224 | # Default value of gEnableWoW is 3.
225 | # gEnableWoW=0
226 |
227 | # Enable or Disable MCC Adaptive Scheduler at the FW
228 | # 1=Enable (default), 0=Disable
229 | gEnableMCCAdaptiveScheduler=1
230 |
231 | #Enable or Disable p2p device address administered
232 | isP2pDeviceAddrAdministrated=0
233 |
234 | # Remove Overlap channel restriction
235 | gEnableOverLapCh=0
236 |
237 | #Enable VHT on 2.4Ghz
238 | gEnableVhtFor24GHzBand=1
239 |
240 | #Maximum number of offload peers supported
241 | # gMaxOffloadPeers=2
242 |
243 | # controlling the following offload patterns
244 | # through ini parameter. Default value is 1
245 | # to disable set it to zero. ssdp = 0
246 | # Setup multicast pattern for mDNS 224.0.0.251,
247 | # SSDP 239.255.255.250 and LLMNR 224.0.0.252
248 | ssdp=0
249 |
250 | #Enable Memory Deep Sleep
251 | gEnableMemDeepSleep=1
252 |
253 | # RA filtering rate limit param, the current value would not
254 | # help if the lifetime in RA is less than 3*60=3min. Then
255 | # we need to change it, though it is uncommon.
256 | # gRAFilterEnable=0
257 | gRArateLimitInterval=600
258 |
259 | # Maximum number of concurrent connections
260 | gMaxConcurrentActiveSessions=3
261 |
262 | # Disable/Enable GreenAP
263 | # 0 to disable, 1 to enable, default: 1
264 | gEnableGreenAp=0
265 |
266 | gPNOScanSupport=1
267 |
268 | #Enable/Disable LPASS support
269 | # 0 to disable, 1 to enable
270 | gEnableLpassSupport=1
271 |
272 | # Whether userspace country code setting shld have priority
273 | gCountryCodePriority=1
274 |
275 | # Enable(1)/Disable(0) SIFS burst
276 | gEnableSifsBurst=1
277 |
278 | # Enable or Disable Multi-user MIMO
279 | # 1=Enable (default), 0=Disable
280 | gEnableMuBformee=1
281 |
282 | # Inactivity time (in ms) to end TX Service Period while in IBSS power save mode
283 | gIbssTxSpEndInactivityTime=10
284 |
285 | # Enable TDLS External Control. That is, user space application has to
286 | # first configure a peer MAC in wlan driver towards which TDLS is desired.
287 | # Device will establish TDLS only towards those configured peers whenever
288 | # TDLS criteria (throughput and RSSI threshold) is met and teardown TDLS
289 | # when teardown criteria (idle packet count and RSSI) is met. However,
290 | # device will accept TDLS connection if it is initiated from any other peer,
291 | # even if that peer is not configured.
292 | # 0 - disable
293 | # 1 - enable
294 | # For TDLS External Control, Implicit Trigger must also be enabled.
295 | gTDLSExternalControl=1
296 |
297 | # Enable support for TDLS off-channel operation
298 | # 0 - disable
299 | # 1 - enable
300 | # TDLS off-channel operation will be invoked when there is only one
301 | # TDLS connection.
302 | gEnableTDLSOffChannel=1
303 |
304 | # Enable or Disable Random MAC (Spoofing)
305 | # 1=Enable (default), 0=Disable
306 | gEnableMacAddrSpoof=1
307 |
308 | ################ Datapath feature set Begin ################
309 | # Bus bandwidth threshold values in terms of number of packets
310 | gBusBandwidthHighThreshold=2000
311 | gBusBandwidthMediumThreshold=500
312 | gBusBandwidthLowThreshold=150
313 |
314 | # Bus bandwidth compute timeout value in ms
315 | gBusBandwidthComputeInterval=100
316 |
317 | # VHT Tx/Rx MCS values
318 | # Valid values are 0,1,2. If commented out, the default value is 0.
319 | # 0=MCS0-7, 1=MCS0-8, 2=MCS0-9
320 | gVhtRxMCS=2
321 | gVhtTxMCS=2
322 |
323 | # VHT Tx/Rx MCS values for 2x2
324 | # Valid values are 0,1,2. If commented out, the default value is 0.
325 | # 0=MCS0-7, 1=MCS0-8, 2=MCS0-9
326 | gEnable2x2=1
327 | gVhtRxMCS2x2=2
328 | gVhtTxMCS2x2=2
329 |
330 | #IPA config is a bit mask and following are the configurations.
331 | #bit0 IPA Enable
332 | #bit1 IPA PRE Filter enable
333 | #bit2 IPv6 enable
334 | #bit3 IPA Resource Manager (RM) enable
335 | #bit4 IPA Clock scaling enable
336 | #bit5 IPA uC ENABLE
337 | #bit6 IPA uC STA ENABLE
338 | #bit8 IPA Real Time Debugging
339 | gIPAConfig=0x7d
340 | gIPADescSize=800
341 |
342 | # Set IPA bandwidth levels in mbps
343 | gIPALowBandwidthMbps=100
344 | gIPAMediumBandwidthMbps=400
345 | gIPAHighBandwidthMbps=800
346 |
347 | # Set CPU mask for RPS Rx queue
348 | rpsRxQueueCpuMapList=07
349 |
350 | # Enable/Disable RX full reorder offload
351 | gReorderOffloadSupported=1
352 |
353 | # Enable CE classification
354 | # 1 - enable(default) 0 - disable
355 | gCEClassifyEnable=1
356 |
357 | # Enable Rx handling options
358 | # Rx_thread=1 RPS=2(default for ROME) NAPI=4(default for ihelium)
359 | rx_mode=20
360 |
361 | # Enable(Tx) fastpath for data traffic.
362 | # 1 - enable(default) 0 - disable
363 | gEnableFastPath=1
364 |
365 | # This flag enables IP, TCP and UDP checksum offload
366 | # 1 - enable(default) 0 - disable
367 | gEnableIpTcpUdpChecksumOffload=1
368 |
369 | # Enable TCP Segmentation Offload
370 | # 1 - enable 0 - disable
371 | TSOEnable=1
372 |
373 | # Enable Generic Receive Offload
374 | # 1 - enable(default) 0 - disable
375 | GROEnable=1
376 |
377 | # Enable HT MPDU Density
378 | # 4 for 2 micro sec
379 | ght_mpdu_density=4
380 |
381 | # Enable flow steering to enable multiple CEs for Rx flows.
382 | # Multiple Rx CEs<==>Multiple Rx IRQs<==>probably different CPUs.
383 | # Parallel Rx paths.
384 | # 1 - enable 0 - disable(default)
385 | gEnableFlowSteering=1
386 |
387 | # Time in microseconds after which a NAPI poll must yield
388 | ce_service_max_yield_time=500
389 |
390 | #Maximum number of HTT messages to be processed per NAPI poll
391 | ce_service_max_rx_ind_flush=1
392 |
393 | # Maximum number of MSDUs the firmware will pack in one HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
394 | maxMSDUsPerRxInd=8
395 |
396 | # Enable NUD tracking feature
397 | # 1 - enable 0 - disable(default)
398 | gEnableNUDTracking=1
399 |
400 | ################ Datapath feature set End ################
401 |
402 | ################ NAN feature set start ###################
403 |
404 | # Enable NAN discovery (NAN 1.0)
405 | # 1 - enable 0 - disable(default)
406 | gEnableNanSupport=1
407 | # Enable NAN Datapath
408 | genable_nan_datapath=1
409 |
410 | ################ NAN feature set end #####################
411 |
412 | adaptive_dwell_mode_enabled=1
413 |
414 | hostscan_adaptive_dwell_mode=1
415 |
416 | adapt_dwell_lpf_weight=80
417 |
418 | adapt_dwell_wifi_act_threshold=10
419 |
420 | MAWCEnabled=0
421 |
422 | # Enable/Disable rtt sta mac randomization
423 | enable_rtt_mac_randomization=1
424 |
425 | #Enable/Disable SNR monitoring
426 | gEnableSNRMonitoring=1
427 |
428 | # Enable Runtime PM
429 | gRuntimePM=2
430 | gRuntimePMDelay=500
431 |
432 | # Rx thread affinity mask in UL case
433 | RX_THREAD_UL_CPU_AFFINITY_MASK=0xc0
434 |
435 | AutoChannelSelectWeight=0x00fafafa
436 |
437 | bcast_twt=1
438 |
439 | dp_tx_ring_size=3072
440 |
441 | gWmiCreditCount=1
442 |
443 | # Enable RX buffer pool
444 | dp_rx_buff_prealloc_pool=1
445 |
446 | #Enable RX FISA
447 | dp_rx_fisa_enable=1
448 | dp_rx_flow_search_table_size=128
449 |
450 | legacy_mode_csum_disable=0
451 |
452 | #Enable Rx refill pool
453 | dp_rx_refill_buff_pool=1
454 |
455 | # Enable Software latency manager
456 | gEnableSWLM=1
457 |
458 | # Place FST in CMEM
459 | dp_rx_fst_in_cmem=1
460 |
461 | # Use QMI path to get LL and station stats
462 | send_ll_and_get_station_stats_over_qmi=1
463 |
464 | # Enable/Disable SAR version conversion
465 | gEnableSARV1toSARV2=1
466 |
467 | #enable 6GHz support for RTT/LOWI
468 | oem_6g_support_disable=0
469 |
470 | #enable/disable Self Recovery
471 | gEnableSelfRecovery=1
472 |
473 | # AOSPA Edit: Disable FW TWT
474 | twt_congestion_timeout=0
475 |
476 | END
477 |
478 | # Note: Configuration parser would not read anything past the END marker
479 |
480 |
--------------------------------------------------------------------------------
/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 = "Paranoid Android";
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 = "co.aospa.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 = "co.aospa.sensor.single_tap";
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 |
--------------------------------------------------------------------------------
/fingerprint/BiometricsFingerprint.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 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 | #define LOG_TAG "android.hardware.biometrics.fingerprint@2.3-service.phone1"
17 | #define LOG_VERBOSE "android.hardware.biometrics.fingerprint@2.3-service.phone1"
18 |
19 | #include
20 |
21 | #include
22 | #include
23 | #include
24 | #include "BiometricsFingerprint.h"
25 |
26 | #include
27 |
28 | #include
29 | #include
30 |
31 | #include
32 | #include
33 | #include
34 |
35 | #define FOD_UI_PATH "/sys/devices/platform/soc/soc:qcom,dsi-display-primary/fod_ui"
36 |
37 | namespace android {
38 | namespace hardware {
39 | namespace biometrics {
40 | namespace fingerprint {
41 | namespace V2_3 {
42 | namespace implementation {
43 |
44 | static bool readBool(int fd) {
45 | char c;
46 | int rc;
47 |
48 | rc = lseek(fd, 0, SEEK_SET);
49 | if (rc) {
50 | ALOGE("failed to seek fd, err: %d", rc);
51 | return false;
52 | }
53 |
54 | rc = read(fd, &c, sizeof(char));
55 | if (rc != 1) {
56 | ALOGE("failed to read bool from fd, err: %d", rc);
57 | return false;
58 | }
59 |
60 | return c != '0';
61 | }
62 |
63 | // Supported fingerprint HAL version
64 | static const uint16_t kVersion = HARDWARE_MODULE_API_VERSION(2, 1);
65 |
66 | using RequestStatus =
67 | android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
68 |
69 | BiometricsFingerprint *BiometricsFingerprint::sInstance = nullptr;
70 |
71 | BiometricsFingerprint::BiometricsFingerprint() : mClientCallback(nullptr), mDevice(nullptr) {
72 | sInstance = this; // keep track of the most recent instance
73 | mDevice = openHal();
74 | if (!mDevice) {
75 | ALOGE("Can't open HAL module");
76 | return;
77 | }
78 | goodixExtCmd = reinterpret_cast(mDevice->reserved[0]);
79 |
80 | std::thread([this]() {
81 | int fd = open(FOD_UI_PATH, O_RDONLY);
82 | if (fd < 0) {
83 | ALOGE("failed to open fd, err: %d", fd);
84 | return;
85 | }
86 |
87 | struct pollfd fodUiPoll = {
88 | .fd = fd,
89 | .events = POLLERR | POLLPRI,
90 | .revents = 0,
91 | };
92 |
93 | while (true) {
94 | int rc = poll(&fodUiPoll, 1, -1);
95 | if (rc < 0) {
96 | ALOGE("failed to poll fd, err: %d", rc);
97 | continue;
98 | }
99 |
100 | goodixExtCmd(0, readBool(fd) ? 1 : 0, 0);
101 | }
102 | }).detach();
103 | }
104 |
105 | BiometricsFingerprint::~BiometricsFingerprint() {
106 | ALOGV("~BiometricsFingerprint()");
107 | if (mDevice == nullptr) {
108 | ALOGE("No valid device");
109 | return;
110 | }
111 | int err;
112 | if (0 != (err = mDevice->common.close(
113 | reinterpret_cast(mDevice)))) {
114 | ALOGE("Can't close fingerprint module, error: %d", err);
115 | return;
116 | }
117 | mDevice = nullptr;
118 | goodixExtCmd = nullptr;
119 | }
120 |
121 | Return BiometricsFingerprint::isUdfps(uint32_t) {
122 | return true;
123 | }
124 |
125 | Return BiometricsFingerprint::onFingerDown(uint32_t, uint32_t, float, float) {
126 | return Void();
127 | }
128 |
129 | Return BiometricsFingerprint::onFingerUp() {
130 | return Void();
131 | }
132 |
133 | Return BiometricsFingerprint::ErrorFilter(int32_t error) {
134 | switch(error) {
135 | case 0: return RequestStatus::SYS_OK;
136 | case -2: return RequestStatus::SYS_ENOENT;
137 | case -4: return RequestStatus::SYS_EINTR;
138 | case -5: return RequestStatus::SYS_EIO;
139 | case -11: return RequestStatus::SYS_EAGAIN;
140 | case -12: return RequestStatus::SYS_ENOMEM;
141 | case -13: return RequestStatus::SYS_EACCES;
142 | case -14: return RequestStatus::SYS_EFAULT;
143 | case -16: return RequestStatus::SYS_EBUSY;
144 | case -22: return RequestStatus::SYS_EINVAL;
145 | case -28: return RequestStatus::SYS_ENOSPC;
146 | case -110: return RequestStatus::SYS_ETIMEDOUT;
147 | default:
148 | ALOGE("An unknown error returned from fingerprint vendor library: %d", error);
149 | return RequestStatus::SYS_UNKNOWN;
150 | }
151 | }
152 |
153 | // Translate from errors returned by traditional HAL (see fingerprint.h) to
154 | // HIDL-compliant FingerprintError.
155 | FingerprintError BiometricsFingerprint::VendorErrorFilter(int32_t error,
156 | int32_t* vendorCode) {
157 | switch(error) {
158 | case FINGERPRINT_ERROR_HW_UNAVAILABLE:
159 | return FingerprintError::ERROR_HW_UNAVAILABLE;
160 | case FINGERPRINT_ERROR_UNABLE_TO_PROCESS:
161 | return FingerprintError::ERROR_UNABLE_TO_PROCESS;
162 | case FINGERPRINT_ERROR_TIMEOUT:
163 | return FingerprintError::ERROR_TIMEOUT;
164 | case FINGERPRINT_ERROR_NO_SPACE:
165 | return FingerprintError::ERROR_NO_SPACE;
166 | case FINGERPRINT_ERROR_CANCELED:
167 | return FingerprintError::ERROR_CANCELED;
168 | case FINGERPRINT_ERROR_UNABLE_TO_REMOVE:
169 | return FingerprintError::ERROR_UNABLE_TO_REMOVE;
170 | case FINGERPRINT_ERROR_LOCKOUT:
171 | return FingerprintError::ERROR_LOCKOUT;
172 | default:
173 | if (error >= FINGERPRINT_ERROR_VENDOR_BASE) {
174 | // vendor specific code.
175 | *vendorCode = error - FINGERPRINT_ERROR_VENDOR_BASE;
176 | return FingerprintError::ERROR_VENDOR;
177 | }
178 | }
179 | ALOGE("Unknown error from fingerprint vendor library: %d", error);
180 | return FingerprintError::ERROR_UNABLE_TO_PROCESS;
181 | }
182 |
183 | // Translate acquired messages returned by traditional HAL (see fingerprint.h)
184 | // to HIDL-compliant FingerprintAcquiredInfo.
185 | FingerprintAcquiredInfo BiometricsFingerprint::VendorAcquiredFilter(
186 | int32_t info, int32_t* vendorCode) {
187 | switch(info) {
188 | case FINGERPRINT_ACQUIRED_GOOD:
189 | return FingerprintAcquiredInfo::ACQUIRED_GOOD;
190 | case FINGERPRINT_ACQUIRED_PARTIAL:
191 | return FingerprintAcquiredInfo::ACQUIRED_PARTIAL;
192 | case FINGERPRINT_ACQUIRED_INSUFFICIENT:
193 | return FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT;
194 | case FINGERPRINT_ACQUIRED_IMAGER_DIRTY:
195 | return FingerprintAcquiredInfo::ACQUIRED_IMAGER_DIRTY;
196 | case FINGERPRINT_ACQUIRED_TOO_SLOW:
197 | return FingerprintAcquiredInfo::ACQUIRED_TOO_SLOW;
198 | case FINGERPRINT_ACQUIRED_TOO_FAST:
199 | return FingerprintAcquiredInfo::ACQUIRED_TOO_FAST;
200 | default:
201 | if (info >= FINGERPRINT_ACQUIRED_VENDOR_BASE) {
202 | // vendor specific code.
203 | *vendorCode = info - FINGERPRINT_ACQUIRED_VENDOR_BASE;
204 | return FingerprintAcquiredInfo::ACQUIRED_VENDOR;
205 | }
206 | }
207 | ALOGE("Unknown acquiredmsg from fingerprint vendor library: %d", info);
208 | return FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT;
209 | }
210 |
211 | Return BiometricsFingerprint::setNotify(
212 | const sp& clientCallback) {
213 | std::lock_guard lock(mClientCallbackMutex);
214 | mClientCallback = clientCallback;
215 | // This is here because HAL 2.3 doesn't have a way to propagate a
216 | // unique token for its driver. Subsequent versions should send a unique
217 | // token for each call to setNotify(). This is fine as long as there's only
218 | // one fingerprint device on the platform.
219 | return reinterpret_cast(mDevice);
220 | }
221 |
222 | Return BiometricsFingerprint::preEnroll() {
223 | return mDevice->pre_enroll(mDevice);
224 | }
225 |
226 | Return BiometricsFingerprint::enroll(const hidl_array& hat,
227 | uint32_t gid, uint32_t timeoutSec) {
228 |
229 | const hw_auth_token_t* authToken =
230 | reinterpret_cast(hat.data());
231 | return ErrorFilter(mDevice->enroll(mDevice, authToken, gid, timeoutSec));
232 | }
233 |
234 | Return BiometricsFingerprint::postEnroll() {
235 | getInstance()->onFingerUp();
236 | return ErrorFilter(mDevice->post_enroll(mDevice));
237 | }
238 |
239 | Return BiometricsFingerprint::getAuthenticatorId() {
240 | return mDevice->get_authenticator_id(mDevice);
241 | }
242 |
243 | Return BiometricsFingerprint::cancel() {
244 | getInstance()->onFingerUp();
245 | return ErrorFilter(mDevice->cancel(mDevice));
246 | }
247 |
248 | Return BiometricsFingerprint::enumerate() {
249 | return ErrorFilter(mDevice->enumerate(mDevice));
250 | }
251 |
252 | Return BiometricsFingerprint::remove(uint32_t gid, uint32_t fid) {
253 | return ErrorFilter(mDevice->remove(mDevice, gid, fid));
254 | }
255 |
256 | Return BiometricsFingerprint::setActiveGroup(uint32_t gid,
257 | const hidl_string& storePath) {
258 | if (storePath.size() >= PATH_MAX || storePath.size() <= 0) {
259 | ALOGE("Bad path length: %zd", storePath.size());
260 | return RequestStatus::SYS_EINVAL;
261 | }
262 | if (access(storePath.c_str(), W_OK)) {
263 | return RequestStatus::SYS_EINVAL;
264 | }
265 |
266 | return ErrorFilter(mDevice->set_active_group(mDevice, gid,
267 | storePath.c_str()));
268 | }
269 |
270 | Return BiometricsFingerprint::authenticate(uint64_t operationId,
271 | uint32_t gid) {
272 | return ErrorFilter(mDevice->authenticate(mDevice, operationId, gid));
273 | }
274 |
275 | IBiometricsFingerprint* BiometricsFingerprint::getInstance() {
276 | if (!sInstance) {
277 | sInstance = new BiometricsFingerprint();
278 | }
279 | return sInstance;
280 | }
281 |
282 | fingerprint_device_t* BiometricsFingerprint::openHal() {
283 | int err;
284 | const hw_module_t *hw_mdl = nullptr;
285 | ALOGD("Opening fingerprint hal library...");
286 | if (0 != (err = hw_get_module(FINGERPRINT_HARDWARE_MODULE_ID, &hw_mdl))) {
287 | ALOGE("Can't open fingerprint HW Module, error: %d", err);
288 | return nullptr;
289 | }
290 |
291 | if (hw_mdl == nullptr) {
292 | ALOGE("No valid fingerprint module");
293 | return nullptr;
294 | }
295 |
296 | fingerprint_module_t const *module =
297 | reinterpret_cast(hw_mdl);
298 | if (module->common.methods->open == nullptr) {
299 | ALOGE("No valid open method");
300 | return nullptr;
301 | }
302 |
303 | hw_device_t *device = nullptr;
304 |
305 | if (0 != (err = module->common.methods->open(hw_mdl, nullptr, &device))) {
306 | ALOGE("Can't open fingerprint methods, error: %d", err);
307 | return nullptr;
308 | }
309 |
310 | if (kVersion != device->version) {
311 | // enforce version on new devices because of HIDL@2.3 translation layer
312 | ALOGE("Wrong fp version. Expected %d, got %d", kVersion, device->version);
313 | return nullptr;
314 | }
315 |
316 | fingerprint_device_t* fp_device =
317 | reinterpret_cast(device);
318 |
319 | if (0 != (err =
320 | fp_device->set_notify(fp_device, BiometricsFingerprint::notify))) {
321 | ALOGE("Can't register fingerprint module callback, error: %d", err);
322 | return nullptr;
323 | }
324 |
325 | return fp_device;
326 | }
327 |
328 | void BiometricsFingerprint::notify(const fingerprint_msg_t *msg) {
329 | BiometricsFingerprint* thisPtr = static_cast(
330 | BiometricsFingerprint::getInstance());
331 | std::lock_guard lock(thisPtr->mClientCallbackMutex);
332 | if (thisPtr == nullptr || thisPtr->mClientCallback == nullptr) {
333 | ALOGE("Receiving callbacks before the client callback is registered.");
334 | return;
335 | }
336 | const uint64_t devId = reinterpret_cast(thisPtr->mDevice);
337 | switch (msg->type) {
338 | case FINGERPRINT_ERROR: {
339 | int32_t vendorCode = 0;
340 | FingerprintError result = VendorErrorFilter(msg->data.error, &vendorCode);
341 | ALOGD("onError(%d)", result);
342 | if (!thisPtr->mClientCallback->onError(devId, result, vendorCode).isOk()) {
343 | ALOGE("failed to invoke fingerprint onError callback");
344 | }
345 | }
346 | break;
347 | case FINGERPRINT_ACQUIRED: {
348 | int32_t vendorCode = 0;
349 | FingerprintAcquiredInfo result =
350 | VendorAcquiredFilter(msg->data.acquired.acquired_info, &vendorCode);
351 | ALOGD("onAcquired(%d)", result);
352 | if (result != FingerprintAcquiredInfo::ACQUIRED_VENDOR) {
353 | if (!thisPtr->mClientCallback->onAcquired(devId, result, vendorCode).isOk()) {
354 | ALOGE("failed to invoke fingerprint onAcquired callback");
355 | }
356 | }
357 | }
358 | break;
359 | case FINGERPRINT_TEMPLATE_ENROLLING:
360 | ALOGD("onEnrollResult(fid=%d, gid=%d, rem=%d)",
361 | msg->data.enroll.finger.fid,
362 | msg->data.enroll.finger.gid,
363 | msg->data.enroll.samples_remaining);
364 | if (!thisPtr->mClientCallback->onEnrollResult(devId,
365 | msg->data.enroll.finger.fid,
366 | msg->data.enroll.finger.gid,
367 | msg->data.enroll.samples_remaining).isOk()) {
368 | ALOGE("failed to invoke fingerprint onEnrollResult callback");
369 | }
370 | break;
371 | case FINGERPRINT_TEMPLATE_REMOVED:
372 | ALOGD("onRemove(fid=%d, gid=%d, rem=%d)",
373 | msg->data.removed.finger.fid,
374 | msg->data.removed.finger.gid,
375 | msg->data.removed.remaining_templates);
376 | if (!thisPtr->mClientCallback->onRemoved(devId,
377 | msg->data.removed.finger.fid,
378 | msg->data.removed.finger.gid,
379 | msg->data.removed.remaining_templates).isOk()) {
380 | ALOGE("failed to invoke fingerprint onRemoved callback");
381 | }
382 | break;
383 | case FINGERPRINT_AUTHENTICATED:
384 | if (msg->data.authenticated.finger.fid != 0) {
385 | ALOGD("onAuthenticated(fid=%d, gid=%d)",
386 | msg->data.authenticated.finger.fid,
387 | msg->data.authenticated.finger.gid);
388 | const uint8_t* hat =
389 | reinterpret_cast(&msg->data.authenticated.hat);
390 | const hidl_vec token(
391 | std::vector(hat, hat + sizeof(msg->data.authenticated.hat)));
392 | if (!thisPtr->mClientCallback->onAuthenticated(devId,
393 | msg->data.authenticated.finger.fid,
394 | msg->data.authenticated.finger.gid,
395 | token).isOk()) {
396 | ALOGE("failed to invoke fingerprint onAuthenticated callback");
397 | }
398 | getInstance()->onFingerUp();
399 | } else {
400 | // Not a recognized fingerprint
401 | if (!thisPtr->mClientCallback->onAuthenticated(devId,
402 | msg->data.authenticated.finger.fid,
403 | msg->data.authenticated.finger.gid,
404 | hidl_vec()).isOk()) {
405 | ALOGE("failed to invoke fingerprint onAuthenticated callback");
406 | }
407 | }
408 | break;
409 | case FINGERPRINT_TEMPLATE_ENUMERATING:
410 | ALOGD("onEnumerate(fid=%d, gid=%d, rem=%d)",
411 | msg->data.enumerated.finger.fid,
412 | msg->data.enumerated.finger.gid,
413 | msg->data.enumerated.remaining_templates);
414 | if (!thisPtr->mClientCallback->onEnumerate(devId,
415 | msg->data.enumerated.finger.fid,
416 | msg->data.enumerated.finger.gid,
417 | msg->data.enumerated.remaining_templates).isOk()) {
418 | ALOGE("failed to invoke fingerprint onEnumerate callback");
419 | }
420 | break;
421 | }
422 | }
423 |
424 | } // namespace implementation
425 | } // namespace V2_3
426 | } // namespace fingerprint
427 | } // namespace biometrics
428 | } // namespace hardware
429 | } // namespace android
430 |
--------------------------------------------------------------------------------
/init/init.target.rc:
--------------------------------------------------------------------------------
1 |
2 | # Copyright (c) 2019-2020, 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
6 | # 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
10 | # copyright notice, this list of conditions and the following
11 | # disclaimer in the documentation and/or other materials provided
12 | # with the distribution.
13 | # * Neither the name of The Linux Foundation nor the names of its
14 | # contributors may be used to endorse or promote products derived
15 | # from this software without specific prior written permission.
16 | #
17 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
18 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
21 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | #
29 | #
30 |
31 | import /vendor/etc/init/hw/init.qti.kernel.rc
32 |
33 | on early-init
34 | write /proc/sys/kernel/sched_boost 1
35 | wait /sys/devices/soc0/soc_id
36 |
37 | on init
38 | # Scheduler uclamp
39 | mkdir /dev/cpuctl/foreground
40 | mkdir /dev/cpuctl/background
41 | mkdir /dev/cpuctl/top-app
42 | mkdir /dev/cpuctl/rt
43 | chown system system /dev/cpuctl
44 | chown system system /dev/cpuctl/foreground
45 | chown system system /dev/cpuctl/background
46 | chown system system /dev/cpuctl/top-app
47 | chown system system /dev/cpuctl/rt
48 | chown system system /dev/cpuctl/tasks
49 | chown system system /dev/cpuctl/foreground/tasks
50 | chown system system /dev/cpuctl/background/tasks
51 | chown system system /dev/cpuctl/top-app/tasks
52 | chown system system /dev/cpuctl/rt/tasks
53 | chmod 0664 /dev/cpuctl/tasks
54 | chmod 0664 /dev/cpuctl/foreground/tasks
55 | chmod 0664 /dev/cpuctl/background/tasks
56 | chmod 0664 /dev/cpuctl/top-app/tasks
57 | chmod 0664 /dev/cpuctl/rt/tasks
58 | write /dev/cpuctl/foreground/cpu.rt_runtime_us 950000
59 | write /dev/cpuctl/background/cpu.rt_runtime_us 950000
60 | write /dev/cpuctl/top-app/cpu.rt_runtime_us 950000
61 | write /dev/cpuctl/rt/cpu.rt_runtime_us 950000
62 |
63 | wait /dev/block/platform/soc/${ro.boot.bootdevice}
64 | symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
65 | chown system system /sys/devices/platform/soc/1d84000.ufshc/auto_hibern8
66 | chmod 0660 /sys/devices/platform/soc/1d84000.ufshc/auto_hibern8
67 | start logd
68 |
69 | # Property used for sku specific sysconfig and permissions
70 | setprop ro.boot.product.hardware.sku ${ro.boot.hardware.sku}
71 | # Begin, added by zhiming.guan for ABR-14096
72 | chown root system /sys/class/thermal/thermal_zone94/mode
73 | chown root system /sys/class/thermal/thermal_zone95/mode
74 | chmod 0664 /sys/class/thermal/thermal_zone94/mode
75 | chmod 0664 /sys/class/thermal/thermal_zone95/mode
76 | # End
77 |
78 | # Allow GOTA targeting full OTA per SKU
79 | setprop ro.oem.key1 ${ro.boot.hardware.sku}
80 |
81 | on early-fs
82 | start vold
83 |
84 | on fs
85 | start hwservicemanager
86 | mkdir /mnt/vendor/spunvm 0660 system system
87 | mount_all --early
88 | chown root system /mnt/vendor/persist
89 | chmod 0771 /mnt/vendor/persist
90 | restorecon_recursive /mnt/vendor/persist
91 | mkdir /mnt/vendor/persist/data 0700 system system
92 | #GW9578 fp
93 | chmod 666 /dev/goodix_fp
94 | chown system system /dev/goodix_fp
95 | chown system system /sys/class/backlight/panel0-backlight/hbm_mode
96 | chmod 666 /sys/class/backlight/panel0-backlight/hbm_mode
97 | #chmod tfa climax
98 | chmod 666 /sys/bus/i2c/devices/1-0034/reg
99 | chmod 666 /sys/bus/i2c/devices/1-0034/rw
100 | chmod 666 /sys/bus/i2c/devices/1-0035/reg
101 | chmod 666 /sys/bus/i2c/devices/1-0035/rw
102 | chmod 666 /sys/kernel/debug/tfa98xx-34/rpc
103 | chmod 666 /sys/kernel/debug/tfa98xx-35/rpc
104 | chmod 666 /proc/tfa98xx-34/rpc
105 | chmod 666 /proc/tfa98xx-35/rpc
106 | chmod 666 /sys/class/qcom-haptics/lra_calibration
107 | chmod 666 /sys/class/qcom-haptics/lra_frequency_hz
108 | chmod 666 /sys/class/qcom-haptics/lra_impedance
109 | chown system system /sys/class/qcom-haptics/lra_calibration
110 | chown system system /sys/class/qcom-haptics/lra_frequency_hz
111 | chown system system /sys/class/qcom-haptics/lra_impedance
112 |
113 | on post-fs-data
114 | mkdir /data/vendor/goodix 0700 system system
115 |
116 | on fs && property:ro.boot.product.vendor.sku=lahaina
117 | mkdir /mnt/vendor/spunvm 0660 system system
118 | wait /dev/block/bootdevice/by-name/spunvm
119 | mount vfat /dev/block/bootdevice/by-name/spunvm /mnt/vendor/spunvm rw noatime shortname=lower,uid=1000,gid=1000,dmask=007,fmask=007,context=u:object_r:vendor_spunvm_file:s0
120 |
121 | on post-fs
122 | # set RLIMIT_MEMLOCK to 64MB
123 | setrlimit 8 67108864 67108864
124 |
125 | on late-fs
126 | wait_for_prop hwservicemanager.ready true
127 | #exec_start wait_for_keymaster
128 | mount_all --late
129 |
130 | on post-fs-data
131 | restorecon_recursive /mnt/vendor/persist
132 | mkdir /mnt/vendor/persist/camera 0777 cameraserver cameraserver
133 | mkdir /vendor/data/tombstones 0771 system system
134 | # Enable WLAN cold boot calibration
135 | write /sys/devices/platform/soc/b0000000.qcom,cnss-qca6490/fs_ready 1
136 |
137 | on post-fs-data
138 | mkdir /data/vendor/camera 0775 camera camera
139 | copy /mnt/vendor/persist/camera/bokeh_caldata_uw_persist.bin /data/vendor/camera/bokeh_caldata_uw_persist.bin
140 | chmod 0444 /data/vendor/camera/bokeh_caldata_uw_persist.bin
141 | chown cameraserver audio /data/vendor/camera/bokeh_caldata_uw_persist.bin
142 | copy /mnt/vendor/persist/camera/ois_caldata_wide_persist.bin /data/vendor/camera/ois_caldata_wide_persist.bin
143 | chmod 0444 /data/vendor/camera/ois_caldata_wide_persist.bin
144 | chown cameraserver audio /data/vendor/camera/ois_caldata_wide_persist.bin
145 |
146 | on early-boot
147 | start vendor.sensors
148 | verity_update_state
149 |
150 | on boot
151 | write /dev/cpuset/audio-app/cpus 1-2
152 | # Add a cpuset for the camera daemon
153 | # We want all cores for camera
154 | mkdir /dev/cpuset/camera-daemon
155 | write /dev/cpuset/camera-daemon/cpus 0-7
156 | write /dev/cpuset/camera-daemon/mems 0
157 | chown cameraserver cameraserver /dev/cpuset/camera-daemon
158 | chown cameraserver cameraserver /dev/cpuset/camera-daemon/tasks
159 | chmod 0660 /dev/cpuset/camera-daemon/tasks
160 | chown system /sys/devices/platform/soc/990000.i2c/i2c-0/0-0049/trusted_touch_enable
161 | chmod 0660 /sys/devices/platform/soc/990000.i2c/i2c-0/0-0049/trusted_touch_enable
162 | chown system /sys/devices/platform/soc/990000.i2c/i2c-0/0-0038/trusted_touch_enable
163 | chmod 0660 /sys/devices/platform/soc/990000.i2c/i2c-0/0-0038/trusted_touch_enable
164 | chown system /sys/devices/platform/soc/988000.i2c/i2c-1/1-0038/trusted_touch_enable
165 | chmod 0660 /sys/devices/platform/soc/988000.i2c/i2c-1/1-0038/trusted_touch_enable
166 | chown system /sys/devices/platform/soc/990000.i2c/i2c-0/0-0049/trusted_touch_event
167 | chmod 0660 /sys/devices/platform/soc/990000.i2c/i2c-0/0-0049/trusted_touch_event
168 | chown system /sys/devices/platform/soc/990000.i2c/i2c-0/0-0038/trusted_touch_event
169 | chmod 0660 /sys/devices/platform/soc/990000.i2c/i2c-0/0-0038/trusted_touch_event
170 | chown system /sys/devices/platform/soc/988000.i2c/i2c-1/1-0038/trusted_touch_event
171 | chmod 0660 /sys/devices/platform/soc/988000.i2c/i2c-1/1-0038/trusted_touch_event
172 | chown system /sys/devices/platform/soc/a94000.i2c/i2c-2/2-0062/trusted_touch_enable
173 | chmod 0660 /sys/devices/platform/soc/a94000.i2c/i2c-2/2-0062/trusted_touch_enable
174 | chown system /sys/devices/platform/soc/a94000.i2c/i2c-2/2-0062/trusted_touch_event
175 | chmod 0660 /sys/devices/platform/soc/a94000.i2c/i2c-2/2-0062/trusted_touch_event
176 | chown system /sys/devices/system/cpu/hyp_core_ctl/enable
177 | chown system /sys/devices/system/cpu/hyp_core_ctl/hcc_min_freq
178 | # add for MZ to write hbm_mode
179 | chown system system /sys/class/drm/sde-conn-1-DSI-1/hbm_mode
180 | chmod 0666 /sys/class/drm/sde-conn-1-DSI-1/hbm_mode
181 | # add for cit to read panel_id
182 | chown system system /sys/class/drm/sde-conn-1-DSI-1/panel_id
183 | chmod 0666 /sys/class/drm/sde-conn-1-DSI-1/panel_id
184 | # add for cit to write leds
185 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/all_leds_effect
186 | chmod 0666 /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/all_leds_effect
187 | #add for TP to write mode
188 | chown system system /sys/bus/spi/devices/spi0.0/fts_edge_mode
189 | chown system system /sys/bus/spi/devices/spi0.0/fts_gesture_mode
190 | # mickey.chin@SystemUI:AOD, 2022/11/10, NOS-611, ABR13T-361
191 | # add for systemui to write gesture mode
192 | chmod 0666 /sys/bus/spi/devices/spi0.0/fts_gesture_mode
193 | # add for cit to write wireless_boost_en
194 | #chown system system /sys/class/qcom-battery/wireless_boost_en
195 | # add for cit to write wls_st38_reg
196 | #chown system system /sys/class/qcom-battery/wls_st38_reg
197 | # add for runin to write charger
198 | #chown system system /sys/class/qcom-battery/usb_charger_en
199 | # add for slowcharge need to write charger
200 | #chown system system /sys/class/qcom-battery/slowcharge_en
201 | # add for ledTest to write led brightness
202 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/all_white_leds_br
203 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/glo_current
204 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/rear_cam_led_br
205 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/front_cam_led_br
206 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/vline_leds_br
207 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/dot_led_br
208 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/horse_race_leds_br
209 | chmod 0666 /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/horse_race_leds_br
210 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/round_leds_br
211 | chmod 0666 /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/round_leds_br
212 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/single_led_br
213 | chmod 0666 /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/single_led_br
214 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/round_leds_effect
215 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/horse_race_leds
216 | #add for hal write lednode
217 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/wired_charging_leds
218 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/random_delay
219 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/random_leds_effect
220 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/keybd_leds_effect
221 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/wlr_charging_leds
222 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/video_leds_effect
223 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/ga_leds_effect
224 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/nf_leds_effect
225 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/bootan_leds_effect
226 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/rear_cam_leds_effect
227 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/music_leds_effect
228 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/frame_leds_effect
229 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/ringtone_leds_effect
230 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/flip_leds_effect
231 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/exclamation_leds_effect
232 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/setting_leds_effect
233 | chown system system /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/setting_br
234 |
235 | #add by Dylan for TFT-404
236 | chmod 0660 /sys/devices/platform/soc/c440000.qcom,spmi/driver/c440000.qcom,spmi/spmi-0/spmi0-00/c440000.qcom,spmi:qcom,pmk8350@0:pon_hlos@1300/force_key_warm_reset
237 | chown system system /sys/devices/platform/soc/c440000.qcom,spmi/driver/c440000.qcom,spmi/spmi-0/spmi0-00/c440000.qcom,spmi:qcom,pmk8350@0:pon_hlos@1300/force_key_warm_reset
238 |
239 | #add by raybin for TFT-666
240 | chown system system /proc/noth_logger/alarm
241 | chown system system /proc/noth_logger/standby
242 | chmod 0220 /proc/noth_logger/alarm
243 | chmod 0220 /proc/noth_logger/standby
244 |
245 | #add by Dylan for TFT-428
246 | write /proc/sys/kernel/hung_task_timeout_secs 180
247 | write /proc/sys/kernel/hung_task_warnings 10
248 | write /proc/sys/kernel/hung_task_check_count 32768
249 | write /proc/sys/kernel/hung_task_panic 1
250 | write /proc/sys/kernel/hung_task_check_interval_secs 0
251 | write /proc/sys/kernel/hung_task_selective_monitoring 0
252 | #USB controller configuration
253 | setprop vendor.usb.rndis.func.name "gsi"
254 | setprop vendor.usb.rmnet.func.name "gsi"
255 | setprop vendor.usb.rmnet.inst.name "rmnet"
256 | setprop vendor.usb.dpl.inst.name "dpl"
257 | setprop vendor.usb.qdss.inst.name "qdss_mdm"
258 | setprop vendor.usb.controller a600000.dwc3
259 | #Allow access to memory hotplug device attributes
260 | chown system system /sys/kernel/mem-offline/anon_migrate
261 | chown system system /proc/modem_restart
262 | chown system system /proc/stat
263 | #start ft-diag
264 | start ft_diag
265 |
266 |
267 | #add by Dylan for TFT-404
268 | on property:persist.vendor.stability.force_key_warm_reset=1
269 | write /sys/devices/platform/soc/c440000.qcom,spmi/driver/c440000.qcom,spmi/spmi-0/spmi0-00/c440000.qcom,spmi:qcom,pmk8350@0:pon_hlos@1300/force_key_warm_reset 1
270 |
271 | on property:persist.vendor.stability.force_key_warm_reset=0
272 | write /sys/devices/platform/soc/c440000.qcom,spmi/driver/c440000.qcom,spmi/spmi-0/spmi0-00/c440000.qcom,spmi:qcom,pmk8350@0:pon_hlos@1300/force_key_warm_reset 0
273 |
274 | #add by Dylan for TFT-456
275 | on property:sys.system_server.start_count=1
276 | write /sys/devices/virtual/NT/NT_reserve_kernel_log/boot_stage_systemserver 1
277 |
278 | #add by Dylan for TFT-428
279 | on property:persist.service.ageTest_running.upload.enable=*
280 | write /proc/sys/kernel/hung_task_timeout_secs 120
281 |
282 | #add by Dylan for TFT-1024
283 | on property:persist.sys.mglru_enable=true
284 | write /sys/kernel/mm/lru_gen/enabled 1
285 |
286 | on property:persist.sys.mglru_enable=false
287 | write /sys/kernel/mm/lru_gen/enabled n
288 |
289 | on property:vendor.display.lcd_density=560
290 | setprop dalvik.vm.heapgrowthlimit 256m
291 |
292 | on property:vendor.display.lcd_density=640
293 | setprop dalvik.vm.heapgrowthlimit 512m
294 |
295 | on boot && property:persist.vendor.usb.controller.default=*
296 | setprop vendor.usb.controller ${persist.vendor.usb.controller.default}
297 |
298 | on init && property:ro.boot.mode=charger
299 | mount_all /vendor/etc/charger_fw_fstab.qti --early
300 | write /sys/kernel/boot_adsp/boot 1
301 | wait /sys/class/power_supply/battery
302 |
303 | on charger
304 | start vendor.power_off_alarm
305 | setprop sys.usb.controller a600000.dwc3
306 | setprop sys.usb.configfs 1
307 |
308 | service vendor.lowi /vendor/bin/lowirpcd
309 | class core
310 | user system
311 | group system wakelock
312 | capabilities BLOCK_SUSPEND
313 |
314 | #pd-mapper
315 | service vendor.pd_mapper /vendor/bin/pd-mapper
316 | class core
317 | user system
318 | group system
319 |
320 | #Peripheral manager
321 | service vendor.per_mgr /vendor/bin/pm-service
322 | class core
323 | user system
324 | group system
325 | ioprio rt 4
326 |
327 | service vendor.per_proxy /vendor/bin/pm-proxy
328 | class core
329 | user system
330 | group system
331 | disabled
332 |
333 | #service vendor.mdm_helper /vendor/bin/mdm_helper
334 | # class core
335 | # group system wakelock
336 | # disabled
337 |
338 | service vendor.mdm_launcher /vendor/bin/sh /vendor/bin/init.mdm.sh
339 | class core
340 | oneshot
341 |
342 | on property:init.svc.vendor.per_mgr=running
343 | start vendor.per_proxy
344 |
345 | on property:sys.shutdown.requested=*
346 | stop vendor.per_proxy
347 |
348 | on property:vold.decrypt=trigger_restart_framework
349 | start vendor.cnss_diag
350 |
351 | service vendor.cnss_diag /system/vendor/bin/cnss_diag -q -f -t HELIUM
352 | class main
353 | user system
354 | group system wifi inet sdcard_rw media_rw diag
355 | oneshot
356 |
357 | #fan-controller
358 | service fan_control_turn_on /vendor/bin/fan_control 1
359 | class late_start
360 | user root
361 | disabled
362 | oneshot
363 |
364 | service fan_control_turn_off /vendor/bin/fan_control 0
365 | class late_start
366 | user root
367 | disabled
368 | oneshot
369 |
370 | #lei.wang add for fix ABR-460
371 | #synchronization vendor properties@{
372 | on property:persist.vendor.camera.singlebokeh.enable=*
373 | setprop persist.vendor.camera.vendor_singlebokeh.enable ${persist.vendor.camera.singlebokeh.enable}
374 | #@}
375 |
376 | #dandy add for fix ABR-942
377 | #Increase boot light effect@{
378 | on property:service.bootanim.exit=0
379 | write /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/bootan_leds_effect 1
380 |
381 | on property:service.bootanim.exit=1
382 | write /sys/devices/platform/soc/984000.i2c/i2c-0/0-0020/leds/aw210xx_led/bootan_leds_effect 0
383 | #@}
384 | #ningfei add for fix ABR-3149
385 | #add system group for charger node@{
386 | on property:service.bootanim.exit=1
387 | # add for cit to write wireless_boost_en
388 | chown system system /sys/class/qcom-battery/wireless_boost_en
389 | chmod 0666 /sys/class/qcom-battery/wireless_boost_en
390 | # add for cit to write wls_st38_reg
391 | chown system system /sys/class/qcom-battery/wls_st38_reg
392 | chmod 0666 /sys/class/qcom-battery/wls_st38_reg
393 | chmod 0666 /sys/class/qcom-battery/wls_reverse_status
394 | # add for runin to write charger
395 | chown system system /sys/class/qcom-battery/usb_charger_en
396 | # add for slowcharge need to write charger
397 | chown system system /sys/class/qcom-battery/slowcharge_en
398 | # add for wls charge online config
399 | chown system system /sys/class/qcom-battery/wls_chg_param
400 | # add for slowcharge need to write charger
401 | chown system system /sys/class/qcom-battery/charge_pump_enable
402 | # add for ABR-2547
403 | chown system system /sys/class/qcom-battery/charge_power
404 | # add for TFT-449
405 | chown system system /sys/class/qcom-battery/wls_en
406 | #@}
407 |
408 | # funk.tan for ship_mode @{
409 | on property:sys.ship_mode.enable=0
410 | write /sys/class/qcom-battery/ship_mode_en 0
411 |
412 | on property:sys.ship_mode.enable=1
413 | write /sys/class/qcom-battery/ship_mode_en 1
414 | # @}
415 |
416 | # change by nick for charge @{
417 | on property:sys.boot_completed=1 && property:persist.sys.runin.charging=false
418 | write /sys/class/qcom-battery/usb_charger_en 0
419 | on property:sys.boot_completed=1 && property:persist.sys.runin.charging=true
420 | write /sys/class/qcom-battery/usb_charger_en 1
421 | # @}
422 |
423 | # leiwang add for ft_diag @{
424 | service ft_diag /vendor/bin/ft_diag
425 | class main
426 | user root
427 | group system
428 | # @}
429 |
430 | # leiwang add for A+G sensor calibration @{
431 | service vendor.ssc_drva_test.accel /vendor/bin/ssc_drva_test -sensor=accel -factory_test=2 -duration=3
432 | class core
433 | user system
434 | group system
435 | disabled
436 | oneshot
437 |
438 | service vendor.ssc_drva_test.gyro /vendor/bin/ssc_drva_test -sensor=gyro -factory_test=2 -duration=3
439 | class core
440 | user system
441 | group system
442 | disabled
443 | oneshot
444 |
445 | on property:sys.ssc_drva_test.accel=start
446 | start vendor.ssc_drva_test.accel
447 |
448 | on property:sys.ssc_drva_test.accel=stop
449 | stop vendor.ssc_drva_test.accel
450 |
451 |
452 | on property:sys.ssc_drva_test.gyro=start
453 | start vendor.ssc_drva_test.gyro
454 |
455 | on property:sys.ssc_drva_test.gyro=stop
456 | stop vendor.ssc_drva_test.gyro
457 | # @}
458 |
459 | on property:sys.touch.edge_mode.enable=*
460 | write sys/class/spi_master/spi0/spi0.0/fts_edge_mode ${sys.touch.edge_mode.enable}
461 | on property:sys.touch.single_en.enable=1
462 | write sys/bus/spi/devices/spi0.0/fts_gesture_mode 1
463 | on property:sys.touch.single_en.enable=0
464 | write sys/bus/spi/devices/spi0.0/fts_gesture_mode 2
465 | on property:sys.touch.fod_en.enable=1
466 | write sys/bus/spi/devices/spi0.0/fts_gesture_mode 3
467 | on property:sys.touch.fod_en.enable=0
468 | write sys/bus/spi/devices/spi0.0/fts_gesture_mode 4
469 |
--------------------------------------------------------------------------------