76 Commits

Author SHA1 Message Date
LuK1337
10586a9d4a sm7125-common: Opt out of speaker_layout_channel_mask field
Required for ABI compatibility with audio HAL compiled before 15 QPR2.

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/9426
Change-Id: Ic910f0634ee0707c21dad77f5264fd89fb33f1c0
2026-01-09 23:19:50 +05:30
theshaenix
213053b2e3 sm7125-common : fine tuned the post boot script
- Improved the overall script behaviour
2026-01-09 22:26:35 +05:30
theshaenix
ce5d0c333f sm7125-common:migrate recovery init rc files to Soong
Move init.recovery.qcom.rc and init.recovery.usb.rc from
PRODUCT_COPY_FILES to proper prebuilt_etc modules.

This aligns recovery configuration with Soong-only builds,
ensures correct installation under /recovery/root, and
improves maintainability going forward.
2026-01-09 22:26:21 +05:30
aminfauzi
e8da85fd96 sm7125-common: Fix for aux camera lens missing in Aperture
Signed-off-by: aminfauzi <aremean0107@gmail.com>
2026-01-09 22:26:21 +05:30
theshaenix
34d8554510 Revert "sm7125-common: overlay: Enable BoostFramework support"
This reverts commit 2a5f329dcdbd63684e8d33ee2827df64b3b93783.
2026-01-09 22:26:21 +05:30
me-cafebabe
b277f8c03e sm7125-common: overlay: Disable high performance transitions
Change-Id: I70c593a8efe1499f8e0917b4e80652b7f3d71198
2026-01-09 22:26:21 +05:30
Pranav Vashi
7b575ce1eb sm7125-common: Update pinner files
Change-Id: Ibec6b6d6d1689fde16837ca526cb245cd5f9711c
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-09 22:26:21 +05:30
Edgar Arriaga
37a7dd6cfb sm7125-common: overlay: Set default pin amount for home app
Bug: 288900050
Test: dumpsys pinner
Flag: EXEMPT refactor

Change-Id: Ieed912786ce51f420da9b0e96ea5d93c22244176
2026-01-09 22:26:20 +05:30
theshaenix
f03e83d1e1 sm7125-common: Drop zram writeback 2026-01-09 22:26:18 +05:30
Cassie
c1b0ecc377 sm7125-common: overlay: Use the new auto network selection UI
Change-Id: I76698911103601d5f3ad67e1099790af8c2fdc18
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-09 22:25:47 +05:30
Georg Veichtlbauer
7aa4220185 sm7125-common: Drop config_setColorTransformAccelerated
It's now enabled by default

Change-Id: I57f059c872fc2ad2fd15e788b1391eeebaff9bde
2026-01-09 22:25:47 +05:30
Sebastiano Barezzi
7c63bfebaa sm7125-common: overlay: Enable config_dozePulsePickup
Change-Id: Ice5cd780eb77e2ae78a3a84a0140c321ad84f143
2026-01-09 22:25:47 +05:30
Bruno Martins
c4e96fd547 sm7125-common: overlay: Remove obsolete config_keyboardTapVibePattern
Change-Id: Ic89566183d2cdc4a20ea83f462c56a14184621ae
2026-01-09 22:25:46 +05:30
x0x00044
129fdb00e4 sm7125-common: overlay: Remove config_cellBroadcastAppLinks
- This is true by default.

Change-Id: I9f91f4bf49995975d434ad8b74b175693409862a
2026-01-09 22:25:46 +05:30
minaripenguin
b44aed089a sm7125-common: prop: Tune lmkd system properties
Signed-off-by: Mayur <ultramayur123@gmail.com>
2026-01-06 00:00:50 +05:30
Andrzej Perczak
afef2a1d6f Import lmkd props from google gki
Reference: https://github.com/LineageOS/android_hardware_google_pixel/blob/lineage-19.1/mm/device_gki.mk
Signed-off-by: Mayur <ultramayur123@gmail.com>
2026-01-06 00:00:50 +05:30
Tim Murray
d70d2d17d3 sm7125-common: prop: Set lmkd's swap_free_low_percentage to 100
Ref: 5f975896d4

Signed-off-by: Mayur <ultramayur123@gmail.com>
2026-01-06 00:00:49 +05:30
Mayur
b6efc02294 sm7125-common: prop: set lmk to kill heaviest task
Signed-off-by: Mayur <ultramayur123@gmail.com>
2026-01-06 00:00:49 +05:30
nullxception
5d82c74ffb sm7125-common: props: Disable LMKD log stats
TARGET_LMKD_STATS_LOG is not used anymore and log stats is enabled by
default, so we have to explicitly disable it from runtime.

Signed-off-by: Mayur <ultramayur123@gmail.com>
2026-01-06 00:00:49 +05:30
890393a955 Revert "sm7125-common: Update some soong config variables to bool type"
This reverts commit e4e29defad.
2025-12-30 09:20:19 +01:00
Yumi Yukimura
e4e29defad sm7125-common: Update some soong config variables to bool type 2025-12-30 13:18:17 +05:30
LuK1337
b0a455e0b8 sm7125-common: Remove vendor/lineage device framework matrix inclusion
See: I78da6340f38b93fdc4c3694cb8f431f387d16c0d
Change-Id: I0b9f527de50ca02082be9b92375559f4893b2688
2025-12-30 13:18:05 +05:30
Sourajit Karmakar
3967a9b37f sm7125-common: Disable FRP
* This should really be disabled after unlocking the bootloader.

Change-Id: Icf5305cba66e9e613000a6ef53b32fa59760a7f2
2025-12-30 13:17:35 +05:30
Kelvin Zhang
b9551ec7b2 sm7125-common: Allow to access bootable/deprecated-ota targets
Sm7125-common is still using non-AB update.
non-AB code will be moved to a separated namespace, add
deprecated-ota to sm6150-common namespace list ahead of time to avoid
breakage.

Test: th
Bug: 324360816
Change-Id: I909064be36e8febe80492cf010eb6eac3d6bc33d
2025-11-30 12:19:40 +05:30
Michael Bestas
9839b86f36 sm7125-common: Build recovery QTI health AIDL service
We have a recovery partition.

Change-Id: I10841b26feea3c214349a20b2eedec74924f993a
2025-11-30 12:19:40 +05:30
theshaenix
3728b1aea2 sm7125-common: Drop the unused android.hardware.power@1.2.vendor 2025-11-30 12:19:40 +05:30
Bruno Martins
5e170e74b3 sm7125-common: Move to QTI health AIDL service
The health AIDL HAL service provides functionalities of charger,
therefore system charger at /system/bin/charger is deprecated.
On top of that, QTI health AIDL HAL service enables suspend by
default, the equivalent of setting ro.charger.enable_suspend
for legacy charger.

Change-Id: I59c23e7974cea1174b0161f31a535fa3afa1e5c9
2025-11-30 12:19:39 +05:30
theshaenix
d7b1c2071f sm7125-common: Cleanup 2025-11-30 12:19:39 +05:30
aminfauzi
d1362347cd sm7125-common: fingerprint: preload HAL early for first-boot SetupWizard
Add an  trigger to start the fingerprint HAL immediately
after /data is mounted. Keeps  to avoid race
conditions, but ensures the HAL is available early enough for
first-boot SetupWizard enrollment.

This fixes the issue where fingerprint setup fails during initial
device setup but works after skipping and opening Settings.

Signed-off-by: aminfauzi <aremean0107@gmail.com>
2025-11-30 12:19:39 +05:30
theshaenix
e86c2261b6 sm7125-common: Enable EPPE 2025-11-30 12:19:39 +05:30
theshaenix
740b46504e sm7125-common: migrate to Adil MultiHAL 2025-11-30 12:19:39 +05:30
Omkar Chandorkar
3fcf8d108e sm7125-common: overlay: Steal CarrierConfig from phone1
* From Nothing OS 2.0.4

Change-Id: I8b761a30c86d72d6bd454332ec3042a22c1a7aac
Signed-off-by: Omkar Chandorkar <gotenksIN@aospa.co>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Signed-off-by: Mayur <ultramayur123@gmail.com>
2025-11-21 16:56:35 +05:30
aminfauzi
bccfa62cd8 sm7125-common: prop: Improve signal strength with missing optimization properties
Signed-off-by: aminfauzi <aremean0107@gmail.com>
2025-11-09 19:50:54 +05:30
aminfauzi
9cbeaf7f9a sm7125-common: prop: Clean up network mode conflict - keep only vendor.prop definition
Signed-off-by: aminfauzi <aremean0107@gmail.com>
2025-11-09 19:50:46 +05:30
1xtAsh
a8876fd7e7 sm7125-common: Disable default framerate for games
This props fixes frame rate restrictions in games

Signed-off-by: 1xtAsh <ashraykrsingh321@gmail.com>
2025-11-09 19:50:37 +05:30
ahmedtohamy1
bfa2e40a46 sm7125-common: Compile HWUI for performance
optimizing compiler flags for HWUI. * -fno-omit-frame-pointer, -marm, -mapcs

Signed-off-by: JaswalAshish <ashish@m.ms.evolution-x.org>
Change-Id: Ia141b59cd1334eede94cfbec5a66c2d0d7784cd4
2025-11-09 19:29:34 +05:30
helliscloser
c997706fe1 sm7125-common: Explicitly disable "Enable GL comp backpressure"
When blur is enabled,
There is severe lag in; Launcher3 while scrolling apps in App drawer, Scrolling through recents and occasionally on QS pull down.

Explicitly disabling the "Enable GL comp backpressure" prop seems to slove the issue.

Lag & janks are gone now, even with blur.

Change-Id: Ia82d84d6ee867caa52ae93b72fbff132070bf808
Signed-off-by: helliscloser <mrumais@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-11-09 19:29:06 +05:30
TheMysticle
7bca1e3cbd sm7125-common: Enable ADPF CPU hints for improved UI performance
Turns on `debug.sf.enable_adpf_cpu_hint` to allow SurfaceFlinger to utilize Android Dynamic Performance Framework CPU hints, improving overall UI responsiveness and frame pacing on Snapdragon devices.

Change-Id: Ia715ab89ffc8a18130904e5588f9e4b487a20faa
2025-11-09 19:28:48 +05:30
Ghosuto
eae47e3ba2 sm7125-common: Enable Client Composition Cache
- All latest soc use it by default. with this cache can improve performance by reusing composition, This can result in smoother UI performance and potentially lower power consumption

- cons: It does increase memory usage because the system needs to store these results, but its not a big issue cause most devices are 12gb ver. and fine for 8gb also

Signed-off-by: Ghosuto <clash.raja10@gmail.com>
2025-11-09 19:28:36 +05:30
johnmart19
3b12dc0491 sm7125-common: Enable full ART optimizations with VDEX/ODEX
Enable comprehensive ART optimizations including VDEX and ODEX
generation for all system components to improve first-boot
performance and reduce application startup latency.

Configuration:
- WITH_DEXPREOPT := true          # Global dexpreopt enable
- DEX_PREOPT_DEFAULT := generate-vdex-and-image  # VDEX+ODEX gen
- WITH_DEXPREOPT_DEBUG_INFO := false  # Exclude debug symbols

Results:
- Verified generation of .odex files (optimized dex)
- Verified generation of .vdex files (verification dex)
- ART images created for core system components
- First boot time significantly reduced
- Application startup latency improved

Test procedure:
1. Full system build with 'm evolution' command
2. Verified artifacts in:
   - system/framework/oat/arm64/*.odex
   - system/framework/oat/arm64/*.vdex
   - system/app/*/oat/arm64/*.odex
   - system/priv-app/*/oat/arm64/*.vdex
3. Confirmed valid ART runtime loading during boot

Signed-off-by: johnmart19 <johnivan19999@gmail.com>
Signed-off-by: Quince <quinceroms@gmail.com>
2025-11-09 19:28:23 +05:30
Rve27
b9141a9f34 sm7125-common: Enable ScrollOptimizer
Change-Id: I1d415521e3e10839afb87f1c6691a6057deab797
Signed-off-by: Rve27 <rve27github@gmail.com>
Signed-off-by: Quince <quinceroms@gmail.com>
2025-11-09 19:28:11 +05:30
theshaenix
d5b0780c14 sm7125-common: rootdir: kang post_boot from miatolls common tree
* Synced post_boot script from Evolution-X miatolls common tree
  https://github.com/Evolution-X-Devices/device_xiaomi_sm6250-common/blob/bka/rootdir/bin/init.qcom.post_boot-atoll.sh
2025-11-09 19:26:16 +05:30
someone5678
51e6b220d3 sm7125-common: Build vendor.qti.hardware.capabilityconfigstore@1.0
Log:
07-08 14:11:18.637  1300  1300 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.qti.hardware.capabilityconfigstore@1.0-service": library "vendor.qti.hardware.capabilityconfigstore@1.0.so" not found: needed by main executable
07-08 14:11:18.724  1366  1366 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/vppservice": library "vendor.qti.hardware.capabilityconfigstore@1.0.so" not found: needed by /vendor/lib64/libvpplibrary.so in namespace (default)
07-08 14:11:23.638  3100  3100 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.qti.hardware.capabilityconfigstore@1.0-service": library "vendor.qti.hardware.capabilityconfigstore@1.0.so" not found: needed by main executable
07-08 14:11:28.644  3177  3177 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.qti.hardware.capabilityconfigstore@1.0-service": library "vendor.qti.hardware.capabilityconfigstore@1.0.so" not found: needed by main executable
07-08 14:11:33.651  3194  3194 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.qti.hardware.capabilityconfigstore@1.0-service": library "vendor.qti.hardware.capabilityconfigstore@1.0.so" not found: needed by main executable
07-08 14:11:28.395  5816  5816 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.qti.hardware.capabilityconfigstore@1.0-service": library "vendor.qti.hardware.capabilityconfigstore@1.0.so" not found: needed by main executable
07-08 14:11:45.348  7112  7112 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/vendor.qti.hardware.capabilityconfigstore@1.0-service": library "vendor.qti.hardware.capabilityconfigstore@1.0.so" not found: needed by main executable
2025-11-09 19:26:15 +05:30
theshaenix
1990a776fb sm7125-common: overlay: Aperture: Ignore redundant aux camera IDs
- Hide camera ID 6 (duplicate 1x lens)
- Hide camera ID 7 (logical/composite stub)
- Prevents duplicate selector and crash when switching lenses
2025-11-09 19:25:33 +05:30
theshaenix
3b20b70f4d sm7125-common: overlay: Allow aux camera package allowlist
- Add config_cameraAuxPackageAllowlist overlay
- Ensures Aperture can access auxiliary lenses
  when vendor aux camera whitelist is present
2025-11-09 19:25:33 +05:30
aminfauzi
3e49ec97fe sm7125-common: prop: Allow camera apps to access auxiliary camera
This enables camera apps (and other whitelisted apps) to use auxiliary sensors without HAL restrictions, preventing crashes when switching lenses.

Signed-off-by: aminfauzi <aremean0107@gmail.com>
2025-11-09 19:25:32 +05:30
aminfauzi
028c7ee1bd sm7125-common: overlay: Configure aux camera for Aperture
overlay from rmx2061 repo

Signed-off-by: aminfauzi <aremean0107@gmail.com>
2025-11-09 19:25:32 +05:30
theshaenix
631486dfff sm7125-common: prop: drop legacy camera EIS prop
- Set EIS enable and type using vendor props only
2025-11-09 19:22:09 +05:30
theshaenix
f8d7219744 sm7125-common: prop: set camera EIS type to 2
From dumpsys media.camera, the vendor tag showed EIS type = 2, which corresponds to:

0 → None
1 → EIS v2
2 → EIS v3
3 → OIS
4 → OIS + EIS

So your blobs natively support EIS v3 (type 2).
If you force is_type=4 (OIS+EIS) but your device only has EIS (no OIS hardware), the HAL may either:
silently fall back to EIS v3 (type 2), or misbehave / crash in certain modes
2025-11-09 19:22:09 +05:30
theshaenix
d852fdcb29 sm7125-common:Initialize EvolutionX 2025-11-09 19:22:09 +05:30
theshaenix
1e298d14a6 sm7125-common: fine tuned the zram 2025-11-09 19:22:09 +05:30
theshaenix
cfba3aaf95 Revert "sm7125-common : integrate Oplus camera vendor blobs"
This reverts commit ecff11a1d3.
2025-11-09 19:22:09 +05:30
theshaenix
8f96a9bf71 sm7125-common: rootdir : bin : Aggressive performance & boot optimization for RMX2061
- Fine-tuned GPU devfreq governors and frequencies for dynamic performance
  - Added support for simple_ondemand and msm-adreno-tz
  - AdrenoBoost handling for performance/battery modes
  - Dynamic min/max frequency assignment without killing idle sleep
- Improved ZRAM configuration
  - Auto-sized based on available RAM
  - Multi-threaded compression enabled
  - Aggressive memory management (swappiness 90, vfs_cache_pressure 80)
- VM and memory tweaks
  - Optimized dirty ratios, writeback intervals, overcommit, and compaction
  - Transparent HugePage disabled for faster memory reclaim
  - NUMA balancing disabled for unified memory efficiency
- LMK / RAM management updates
  - Preserves recent apps longer with custom minfree values
  - Extra free memory and watermark tuning
  - CPU cgroup tuning for foreground/background prioritization
- Thermal and network optimizations
  - Conservative thermal trip points to reduce throttling
  - TCP/IP stack and buffer tuning for low latency
- Bootspeed improvements
  - Suppressed printk, RCU and debug overhead
  - Disabled NMI watchdog and tracing for faster initialization
- Overall: Enhanced user experience for both gaming and everyday usage
  - Aggressive memory & GPU management without sacrificing idle or background tasks
2025-11-09 19:22:09 +05:30
theshaenix
a54e5c546c sm7125-common: ship excluded-input-devices.xml
- Add PRODUCT_COPY_FILES entry to install excluded-input-devices.xml
  into /vendor/etc
- Ensures vibrator HAL ignores blacklisted input devices
- Prevents duplicate or unintended haptic feedback
- Improves consistency of vibration across UI and apps
2025-11-09 19:22:08 +05:30
theshaenix
35b87f7c6d sm7125-common: configs: raise min blocks-per-second limit
- Increase blocks-per-second range from 24–979200 to 36–979200
- Prevents codec operation at extremely low block rates
- Reduces risk of underruns and playback instability
- Improves scheduling efficiency and smoother video performance

Trade-off: drops support for extreme low-FPS edge cases, but ensures
better stability across typical playback/recording scenarios.
2025-11-09 19:22:08 +05:30
theshaenix
0684cf355a sm7125-common: Switch to dot product CPU variant
* sm7125:/ $ cat /proc/cpuinfo | grep -m 1 Features
   Features: fp asimd evtstrm aes pmull sha1 sha2 crc32
   atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp

 * From this, it's evident that our CPU (Snapdragon 720G)
   supports all the features of ARMv8.2-DotProd [1].
   Moreover AOSP sets this arch variant in their generic
   cortex-a55 ART target as well [2]. This should unlock
   some optimizations in different code paths.
[1]:
https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features
[2]:
https://android.googlesource.com/device/generic/art/+/refs/heads/master/armv8_cortex_a55/BoardConfig.mk#23
2025-11-09 19:22:08 +05:30
theshaenix
ffd1ddfbf9 sm7125-common : integrate Oplus camera vendor blobs
- Cloned proprietary_vendor_oplus_camera repo by pjgowtham
  (https://gitlab.com/pjgowtham/proprietary_vendor_oplus_camera.git)
- Added vendor/oplus/camera directory
- Updated device tree to include
2025-11-09 19:22:08 +05:30
theshaenix
e005ad2aa1 sm7125-common: rootdir : bin: tune CPU, scheduler and memory
- Enable ZRAM with LZ4 compression and tuned swappiness
- Adjust CPU hispeed freqs and minimums for better responsiveness
- Configure schedutil governor for both clusters
- Lower migration thresholds for smoother task distribution
- Tune core_ctl for balanced performance vs. idle drain
- Re-enable sleep states for improved standby battery
- Set up bw_hwmon and mem_latency governors on interconnects
- Cleaned out unnecessary/duplicate entries from script

Overall effect: smoother UI, faster app response, and better
multitasking with minimal idle power impact.
2025-11-09 19:22:07 +05:30
theshaenix
a8c5e9bdd5 sm7125-common:Switch to android.hardware.sensors@2.1 multihal
The legacy 2.0 multihal does not support ScopedWakelock handling,
causing non-wakeup sensors (e.g. BMI160 gyroscope) to stall unless
the screen is actively touched.

Migrate to android.hardware.sensors@2.1-service.multihal_realme_sm7125
to properly integrate ScopedWakelock and per-event wakelock tracking.

This resolves issues where the gyroscope only reported data
while the device was awake, ensuring continuous event delivery
even when idle.

Tested:
- Gyroscope events stream without requiring screen touches
- dumpsys sensorservice shows correct flags and batching
- No regressions observed in other HAL sensors
2025-11-09 19:22:07 +05:30
theshaenix
5a2b337dbc sm7125-common: reduced the status bar padding top 2025-11-09 19:22:07 +05:30
anhdat1024
8e19cbb0a5 sm7125-common: overlay: Adjust status bar height 2025-11-09 19:22:07 +05:30
theshaenix
c5ea61e49f sm7125-common: props: Use EIS for camera
* Fixes gcam video stabilization
2025-11-09 19:22:07 +05:30
theshaenix
be8403dea6 sm7125-common : rootdir: Optimize CPU governor, sched, and core control for Snapdragon 720G
- Replaced static performance governor with dynamic schedutil for all cores
    - Tuned up_rate_limit_us and down_rate_limit_us for smooth everyday performance
    - Set scaling_min and scaling_max frequencies according to Kryo 465 Gold/Silver cores
    - Configured core_ctl for little cluster (min_cpus, busy thresholds, offline delay)
    - Disabled core_ctl on big cluster to let scheduler manage ramp-up efficiently
    - Adjusted b.L scheduler parameters (sched_downmigrate, sched_upmigrate, group migrate)
    - Set sched_little_cluster_coloc_fmin_khz for smoother colocation
    - Applied sched_load_boost per CPU for better responsiveness
    - Configured input boost frequency and duration for UI snappiness
    - Updated memory and bus DCVS parameters for balanced performance/power
    - Maintained conservative power optimizations (cpusets, sleep modes, kswapd, I/O scheduler)

    This commit ensures a universal setup for normal daily use and gaming while
    avoiding overheating and maintaining high FPS
2025-11-09 19:22:06 +05:30
aminfauzi
bccca041aa sm7125-common:audio: Sync with Spatial Audio
Signed-off-by: aminfauzi <aremean0107@gmail.com>
2025-11-09 19:22:06 +05:30
theshaenix
4f22c6fe43 sm7125-common: overlay: Enable Wifi display 2025-11-09 19:22:06 +05:30
theshaenix
025b4df531 sm7125-common: sm7125-common: overlay: Speed up animations
On low powered, legacy devices, the animations are a bit sluggish. Set the animation scales to 50% to make the UI feel snappier.
2025-11-09 19:22:06 +05:30
Skyblueborb
195e21ae45 sm7125-common: Label cust partition
Fixes flashing `cust` through fastbootd.

Change-Id: I1a950037dafa99c5e7b4305dda4aa8d35fce143b
Signed-off-by: Skyblueborb <tomaszborbely0710@gmail.com>
2025-11-09 19:22:06 +05:30
theshaenix
57f7fb9151 sm7125-common: Disable scudo to save ram 2025-11-09 19:22:06 +05:30
theshaenix
e5405be694 sm7125-common: Switch to AIDL LiveDisplay HAL 2025-11-09 19:22:05 +05:30
LuK1337
e455368c95 sm7125-common: Set SSR restart_level in init.qcom.rc
Change-Id: I31e174f8c3647c17152a2b225b1bb524e22e07aa
2025-11-09 19:22:05 +05:30
theshaenix
0a8fe4c93c Revert "sm7125--common: Commonize schedtune and cpuset configuration"
This reverts commit 13f221fb28.
2025-11-09 19:22:05 +05:30
theshaenix
0b3cef643a sm7125-common: Disable EPPE targets 2025-11-09 19:22:05 +05:30
theshaenix
a31601d296 sm7125-common: Added new allow rules to sepolicy 2025-11-09 19:22:05 +05:30
theshaenix
0de72b411d sm7125-common: overlay: Enable BoostFramework support 2025-11-09 19:22:04 +05:30
theshaenix
d94aacfeb1 sm7125-common: switch to AIDL fingerprint HAL 2025-11-09 19:22:04 +05:30
Arian
98dd114623 sm7125-common: rootdir: Enable PowerHAL hint processing
Change-Id: I4de6ec81eaf002c094df53ff26ed24db02972dfe
2025-11-09 19:22:00 +05:30
35 changed files with 3465 additions and 7212 deletions

View File

@@ -2,6 +2,7 @@ soong_namespace {
imports: [
"hardware/google/interfaces",
"hardware/google/pixel",
"bootable/deprecated-ota",
],
}

View File

@@ -32,19 +32,24 @@ BUILD_BROKEN_INCORRECT_PARTITION_IMAGES := true
# Architecture
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
TARGET_ARCH_VARIANT := armv8-2a-dotprod
TARGET_CPU_ABI := arm64-v8a
TARGET_CPU_ABI2 :=
TARGET_CPU_VARIANT := generic
TARGET_CPU_VARIANT := cortex-a76
TARGET_CPU_VARIANT_RUNTIME := cortex-a76
TARGET_2ND_ARCH := arm
TARGET_2ND_ARCH_VARIANT := armv8-a
TARGET_2ND_ARCH_VARIANT := armv8-2a
TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := generic
TARGET_2ND_CPU_VARIANT := cortex-a76
TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a76
# ART
WITH_DEXPREOPT := true
DEX_PREOPT_DEFAULT := generate-vdex-and-image
WITH_DEXPREOPT_DEBUG_INFO := false
# Audio
AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true
AUDIO_FEATURE_ENABLED_HDMI_SPK := true
@@ -96,7 +101,6 @@ BOARD_HAVE_QCOM_FM := true
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \
hardware/qcom-caf/common/vendor_framework_compatibility_matrix.xml \
hardware/qcom-caf/common/vendor_framework_compatibility_matrix_legacy.xml \
vendor/lineage/config/device_framework_matrix.xml \
$(COMMON_PATH)/framework_compatibility_matrix.xml
DEVICE_MANIFEST_FILE := \
@@ -108,6 +112,9 @@ DEVICE_MATRIX_FILE := \
ODM_MANIFEST_SKUS := nfc
ODM_MANIFEST_NFC_FILES := $(COMMON_PATH)/manifest_nfc.xml
# HWUI
HWUI_COMPILE_FOR_PERF := true
# Kernel
BOARD_KERNEL_BASE := 0x00000000
BOARD_KERNEL_IMAGE_NAME := Image.gz

View File

@@ -52,6 +52,9 @@
<!--DOLBY VQE-->
<library name="vqe" path="libswvqe.so"/>
<!--DOLBY END-->
<!--Spatial Audio-->
<library name="spatializer" path="libspatialaudio.so"/>
<!--Spatial Audio-->
</libraries>
<effects>
<effectProxy name="bassboost" library="proxy" uuid="14804144-a5ee-4d24-aa88-0002a5d5c51b">
@@ -116,6 +119,9 @@
<!--DOLBY VQE-->
<effect name="vqe" library="vqe" uuid="64a0f614-7fa4-48b8-b081-d59dc954616f"/>
<!--DOLBY END-->
<!--Spatial Audio-->
<effect name="spatializer" library="spatializer" uuid="cc4677de-ff72-11eb-9a03-0242ac130003"/>
<!--Spatial Audio-->
</effects>
<postprocess>
<stream type="music">

View File

@@ -81,6 +81,12 @@
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<mixPort name="hifi_playback" role="source" />
<!--Spatial Audio-->
<mixPort name="immersive_out" role="source" flags="AUDIO_OUTPUT_FLAG_SPATIALIZER">
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
<!--Spatial Audio-->
</mixPort>
<mixPort name="compress_passthrough" role="source"
flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING">
<profile name="" format="dynamic"
@@ -322,11 +328,11 @@
<route type="mix" sink="Earpiece"
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
<route type="mix" sink="Speaker"
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="Wired Headset"
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out"/>
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="Wired Headphones"
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out"/>
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="Line"
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,dsd_compress_passthrough,voip_rx,mmap_no_irq_out"/>
<route type="mix" sink="HDMI"
@@ -336,15 +342,15 @@
<route type="mix" sink="FM"
sources="primary output"/>
<route type="mix" sink="BT SCO"
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,immersive_out"/>
<route type="mix" sink="BT SCO Headset"
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,immersive_out"/>
<route type="mix" sink="BT SCO Car Kit"
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,immersive_out"/>
<route type="mix" sink="USB Device Out"
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback"/>
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback,immersive_out"/>
<route type="mix" sink="USB Headset Out"
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback"/>
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback,immersive_out"/>
#else VENDOR_EDIT -->
<route type="mix" sink="Earpiece"
sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>

View File

@@ -22,6 +22,9 @@ $(call inherit-product, hardware/qcom-caf/common/common.mk)
# UDFPS
$(call soong_config_set,surfaceflinger,udfps_lib,//$(LOCAL_PATH):libudfps_extension.realme_sm7125)
# speaker layout channel mask
$(call soong_config_set,android_hardware_audio,skip_speaker_layout_channel_mask_field,true)
# Partitions
PRODUCT_USE_DYNAMIC_PARTITIONS := true
PRODUCT_BOARD_PLATFORM := atoll
@@ -66,12 +69,6 @@ PRODUCT_COPY_FILES += \
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/audio/odm/,$(TARGET_COPY_OUT_ODM)/etc) \
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/audio/vendor/,$(TARGET_COPY_OUT_VENDOR)/etc)
# AVB
#PRODUCT_PACKAGES += \
# q-gsi.avbpubkey \
# r-gsi.avbpubkey \
# s-gsi.avbpubkey
# Bluetooth
PRODUCT_PACKAGES += \
audio.bluetooth.default
@@ -90,10 +87,6 @@ PRODUCT_COPY_FILES += \
TARGET_SCREEN_HEIGHT := 2400
TARGET_SCREEN_WIDTH := 1080
# Call recording
#PRODUCT_PACKAGES += \
# com.google.android.apps.dialer.call_recording_audio.features.xml
# Camera
PRODUCT_PACKAGES += \
android.hardware.camera.provider@2.4-impl \
@@ -109,9 +102,14 @@ PRODUCT_COPY_FILES += \
#CertifiedProps
$(call inherit-product-if-exists, vendor/certprops/Android.mk)
# Display
# Config Store
PRODUCT_PACKAGES += \
disable_configstore \
vendor.qti.hardware.capabilityconfigstore@1.0 \
vendor.qti.hardware.capabilityconfigstore@1.0.vendor
# Display
PRODUCT_PACKAGES += \
gralloc.qcom \
hwcomposer.qcom \
libdisplayconfig.qti \
@@ -189,8 +187,8 @@ PRODUCT_COPY_FILES += \
# Health
PRODUCT_PACKAGES += \
android.hardware.health@2.1-impl-qti \
android.hardware.health@2.1-service
android.hardware.health-service.qti \
android.hardware.health-service.qti_recovery
# HIDL
PRODUCT_PACKAGES += \
@@ -232,9 +230,11 @@ PRODUCT_PACKAGES += \
init.qcom.usb.rc \
init.sm7125.rc
# Recovery init script
# Recovery
PRODUCT_PACKAGES += \
init.recovery.qcom.sh
init.recovery.qcom.sh \
init.recovery.qcom.rc \
init.recovery.usb.rc
# Vendor shell scripts
PRODUCT_PACKAGES += \
@@ -271,9 +271,11 @@ PRODUCT_PACKAGES += \
#Lawnchair
$(call inherit-product-if-exists, vendor/lawnchair/lawnchair.mk)
# LiveDisplay
# PRODUCT_PACKAGES += \
# vendor.lineage.livedisplay@2.0-service-sdm
#LiveDisplay
PRODUCT_PACKAGES += \
vendor.lineage.livedisplay-service.sdm
$(call soong_config_set,livedisplay_sdm,enable_dm,false)
# Media
PRODUCT_PACKAGES += \
@@ -329,7 +331,8 @@ PRODUCT_PACKAGES += \
# Overlays
DEVICE_PACKAGE_OVERLAYS += \
$(LOCAL_PATH)/overlay \
$(LOCAL_PATH)/overlay-lineage
$(LOCAL_PATH)/overlay-lineage \
$(LOCAL_PATH)/overlay-evolution
# Perf
PRODUCT_PACKAGES += \
@@ -345,7 +348,6 @@ PRODUCT_PROPERTY_OVERRIDES += \
# Power
PRODUCT_PACKAGES += \
android.hardware.power-service.lineage-libperfmgr \
android.hardware.power@1.2.vendor \
libqti-perfd-client
PRODUCT_COPY_FILES += \
@@ -383,8 +385,8 @@ PRODUCT_PACKAGES += \
# Sensors
PRODUCT_PACKAGES += \
android.hardware.sensors@2.0-service.multihal_realme_sm7125
android.hardware.sensors-service.multihal
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \
@@ -402,12 +404,16 @@ PRODUCT_PACKAGES += \
vendor.qti.hardware.servicetracker@1.1.vendor \
vendor.qti.hardware.servicetracker@1.2.vendor
# Disable Scudo to save RAM.
PRODUCT_DISABLE_SCUDO := true
# Soong namespaces
PRODUCT_SOONG_NAMESPACES += \
$(LOCAL_PATH) \
kernel/realme/sm7125 \
hardware/google/interfaces \
hardware/google/pixel \
bootable/deprecated-ota \
hardware/lineage/interfaces/power-libperfmgr \
hardware/oplus \
hardware/qcom-caf/common/libqti-perfd-client
@@ -454,10 +460,6 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
android.hardware.thermal-service.qti
# TextClassifier
#PRODUCT_PACKAGES += \
# textclassifier.bundle1
# Touchscreen
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml
@@ -477,6 +479,9 @@ PRODUCT_COPY_FILES += \
PRODUCT_PACKAGES += \
vendor.qti.hardware.vibrator.service
PRODUCT_COPY_FILES += \
vendor/qcom/opensource/vibrator/excluded-input-devices.xml:$(TARGET_COPY_OUT_VENDOR)/etc/excluded-input-devices.xml
PRODUCT_COPY_FILES += \
prebuilts/vndk/v30/arm64/arch-arm64-armv8-a/shared/vndk-core/libgui.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/libxxx.so \
prebuilts/vndk/v30/arm64/arch-arm-armv8-a/shared/vndk-core/libgui.so:$(TARGET_COPY_OUT_SYSTEM)/lib/libxxx.so \
@@ -525,9 +530,6 @@ PRODUCT_PACKAGES += \
firmware_wlan_mac.bin_symlink \
firmware_WCNSS_qcom_cfg.ini_symlink
#PRODUCT_BOOT_JARS += \
WfdCommon
# Build Specific VNDK 30 Libs for Android 12+
PRODUCT_PACKAGES += \
android.frameworks.automotive.display@1.0.vendor \

View File

@@ -64,7 +64,7 @@
<Limit name="size" min="96x96" max="4096x2160" />
<Limit name="alignment" value="2x2" />
<Limit name="block-size" value="16x16" />
<Limit name="blocks-per-second" range="24-979200" />
<Limit name="blocks-per-second" range="36-979200" />
<Limit name="bitrate" range="1-100000000" />
<Limit name="frame-rate" range="1-240" />
<Limit name="concurrent-instances" max="16" />

View File

@@ -1,7 +0,0 @@
[
{
"repository": "crdroidandroid/android_hardware_dolby",
"target_path": "hardware/dolby",
"branch": "15.0"
}
]

View File

@@ -2,7 +2,10 @@ service vendor.fps_hal.realme_sm7125 /vendor/bin/hw/android.hardware.biometrics.
# "class hal" causes a race condition on some devices due to files created
# in /data. As a workaround, postpone startup until later in boot once
# /data is mounted.
class late_start
class hal
user system
group system input uhid
writepid /dev/cpuset/system-background/tasks
on post-fs-data
start vendor.fps_hal.realme_sm7125

View File

@@ -659,15 +659,6 @@
<instance>oplus_slot2</instance>
</interface>
</hal>
<!-- <hal format="hidl">
<name>vendor.lineage.livedisplay</name>
<transport>hwbinder</transport>
<version>2.0</version>
<interface>
<name>IPictureAdjustment</name>
<instance>default</instance>
</interface>
</hal> -->
<hal format="hidl">
<name>vendor.qti.hardware.data.iwlan</name>
<transport>hwbinder</transport>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2019-2025 The Evolution X Project
SPDX-License-Identifier: Apache-2.0
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Android version screen, build maintainer -->
<string name="build_maintainer_summary" translatable="false">SHAHID_SHAMIM</string>
<string name="build_maintainer_donate_url" translatable="false">https://paypal.me/shaenix</string>
</resources>

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Defines the location of the fingerprint sensor on the device
0 = back
1 = front
2 = left side
3 = right side
-->
<integer name="config_fingerprintSensorLocation">3</integer>
</resources>

View File

@@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Copyright (C) 2022-2024 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<!-- Whether a software navigation bar should be shown. NOTE: in the future this may be
autodetected from the Configuration. -->
@@ -21,9 +13,6 @@
<!-- The restoring is handled by modem if it is true-->
<bool name="skip_restoring_network_selection">true</bool>
<!-- Set to true to add links to Cell Broadcast app from Settings and MMS app. -->
<bool name="config_cellBroadcastAppLinks">true</bool>
<!-- M user agent string -->
<string name="config_mms_user_agent">Android-Mms/2.0</string>
@@ -161,6 +150,9 @@
Doze dreams will run whenever the power manager is in a dozing state. -->
<string name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
<!-- Doze: should the TYPE_PICK_UP_GESTURE sensor be used as a pulse signal. -->
<bool name="config_dozePulsePickup">true</bool>
<!-- If true, the doze component is not started until after the screen has been
turned off and the screen off animation has been performed. -->
<bool name="config_dozeAfterScreenOffByDefault">true</bool>
@@ -218,10 +210,6 @@
on the headphone/microphone jack. When false use the older uevent framework. -->
<bool name="config_useDevInputEventForAudioJack">true</bool>
<!-- Boolean indicating whether the HWC setColorTransform function can be performed efficiently
in hardware. -->
<bool name="config_setColorTransformAccelerated">true</bool>
<!-- Flag indicating whether the we should enable the automatic brightness in Settings.
Software implementation will be used if config_hardware_auto_brightness_available is not set -->
<bool name="config_automatic_brightness_available">true</bool>
@@ -366,11 +354,6 @@
Equivalent to 67/255 (default for this device) -->
<integer name="config_screenBrightnessSettingDefault">45</integer>
<!-- Vibrator pattern for a very short but reliable vibration for soft keyboard tap -->
<integer-array name="config_keyboardTapVibePattern">
<item>40</item>
</integer-array>
<!-- Vibrator pattern for feedback about a long screen/key press -->
<integer-array name="config_longPressVibePattern">
<item>0</item>
@@ -434,22 +417,58 @@
<!-- Default list of files pinned by the Pinner Service -->
<string-array translatable="false" name="config_defaultPinnerServiceFiles">
<item>"/apex/com.android.art/javalib/core-libart.jar"</item>
<item>"/apex/com.android.art/javalib/core-oj.jar"</item>
<item>"/apex/com.android.art/javalib/core-libart.jar"</item>
<item>"/system_ext/priv-app/SystemUI/SystemUI.apk"</item>
<item>"/system/bin/surfaceflinger"</item>
<item>"/system/framework/boot-framework.vdex"</item>
<item>"/system/framework/ext.jar"</item>
<item>"/system/framework/framework-res.apk"</item>
<item>"/system/framework/framework.jar"</item>
<item>"/system/framework/services.jar"</item>
<item>"/system/framework/ext.jar"</item>
<item>"/system/framework/telephony-common.jar"</item>
<item>"/system/lib/libEGL.so"</item>
<item>"/system/lib/libGLESv1_CM.so"</item>
<item>"/system/lib/libGLESv2.so"</item>
<item>"/system/lib/libGLESv3.so"</item>
<item>"/system/lib/libgui.so"</item>
<item>"/system/lib/libhwui.so"</item>
<item>"/system/lib/libui.so"</item>
<item>"/system/lib/libvulkan.so"</item>
<item>"/system/lib64/libEGL.so"</item>
<item>"/system/lib64/libGLESv1_CM.so"</item>
<item>"/system/lib64/libGLESv2.so"</item>
<item>"/system/lib64/libGLESv3.so"</item>
<item>"/system/lib64/libgui.so"</item>
<item>"/system/lib64/libhwui.so"</item>
<item>"/system_ext/priv-app/SystemUI/SystemUI.apk"</item>
<item>"/system/lib64/libui.so"</item>
<item>"/system/lib64/libvulkan.so"</item>
<item>"/vendor/lib/egl/eglSubDriverAndroid.so"</item>
<item>"/vendor/lib/egl/libEGL_adreno.so"</item>
<item>"/vendor/lib/egl/libGLESv1_CM_adreno.so"</item>
<item>"/vendor/lib/egl/libGLESv2_adreno.so"</item>
<item>"/vendor/lib/hw/vulkan.adreno.so"</item>
<item>"/vendor/lib/libCB.so"</item>
<item>"/vendor/lib/libOpenCL.so"</item>
<item>"/vendor/lib/libadreno_utils.so"</item>
<item>"/vendor/lib/libgsl.so"</item>
<item>"/vendor/lib/libllvm-glnext.so"</item>
<item>"/vendor/lib/libllvm-qcom.so"</item>
<item>"/vendor/lib64/egl/eglSubDriverAndroid.so"</item>
<item>"/vendor/lib64/egl/libEGL_adreno.so"</item>
<item>"/vendor/lib64/egl/libGLESv1_CM_adreno.so"</item>
<item>"/vendor/lib64/egl/libGLESv2_adreno.so"</item>
<item>"/vendor/lib64/hw/vulkan.adreno.so"</item>
<item>"/vendor/lib64/libCB.so"</item>
<item>"/vendor/lib64/libOpenCL.so"</item>
<item>"/vendor/lib64/libadreno_utils.so"</item>
<item>"/vendor/lib64/libgsl.so"</item>
<item>"/vendor/lib64/libllvm-qgl.so"</item>
<item>"/vendor/lib64/libllvm-glnext.so"</item>
<item>"/vendor/lib64/libllvm-qcom.so"</item>
</string-array>
<!-- Should the pinner service pin the Home application? -->
<bool name="config_pinnerHomeApp">true</bool>
<!-- Bytes that the PinnerService will pin for Home app -->
<integer name="config_pinnerHomePinBytes">6291456</integer>
<!-- List of files pinned by the Pinner Service with the JIT Zygote boot image b/119800099 -->
<string-array translatable="false" name="config_jitzygoteBootImagePinnerServiceFiles">
@@ -502,9 +521,6 @@
available on some devices. -->
<bool name="config_enableHapticTextHandle">true</bool>
<!-- Enable Zram writeback feature to allow unused pages in zram be written to flash. -->
<bool name="config_zramWriteback">true</bool>
<!-- Whether to post reset runnable for all clients. Needed for some older
vendor fingerprint HAL implementations. -->
<bool name="config_fingerprintPostResetRunnableForAllClients">true</bool>
@@ -550,9 +566,6 @@
<!-- Whether to show min/max refresh rate in display settings -->
<bool name="config_show_refresh_rate_controls">true</bool>
<!-- Indicates whether device has a power button fingerprint sensor. -->
<bool name="config_is_powerbutton_fps" translatable="false" >true</bool>
<!-- Control the behavior when the user long presses the power button.
0 - Nothing
1 - Global actions menu
@@ -568,6 +581,8 @@
manager will disable alpha trasformation in animations where not
strictly needed. -->
<bool name="config_sf_limitedAlpha">true</bool>
<!-- Whether the new Auto Selection Network UI should be shown -->
<bool name="config_enableNewAutoSelectNetworkUI">true</bool>
<!-- Package name of a telephony-related system app, such as an IMS service.
Exempted from privacy indicators. -->
@@ -592,4 +607,23 @@
<!-- Whether we use large screen shade header which takes only one row compared to QS header -->
<bool name="config_use_large_screen_shade_header">true</bool>
<!-- Whether WiFi display is supported by this device.
There are many prerequisites for this feature to work correctly.
Here are a few of them:
* The WiFi radio must support WiFi P2P.
* The WiFi radio must support concurrent connections to the WiFi display and
to an access point.
* The Audio Server audio_policy_configuration.xml file must specify a rule for
the "r_submix" remote submix module. This module is used to record and stream system
audio output to the WiFi display encoder in the media server.
* The remote submix module "audio.r_submix.default" must be installed on the device.
* The device must be provisioned with HDCP keys (for protected content).
-->
<bool name="config_enableWifiDisplay">true</bool>
<!-- Whether WM DisplayContent supports high performance transitions
(lower-end devices may want to disable) -->
<bool name="config_deviceSupportsHighPerfTransitions">false</bool>
</resources>

View File

@@ -15,10 +15,15 @@
* limitations under the License.
*/
-->
<resources>
<!-- Height of the status bar. Do not read this dimen directly. Use {@link SystemBarUtils#getStatusBarHeight} instead.-->
<dimen name="status_bar_height">100px</dimen>
<!-- Height of the status bar in portrait -->
<dimen name="status_bar_height_portrait">110px</dimen>
<dimen name="status_bar_height_portrait">100px</dimen>
<!-- Height of the status bar in landscape -->
<dimen name="status_bar_height_landscape">82px</dimen>

View File

@@ -39,5 +39,7 @@
<!-- Enable vibrate for calls by default -->
<bool name="def_vibrate_when_ringing">true</bool>
<!-- Speed up the animations -->
<fraction name="def_window_transition_scale">50%</fraction>
</resources>

View File

@@ -23,7 +23,7 @@
<dimen name="status_bar_padding_end">16px</dimen>
<!-- the padding on the top of the statusbar -->
<dimen name="status_bar_padding_top">8dp</dimen>
<dimen name="status_bar_padding_top">4dp</dimen>
<!-- Starting padding for a left-aligned status bar clock -->
<dimen name="status_bar_left_clock_starting_padding">6px</dimen>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Enable auxiliary cameras selector. -->
<bool name="config_enableAuxCameras">true</bool>
<!-- List of ID of auxiliary cameras that must be ignored by the app. -->
<string-array name="config_ignoredAuxCameraIds">
<item>6</item>
<item>7</item>
</string-array>
<!-- List of ID of camera devices that doesn't advertise
REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE yet are
able to produce a JPEG or a YUV stream. The camera IDs specified
here won't be excluded by CameraX. Please be sure to test all
modes exposed by the app with those cameras. -->
<!-- <string-array name="config_backwardCompatibleCameraIds">
<item>30</item>
</string-array> -->
<!-- New flag to allow aperture in aux package allowlist -->
<bool name="config_cameraAuxPackageAllowlist">true</bool>
</resources>

File diff suppressed because it is too large Load Diff

View File

@@ -24,14 +24,6 @@
devices will be able to vary their amplitude but do not possess enough dynamic range to
have distinct intensity levels -->
<bool name="config_vibration_supports_multiple_intensities">true</bool>
<!-- Defines the location of the fingerprint sensor on the device
0 = back
1 = front
2 = left side
3 = right side
-->
<integer name="config_fingerprintSensorLocation">3</integer>
<!-- Whether this device is supporting the microphone toggle -->
<bool name="config_supportsMicToggle">true</bool>

View File

@@ -1,6 +1,3 @@
# Charger
ro.charger.enable_suspend=true
# Display
debug.sf.hw=0
debug.egl.hw=0
@@ -22,6 +19,22 @@ vendor.display.disable_metadata_dynamic_fps=1
# LMKD
ro.config.low_ram=false
ro.lmk.log_stats=false
ro.lmk.kill_heaviest_task=true
ro.lmk.swap_free_low_percentage=100
# LMK tuning
ro.lmk.filecache_min_kb=153600
ro.lmk.stall_limit_critical=40
ro.lmk.use_new_strategy=true
ro.lmk.enable_watermark_check=true
ro.lmk.enable_userspace_lmk=true
ro.lmk.enhance_batch_kill=false
ro.lmk.super_critical=701
ro.lmk.kill_timeout_ms=50
ro.lmk.psi_scrit_complete_stall_ms=150
ro.lmk.direct_reclaim_pressure=45
ro.lmk.reclaim_scan_threshold=0
# Incremental FS
ro.incremental.enable=1

20
recovery/root/Android.bp Normal file
View File

@@ -0,0 +1,20 @@
//
// Copyright (C) 2026 The LineageOS Project
// SPDX-License-Identifier: Apache-2.0
//
prebuilt_etc {
name: "init.recovery.qcom.rc",
src: "init.recovery.qcom.rc",
sub_dir: "recovery/root",
filename: "init.recovery.qcom.rc",
installable: true,
}
prebuilt_etc {
name: "init.recovery.usb.rc",
src: "init.recovery.usb.rc",
sub_dir: "recovery/root",
filename: "init.recovery.usb.rc",
installable: true,
}

File diff suppressed because it is too large Load Diff

View File

@@ -122,6 +122,14 @@ on early-boot
exec u:r:vendor_qti_init_shell:s0 -- /vendor/bin/init.qti.can.sh
setprop ro.sf.lcd_density ${vendor.display.lcd_density}
# SSR
write /sys/bus/msm_subsys/devices/subsys0/restart_level RELATED
write /sys/bus/msm_subsys/devices/subsys1/restart_level RELATED
write /sys/bus/msm_subsys/devices/subsys2/restart_level RELATED
write /sys/bus/msm_subsys/devices/subsys3/restart_level RELATED
write /sys/bus/msm_subsys/devices/subsys4/restart_level RELATED
write /sys/bus/msm_subsys/devices/subsys5/restart_level RELATED
chown system system /mnt/vendor/persist/data/pfm/licenses
chmod 0775 /mnt/vendor/persist/data/pfm/licenses

View File

@@ -87,122 +87,6 @@ on init
chown cameraserver cameraserver /dev/cpuset/camera-daemon/tasks
chmod 0660 /dev/cpuset/camera-daemon/tasks
on late-fs
# Start services for bootanim
start servicemanager
start surfaceflinger
start bootanim
on property:sys.boot_completed=1
# Runtime fs tuning
write /sys/block/sda/queue/nr_requests 128
write /sys/block/sda/queue/iostats 0
# Block layer tuning: discard chunk size up to 128MB
# Otherwise, contiguous discards can be merged
write /sys/block/sda/queue/discard_max_bytes 134217728
# Back to default VM settings
write /proc/sys/vm/dirty_expire_centisecs 3000
write /proc/sys/vm/dirty_background_ratio 10
# Setup runtime cpusets
write /dev/cpuset/top-app/cpus 0-7
write /dev/cpuset/foreground/cpus 0-2,5-7
write /dev/cpuset/background/cpus 0-3
write /dev/cpuset/system-background/cpus 0-3
write /dev/cpuset/restricted/cpus 0-3
# Setup runtime schedTune
write /dev/stune/foreground/schedtune.prefer_idle 1
write /dev/stune/foreground/schedtune.prefer_high_cap 0
write /dev/stune/foreground/schedtune.boost 0
write /dev/stune/schedtune.prefer_idle 0
write /dev/stune/schedtune.prefer_high_cap 0
write /dev/stune/schedtune.boost 0
write /dev/stune/top-app/schedtune.prefer_idle 1
write /dev/stune/top-app/schedtune.prefer_high_cap 0
write /dev/stune/top-app/schedtune.boost 10
# Setup runtime blkio
# value for group_idle is us
write /dev/blkio/blkio.weight 1000
write /dev/blkio/background/blkio.weight 200
write /dev/blkio/blkio.group_idle 2000
write /dev/blkio/background/blkio.group_idle 0
on early-init
# configure governor settings
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor schedutil
write /sys/devices/system/cpu/cpu0/cpufreq/schedutil/up_rate_limit_us 500
write /sys/devices/system/cpu/cpu0/cpufreq/schedutil/down_rate_limit_us 20000
# configure governor settings for big cluster
write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor schedutil
write /sys/devices/system/cpu/cpu4/cpufreq/schedutil/up_rate_limit_us 500
write /sys/devices/system/cpu/cpu4/cpufreq/schedutil/down_rate_limit_us 20000
# Disable UFS clock scaling
write /sys/bus/platform/devices/${ro.boot.bootdevice}/clkscale_enable 0
on init
# Boot time cpuset and stune
write /dev/cpuset/top-app/cpus 0-7
write /dev/cpuset/foreground/cpus 0-7
write /dev/cpuset/background/cpus 0-5
write /dev/cpuset/system-background/cpus 0-5
write /dev/cpuset/restricted/cpus 2-5
write /dev/stune/foreground/schedtune.prefer_idle 1
write /dev/stune/foreground/schedtune.prefer_high_cap 1
write /dev/stune/foreground/schedtune.boost 100
write /dev/stune/schedtune.prefer_idle 1
write /dev/stune/schedtune.prefer_high_cap 1
write /dev/stune/schedtune.boost 100
write /dev/stune/top-app/schedtune.prefer_idle 1
write /dev/stune/top-app/schedtune.prefer_high_cap 1
write /dev/stune/top-app/schedtune.boost 100
# Boot time fs tuning
write /sys/block/sda/queue/iostats 0
write /sys/block/sda/queue/scheduler cfq
write /sys/block/sda/queue/iosched/slice_idle 0
write /sys/block/sda/queue/nr_requests 256
# Disable UFS powersaving
write /sys/devices/platform/soc/${ro.boot.bootdevice}/clkgate_enable 0
# Disable powersaving
write /sys/module/lpm_levels/parameters/sleep_disabled 1
# bring back all cores
write /sys/devices/system/cpu/cpu0/online 1
write /sys/devices/system/cpu/cpu1/online 1
write /sys/devices/system/cpu/cpu2/online 1
write /sys/devices/system/cpu/cpu3/online 1
write /sys/devices/system/cpu/cpu4/online 1
write /sys/devices/system/cpu/cpu5/online 1
write /sys/devices/system/cpu/cpu6/online 1
write /sys/devices/system/cpu/cpu7/online 1
mkdir /dev/cpuset/camera-daemon-dedicated
write /dev/cpuset/camera-daemon-dedicated/cpus 0-7
write /dev/cpuset/camera-daemon-dedicated/mems 0
chown system system /dev/cpuset/camera-daemon-dedicated
chown system system /dev/cpuset/camera-daemon-dedicated/tasks
chmod 0664 /dev/cpuset/camera-daemon-dedicated/tasks
# create an stune group for camera-specific processes
mkdir /dev/stune/camera-daemon
write /dev/stune/camera-daemon/schedtune.prefer_idle 1
write /dev/stune/camera-daemon/schedtune.boost 0
chown system system /dev/stune/camera-daemon
chown system system /dev/stune/camera-daemon/tasks
chmod 0664 /dev/stune/camera-daemon/tasks
# set default schedTune value for camera-daemon
write /dev/stune/camera-daemon/schedtune.prefer_idle 1
write /dev/stune/camera-daemon/schedtune.boost 0
on early-fs
start vold

View File

@@ -1,50 +0,0 @@
//
// Copyright (C) 2019 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
cc_binary {
name: "android.hardware.sensors@2.0-service.multihal_realme_sm7125",
stem: "android.hardware.sensors@2.0-service.multihal",
defaults: [
"hidl_defaults",
],
vendor: true,
relative_install_path: "hw",
srcs: [
"HalProxy.cpp",
"HalProxyCallback.cpp",
"service.cpp",
],
init_rc: ["android.hardware.sensors@2.0-service-multihal.rc"],
vintf_fragments: ["android.hardware.sensors@2.0-multihal.xml"],
header_libs: [
"android.hardware.sensors@2.X-multihal.header",
"android.hardware.sensors@2.X-shared-utils",
],
shared_libs: [
"android.hardware.sensors@2.0",
"android.hardware.sensors@2.0-ScopedWakelock",
"android.hardware.sensors@2.1",
"libbase",
"libcutils",
"libfmq",
"libhidlbase",
"liblog",
"libpower",
"libutils",
],
static_libs: [
"android.hardware.sensors@1.0-convert",
],
}

View File

@@ -1,769 +0,0 @@
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "HalProxy.h"
#include <android/hardware/sensors/2.0/types.h>
#include <android-base/file.h>
#include "hardware_legacy/power.h"
#include <dlfcn.h>
#include <cinttypes>
#include <cmath>
#include <fstream>
#include <functional>
#include <thread>
namespace android {
namespace hardware {
namespace sensors {
namespace V2_1 {
namespace implementation {
using ::android::hardware::sensors::V1_0::Result;
using ::android::hardware::sensors::V2_0::EventQueueFlagBits;
using ::android::hardware::sensors::V2_0::WakeLockQueueFlagBits;
using ::android::hardware::sensors::V2_0::implementation::getTimeNow;
using ::android::hardware::sensors::V2_0::implementation::kWakelockTimeoutNs;
typedef V2_0::implementation::ISensorsSubHal*(SensorsHalGetSubHalFunc)(uint32_t*);
typedef V2_1::implementation::ISensorsSubHal*(SensorsHalGetSubHalV2_1Func)(uint32_t*);
static constexpr int32_t kBitsAfterSubHalIndex = 24;
/**
* Set the subhal index as first byte of sensor handle and return this modified version.
*
* @param sensorHandle The sensor handle to modify.
* @param subHalIndex The index in the hal proxy of the sub hal this sensor belongs to.
*
* @return The modified sensor handle.
*/
int32_t setSubHalIndex(int32_t sensorHandle, size_t subHalIndex) {
return sensorHandle | (static_cast<int32_t>(subHalIndex) << kBitsAfterSubHalIndex);
}
/**
* Extract the subHalIndex from sensorHandle.
*
* @param sensorHandle The sensorHandle to extract from.
*
* @return The subhal index.
*/
size_t extractSubHalIndex(int32_t sensorHandle) {
return static_cast<size_t>(sensorHandle >> kBitsAfterSubHalIndex);
}
/**
* Convert nanoseconds to milliseconds.
*
* @param nanos The nanoseconds input.
*
* @return The milliseconds count.
*/
int64_t msFromNs(int64_t nanos) {
constexpr int64_t nanosecondsInAMillsecond = 1000000;
return nanos / nanosecondsInAMillsecond;
}
HalProxy::HalProxy() {
const char* kMultiHalConfigFile = "/vendor/etc/sensors/hals.conf";
initializeSubHalListFromConfigFile(kMultiHalConfigFile);
init();
}
HalProxy::HalProxy(std::vector<ISensorsSubHalV2_0*>& subHalList) {
for (ISensorsSubHalV2_0* subHal : subHalList) {
mSubHalList.push_back(std::make_unique<SubHalWrapperV2_0>(subHal));
}
init();
}
HalProxy::HalProxy(std::vector<ISensorsSubHalV2_0*>& subHalList,
std::vector<ISensorsSubHalV2_1*>& subHalListV2_1) {
for (ISensorsSubHalV2_0* subHal : subHalList) {
mSubHalList.push_back(std::make_unique<SubHalWrapperV2_0>(subHal));
}
for (ISensorsSubHalV2_1* subHal : subHalListV2_1) {
mSubHalList.push_back(std::make_unique<SubHalWrapperV2_1>(subHal));
}
init();
}
HalProxy::~HalProxy() {
stopThreads();
}
Return<void> HalProxy::getSensorsList_2_1(ISensorsV2_1::getSensorsList_2_1_cb _hidl_cb) {
std::vector<V2_1::SensorInfo> sensors;
for (const auto& iter : mSensors) {
sensors.push_back(iter.second);
}
_hidl_cb(sensors);
return Void();
}
Return<void> HalProxy::getSensorsList(ISensorsV2_0::getSensorsList_cb _hidl_cb) {
std::vector<V1_0::SensorInfo> sensors;
for (const auto& iter : mSensors) {
sensors.push_back(convertToOldSensorInfo(iter.second));
}
_hidl_cb(sensors);
return Void();
}
Return<Result> HalProxy::setOperationMode(OperationMode mode) {
Result result = Result::OK;
size_t subHalIndex;
for (subHalIndex = 0; subHalIndex < mSubHalList.size(); subHalIndex++) {
result = mSubHalList[subHalIndex]->setOperationMode(mode);
if (result != Result::OK) {
ALOGE("setOperationMode failed for SubHal: %s",
mSubHalList[subHalIndex]->getName().c_str());
break;
}
}
if (result != Result::OK) {
// Reset the subhal operation modes that have been flipped
for (size_t i = 0; i < subHalIndex; i++) {
mSubHalList[i]->setOperationMode(mCurrentOperationMode);
}
} else {
mCurrentOperationMode = mode;
}
return result;
}
Return<Result> HalProxy::activate(int32_t sensorHandle, bool enabled) {
if (!isSubHalIndexValid(sensorHandle)) {
return Result::BAD_VALUE;
}
return getSubHalForSensorHandle(sensorHandle)
->activate(clearSubHalIndex(sensorHandle), enabled);
}
Return<Result> HalProxy::initialize_2_1(
const ::android::hardware::MQDescriptorSync<V2_1::Event>& eventQueueDescriptor,
const ::android::hardware::MQDescriptorSync<uint32_t>& wakeLockDescriptor,
const sp<V2_1::ISensorsCallback>& sensorsCallback) {
sp<ISensorsCallbackWrapperBase> dynamicCallback =
new ISensorsCallbackWrapperV2_1(sensorsCallback);
// Create the Event FMQ from the eventQueueDescriptor. Reset the read/write positions.
auto eventQueue =
std::make_unique<EventMessageQueueV2_1>(eventQueueDescriptor, true /* resetPointers */);
std::unique_ptr<EventMessageQueueWrapperBase> queue =
std::make_unique<EventMessageQueueWrapperV2_1>(eventQueue);
// Create the Wake Lock FMQ from the wakeLockDescriptor. Reset the read/write positions.
auto hidlWakeLockQueue =
std::make_unique<WakeLockMessageQueue>(wakeLockDescriptor, true /* resetPointers */);
std::unique_ptr<WakeLockMessageQueueWrapperBase> wakeLockQueue =
std::make_unique<WakeLockMessageQueueWrapperHidl>(hidlWakeLockQueue);
return initializeCommon(queue, wakeLockQueue, dynamicCallback);
}
Return<Result> HalProxy::initialize(
const ::android::hardware::MQDescriptorSync<V1_0::Event>& eventQueueDescriptor,
const ::android::hardware::MQDescriptorSync<uint32_t>& wakeLockDescriptor,
const sp<V2_0::ISensorsCallback>& sensorsCallback) {
sp<ISensorsCallbackWrapperBase> dynamicCallback =
new ISensorsCallbackWrapperV2_0(sensorsCallback);
// Create the Event FMQ from the eventQueueDescriptor. Reset the read/write positions.
auto eventQueue =
std::make_unique<EventMessageQueueV2_0>(eventQueueDescriptor, true /* resetPointers */);
std::unique_ptr<EventMessageQueueWrapperBase> queue =
std::make_unique<EventMessageQueueWrapperV1_0>(eventQueue);
// Create the Wake Lock FMQ from the wakeLockDescriptor. Reset the read/write positions.
auto hidlWakeLockQueue =
std::make_unique<WakeLockMessageQueue>(wakeLockDescriptor, true /* resetPointers */);
std::unique_ptr<WakeLockMessageQueueWrapperBase> wakeLockQueue =
std::make_unique<WakeLockMessageQueueWrapperHidl>(hidlWakeLockQueue);
return initializeCommon(queue, wakeLockQueue, dynamicCallback);
}
Return<Result> HalProxy::initializeCommon(
std::unique_ptr<EventMessageQueueWrapperBase>& eventQueue,
std::unique_ptr<WakeLockMessageQueueWrapperBase>& wakeLockQueue,
const sp<ISensorsCallbackWrapperBase>& sensorsCallback) {
Result result = Result::OK;
stopThreads();
resetSharedWakelock();
// So that the pending write events queue can be cleared safely and when we start threads
// again we do not get new events until after initialize resets the subhals.
disableAllSensors();
// Clears the queue if any events were pending write before.
mPendingWriteEventsQueue = std::queue<std::pair<std::vector<V2_1::Event>, size_t>>();
mSizePendingWriteEventsQueue = 0;
// Clears previously connected dynamic sensors
mDynamicSensors.clear();
mDynamicSensorsCallback = sensorsCallback;
// Create the Event FMQ from the eventQueueDescriptor. Reset the read/write positions.
mEventQueue = std::move(eventQueue);
// Create the Wake Lock FMQ that is used by the framework to communicate whenever WAKE_UP
// events have been successfully read and handled by the framework.
mWakeLockQueue = std::move(wakeLockQueue);
if (mEventQueueFlag != nullptr) {
EventFlag::deleteEventFlag(&mEventQueueFlag);
}
if (mWakelockQueueFlag != nullptr) {
EventFlag::deleteEventFlag(&mWakelockQueueFlag);
}
if (EventFlag::createEventFlag(mEventQueue->getEventFlagWord(), &mEventQueueFlag) != OK) {
result = Result::BAD_VALUE;
}
if (EventFlag::createEventFlag(mWakeLockQueue->getEventFlagWord(), &mWakelockQueueFlag) != OK) {
result = Result::BAD_VALUE;
}
if (!mDynamicSensorsCallback || !mEventQueue || !mWakeLockQueue || mEventQueueFlag == nullptr) {
result = Result::BAD_VALUE;
}
mThreadsRun.store(true);
mPendingWritesThread = std::thread(startPendingWritesThread, this);
mWakelockThread = std::thread(startWakelockThread, this);
for (size_t i = 0; i < mSubHalList.size(); i++) {
Result currRes = mSubHalList[i]->initialize(this, this, i);
if (currRes != Result::OK) {
result = currRes;
ALOGE("Subhal '%s' failed to initialize.", mSubHalList[i]->getName().c_str());
break;
}
}
mCurrentOperationMode = OperationMode::NORMAL;
return result;
}
Return<Result> HalProxy::batch(int32_t sensorHandle, int64_t samplingPeriodNs,
int64_t maxReportLatencyNs) {
if (!isSubHalIndexValid(sensorHandle)) {
return Result::BAD_VALUE;
}
return getSubHalForSensorHandle(sensorHandle)
->batch(clearSubHalIndex(sensorHandle), samplingPeriodNs, maxReportLatencyNs);
}
Return<Result> HalProxy::flush(int32_t sensorHandle) {
if (!isSubHalIndexValid(sensorHandle)) {
return Result::BAD_VALUE;
}
return getSubHalForSensorHandle(sensorHandle)->flush(clearSubHalIndex(sensorHandle));
}
Return<Result> HalProxy::injectSensorData_2_1(const V2_1::Event& event) {
return injectSensorData(convertToOldEvent(event));
}
Return<Result> HalProxy::injectSensorData(const V1_0::Event& event) {
Result result = Result::OK;
if (mCurrentOperationMode == OperationMode::NORMAL &&
event.sensorType != V1_0::SensorType::ADDITIONAL_INFO) {
ALOGE("An event with type != ADDITIONAL_INFO passed to injectSensorData while operation"
" mode was NORMAL.");
result = Result::BAD_VALUE;
}
if (result == Result::OK) {
V1_0::Event subHalEvent = event;
if (!isSubHalIndexValid(event.sensorHandle)) {
return Result::BAD_VALUE;
}
subHalEvent.sensorHandle = clearSubHalIndex(event.sensorHandle);
result = getSubHalForSensorHandle(event.sensorHandle)
->injectSensorData(convertToNewEvent(subHalEvent));
}
return result;
}
Return<void> HalProxy::registerDirectChannel(const SharedMemInfo& mem,
ISensorsV2_0::registerDirectChannel_cb _hidl_cb) {
if (mDirectChannelSubHal == nullptr) {
_hidl_cb(Result::INVALID_OPERATION, -1 /* channelHandle */);
} else {
mDirectChannelSubHal->registerDirectChannel(mem, _hidl_cb);
}
return Return<void>();
}
Return<Result> HalProxy::unregisterDirectChannel(int32_t channelHandle) {
Result result;
if (mDirectChannelSubHal == nullptr) {
result = Result::INVALID_OPERATION;
} else {
result = mDirectChannelSubHal->unregisterDirectChannel(channelHandle);
}
return result;
}
Return<void> HalProxy::configDirectReport(int32_t sensorHandle, int32_t channelHandle,
RateLevel rate,
ISensorsV2_0::configDirectReport_cb _hidl_cb) {
if (mDirectChannelSubHal == nullptr) {
_hidl_cb(Result::INVALID_OPERATION, -1 /* reportToken */);
} else if (sensorHandle == -1 && rate != RateLevel::STOP) {
_hidl_cb(Result::BAD_VALUE, -1 /* reportToken */);
} else {
// -1 denotes all sensors should be disabled
if (sensorHandle != -1) {
sensorHandle = clearSubHalIndex(sensorHandle);
}
mDirectChannelSubHal->configDirectReport(sensorHandle, channelHandle, rate, _hidl_cb);
}
return Return<void>();
}
Return<void> HalProxy::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& /*args*/) {
if (fd.getNativeHandle() == nullptr || fd->numFds < 1) {
ALOGE("%s: missing fd for writing", __FUNCTION__);
return Void();
}
android::base::borrowed_fd writeFd = dup(fd->data[0]);
std::ostringstream stream;
stream << "===HalProxy===" << std::endl;
stream << "Internal values:" << std::endl;
stream << " Threads are running: " << (mThreadsRun.load() ? "true" : "false") << std::endl;
int64_t now = getTimeNow();
stream << " Wakelock timeout start time: " << msFromNs(now - mWakelockTimeoutStartTime)
<< " ms ago" << std::endl;
stream << " Wakelock timeout reset time: " << msFromNs(now - mWakelockTimeoutResetTime)
<< " ms ago" << std::endl;
// TODO(b/142969448): Add logging for history of wakelock acquisition per subhal.
stream << " Wakelock ref count: " << mWakelockRefCount << std::endl;
stream << " # of events on pending write writes queue: " << mSizePendingWriteEventsQueue
<< std::endl;
stream << " Most events seen on pending write events queue: "
<< mMostEventsObservedPendingWriteEventsQueue << std::endl;
if (!mPendingWriteEventsQueue.empty()) {
stream << " Size of events list on front of pending writes queue: "
<< mPendingWriteEventsQueue.front().first.size() << std::endl;
}
stream << " # of non-dynamic sensors across all subhals: " << mSensors.size() << std::endl;
stream << " # of dynamic sensors across all subhals: " << mDynamicSensors.size() << std::endl;
stream << "SubHals (" << mSubHalList.size() << "):" << std::endl;
for (auto& subHal : mSubHalList) {
stream << " Name: " << subHal->getName() << std::endl;
stream << " Debug dump: " << std::endl;
android::base::WriteStringToFd(stream.str(), writeFd);
subHal->debug(fd, {});
stream.str("");
stream << std::endl;
}
android::base::WriteStringToFd(stream.str(), writeFd);
return Return<void>();
}
Return<void> HalProxy::onDynamicSensorsConnected(const hidl_vec<SensorInfo>& dynamicSensorsAdded,
int32_t subHalIndex) {
std::vector<SensorInfo> sensors;
{
std::lock_guard<std::mutex> lock(mDynamicSensorsMutex);
for (SensorInfo sensor : dynamicSensorsAdded) {
if (!subHalIndexIsClear(sensor.sensorHandle)) {
ALOGE("Dynamic sensor added %s had sensorHandle with first byte not 0.",
sensor.name.c_str());
} else {
sensor.sensorHandle = setSubHalIndex(sensor.sensorHandle, subHalIndex);
mDynamicSensors[sensor.sensorHandle] = sensor;
sensors.push_back(sensor);
}
}
}
mDynamicSensorsCallback->onDynamicSensorsConnected(sensors);
return Return<void>();
}
Return<void> HalProxy::onDynamicSensorsDisconnected(
const hidl_vec<int32_t>& dynamicSensorHandlesRemoved, int32_t subHalIndex) {
// TODO(b/143302327): Block this call until all pending events are flushed from queue
std::vector<int32_t> sensorHandles;
{
std::lock_guard<std::mutex> lock(mDynamicSensorsMutex);
for (int32_t sensorHandle : dynamicSensorHandlesRemoved) {
if (!subHalIndexIsClear(sensorHandle)) {
ALOGE("Dynamic sensorHandle removed had first byte not 0.");
} else {
sensorHandle = setSubHalIndex(sensorHandle, subHalIndex);
if (mDynamicSensors.find(sensorHandle) != mDynamicSensors.end()) {
mDynamicSensors.erase(sensorHandle);
sensorHandles.push_back(sensorHandle);
}
}
}
}
mDynamicSensorsCallback->onDynamicSensorsDisconnected(sensorHandles);
return Return<void>();
}
void HalProxy::initializeSubHalListFromConfigFile(const char* configFileName) {
std::ifstream subHalConfigStream(configFileName);
if (!subHalConfigStream) {
ALOGE("Failed to load subHal config file: %s", configFileName);
} else {
std::string subHalLibraryFile;
while (subHalConfigStream >> subHalLibraryFile) {
void* handle = getHandleForSubHalSharedObject(subHalLibraryFile);
if (handle == nullptr) {
ALOGE("dlopen failed for library: %s", subHalLibraryFile.c_str());
} else {
SensorsHalGetSubHalFunc* sensorsHalGetSubHalPtr =
(SensorsHalGetSubHalFunc*)dlsym(handle, "sensorsHalGetSubHal");
if (sensorsHalGetSubHalPtr != nullptr) {
std::function<SensorsHalGetSubHalFunc> sensorsHalGetSubHal =
*sensorsHalGetSubHalPtr;
uint32_t version;
ISensorsSubHalV2_0* subHal = sensorsHalGetSubHal(&version);
if (version != SUB_HAL_2_0_VERSION) {
ALOGE("SubHal version was not 2.0 for library: %s",
subHalLibraryFile.c_str());
} else {
ALOGV("Loaded SubHal from library: %s", subHalLibraryFile.c_str());
mSubHalList.push_back(std::make_unique<SubHalWrapperV2_0>(subHal));
}
} else {
SensorsHalGetSubHalV2_1Func* getSubHalV2_1Ptr =
(SensorsHalGetSubHalV2_1Func*)dlsym(handle, "sensorsHalGetSubHal_2_1");
if (getSubHalV2_1Ptr == nullptr) {
ALOGE("Failed to locate sensorsHalGetSubHal function for library: %s",
subHalLibraryFile.c_str());
} else {
std::function<SensorsHalGetSubHalV2_1Func> sensorsHalGetSubHal_2_1 =
*getSubHalV2_1Ptr;
uint32_t version;
ISensorsSubHalV2_1* subHal = sensorsHalGetSubHal_2_1(&version);
if (version != SUB_HAL_2_1_VERSION) {
ALOGE("SubHal version was not 2.1 for library: %s",
subHalLibraryFile.c_str());
} else {
ALOGV("Loaded SubHal from library: %s", subHalLibraryFile.c_str());
mSubHalList.push_back(std::make_unique<SubHalWrapperV2_1>(subHal));
}
}
}
}
}
}
}
void HalProxy::initializeSensorList() {
for (size_t subHalIndex = 0; subHalIndex < mSubHalList.size(); subHalIndex++) {
auto result = mSubHalList[subHalIndex]->getSensorsList([&](const auto& list) {
for (SensorInfo sensor : list) {
if (!subHalIndexIsClear(sensor.sensorHandle)) {
ALOGE("SubHal sensorHandle's first byte was not 0");
} else {
ALOGV("Loaded sensor: %s", sensor.name.c_str());
sensor.sensorHandle = setSubHalIndex(sensor.sensorHandle, subHalIndex);
setDirectChannelFlags(&sensor, mSubHalList[subHalIndex]);
if (sensor.typeAsString == "qti.sensor.wise_light") {
sensor.type = SensorType::LIGHT;
sensor.typeAsString = "";
}
mSensors[sensor.sensorHandle] = sensor;
}
}
});
if (!result.isOk()) {
ALOGE("getSensorsList call failed for SubHal: %s",
mSubHalList[subHalIndex]->getName().c_str());
}
}
}
void* HalProxy::getHandleForSubHalSharedObject(const std::string& filename) {
static const std::string kSubHalShareObjectLocations[] = {
"", // Default locations will be searched
#ifdef __LP64__
"/vendor/lib64/hw/", "/odm/lib64/hw/"
#else
"/vendor/lib/hw/", "/odm/lib/hw/"
#endif
};
for (const std::string& dir : kSubHalShareObjectLocations) {
void* handle = dlopen((dir + filename).c_str(), RTLD_NOW);
if (handle != nullptr) {
return handle;
}
}
return nullptr;
}
void HalProxy::init() {
initializeSensorList();
}
void HalProxy::stopThreads() {
mThreadsRun.store(false);
if (mEventQueueFlag != nullptr && mEventQueue != nullptr) {
size_t numToRead = mEventQueue->availableToRead();
std::vector<Event> events(numToRead);
mEventQueue->read(events.data(), numToRead);
mEventQueueFlag->wake(static_cast<uint32_t>(EventQueueFlagBits::EVENTS_READ));
}
if (mWakelockQueueFlag != nullptr && mWakeLockQueue != nullptr) {
uint32_t kZero = 0;
mWakeLockQueue->write(&kZero);
mWakelockQueueFlag->wake(static_cast<uint32_t>(WakeLockQueueFlagBits::DATA_WRITTEN));
}
mWakelockCV.notify_one();
mEventQueueWriteCV.notify_one();
if (mPendingWritesThread.joinable()) {
mPendingWritesThread.join();
}
if (mWakelockThread.joinable()) {
mWakelockThread.join();
}
}
void HalProxy::disableAllSensors() {
for (const auto& sensorEntry : mSensors) {
int32_t sensorHandle = sensorEntry.first;
activate(sensorHandle, false /* enabled */);
}
std::lock_guard<std::mutex> dynamicSensorsLock(mDynamicSensorsMutex);
for (const auto& sensorEntry : mDynamicSensors) {
int32_t sensorHandle = sensorEntry.first;
activate(sensorHandle, false /* enabled */);
}
}
void HalProxy::startPendingWritesThread(HalProxy* halProxy) {
halProxy->handlePendingWrites();
}
void HalProxy::handlePendingWrites() {
// TODO(b/143302327): Find a way to optimize locking strategy maybe using two mutexes instead of
// one.
std::unique_lock<std::mutex> lock(mEventQueueWriteMutex);
while (mThreadsRun.load()) {
mEventQueueWriteCV.wait(
lock, [&] { return !mPendingWriteEventsQueue.empty() || !mThreadsRun.load(); });
if (mThreadsRun.load()) {
std::vector<Event>& pendingWriteEvents = mPendingWriteEventsQueue.front().first;
size_t numWakeupEvents = mPendingWriteEventsQueue.front().second;
size_t eventQueueSize = mEventQueue->getQuantumCount();
size_t numToWrite = std::min(pendingWriteEvents.size(), eventQueueSize);
lock.unlock();
if (!mEventQueue->writeBlocking(
pendingWriteEvents.data(), numToWrite,
static_cast<uint32_t>(EventQueueFlagBits::EVENTS_READ),
static_cast<uint32_t>(EventQueueFlagBits::READ_AND_PROCESS),
kPendingWriteTimeoutNs, mEventQueueFlag)) {
ALOGE("Dropping %zu events after blockingWrite failed.", numToWrite);
if (numWakeupEvents > 0) {
if (pendingWriteEvents.size() > eventQueueSize) {
decrementRefCountAndMaybeReleaseWakelock(
countNumWakeupEvents(pendingWriteEvents, eventQueueSize));
} else {
decrementRefCountAndMaybeReleaseWakelock(numWakeupEvents);
}
}
}
lock.lock();
mSizePendingWriteEventsQueue -= numToWrite;
if (pendingWriteEvents.size() > eventQueueSize) {
// TODO(b/143302327): Check if this erase operation is too inefficient. It will copy
// all the events ahead of it down to fill gap off array at front after the erase.
pendingWriteEvents.erase(pendingWriteEvents.begin(),
pendingWriteEvents.begin() + eventQueueSize);
} else {
mPendingWriteEventsQueue.pop();
}
}
}
}
void HalProxy::startWakelockThread(HalProxy* halProxy) {
halProxy->handleWakelocks();
}
void HalProxy::handleWakelocks() {
std::unique_lock<std::recursive_mutex> lock(mWakelockMutex);
while (mThreadsRun.load()) {
mWakelockCV.wait(lock, [&] { return mWakelockRefCount > 0 || !mThreadsRun.load(); });
if (mThreadsRun.load()) {
int64_t timeLeft;
if (sharedWakelockDidTimeout(&timeLeft)) {
resetSharedWakelock();
} else {
uint32_t numWakeLocksProcessed;
lock.unlock();
bool success = mWakeLockQueue->readBlocking(
&numWakeLocksProcessed, 1, 0,
static_cast<uint32_t>(WakeLockQueueFlagBits::DATA_WRITTEN), timeLeft);
lock.lock();
if (success) {
decrementRefCountAndMaybeReleaseWakelock(
static_cast<size_t>(numWakeLocksProcessed));
}
}
}
}
resetSharedWakelock();
}
bool HalProxy::sharedWakelockDidTimeout(int64_t* timeLeft) {
bool didTimeout;
int64_t duration = getTimeNow() - mWakelockTimeoutStartTime;
if (duration > kWakelockTimeoutNs) {
didTimeout = true;
} else {
didTimeout = false;
*timeLeft = kWakelockTimeoutNs - duration;
}
return didTimeout;
}
void HalProxy::resetSharedWakelock() {
std::lock_guard<std::recursive_mutex> lockGuard(mWakelockMutex);
decrementRefCountAndMaybeReleaseWakelock(mWakelockRefCount);
mWakelockTimeoutResetTime = getTimeNow();
}
void HalProxy::postEventsToMessageQueue(const std::vector<Event>& events, size_t numWakeupEvents,
V2_0::implementation::ScopedWakelock wakelock) {
size_t numToWrite = 0;
std::lock_guard<std::mutex> lock(mEventQueueWriteMutex);
if (wakelock.isLocked()) {
incrementRefCountAndMaybeAcquireWakelock(numWakeupEvents);
}
if (mPendingWriteEventsQueue.empty()) {
numToWrite = std::min(events.size(), mEventQueue->availableToWrite());
if (numToWrite > 0) {
if (mEventQueue->write(events.data(), numToWrite)) {
// TODO(b/143302327): While loop if mEventQueue->avaiableToWrite > 0 to possibly fit
// in more writes immediately
mEventQueueFlag->wake(static_cast<uint32_t>(EventQueueFlagBits::READ_AND_PROCESS));
} else {
numToWrite = 0;
}
}
}
size_t numLeft = events.size() - numToWrite;
if (numToWrite < events.size() &&
mSizePendingWriteEventsQueue + numLeft <= kMaxSizePendingWriteEventsQueue) {
std::vector<Event> eventsLeft(events.begin() + numToWrite, events.end());
mPendingWriteEventsQueue.push({eventsLeft, numWakeupEvents});
mSizePendingWriteEventsQueue += numLeft;
mMostEventsObservedPendingWriteEventsQueue =
std::max(mMostEventsObservedPendingWriteEventsQueue, mSizePendingWriteEventsQueue);
mEventQueueWriteCV.notify_one();
}
}
bool HalProxy::incrementRefCountAndMaybeAcquireWakelock(size_t delta,
int64_t* timeoutStart /* = nullptr */) {
if (!mThreadsRun.load()) return false;
std::lock_guard<std::recursive_mutex> lockGuard(mWakelockMutex);
if (mWakelockRefCount == 0) {
acquire_wake_lock(PARTIAL_WAKE_LOCK, kWakelockName);
mWakelockCV.notify_one();
}
mWakelockTimeoutStartTime = getTimeNow();
mWakelockRefCount += delta;
if (timeoutStart != nullptr) {
*timeoutStart = mWakelockTimeoutStartTime;
}
return true;
}
void HalProxy::decrementRefCountAndMaybeReleaseWakelock(size_t delta,
int64_t timeoutStart /* = -1 */) {
if (!mThreadsRun.load()) return;
std::lock_guard<std::recursive_mutex> lockGuard(mWakelockMutex);
if (delta > mWakelockRefCount) {
ALOGE("Decrementing wakelock ref count by %zu when count is %zu",
delta, mWakelockRefCount);
}
if (timeoutStart == -1) timeoutStart = mWakelockTimeoutResetTime;
if (mWakelockRefCount == 0 || timeoutStart < mWakelockTimeoutResetTime) return;
mWakelockRefCount -= std::min(mWakelockRefCount, delta);
if (mWakelockRefCount == 0) {
release_wake_lock(kWakelockName);
}
}
void HalProxy::setDirectChannelFlags(SensorInfo* sensorInfo,
std::shared_ptr<ISubHalWrapperBase> subHal) {
bool sensorSupportsDirectChannel =
(sensorInfo->flags & (V1_0::SensorFlagBits::MASK_DIRECT_REPORT |
V1_0::SensorFlagBits::MASK_DIRECT_CHANNEL)) != 0;
if (mDirectChannelSubHal == nullptr && sensorSupportsDirectChannel) {
mDirectChannelSubHal = subHal;
} else if (mDirectChannelSubHal != nullptr && subHal != mDirectChannelSubHal) {
// disable direct channel capability for sensors in subHals that are not
// the only one we will enable
sensorInfo->flags &= ~(V1_0::SensorFlagBits::MASK_DIRECT_REPORT |
V1_0::SensorFlagBits::MASK_DIRECT_CHANNEL);
}
}
std::shared_ptr<ISubHalWrapperBase> HalProxy::getSubHalForSensorHandle(int32_t sensorHandle) {
return mSubHalList[extractSubHalIndex(sensorHandle)];
}
bool HalProxy::isSubHalIndexValid(int32_t sensorHandle) {
return extractSubHalIndex(sensorHandle) < mSubHalList.size();
}
size_t HalProxy::countNumWakeupEvents(const std::vector<Event>& events, size_t n) {
size_t numWakeupEvents = 0;
for (size_t i = 0; i < n; i++) {
int32_t sensorHandle = events[i].sensorHandle;
if (mSensors[sensorHandle].flags & static_cast<uint32_t>(V1_0::SensorFlagBits::WAKE_UP)) {
numWakeupEvents++;
}
}
return numWakeupEvents;
}
int32_t HalProxy::clearSubHalIndex(int32_t sensorHandle) {
return sensorHandle & (~kSensorHandleSubHalIndexMask);
}
bool HalProxy::subHalIndexIsClear(int32_t sensorHandle) {
return (sensorHandle & kSensorHandleSubHalIndexMask) == 0;
}
} // namespace implementation
} // namespace V2_1
} // namespace sensors
} // namespace hardware
} // namespace android

View File

@@ -1,84 +0,0 @@
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "HalProxyCallback.h"
#include <cinttypes>
namespace android {
namespace hardware {
namespace sensors {
namespace V2_0 {
namespace implementation {
static constexpr int32_t kBitsAfterSubHalIndex = 24;
/**
* Set the subhal index as first byte of sensor handle and return this modified version.
*
* @param sensorHandle The sensor handle to modify.
* @param subHalIndex The index in the hal proxy of the sub hal this sensor belongs to.
*
* @return The modified sensor handle.
*/
int32_t setSubHalIndex(int32_t sensorHandle, size_t subHalIndex) {
return sensorHandle | (static_cast<int32_t>(subHalIndex) << kBitsAfterSubHalIndex);
}
void HalProxyCallbackBase::postEvents(const std::vector<V2_1::Event>& events,
ScopedWakelock wakelock) {
if (events.empty() || !mCallback->areThreadsRunning()) return;
size_t numWakeupEvents;
std::vector<V2_1::Event> processedEvents = processEvents(events, &numWakeupEvents);
if (numWakeupEvents > 0) {
ALOG_ASSERT(wakelock.isLocked(),
"Wakeup events posted while wakelock unlocked for subhal"
" w/ index %" PRId32 ".",
mSubHalIndex);
} else {
ALOG_ASSERT(!wakelock.isLocked(),
"No Wakeup events posted but wakelock locked for subhal"
" w/ index %" PRId32 ".",
mSubHalIndex);
}
mCallback->postEventsToMessageQueue(processedEvents, numWakeupEvents, std::move(wakelock));
}
ScopedWakelock HalProxyCallbackBase::createScopedWakelock(bool lock) {
ScopedWakelock wakelock(mRefCounter, lock);
return wakelock;
}
std::vector<V2_1::Event> HalProxyCallbackBase::processEvents(const std::vector<V2_1::Event>& events,
size_t* numWakeupEvents) const {
*numWakeupEvents = 0;
std::vector<V2_1::Event> eventsOut;
for (V2_1::Event event : events) {
event.sensorHandle = setSubHalIndex(event.sensorHandle, mSubHalIndex);
eventsOut.push_back(event);
const V2_1::SensorInfo& sensor = mCallback->getSensorInfo(event.sensorHandle);
if ((sensor.flags & V1_0::SensorFlagBits::WAKE_UP) != 0) {
(*numWakeupEvents)++;
}
}
return eventsOut;
}
} // namespace implementation
} // namespace V2_0
} // namespace sensors
} // namespace hardware
} // namespace android

View File

@@ -1,11 +0,0 @@
<manifest version="1.0" type="device">
<hal format="hidl">
<name>android.hardware.sensors</name>
<transport>hwbinder</transport>
<version>2.0</version>
<interface>
<name>ISensors</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View File

@@ -1,7 +0,0 @@
service vendor.sensors-hal-2-0-multihal /vendor/bin/hw/android.hardware.sensors@2.0-service.multihal
class hal
user system
group system wakelock context_hub input
writepid /dev/cpuset/system-background/tasks
capabilities BLOCK_SUSPEND
rlimit rtprio 10 10

View File

@@ -1,39 +0,0 @@
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <android/hardware/sensors/2.0/ISensors.h>
#include <hidl/HidlTransportSupport.h>
#include <log/log.h>
#include <utils/StrongPointer.h>
#include "HalProxy.h"
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using android::hardware::sensors::V2_0::ISensors;
using android::hardware::sensors::V2_1::implementation::HalProxyV2_0;
int main(int /* argc */, char** /* argv */) {
configureRpcThreadpool(1, true);
android::sp<ISensors> halProxy = new HalProxyV2_0();
if (halProxy->registerAsService() != ::android::OK) {
ALOGE("Failed to register Sensors HAL instance");
return -1;
}
joinRpcThreadpool();
return 1; // joinRpcThreadpool shouldn't exit
}

View File

@@ -16,6 +16,9 @@
# Camera
/mnt/vendor/persist/camera(/.*)? u:object_r:vendor_persist_camera_file:s0
# Cust
/dev/block/platform/soc/4744000.sdhci/by-name/cust u:object_r:vendor_custom_block_device:s0
# Oppo Partitions
/dev/block/platform/soc/1d84000.ufshc/by-name/oppodycnvbk u:object_r:vendor_modem_efs_partition_device:s0
/dev/block/platform/soc/1d84000.ufshc/by-name/oppostanvbk u:object_r:vendor_modem_efs_partition_device:s0

View File

@@ -6,5 +6,6 @@ r_dir_file(system_app, proc_touchpanel);
r_dir_file(system_app, vendor_sysfs_usb_supply);
allow system_app vendor_sysfs_usb_supply:file rw_file_perms;
allow system_app vendor_sysfs_battery_supply:dir search;

4
sepolicy/vendor/system_server.te vendored Normal file
View File

@@ -0,0 +1,4 @@
allow system_server proc_devinfo:dir search;
allow system_server proc_oppo_rf:dir search;
allow system_server proc_oppoversion:dir search;
allow system_server proc_touchpanel:dir search;

View File

@@ -6,3 +6,7 @@ get_prop(vendor_qti_init_shell, oppo_debug_prop)
allow vendor_qti_init_shell sysfs:file write;
allow vendor_qti_init_shell proc_page_cluster:file { open };
# To set powerhal init property
set_prop(vendor_qti_init_shell, vendor_power_prop)

View File

@@ -21,11 +21,14 @@ ro.camera.attr.detect.enable=1
ro.camera.notify_nfc=1
ro.camera.temperature.limit=470
persist.vendor.camera.light_ae.enable=1
persist.camera.eis.enable=1
persist.camera.is_mode=4
persist.vendor.camera.oissr.debug=1
vendor.debug.camera.eisv2enable=1
vendor.debug.camera.eisv3enable=1
# Allow privileged camera apps
persist.vendor.camera.privapp.list=org.lineageos.aperture,org.codeaurora.snapcam,com.android.camera,com.google.camera
# Allow aux cameras
vendor.camera.aux.packagelist=org.lineageos.aperture,org.codeaurora.snapcam,com.android.camera,com.google.camera
persist.vendor.camera.expose.aux=1
# CNE
persist.vendor.cne.feature=1
@@ -108,7 +111,6 @@ persist.sys.radio.force_lte_ca=true
persist.vendor.data.iwlan.enable=true
persist.vendor.data.mode=concurrent
ril.subscription.types=NV,RUIM
ro.telephony.default_network=22,22
ro.vendor.use_data_netmgrd=true
telephony.lteOnCdmaDevice=1
persist.sys.fflag.override.settings_network_and_internet_v2=true
@@ -121,11 +123,6 @@ persist.vendor.ssr.restart_level=ALL_ENABLE
persist.debug.wfd.enable=1
persist.sys.wfd.virtual=0
# ZRAM
ro.zram.mark_idle_delay_mins=60
ro.zram.first_wb_delay_mins=180
ro.zram.periodic_wb_delay_hours=24
#SkiaGL
debug.renderengine.backend=skiaglthreaded
renderthread.skia.reduceopstasksplitting=true

View File

@@ -97,6 +97,8 @@ vendor.qcom.bluetooth.soc=cherokee
# Camera
camera.disable_zsl_mode=1
persist.vendor.camera.eis.enable=1
persist.vendor.camera.is_type=2
# Crypto
ro.crypto.allow_encrypt_override=true
@@ -149,19 +151,22 @@ ro.qcom.adreno.qgl.ShaderStorageImageExtendedFormats=0
# FM
vendor.hw.fm.init=0
# FRP
ro.frp.pst=/dev/block/bootdevice/by-name/frp
#Graphics
debug.hwui.use_hint_manager=true
debug.hwui.target_cpu_time_percent=30
debug.sf.disable_client_composition_cache=0
debug.sf.enable_adpf_cpu_hint=true
# Keyguard
keyguard.no_require_sim=true
debug.sf.enable_gl_backpressure=0
# Keystore
ro.hardware.keystore_desede=true
# Game FrameRate
debug.graphics.game_default_frame_rate.disabled=true
# Media
debug.media.codec2=2
debug.stagefright.c2inputsurface=-1
@@ -192,6 +197,21 @@ persist.vendor.radio.rat_on=combine
ro.telephony.default_network=22,20
ro.vendor.use_data_netmgrd=true
telephony.lteOnCdmaDevice=1
persist.vendor.radio.add_power_save=1
persist.vendor.radio.force_on_dc=1
persist.vendor.radio.lte_vrte_ltd=1
persist.vendor.radio.snrt_max_layer=3
persist.vendor.radio.data_con_rprt=1
persist.vendor.radio.ignore_dom_time=10
persist.vendor.radio.oppo.signal.adapt=1
ro.vendor.radio.oppo.signal.adapt=true
persist.vendor.radio.enable_temp_dds=true
persist.vendor.radio.custom_ecc=1
persist.vendor.radio.data_ltd_sys_ind=1
# ScrollOptimizer
persist.sys.perf.scroll_opt=true
persist.sys.perf.scroll_opt.heavy_app=1
# Sensors
persist.vendor.sensors.odl.adsp=true
@@ -222,3 +242,7 @@ sys.fflag.override.settings_seamless_transfer=true
# default refresh rate threshold
debug.sf.frame_rate_multiple_threshold=0
# Fingerprint
ro.vendor.fingerprint.type=side
ro.vendor.fingerprint.supports_gestures=true