69 Commits

Author SHA1 Message Date
k4ngcaribug
bd7c47e793 vibrator/effect: Drop libc++fs 2025-08-30 08:11:09 +09:00
Adithya R
02dd7c3c56 interfaces: displayfeature: Fix method ordering
Based on analysis of stock interface.

Change-Id: Ib49d18ee15e3f7be1b3b314277357e54f953d73a
2025-08-30 08:11:09 +09:00
Pranav Vashi
f62a2c9eeb XiaomiEuicc: Add EuiccGoogle when building XiaomiEuicc
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-08-30 08:11:09 +09:00
Dmitry
4e2ce1d8d8 euicc: add EuiccGoogle to manage eSIM 2025-08-30 08:11:09 +09:00
Dmitry
230888e2bf euicc: expanded list of esim-enabled devices 2025-08-30 08:11:09 +09:00
LuK1337
36013e8d1e XiaomiEuicc: Switch to PackageManager.getApplicationInfo()
Change-Id: Iccd792d147d61d324170ba4e3e2aa1b5a6910274
2025-08-30 08:11:09 +09:00
someone5678
d94967c306 XiaomiEuicc: Don't fatally crash when euicc package is not exists
Log:
01-18 20:01:59.274  5014  5014 E AndroidRuntime: FATAL EXCEPTION: main
01-18 20:01:59.274  5014  5014 E AndroidRuntime: Process: org.lineageos.euicc, PID: 5014
01-18 20:01:59.274  5014  5014 E AndroidRuntime: java.lang.RuntimeException: Unable to start receiver org.lineageos.euicc.BootCompletedReceiver: java.lang.IllegalArgumentException: Unknown package: com.google.euiccpixel
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at android.app.ActivityThread.handleReceiver(ActivityThread.java:4500)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2282)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:205)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:294)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:8291)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: Unknown package: com.google.euiccpixel
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at android.os.Parcel.createExceptionOrNull(Parcel.java:3061)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at android.os.Parcel.createException(Parcel.java:3041)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:3024)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:2966)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at android.content.pm.IPackageManager$Stub$Proxy.setApplicationEnabledSetting(IPackageManager.java:6107)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at android.app.ApplicationPackageManager.setApplicationEnabledSetting(ApplicationPackageManager.java:3185)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at org.lineageos.euicc.EuiccDisabler.enableOrDisableEuicc(EuiccDisabler.kt:43)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at org.lineageos.euicc.BootCompletedReceiver.onReceive(BootCompletedReceiver.kt:16)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	at android.app.ActivityThread.handleReceiver(ActivityThread.java:4491)
01-18 20:01:59.274  5014  5014 E AndroidRuntime: 	... 9 more

Change-Id: I86880342693c92afddf09dbe8db22255ca93c355
2025-08-30 08:11:09 +09:00
someone5678
7e0d5aee84 XiaomiEuicc: Move to priv-app and grant required permissions
* We are trying to use functions that required
  priviledged permissions
  (e.g. android.permission.CHANGE_COMPONENT_ENABLED_STATE)

* To make these functions correctly, move this app to priv-app

* Signing with platform key
* Add android.permission.CHANGE_COMPONENT_ENABLED_STATE
* Indicates and grant WRITE_EMBEDDED_SUBSCRIPTIONS permission
* Whitelist Hidden API

Log:
08-26 21:24:38.610  4898  4898 E AndroidRuntime: FATAL EXCEPTION: main
08-26 21:24:38.610  4898  4898 E AndroidRuntime: Process: co.aospa.euicc, PID: 4898
08-26 21:24:38.610  4898  4898 E AndroidRuntime: java.lang.RuntimeException: Unable to start receiver co.aospa.euicc.BootCompletedReceiver: java.lang.SecurityException: Attempt to change component state; pid=4898, uid=10191, package=com.google.android.euicc
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at android.app.ActivityThread.handleReceiver(ActivityThread.java:4316)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2153)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:201)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7960)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: Caused by: java.lang.SecurityException: Attempt to change component state; pid=4898, uid=10191, package=com.google.android.euicc
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at android.os.Parcel.createExceptionOrNull(Parcel.java:3011)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at android.os.Parcel.createException(Parcel.java:2995)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:2978)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:2920)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at android.content.pm.IPackageManager$Stub$Proxy.setApplicationEnabledSetting(IPackageManager.java:5938)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at android.app.ApplicationPackageManager.setApplicationEnabledSetting(ApplicationPackageManager.java:3177)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at co.aospa.euicc.EuiccDisabler.enableOrDisableEuicc(EuiccDisabler.kt:43)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at co.aospa.euicc.BootCompletedReceiver.onReceive(BootCompletedReceiver.kt:16)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at android.app.ActivityThread.handleReceiver(ActivityThread.java:4307)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	... 9 more
08-26 21:24:38.610  4898  4898 E AndroidRuntime: Caused by: android.os.RemoteException: Remote stack trace:
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at com.android.server.pm.PackageManagerService.setEnabledSettings(PackageManagerService.java:3784)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at com.android.server.pm.PackageManagerService.-$$Nest$msetEnabledSettings(Unknown Source:0)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at com.android.server.pm.PackageManagerService$IPackageManagerImpl.setApplicationEnabledSetting(PackageManagerService.java:5527)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2971)
08-26 21:24:38.610  4898  4898 E AndroidRuntime: 	at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onTransact(PackageManagerService.java:6042)
08-26 21:24:38.610  4898  4898 E AndroidRuntime:

Change-Id: Ied5d023e0f403e9c6f4908c59bcbb538aeef4574
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-08-30 08:11:09 +09:00
Peter Cai
a047cd0e9c XiaomiEuicc: Disable EuiccGoogle when GMS and GSF are not installed
* This avoids EuiccGoogle / GoogleCarrierServices crashing, taking the
  whole telephony stack with them when no GMS or GSF is installed.
* This approach is no-op when GAPPS add-on is flashed before the first
  boot, and thus should not cause issues with eSIM when GAPPS is
  flashed.
* With microG, this also works after installing the microG GMS & GSF
  packages and rebooting, although manual activation of the eSIM is
  needed via Settings - Network.
* The only downside is that users will still see one or two crashes
  during the first boot because our application only starts after the
  device is booted.

Change-Id: Ice053b623d8f4a8e3783d82ffe0dc67f2cba558e
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-08-30 08:11:09 +09:00
Bruno Martins
ce2e14c9cb Introduce XiaomiEuicc
This is a companion app for EuiccGoogle (SIM Manager), that basically
sends over the mapping of the SIM slots and sets proper SIM tray
illustration (props to Yuri for the lottie animations).

For the time being it only includes the mappings for one of the
Xiaoi 12T Pro models (22081212UG).

Change-Id: I09db5d6a9acbf05bf82803682572aeae54337c1b
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-08-30 08:11:09 +09:00
Aaron Kling
070b86f599 healthd-ext: update AIDL HAL version to 3
Resolves vts failure:
For android.hardware.health.IHealth/default, manifest (targeting FCM:6)
declares version 2, but the actual version is 3

Change-Id: I8ff7278d373d6bdf906d3e1367fe7d4613552a8b
2025-08-30 08:11:09 +09:00
Fenglin Wu
5afba6fd79 healthd-ext: update VINTF manifest version to 2
Update VINTF manifest version to 2 to match with the latest definition
in android.hardware.health.IHealth AIDL interface.

Change-Id: Iabf4165c52cca95ff8aa75a67bbc61f4c102bb9e
(cherry picked from commit ad957d158ad1d53193536a2e0cee016836d90cd0)
2025-08-30 08:11:09 +09:00
Fabian Leutenegger
1d8c9ea4be healthd-ext: Fix charge_counter and ETA values
Based on 137843ec4f

Co-authored-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Change-Id: I3d000d283302a84ee9fcbd5a85ef26817b68c0a7
2025-08-30 08:11:09 +09:00
chrisl7
5c60662e3e healthd-ext: Define override to QTI AIDL healthd-ext hal
Change-Id: I26009b1f20c02219dd371ad184cad4eafb9e8eec
2025-08-30 08:11:09 +09:00
chrisl7
93279a0cd0 healthd-ext: Rename hal to xiaomi to avoid compilation conflicts
Change-Id: I8f33b6870eccfd19272cfbdb816b5b53371012c5
2025-08-30 08:11:09 +09:00
Fenglin Wu
57366c40d5 healthd-ext: Update AIDL HAL service installation paths
Update the installation path for vendor and recovery partition
respectively.

Change-Id: I1908d10d782127f555e2fb316f3640bc93efcdbd
2025-08-30 08:11:09 +09:00
Fenglin Wu
dd598de4bc healthd-ext: Add suspend support for charger mode
Override ChargerEnableSuspend() function to true to support kernel
suspend and resume in charger mode.

Change-Id: I01ceaecf7e918504624b2bf1bfb34207fcde74e7
2025-08-30 08:11:09 +09:00
Fenglin Wu
fab72f6b5b healthd-ext: Add health HAL AIDL implementation
Add health HAL AIDL implementation which is a service running for
both health HAL and charger mode.

Change-Id: I1f3205d1e34d93ed1739d5fa29c95a8f2b2d2894
2025-08-30 08:11:09 +09:00
AdarshGrewal
c2e5046b68 hardware/xiaomi: Mark setTouchMode as void
* these methods dont return any values this needs to be doe for remaining methods too probabbly
2025-08-30 08:11:09 +09:00
AdarshGrewal
46e5d2d42b interfaces: Import reversed aidl interface for IDisplayFeature
This Interface Needed for parts fragment to make working custom saturation Slider instead of using linej livedisplay hal.
Signed-off-by: GuidixX <guidixm@gmail.com>
2025-08-30 08:11:09 +09:00
AdarshGrewal
30d76ef466 hardware/xiaomi: fixup aidl interfaces 2025-08-30 08:11:09 +09:00
raghavt20
c8d7bb56f5 hardware/xiaomi: Import reversed aidl interface for ITouchFeature
Change-Id: Icc959b71ae4d90f81c5769de4ad16ba1a0984871
2025-08-30 08:11:09 +09:00
raghavt20
a0aa2970a7 hardware/xiaomi: Import reversed aidl interface for IXiaomiFingerprint
Change-Id: I0d60666324d986333dc10824250d90fe42ab878a
2025-08-30 08:11:09 +09:00
Piotr Kozimor
be34cb1415 vintf: Add IMiSys HAL in compatibility matrix
Change-Id: I65bb9bf6d0aff733ca533f3c8bd5a7922058c9ff
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: firebird11 <hbgassel@gmail.com>
2025-08-30 08:11:09 +09:00
basamaryan
caaf1534cf vinf: Add {vendor.dolby_sp.hardware.dmssp, vendor.dolby_v3_6.hardware.dms360} to FCM
Change-Id: I19a0ca830469aa3978e0e89a75536d14cec735b8
2025-08-30 08:11:09 +09:00
Adithya R
ce9b047f39 vintf: Add more hals to fcm
Change-Id: I6645216d2665ab1d51f789b9f4f80acf411e875c
2025-08-30 08:11:09 +09:00
Pranav Vashi
ce324574da DSPVolumeSynchronizer: Do not install for clone apps or private space
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-08-30 08:11:09 +09:00
Alcatraz323
126ff7676b Implement DSPVolumeSynchronizer
Some Xiaomi devices have a speaker that needs a framework to cooperate
with DSP to synchronize volume so that the DSP can limit bass when the
volume is high to prevent distortion.

Change-Id: I750803d94161e1e7482552d2a39566f42e82fc0a
2025-08-30 08:11:09 +09:00
Abhay Singh Gill
70a27f6856 dolby: Add custom profile
Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2025-08-30 08:11:09 +09:00
Abhay Singh Gill
785a2b1d9d dolby: Add icons for dolby profiles
Also nuke voice profile and fixup some strings.

Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2025-08-30 08:11:09 +09:00
Abhay Singh Gill
bba31b00d2 dolby: Make bass enhancer available on speakers as well
Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2025-08-30 08:11:09 +09:00
Pranav Vashi
505310f835 dolby: Exempt installing package in clone or private space
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-08-30 08:11:09 +09:00
Marat Budkevich
b14334f2d5 dolby: translate strings to Russian 2025-08-30 08:11:09 +09:00
Pranav Vashi
0b6822d5f3 dolby: Override AudioFx
Change-Id: I8523c10fdec7809f2872db82d85e89d076ae582a
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-08-30 08:11:09 +09:00
Kevin Truong
598db92c74 dolby: [Tooltip] Use new positioning logic
rememberTooltipPositionProvider contains new positioning logic that should be used for both Plain and Rich tooltips.

Test: Update to use rememberTooltipPositionProvider.
Bug: b/372914353
Relnote: Added rememberTooltipPositionProvider that contains an updated positioning logic. Deprecated rememberPlainTooltipPositionProvider and rememberRichTooltipPositionProvider.
Change-Id: Ie66e2ec58567cc38fc06bb8e13ef928160db114a
2025-08-30 08:11:09 +09:00
Bruno Martins
6a4f5955bb dolby: Use all shared resources from devicesettings
Change-Id: Icd7f381c574ea36eb4d797cefd60ba9f1a0941bd
2025-08-30 08:11:09 +09:00
Fabian Leutenegger
8324f4930e dolby: Update EqualizerScreen background color for 15
Switch to MaterialTheme settingsBackground for EqualizerScreen background color

Change-Id: I546e3528814276eb857a650cb6c173d914550fb5
2025-08-30 08:11:09 +09:00
Pranav Vashi
2ed020295d dolby: Remove deprecated PlainTooltipBox
Change-Id: I70ffff5ba30c5eeaff431e46c82eaf05d46e4cb0
2025-08-30 08:11:09 +09:00
basamaryan
9034fe2625 dolby: Fix build with kotlinc 1.9.0
Change-Id: I4f9fdc9d25eb57240612cff1b3bef3663014f9a8
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2025-08-30 08:11:09 +09:00
Michael Bestas
c89510a83d dolby: Convert to SwitchPreferenceCompat
Change-Id: Ic1cbaba37d499da1855af9c3930f2df426e2d3af
2025-08-30 08:11:09 +09:00
Chaohui Wang
37ad6f91a8 dolby: Migrate to CompoundButton.OnCheckedChangeListener
Switch and SwitchCompat are both CompoundButton.

Using CompoundButton in Java will helps migration in the future.

Bug: 306658427 | AOSP | AOSP
Test: manual - check Settings pages
Test: m RunSettingsLibRoboTests
Change-Id: I85a70d4c504d8584030ea4a058f30d74206ab835
2025-08-30 08:11:09 +09:00
Peter Kalauskas
f103b97ebb dolby: Enable use_resource_processor for all sysui deps
This will make the build faster

Test: m checkbuild
Bug: 295208392
Change-Id: I0c1bd901429bbe3bf81c1530e156735f8637a96e
2025-08-30 08:11:09 +09:00
Adithya R
f8ba52c219 dolby: Make sure to persist value after toggling QS tile
Toggling the switch pref automatically sets the shared pref for us, but
toggling the QS tile does no such thing so we gotta do it ourselves.

Change-Id: Iac881ed654bf4eb76b111fc87667f16476d11522
2025-08-30 08:11:09 +09:00
Adithya R
1ca613f5fc dolby: Add intelligent equalizer setting
Move preference-related classes to a new package while we're at it,
to reduce code clutter.

Change-Id: I2430e8ab9b6758503ce1777ec985a3e400b55b8e
2025-08-30 08:11:09 +09:00
Adithya R
de18245d3d dolby: Introduce graphical equalizer
Squashed:

dolby: Refresh preset name on main screen

Change-Id: I96783e2a03c384f031787f4cc9140f7d64dadb2f
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Change-Id: I38ee6ce594e5671af42afc3d4bf0f004329482b9
2025-08-30 08:11:09 +09:00
Pranav Vashi
fc3cea066b dolby: Add launcher icon
Change-Id: I4d36842ca96048f9b55604d66cc7741759d657f3
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
[adithya2306: Add monochrome icon as well]
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2025-08-30 08:11:09 +09:00
Adithya R
a8358855a7 fixup! dolby: Restore all settings upon bootup
Stereo widening dependency on virtualizer was accidentally removed.

Change-Id: I9b1e35aef5037935af3dc18a303408e2a81ca635
2025-08-30 08:11:09 +09:00
Adithya R
55e2934dd1 dolby: Restore current profile _after_ resetting profiles
Ensure to end the onBootCompleted routine with the correct profile set.

Change-Id: I2d5f74a7c0145af2f9d064cd98fa2dc70e5a7acd
2025-08-30 08:11:09 +09:00
Adithya R
6af2127ff2 dolby: Do not set volume leveler amount
This value is set to zero in almost every known dax-default.xml,
including ours.
DaxService also doesn't mess with this value, instead only sets
VolumeLevelerEnabled.

Change-Id: Ib944728d478cff58aebc4f47128bcd5fe32ff9f6
2025-08-30 08:11:09 +09:00
Adithya R
933e0e1264 dolby: Restore all settings upon bootup
Dolby often messes up restoring profile-specific settings after a reboot.
"Fine. I'll do it myself."

Change-Id: Ic255c6922eabae0b522c05110f87e2c10a97fb6c
2025-08-30 08:11:08 +09:00
Adithya R
7538a10c0e dolby: Rewrite in Kotlin
Some cleanup and restructuring while we're at it.

Change-Id: I2f1fc53c202d91421c7b6af68c814c25398a62e4
2025-08-30 08:11:08 +09:00
Adithya R
3f91fa1724 dolby: Revert "Re-enable speaker virtualization after bootup"
No longer necessary

Change-Id: Iac820eafa71ea3e4ccaad2bfa0fb76c37279a22a
2025-08-30 08:11:08 +09:00
Adithya R
98cf605161 xiaomi: Introduce Dolby Atmos
Moved from marble/sm8450-common

History:

commit 82fe03168c0402e4cb10d25859c3b398c0ef654a
Author: Adithya R <gh0strider.2k18.reborn@gmail.com>
Date:   Thu Mar 21 21:35:36 2024 +0530

    marble: parts: Restore dolby profile on audio changes

    Something keeps resetting back at random times, from what I observed,
    after resuming media or on a device change, lets workaround that.

    Change-Id: Id065f2482636194655c2399f0c35ad56b8e7a29d

commit c4400bd1326f65aeac1d0f26bb830ce7fd079773
Author: Adithya R <gh0strider.2k18.reborn@gmail.com>
Date:   Fri Feb 2 09:29:08 2024 +0530

    marble: parts/keyhandler: Guard debug logging

    Change-Id: I246941f26cd1f71b696eb3c996794c9baa5dbc00

commit f11b70a98a11d0b89673d73002996aed9f11fbd7
Author: Adithya R <gh0strider.2k18.reborn@gmail.com>
Date:   Sun Dec 31 20:36:52 2023 +0530

    marble: parts: Re-enable speaker virtualization after bootup

    For whatever reason, speaker virtualization isn't automatically
    restored at bootup unlike the other parameters. It was reported to be
    fixed by connecting and disconnecting headphones or disabling and
    enabling the toggle, so let's just automate that at bootup.

commit abcff4fb947c89b69c1d25bd290fd91b7873af6a
Author: Adithya R <gh0strider.2k18.reborn@gmail.com>
Date:   Fri Oct 20 06:49:19 2023 +0530

    marble: parts: Implement profile-specific Dolby settings

    Some refactoring and cleanup while we're at it.

commit dc54f9ddeff212d017b0cba16e56516e99335bb3
Author: Adithya R <gh0strider.2k18.reborn@gmail.com>
Date:   Mon Oct 9 21:58:58 2023 +0530

    marble: parts: Remove play/pause hack while toggling Dolby

    Not required with/fixed by:
    35217: audioflinger: Do not allow DAP effect to be suspended | https://gerrit.aospa.co/c/AOSPA/android_frameworks_av/+/35217

commit dd2acc8e0c10d05f86ff229412cc9f72ea242b44
Author: Adithya R <gh0strider.2k18.reborn@gmail.com>
Date:   Wed Sep 13 21:41:20 2023 +0530

    marble: parts: Set proper summary for dolby settings

    Show the current status in Settings > Sound as well as the QS tile.

commit 92d341ba3d22f323eded525487db4289d6edc0fe
Author: Fabian Leutenegger <fabian.leutenegger@bluewin.ch>
Date:   Fri Aug 25 10:26:53 2023 +0200

    marble: parts: Always refresh playback if status changed

     * otherwise dolby would stay active even if you disable its setting

    Change-Id: If59d8081fa12da2aa67e5149db97965c0805d76e

commit b1944744649b6fddcb7bc3864b92f298b6e78821
Author: Adithya R <gh0strider.2k18.reborn@gmail.com>
Date:   Mon Aug 21 13:21:18 2023 +0530

    marble: parts: Introduce Dolby Atmos

    Based on existing dirac implementation and observing stock
    sound effects app and daxservice.

    Thanks to jhenrique09 for the hack from old dirac parts
    "Pause/play music stream to get effects applied".

    TODO: bring back misound (same as stock)

    Co-authored-by: Henrique Silva <jhenrique09.mcz@hotmail.com>

Change-Id: I79841c045fe7b92c438177916f756faab72ff0e9
2025-08-30 08:11:03 +09:00
LuK1337
f5b202281a IFAAService: Simplify startBIOManager function
Change-Id: I86ae17e0fa3cfcf438c90502a3be5035d9373f54
2025-08-09 14:39:47 +01:00
Bin
636ce206a0 aidl: fingerprint: Set properties for IFAA
MlipayService needs these props to work.
This exists in hidl fingerprint, but is missing in aidl.

Reference: I0b1786721c951cd833d3c20f58cd0c8a70c08fae
Change-Id: I70a43ccde9ec2db51b265e1896a89ca640164a36
2025-06-23 09:00:45 +00:00
Bruno Martins
33a419e8c1 touch: Include KeyDisabler and KeySwapper generic support
This adds conditional support for KeyDisabler and KeySwapper
along with HighTouchPollingRate feature.

Change-Id: Ie6c0e7c1032e9d44bf03e6f6738581a4418fb645
2025-06-18 07:37:21 +00:00
Bruno Martins
064c24617e touch: Migrate to AIDL
Change-Id: If44efbab6ad53701a662788daecfd7678935e8b4
2025-06-18 07:37:21 +00:00
Bruno Martins
4d7a952308 touch: Use select()
Change-Id: I28e54d5ddaf5e376292d2b4ec7b69d5a49fe4f54
2025-06-18 07:37:21 +00:00
Arian
06bfc823ef aidl: fingerprint: Grant SYS_NICE capability to set SCHED_FIFO
Xiaomi is using sched_setscheduler in libgf_hal to increase the
fingerprint processes scheduling policy to SCHED_FIFO while the
finger is down. This requires the SYS_NICE capability.

Change-Id: Id22c5e255e61080dc83561948ea14f5ad6ebf38f
2025-06-12 23:40:04 +00:00
Bruno Martins
641b58600b xiaomi: Document Soong options
Change-Id: If0bb874560b1a612fb747c79d8a15e4c17277025
2025-06-07 18:22:17 +01:00
Bruno Martins
6454f6c267 aidl: fingerprint: Follow pre-existing namespace convention
Change-Id: I368cfc3756c124f7025ad0ea85c138b5f7e18aa0
2025-06-07 18:15:49 +01:00
basamaryan
6785f93e35 Remove aidl/ir
More common one available in hardware/lineage/interfaces.

Change-Id: I5546cba7ef770f028f8d2222a7960d53c51f02c8
2025-05-27 10:37:37 -04:00
Arian
3bb55820e8 udfpshandler: Add authentication succeeded/failed notifications
We currently miss a call when the fingerprint gets rejected
the fifth time, and the onFingerUp method isn't called anymore.
Without handling this in the touchscreen driver, we can not
disable lhbm (ghbm should turn off fine since the udfps layer
vanishes). The onAuthentication* methods are called when the
authentication ends, allowing for a better control of the lhbm
state.

Change-Id: I5ff6b9b4692657fade4579faff33eb48c1311987
2025-05-22 15:52:00 +02:00
Arian
0b8722e673 udfpshandler: Provide default noop implementations of functions
Some devices might not require to do something in all cases.
In order to simplify adding new functions, add default
implementations such that we can add new functions without
having to add new dummy implementations to all devices
udfpshandlers.

Change-Id: I37ad23c551fd51e3ff778ac43f10dc6552d32651
2025-05-22 15:51:31 +02:00
Arian
3a4813d67b interfaces: Add prebuilt hidl interfaces declarations
All interfaces that are defined in vintf/xiaomi_framework_compatibility_matrix
for which no source is available in interfaces/ are added to the list
of prebuilt hidl interfaces to allow host_init_verifier to work
properly.

Change-Id: If6bdd313bb9ff5dc8c766f0f883f5a86c22c83ec
2025-04-06 22:33:25 +00:00
Giovanni Ricca
1300e116bc vintf: Add IMiCameraPerfService interface to FCM
Change-Id: Ib5d105ead609c9d8bff06733ca0ff5afac38a658
2025-03-30 12:30:53 +02:00
bengris32
88247d9e05 vintf: Add dtool interface
Change-Id: Ida7da820801272266f0081c16ff795b04d7d3202
Signed-off-by: bengris32 <bengris32@protonmail.ch>
2025-03-30 12:30:53 +02:00
bengris32
bb6f814a3d vintf: Add alternative citsensorservice interface
Change-Id: I056da81869f438e197e0c46a4b520124537181bc
Signed-off-by: bengris32 <bengris32@protonmail.ch>
2025-03-30 12:30:50 +02:00
Daniel Zheng
b56de4957c Revert^2 "SensorHAL: add moisture detection"
919258a5867165de9abe377f30a0b7a8fc9a2c99

Change-Id: I351625927ce9259967218565abaf56035e97674a
2025-03-09 23:11:45 +02:00
55 changed files with 755 additions and 413 deletions

View File

@@ -21,9 +21,43 @@ android_app {
required: [
"co.aospa.euicc.xml",
"hidden-api-whitelist-co.aospa.euicc.xml",
"EuiccGoogle",
],
}
android_app_import {
name: "EuiccGoogle",
owner: "xiaomi",
apk: "proprietary/product/priv-app/EuiccGoogle/EuiccGoogle.apk",
preprocessed: true,
presigned: true,
dex_preopt: {
enabled: false,
},
privileged: true,
product_specific: true,
required: [
"default-permissions-euicc.xml",
"privapp-permissions-euiccgoogle.xml",
],
}
prebuilt_etc {
sub_dir: "default-permissions",
name: "default-permissions-euicc.xml",
filename: "default-permissions-euicc.xml",
src: "default-permissions-euicc.xml",
product_specific: true,
}
prebuilt_etc {
sub_dir: "permissions",
name: "privapp-permissions-euiccgoogle.xml",
filename: "privapp-permissions-euiccgoogle.xml",
src: "privapp-permissions-euiccgoogle.xml",
product_specific: true,
}
prebuilt_etc {
sub_dir: "permissions",
name: "co.aospa.euicc.xml",

View File

@@ -0,0 +1,40 @@
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<!-- Copyright (C) 2019 Google Inc.
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.
-->
<!--
This file contains permissions to be granted by default. Default
permissions are granted to special platform components and to apps
that are approved to get default grants. The special components
are apps that are expected tto work out-of-the-box as they provide
core use cases such as default dialer, default email, etc. These
grants are managed by the platform. The apps that are additionally
approved for default grants are ones that provide carrier specific
functionality, ones legally required at some location, ones providing
alternative disclosure and opt-out UI, ones providing highlight features
of a dedicated device, etc. This file contains only the latter exceptions.
Fixed permissions cannot be controlled by the user and need a special
approval. Typically these are to ensure either legally mandated functions
or the app is considered a part of the OS.
-->
<exceptions>
<exception
package="com.google.android.euicc">
<!-- Notifications -->
<permission name="android.permission.POST_NOTIFICATIONS" fixed="false"/>
</exception>
</exceptions>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<privapp-permissions package="com.google.android.euicc">
<permission name="android.permission.ACCESS_NETWORK_STATE"/>
<permission name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"/>
<permission name="android.permission.FOREGROUND_SERVICE"/>
<permission name="android.permission.MODIFY_PHONE_STATE"/>
<permission name="android.permission.INTERNET"/>
<permission name="android.permission.READ_PRIVILEGED_PHONE_STATE"/>
<permission name="android.permission.REBOOT"/>
<permission name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<permission name="android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND"/>
<permission name="android.permission.VIBRATE"/>
<permission name="android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS"/>
<permission name="android.permission.WRITE_SECURE_SETTINGS"/>
<permission name="com.android.permission.INSTALL_EXISTING_PACKAGES"/>
<permission name="com.android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS"/>
<permission name="com.android.permission.INSTALL_EXISTING_PACKAGES" />
<permission name="android.permission.START_ACTIVITIES_FROM_BACKGROUND"/>
<permission name="android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS"/>
<permission name="android.permission.READ_NETWORK_USAGE_HISTORY"/>
<permission name="com.google.android.setupwizard.SETUP_COMPAT_SERVICE"/>
<permission name="com.google.android.permission.USE_GRIL" />
</privapp-permissions>
</permissions>

View File

@@ -4,6 +4,6 @@
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="sim_illustration_lottie_mappings_json">{\"sim_illustration_lottie_mappings\":[{\"devices\":[\"diting\"],\"illustration_lottie\":\"sim_illustration_lottie_bottom\"}]}</string>
<string name="sim_slot_mappings_json">{\"sim-slot-mappings\":[{\"devices\":[\"diting\"],\"esim-slot-ids\":[1],\"psim-slot-ids\":[0]}]}</string>
<string name="sim_illustration_lottie_mappings_json">{\"sim_illustration_lottie_mappings\":[{\"devices\":[\"diting\",\"ziyi\",\"nuwa\",\"fuxi\"],\"illustration_lottie\":\"sim_illustration_lottie_bottom\"}]}</string>
<string name="sim_slot_mappings_json">{\"sim-slot-mappings\":[{\"devices\":[\"diting\",\"ziyi\",\"nuwa\",\"fuxi\"],\"esim-slot-ids\":[1],\"psim-slot-ids\":[0]}]}</string>
</resources>

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2024 The LineageOS Project
* SPDX-FileCopyrightText: 2022-2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
@@ -46,11 +46,11 @@ class IfaaService : Service() {
override fun startBIOManager(authType: Int) = when (authType) {
AUTH_TYPE_FINGERPRINT -> {
val intent = Intent(Settings.ACTION_SECURITY_SETTINGS).apply {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
applicationContext.startActivity(intent)
applicationContext.startActivity(
Intent(Settings.ACTION_SECURITY_SETTINGS).apply {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
)
COMMAND_OK
}

10
README.md Normal file
View File

@@ -0,0 +1,10 @@
# hardware/xiaomi
## Soong options
| Namespace | Variable | Description | Default |
| --------- | -------- | ----------- | ------- |
| XIAOMI_BIOMETRICS_FINGERPRINT | RUN_32BIT | Opt to run service in 32-bit mode only | false |
| XIAOMI_TOUCH | HIGH_TOUCH_POLLING_PATH | HighTouchPollingRate feature control path | |
| XIAOMI_TOUCH | KEY_DISABLER_CONTROL_PATH | KeyDisabler feature control path | |
| XIAOMI_TOUCH | KEY_SWAPPER_CONTROL_PATH | KeySwapper feature control path | |

View File

@@ -1,5 +1,5 @@
//
// Copyright (C) 2024 The LineageOS Project
// Copyright (C) 2024-2025 The LineageOS Project
// 2024 Paranoid Android
//
// SPDX-License-Identifier: Apache-2.0
@@ -8,9 +8,9 @@
soong_config_module_type {
name: "xiaomi_hardware_biometrics_config_default",
module_type: "cc_defaults",
config_namespace: "xiaomi_hardware_biometrics",
config_namespace: "XIAOMI_BIOMETRICS_FINGERPRINT",
bool_variables: [
"run_32bit",
"RUN_32BIT",
],
properties: ["compile_multilib"],
}
@@ -19,7 +19,7 @@ xiaomi_hardware_biometrics_config_default {
name: "xiaomi_hardware_biometrics_config_default",
soong_config_variables: {
run_32bit: {
RUN_32BIT: {
conditions_default: {
compile_multilib: "64",
},

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
* 2024 Paranoid Android
*
* SPDX-License-Identifier: Apache-2.0
@@ -12,8 +12,11 @@
#include "util/Util.h"
#include <android-base/logging.h>
#include <android-base/properties.h>
#include <android-base/strings.h>
using ::android::base::SetProperty;
namespace aidl::android::hardware::biometrics::fingerprint {
namespace {
@@ -67,15 +70,19 @@ Fingerprint::Fingerprint(std::shared_ptr<FingerprintConfig> config) : mConfig(st
}
ALOGI("Opened fingerprint HAL, class: %s, module_id: %s", class_name.c_str(),
class_module_id.c_str());
SetProperty("persist.vendor.sys.fp.vendor", class_name);
break;
}
if (!mDevice) {
ALOGE("Can't open any fingerprint HAL module");
SetProperty("persist.vendor.sys.fp.vendor", "none");
}
}
std::string sensorTypeProp = mConfig->get<std::string>("type");
if (sensorTypeProp == "udfps" || sensorTypeProp == "udfps_optical") {
SetProperty("ro.hardware.fp.udfps", "true");
if (sensorTypeProp == "udfps") {
mSensorType = FingerprintSensorType::UNDER_DISPLAY_ULTRASONIC;
} else {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -364,9 +364,15 @@ void Session::notify(const fingerprint_msg_t* msg) {
HardwareAuthToken authToken;
translate(hat, authToken);
if (mUdfpsHandler) {
mUdfpsHandler->onAuthenticationSucceeded();
}
mCb->onAuthenticationSucceeded(msg->data.authenticated.finger.fid, authToken);
mLockoutTracker.reset(true);
} else {
if (mUdfpsHandler) {
mUdfpsHandler->onAuthenticationFailed();
}
mCb->onAuthenticationFailed();
mLockoutTracker.addFailedAttempt();
checkSensorLockout();

View File

@@ -5,5 +5,5 @@ service vendor.fingerprint-default /vendor/bin/hw/android.hardware.biometrics.fi
class late_start
user system
group system input uhid
capabilities SYS_NICE
shutdown critical
task_profiles ProcessCapacityHigh MaxPerformance

View File

@@ -1,21 +0,0 @@
//
// SPDX-FileCopyrightText: 2024 The LineageOS Project
// SPDX-License-Identifier: Apache-2.0
//
cc_binary {
name: "android.hardware.ir-service.xiaomi",
relative_install_path: "hw",
vendor: true,
init_rc: ["android.hardware.ir-service.xiaomi.rc"],
vintf_fragments: ["android.hardware.ir-service.xiaomi.xml"],
srcs: [
"ConsumerIr.cpp",
"service.cpp",
],
shared_libs: [
"libbase",
"libbinder_ndk",
"android.hardware.ir-V1-ndk",
],
}

View File

@@ -1,80 +0,0 @@
/*
* SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#define LOG_TAG "ConsumerIr"
#include "ConsumerIr.h"
#include <android-base/logging.h>
#include <fcntl.h>
#include <linux/lirc.h>
#include <string>
using std::vector;
namespace aidl {
namespace android {
namespace hardware {
namespace ir {
static const std::string kIrDevice = "/dev/lirc0";
static vector<ConsumerIrFreqRange> kRangeVec{
{.minHz = 30000, .maxHz = 60000},
};
::ndk::ScopedAStatus ConsumerIr::getCarrierFreqs(vector<ConsumerIrFreqRange>* _aidl_return) {
*_aidl_return = kRangeVec;
return ::ndk::ScopedAStatus::ok();
}
::ndk::ScopedAStatus ConsumerIr::transmit(int32_t carrierFreqHz, const vector<int32_t>& pattern) {
size_t entries = pattern.size();
if (entries == 0) {
return ::ndk::ScopedAStatus::ok();
}
int fd = open(kIrDevice.c_str(), O_RDWR);
if (fd < 0) {
LOG(ERROR) << "Failed to open " << kIrDevice << ", error " << fd;
return ::ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
int rc = ioctl(fd, LIRC_SET_SEND_CARRIER, &carrierFreqHz);
if (rc < 0) {
LOG(ERROR) << "Failed to set carrier " << carrierFreqHz << ", error: " << errno;
close(fd);
return ::ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
if ((entries & 1) != 0) {
rc = write(fd, pattern.data(), entries * sizeof(int32_t));
} else {
rc = write(fd, pattern.data(), (entries - 1) * sizeof(int32_t));
usleep(pattern[entries - 1]);
}
if (rc < 0) {
LOG(ERROR) << "Failed to write pattern, " << entries << " entries, error: " << errno;
close(fd);
return ::ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
close(fd);
return ::ndk::ScopedAStatus::ok();
}
} // namespace ir
} // namespace hardware
} // namespace android
} // namespace aidl

View File

@@ -1,27 +0,0 @@
/*
* SPDX-FileCopyrightText: 2024 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <aidl/android/hardware/ir/BnConsumerIr.h>
namespace aidl {
namespace android {
namespace hardware {
namespace ir {
class ConsumerIr : public BnConsumerIr {
public:
::ndk::ScopedAStatus getCarrierFreqs(
::std::vector<::aidl::android::hardware::ir::ConsumerIrFreqRange>* _aidl_return)
override;
::ndk::ScopedAStatus transmit(int32_t carrierFreqHz,
const ::std::vector<int32_t>& pattern) override;
};
} // namespace ir
} // namespace hardware
} // namespace android
} // namespace aidl

View File

@@ -1,14 +0,0 @@
#
# SPDX-FileCopyrightText: 2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
on early-boot
# IR device
chown system system /dev/lirc0
service vendor.ir-default /vendor/bin/hw/android.hardware.ir-service.xiaomi
class hal
user system
group system
shutdown critical

View File

@@ -1,11 +0,0 @@
<!--
SPDX-FileCopyrightText: 2024 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.ir</name>
<version>1</version>
<fqname>IConsumerIr/default</fqname>
</hal>
</manifest>

View File

@@ -1,24 +0,0 @@
/*
* SPDX-FileCopyrightText: 2024 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#include "ConsumerIr.h"
#include <android-base/logging.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
using aidl::android::hardware::ir::ConsumerIr;
int main() {
ABinderProcess_setThreadPoolMaxThreadCount(0);
std::shared_ptr<ConsumerIr> hal = ::ndk::SharedRefBase::make<ConsumerIr>();
const std::string instance = std::string(ConsumerIr::descriptor) + "/default";
binder_status_t status = AServiceManager_addService(hal->asBinder().get(), instance.c_str());
CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
}

View File

@@ -38,7 +38,7 @@ cc_binary {
"android.hardware.sensors@2.0-ScopedWakelock",
"android.hardware.sensors@2.0",
"android.hardware.sensors@2.1",
"android.hardware.sensors-V2-ndk",
"android.hardware.sensors-V3-ndk",
"libbase",
"libcutils",
"libfmq",

View File

@@ -17,7 +17,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.sensors</name>
<version>2</version>
<version>3</version>
<fqname>ISensors/default</fqname>
</hal>
</manifest>

48
aidl/touch/Android.bp Normal file
View File

@@ -0,0 +1,48 @@
//
// SPDX-FileCopyrightText: 2025 The LineageOS Project
// SPDX-License-Identifier: Apache-2.0
//
cc_binary {
name: "vendor.lineage.touch-service.xiaomi",
init_rc: ["vendor.lineage.touch-service.xiaomi.rc"],
vintf_fragments: select(soong_config_variable("XIAOMI_TOUCH", "HIGH_TOUCH_POLLING_PATH"), {
any: ["vendor.lineage.touch-service.xiaomi-htpr.xml"],
default: [],
}) + select(soong_config_variable("XIAOMI_TOUCH", "KEY_DISABLER_CONTROL_PATH"), {
any: ["vendor.lineage.touch-service.xiaomi-kd.xml"],
default: [],
}) + select(soong_config_variable("XIAOMI_TOUCH", "KEY_SWAPPER_CONTROL_PATH"), {
any: ["vendor.lineage.touch-service.xiaomi-ks.xml"],
default: [],
}),
relative_install_path: "hw",
proprietary: true,
cppflags: select(soong_config_variable("XIAOMI_TOUCH", "HIGH_TOUCH_POLLING_PATH"), {
any @ flag_val: ["-DHTPR_CONTROL_PATH=\"" + flag_val + "\""],
default: [],
}) + select(soong_config_variable("XIAOMI_TOUCH", "KEY_DISABLER_CONTROL_PATH"), {
any @ flag_val: ["-DKD_CONTROL_PATH=\"" + flag_val + "\""],
default: [],
}) + select(soong_config_variable("XIAOMI_TOUCH", "KEY_SWAPPER_CONTROL_PATH"), {
any @ flag_val: ["-DKS_CONTROL_PATH=\"" + flag_val + "\""],
default: [],
}),
srcs: select(soong_config_variable("XIAOMI_TOUCH", "HIGH_TOUCH_POLLING_PATH"), {
any: ["HighTouchPollingRate.cpp"],
default: [],
}) + select(soong_config_variable("XIAOMI_TOUCH", "KEY_DISABLER_CONTROL_PATH"), {
any: ["KeyDisabler.cpp"],
default: [],
}) + select(soong_config_variable("XIAOMI_TOUCH", "KEY_SWAPPER_CONTROL_PATH"), {
any: ["KeySwapper.cpp"],
default: [],
}) + ["service.cpp"],
shared_libs: [
"libbase",
"libbinder_ndk",
"liblog",
"libutils",
"vendor.lineage.touch-V1-ndk",
],
}

View File

@@ -0,0 +1,46 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#define LOG_TAG "vendor.lineage.touch-service.xiaomi"
#include "HighTouchPollingRate.h"
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/strings.h>
using ::android::base::ReadFileToString;
using ::android::base::Trim;
using ::android::base::WriteStringToFile;
namespace aidl {
namespace vendor {
namespace lineage {
namespace touch {
ndk::ScopedAStatus HighTouchPollingRate::getEnabled(bool* _aidl_return) {
std::string buf;
if (!ReadFileToString(HTPR_CONTROL_PATH, &buf)) {
LOG(ERROR) << "Failed to read current HighTouchPollingRate state";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
*_aidl_return = Trim(buf) == "1";
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus HighTouchPollingRate::setEnabled(bool enabled) {
if (!WriteStringToFile(enabled ? "1" : "0", HTPR_CONTROL_PATH)) {
LOG(ERROR) << "Failed to write HighTouchPollingRate state";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
return ndk::ScopedAStatus::ok();
}
} // namespace touch
} // namespace lineage
} // namespace vendor
} // namespace aidl

View File

@@ -0,0 +1,24 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <aidl/vendor/lineage/touch/BnHighTouchPollingRate.h>
namespace aidl {
namespace vendor {
namespace lineage {
namespace touch {
class HighTouchPollingRate : public BnHighTouchPollingRate {
public:
ndk::ScopedAStatus getEnabled(bool* _aidl_return) override;
ndk::ScopedAStatus setEnabled(bool enabled) override;
};
} // namespace touch
} // namespace lineage
} // namespace vendor
} // namespace aidl

View File

@@ -0,0 +1,46 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#define LOG_TAG "vendor.lineage.touch-service.xiaomi"
#include "KeyDisabler.h"
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/strings.h>
using ::android::base::ReadFileToString;
using ::android::base::Trim;
using ::android::base::WriteStringToFile;
namespace aidl {
namespace vendor {
namespace lineage {
namespace touch {
ndk::ScopedAStatus KeyDisabler::getEnabled(bool* _aidl_return) {
std::string buf;
if (!ReadFileToString(KD_CONTROL_PATH, &buf)) {
LOG(ERROR) << "Failed to read current KeyDisabler state";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
*_aidl_return = Trim(buf) == "0";
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus KeyDisabler::setEnabled(bool enabled) {
if (!WriteStringToFile(enabled ? "0" : "1", KD_CONTROL_PATH, true)) {
LOG(ERROR) << "Failed to write KeyDisabler state";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
return ndk::ScopedAStatus::ok();
}
} // namespace touch
} // namespace lineage
} // namespace vendor
} // namespace aidl

24
aidl/touch/KeyDisabler.h Normal file
View File

@@ -0,0 +1,24 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <aidl/vendor/lineage/touch/BnKeyDisabler.h>
namespace aidl {
namespace vendor {
namespace lineage {
namespace touch {
class KeyDisabler : public BnKeyDisabler {
public:
ndk::ScopedAStatus getEnabled(bool* _aidl_return) override;
ndk::ScopedAStatus setEnabled(bool enabled) override;
};
} // namespace touch
} // namespace lineage
} // namespace vendor
} // namespace aidl

46
aidl/touch/KeySwapper.cpp Normal file
View File

@@ -0,0 +1,46 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#define LOG_TAG "vendor.lineage.touch-service.xiaomi"
#include "KeySwapper.h"
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/strings.h>
using ::android::base::ReadFileToString;
using ::android::base::Trim;
using ::android::base::WriteStringToFile;
namespace aidl {
namespace vendor {
namespace lineage {
namespace touch {
ndk::ScopedAStatus KeySwapper::getEnabled(bool* _aidl_return) {
std::string buf;
if (!ReadFileToString(KS_CONTROL_PATH, &buf)) {
LOG(ERROR) << "Failed to read current KeySwapper state";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
*_aidl_return = Trim(buf) == "1";
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus KeySwapper::setEnabled(bool enabled) {
if (!WriteStringToFile(enabled ? "1" : "0", KS_CONTROL_PATH, true)) {
LOG(ERROR) << "Failed to write KeySwapper state";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
return ndk::ScopedAStatus::ok();
}
} // namespace touch
} // namespace lineage
} // namespace vendor
} // namespace aidl

24
aidl/touch/KeySwapper.h Normal file
View File

@@ -0,0 +1,24 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <aidl/vendor/lineage/touch/BnKeySwapper.h>
namespace aidl {
namespace vendor {
namespace lineage {
namespace touch {
class KeySwapper : public BnKeySwapper {
public:
ndk::ScopedAStatus getEnabled(bool* _aidl_return) override;
ndk::ScopedAStatus setEnabled(bool enabled) override;
};
} // namespace touch
} // namespace lineage
} // namespace vendor
} // namespace aidl

48
aidl/touch/service.cpp Normal file
View File

@@ -0,0 +1,48 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#define LOG_TAG "vendor.lineage.touch-service.xiaomi"
#include "HighTouchPollingRate.h"
#include "KeyDisabler.h"
#include "KeySwapper.h"
#include <android-base/logging.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
using aidl::vendor::lineage::touch::HighTouchPollingRate;
using aidl::vendor::lineage::touch::KeyDisabler;
using aidl::vendor::lineage::touch::KeySwapper;
int main() {
binder_status_t status = STATUS_OK;
ABinderProcess_setThreadPoolMaxThreadCount(0);
#ifdef HTPR_CONTROL_PATH
std::shared_ptr<HighTouchPollingRate> htpr = ndk::SharedRefBase::make<HighTouchPollingRate>();
const std::string htpr_instance = std::string(HighTouchPollingRate::descriptor) + "/default";
status = AServiceManager_addService(htpr->asBinder().get(), htpr_instance.c_str());
CHECK_EQ(status, STATUS_OK) << "Failed to add service " << htpr_instance << " " << status;
#endif
#ifdef KD_CONTROL_PATH
std::shared_ptr<KeyDisabler> kd = ndk::SharedRefBase::make<KeyDisabler>();
const std::string kd_instance = std::string(KeyDisabler::descriptor) + "/default";
status = AServiceManager_addService(kd->asBinder().get(), kd_instance.c_str());
CHECK_EQ(status, STATUS_OK) << "Failed to add service " << kd_instance << " " << status;
#endif
#ifdef KS_CONTROL_PATH
std::shared_ptr<KeySwapper> ks = ndk::SharedRefBase::make<KeySwapper>();
const std::string ks_instance = std::string(KeySwapper::descriptor) + "/default";
status = AServiceManager_addService(ks->asBinder().get(), ks_instance.c_str());
CHECK_EQ(status, STATUS_OK) << "Failed to add service " << ks_instance << " " << status;
#endif
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
}

View File

@@ -1,8 +1,7 @@
<manifest version="1.0" type="device">
<hal format="hidl">
<hal format="aidl">
<name>vendor.lineage.touch</name>
<transport>hwbinder</transport>
<version>1.0</version>
<version>1</version>
<interface>
<name>IHighTouchPollingRate</name>
<instance>default</instance>

View File

@@ -0,0 +1,10 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>vendor.lineage.touch</name>
<version>1</version>
<interface>
<name>IKeyDisabler</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View File

@@ -0,0 +1,10 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>vendor.lineage.touch</name>
<version>1</version>
<interface>
<name>IKeySwapper</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View File

@@ -0,0 +1,4 @@
service vendor.touch-hal /vendor/bin/hw/vendor.lineage.touch-service.xiaomi
class hal
user system
group system

View File

@@ -10,7 +10,8 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:label="@string/dolby_title"
android:persistent="true">
@@ -36,6 +37,10 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.CATEGORY_CONTENT_MUSIC" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.sound" />
<meta-data android:name="com.android.settings.summary_uri"

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<vector android:height="108.0dip" android:width="108.0dip" android:viewportWidth="108.0" android:viewportHeight="108.0"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt">
<group android:scaleX="1.3544992" android:scaleY="1.3544992" android:translateX="-23.22" android:translateY="-23.22">
<group>
<clip-path android:pathData="M57.01,57.01m-54,0a54,54 0,1 1,108 0a54,54 0,1 1,-108 0" />
<path android:fillColor="#ffeaedef" android:pathData="M-1.9,-1.9h117.82v117.82h-117.82z" />
<path android:fillColor="@drawable/ic_launcher_background__0" android:pathData="M-1.9,115.92l0,-117.82l117.82,0l-117.82,117.82z" />
<path android:fillColor="@drawable/ic_launcher_background__1" android:pathData="M-1.9,-1.9h117.82v117.82h-117.82z" android:strokeAlpha="0.2" android:fillAlpha="0.2" />
</group>
</group>
</vector>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<gradient android:angle="0.0" android:type="linear" android:startX="57.01" android:startY="56.4" android:endX="57.01" android:endY="-1.58"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt">
<item android:color="#ffffffff" android:offset="0.0" />
<item android:color="#fff3f5f6" android:offset="1.0" />
</gradient>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<gradient android:angle="0.0" android:type="linear" android:startX="-1.9" android:startY="115.92" android:endX="115.92" android:endY="-1.9"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt">
<item android:color="#ff80d0ce" android:offset="0.0" />
<item android:color="#ff9fa8da" android:offset="1.0" />
</gradient>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<vector android:height="108.0dip" android:width="108.0dip" android:viewportWidth="108.0" android:viewportHeight="108.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<group android:scaleX="0.84" android:scaleY="0.84" android:translateX="23.76" android:translateY="23.76">
<path android:fillColor="#ff465461" android:pathData="M12,19.13h5a16.87,16.87 0,0 1,0 33.74H12Z" />
<path android:fillColor="#ff465461" android:pathData="M60,52.87H55a16.87,16.87 0,0 1,0 -33.74h5Z" />
</group>
</vector>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="108dp" android:width="108dp" android:viewportWidth="108" android:viewportHeight="108">
<path android:fillColor="#000000" android:pathData="M36.6305484,38 C45.6078241,38.1592687 52.837468,45.7082857 52.837468,54.9974325 C52.837468,64.2865794 45.6078241,71.8355964 36.6307694,71.9948651 L32,72 L32,38 L36.6305484,38 Z M36.999,43.017 L36.999,66.977 L37.1225728,66.9701894 C42.9872179,66.559014 47.6837958,61.5395304 47.8337726,55.3050128 L47.837468,54.9974325 C47.837468,48.6211219 43.0833381,43.4425908 37.1223719,43.0246757 L36.999,43.017 Z M71.3694516,38 C62.3921759,38.1592687 55.162532,45.7082857 55.162532,54.9974325 C55.162532,64.2865794 62.3921759,71.8355964 71.3692306,71.9948651 L76,72 L76,38 L71.3694516,38 Z M71.000532,43.017 L71.000532,66.977 L70.8774272,66.9701894 C65.0127821,66.559014 60.3162042,61.5395304 60.1662274,55.3050128 L60.162532,54.9974325 C60.162532,48.6211219 64.9166619,43.4425908 70.8776281,43.0246757 L71.000532,43.017 Z" android:strokeWidth="1"/>
</vector>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_mono" />
</adaptive-icon>

View File

@@ -17,7 +17,7 @@ class DolbyActivity : CollapsingToolbarBaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
fragmentManager.beginTransaction()
.replace(com.android.settingslib.collapsingtoolbar.R.id.content_frame, DolbySettingsFragment(), TAG)
.commit()
.replace(com.android.settingslib.collapsingtoolbar.R.id.content_frame, DolbySettingsFragment(), TAG)
.commit()
}
}

View File

@@ -23,7 +23,7 @@ internal class DolbyController private constructor(
private val context: Context
) {
private var dolbyEffect = DolbyAudioEffect(EFFECT_PRIORITY, audioSession = 0)
private val audioManager = context.getSystemService(AudioManager::class.java)
private val audioManager = context.getSystemService(AudioManager::class.java)!!
private val handler = Handler(context.mainLooper)
// Restore current profile on every media session
@@ -57,10 +57,10 @@ internal class DolbyController private constructor(
field = value
dlog(TAG, "setRegisterCallbacks($value)")
if (value) {
audioManager!!.registerAudioPlaybackCallback(playbackCallback, handler)
audioManager.registerAudioPlaybackCallback(playbackCallback, handler)
audioManager.registerAudioDeviceCallback(audioDeviceCallback, handler)
} else {
audioManager!!.unregisterAudioPlaybackCallback(playbackCallback)
audioManager.unregisterAudioPlaybackCallback(playbackCallback)
audioManager.unregisterAudioDeviceCallback(audioDeviceCallback)
}
}
@@ -102,13 +102,13 @@ internal class DolbyController private constructor(
dsOn = prefs.getBoolean(DolbyConstants.PREF_ENABLE, true)
context.resources.getStringArray(R.array.dolby_profile_values)
.map { it.toInt() }
.forEach { profile ->
// Reset dolby first to prevent it from loading bad settings
dolbyEffect.resetProfileSpecificSettings(profile)
// Now restore our profile-specific settings
restoreSettings(profile)
}
.map { it.toInt() }
.forEach { profile ->
// Reset dolby first to prevent it from loading bad settings
dolbyEffect.resetProfileSpecificSettings(profile)
// Now restore our profile-specific settings
restoreSettings(profile)
}
// Finally restore the current profile.
setCurrentProfile()
@@ -174,6 +174,13 @@ internal class DolbyController private constructor(
profile = prefs.getString(DolbyConstants.PREF_PROFILE, "0" /*dynamic*/)!!.toInt()
}
fun setDsOnAndPersist(dsOn: Boolean) {
this.dsOn = dsOn
PreferenceManager.getDefaultSharedPreferences(context).edit()
.putBoolean(DolbyConstants.PREF_ENABLE, dsOn)
.apply()
}
fun getProfileName(): String? {
val profile = dolbyEffect.profile.toString()
val profiles = context.resources.getStringArray(R.array.dolby_profile_values)
@@ -202,8 +209,8 @@ internal class DolbyController private constructor(
dlog(TAG, "setPreset: $value")
checkEffect()
val gains = value.split(",")
.map { it.toInt() }
.toIntArray()
.map { it.toInt() }
.toIntArray()
dolbyEffect.setDapParameter(DsParam.GEQ_BAND_GAINS, gains, profile)
}

View File

@@ -26,7 +26,7 @@ class DolbyTileService : TileService() {
override fun onClick() {
val isDsOn = dolbyController.dsOn
dolbyController.dsOn = !isDsOn
dolbyController.setDsOnAndPersist(!isDsOn) // toggle
qsTile.apply {
state = if (isDsOn) Tile.STATE_INACTIVE else Tile.STATE_ACTIVE
updateTile()

View File

@@ -58,13 +58,14 @@ class SummaryProvider : ContentProvider() {
): Int = 0
private fun getDolbySummary(): String {
val dolbyController = DolbyController.getInstance(context!!)
val context = context!!
val dolbyController = DolbyController.getInstance(context)
if (!dolbyController.dsOn) {
return context!!.getString(R.string.dolby_off)
return context.getString(R.string.dolby_off)
}
return dolbyController.getProfileName()?.let {
context!!.getString(R.string.dolby_on_with_profile, it)
} ?: context!!.getString(R.string.dolby_on)
context.getString(R.string.dolby_on_with_profile, it)
} ?: context.getString(R.string.dolby_on)
}
}

View File

@@ -27,7 +27,7 @@ fun TooltipIconButton(
onClick: () -> Unit
) {
TooltipBox(
positionProvider = TooltipDefaults.rememberPlainTooltipPositionProvider(),
positionProvider = TooltipDefaults.rememberTooltipPositionProvider(),
tooltip = {
Text(text)
},

View File

@@ -40,24 +40,24 @@ class DolbyPreferenceStore(
override fun putBoolean(key: String, value: Boolean) =
getSharedPreferences(key).edit()
.putBoolean(key, value)
.apply()
.putBoolean(key, value)
.apply()
override fun getBoolean(key: String, defValue: Boolean) =
getSharedPreferences(key).getBoolean(key, defValue)
override fun putInt(key: String, value: Int) =
getSharedPreferences(key).edit()
.putInt(key, value)
.apply()
.putInt(key, value)
.apply()
override fun getInt(key: String, defValue: Int) =
getSharedPreferences(key).getInt(key, defValue)
override fun putString(key: String, value: String?) =
getSharedPreferences(key).edit()
.putString(key, value)
.apply()
.putString(key, value)
.apply()
override fun getString(key: String, defValue: String?) =
getSharedPreferences(key).getString(key, defValue)

View File

@@ -13,6 +13,7 @@ import android.media.AudioManager
import android.os.Bundle
import android.os.Handler
import android.widget.CompoundButton
import android.widget.CompoundButton.OnCheckedChangeListener
import android.widget.Toast
import androidx.preference.ListPreference
import androidx.preference.Preference
@@ -37,7 +38,7 @@ import co.aospa.dolby.xiaomi.R
import com.android.settingslib.widget.MainSwitchPreference
class DolbySettingsFragment : PreferenceFragment(),
OnPreferenceChangeListener, CompoundButton.OnCheckedChangeListener {
OnPreferenceChangeListener, OnCheckedChangeListener {
private val switchBar by lazy {
findPreference<MainSwitchPreference>(PREF_ENABLE)!!
@@ -74,7 +75,7 @@ class DolbySettingsFragment : PreferenceFragment(),
}
private val dolbyController by lazy { DolbyController.getInstance(context) }
private val audioManager by lazy { context.getSystemService(AudioManager::class.java) }
private val audioManager by lazy { context.getSystemService(AudioManager::class.java)!! }
private val handler = Handler()
private var isOnSpeaker = true
@@ -141,14 +142,14 @@ class DolbySettingsFragment : PreferenceFragment(),
true
}
audioManager!!.registerAudioDeviceCallback(audioDeviceCallback, handler)
audioManager.registerAudioDeviceCallback(audioDeviceCallback, handler)
updateSpeakerState()
updateProfileSpecificPrefs()
}
override fun onDestroyView() {
dlog(TAG, "onDestroyView")
audioManager!!.unregisterAudioDeviceCallback(audioDeviceCallback)
audioManager.unregisterAudioDeviceCallback(audioDeviceCallback)
super.onDestroyView()
}
@@ -209,7 +210,7 @@ class DolbySettingsFragment : PreferenceFragment(),
}
private fun updateSpeakerState() {
val device = audioManager!!.getDevicesForAttributes(ATTRIBUTES_MEDIA)[0]
val device = audioManager.getDevicesForAttributes(ATTRIBUTES_MEDIA)[0]
isOnSpeaker = (device.type == AudioDeviceInfo.TYPE_BUILTIN_SPEAKER)
}
@@ -299,7 +300,7 @@ class DolbySettingsFragment : PreferenceFragment(),
companion object {
private const val TAG = "DolbySettingsFragment"
private val ATTRIBUTES_MEDIA = AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_MEDIA)
.build()
.setUsage(AudioAttributes.USAGE_MEDIA)
.build()
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 The LineageOS Project
* Copyright (C) 2022,2025 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -13,12 +13,14 @@ class UdfpsHandler {
public:
virtual ~UdfpsHandler() = default;
virtual void init(fingerprint_device_t* device) = 0;
virtual void onFingerDown(uint32_t x, uint32_t y, float minor, float major) = 0;
virtual void onFingerUp() = 0;
virtual void init(fingerprint_device_t* device) {};
virtual void onFingerDown(uint32_t x, uint32_t y, float minor, float major) {};
virtual void onFingerUp() {};
virtual void onAcquired(int32_t result, int32_t vendorCode) = 0;
virtual void cancel() = 0;
virtual void onAcquired(int32_t result, int32_t vendorCode) {};
virtual void onAuthenticationSucceeded() {};
virtual void onAuthenticationFailed() {};
virtual void cancel() {};
};
struct UdfpsHandlerFactory {

View File

@@ -1,45 +0,0 @@
//
// Copyright (C) 2022 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
soong_config_module_type {
name: "xiaomi_touch_hal_cc_defaults",
module_type: "cc_defaults",
config_namespace: "XIAOMI_TOUCH",
value_variables: ["HIGH_TOUCH_POLLING_PATH"],
properties: ["cppflags"],
}
xiaomi_touch_hal_cc_defaults {
name: "xiaomi_touch_hal_defaults",
soong_config_variables: {
HIGH_TOUCH_POLLING_PATH: {
cppflags: ["-DHIGH_TOUCH_POLLING_PATH=\"%s\""],
},
},
}
cc_binary {
name: "vendor.lineage.touch@1.0-service.xiaomi",
defaults: [
"hidl_defaults",
"xiaomi_touch_hal_defaults",
],
vintf_fragments: ["vendor.lineage.touch@1.0-service.xiaomi.xml"],
init_rc: ["vendor.lineage.touch@1.0-service.xiaomi.rc"],
relative_install_path: "hw",
proprietary: true,
srcs: [
"HighTouchPollingRate.cpp",
"service.cpp",
],
shared_libs: [
"libbase",
"libbinder",
"libhidlbase",
"libutils",
"vendor.lineage.touch@1.0",
],
}

View File

@@ -1,37 +0,0 @@
/*
* Copyright (C) 2022 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#define LOG_TAG "HighTouchPollingRateService"
#include "HighTouchPollingRate.h"
#include <fstream>
namespace vendor {
namespace lineage {
namespace touch {
namespace V1_0 {
namespace implementation {
Return<bool> HighTouchPollingRate::isEnabled() {
std::ifstream file(HIGH_TOUCH_POLLING_PATH);
int enabled;
file >> enabled;
return enabled == 1;
}
Return<bool> HighTouchPollingRate::setEnabled(bool enabled) {
std::ofstream file(HIGH_TOUCH_POLLING_PATH);
file << (enabled ? "1" : "0");
return !file.fail();
}
} // namespace implementation
} // namespace V1_0
} // namespace touch
} // namespace lineage
} // namespace vendor

View File

@@ -1,30 +0,0 @@
/*
* Copyright (C) 2022 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <vendor/lineage/touch/1.0/IHighTouchPollingRate.h>
namespace vendor {
namespace lineage {
namespace touch {
namespace V1_0 {
namespace implementation {
using ::android::hardware::Return;
class HighTouchPollingRate : public IHighTouchPollingRate {
public:
// Methods from ::vendor::lineage::touch::V1_0::IHighTouchPollingRate follow.
Return<bool> isEnabled() override;
Return<bool> setEnabled(bool enabled) override;
};
} // namespace implementation
} // namespace V1_0
} // namespace touch
} // namespace lineage
} // namespace vendor

View File

@@ -1,33 +0,0 @@
/*
* Copyright (C) 2022 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#define LOG_TAG "lineage.touch@1.0-service.xiaomi"
#include <android-base/logging.h>
#include <hidl/HidlTransportSupport.h>
#include "HighTouchPollingRate.h"
using ::vendor::lineage::touch::V1_0::IHighTouchPollingRate;
using ::vendor::lineage::touch::V1_0::implementation::HighTouchPollingRate;
int main() {
android::sp<IHighTouchPollingRate> highTouchPollingRate = new HighTouchPollingRate();
android::hardware::configureRpcThreadpool(1, true);
if (highTouchPollingRate->registerAsService() != android::OK) {
LOG(ERROR) << "Cannot register touchscreen high polling rate HAL service.";
return 1;
}
LOG(INFO) << "Touchscreen HAL service ready.";
android::hardware::joinRpcThreadpool();
LOG(ERROR) << "Touchscreen HAL service failed to join thread pool.";
return 1;
}

View File

@@ -1,5 +0,0 @@
service vendor.touch-hal-1-0 /vendor/bin/hw/vendor.lineage.touch@1.0-service.xiaomi
interface vendor.lineage.touch@1.0::IHighTouchPollingRate default
class hal
user system
group system

View File

@@ -1,3 +1,8 @@
//
// SPDX-FileCopyrightText: 2020-2025 The LineageOS Project
// SPDX-License-Identifier: Apache-2.0
//
hidl_package_root {
name: "com.fingerprints",
path: "hardware/xiaomi/interfaces/fingerprints",
@@ -12,3 +17,129 @@ hidl_package_root {
name: "vendor.xiaomi",
path: "hardware/xiaomi/interfaces/xiaomi",
}
prebuilt_hidl_interfaces {
name: "hidl_com_fingerprints_extension_interface",
interfaces: [
"com.fingerprints.extension@3.0::IFingerprintAuthenticator",
"com.fingerprints.extension@3.0::IFingerprintCalibration",
"com.fingerprints.extension@3.0::IFingerprintEngineering",
"com.fingerprints.extension@3.0::IFingerprintNavigation",
"com.fingerprints.extension@3.0::IFingerprintOptical",
"com.fingerprints.extension@3.0::IFingerprintRecalibration",
"com.fingerprints.extension@3.0::IFingerprintSenseTouch",
"com.fingerprints.extension@3.0::IFingerprintSensorTest",
],
}
prebuilt_hidl_interfaces {
name: "hidl_vendor_focaltech_fingerprint_interface",
interfaces: [
"vendor.focaltech.fingerprint@1.0::IFocalFingerprintService",
],
}
prebuilt_hidl_interfaces {
name: "hidl_vendor_goodix_hardware_cap_biometrics_fingerprint_interface",
interfaces: [
"vendor.goodix.hardware.cap.biometrics.fingerprint@2.1::IGoodixFingerprintDaemon",
"vendor.goodix.hardware.cap.biometrics.fingerprint@2.1::IGoodixFingerprintDaemonExt",
],
}
prebuilt_hidl_interfaces {
name: "hidl_vendor_pixelworks_hardware_display_interface",
interfaces: [
"vendor.pixelworks.hardware.display@1.0::IIris",
],
}
prebuilt_hidl_interfaces {
name: "hidl_vendor_silead_hardware_fingerprintext_interface",
interfaces: [
"vendor.silead.hardware.fingerprintext@1.0::ISileadFingerprint",
],
}
prebuilt_hidl_interfaces {
name: "hidl_vendor_synaptics_fingerprints_interfaces_extensions_interface",
interfaces: [
"vendor.synaptics.fingerprints.interfaces.extensions@1.0::IFpCollection",
"vendor.synaptics.fingerprints.interfaces.extensions@1.0::INavigation",
"vendor.synaptics.fingerprints.interfaces.extensions@1.0::ISensorTest",
],
}
prebuilt_hidl_interfaces {
name: "hidl_vendor_xiaomi_hardware_bgservice_interface",
interfaces: [
"vendor.xiaomi.hardware.bgservice@1.0::IBGService",
],
}
prebuilt_hidl_interfaces {
name: "hidl_vendor_xiaomi_hardware_cameraperf_interface",
interfaces: [
"vendor.xiaomi.hardware.cameraperf@1.0::IMiCameraPerfService",
],
}
prebuilt_hidl_interfaces {
name: "hidl_vendor_xiaomi_hardware_campostproc_interface",
interfaces: [
"vendor.xiaomi.hardware.campostproc@1.0::IMiPostProcService",
],
}
prebuilt_hidl_interfaces {
name: "hidl_vendor_xiaomi_hardware_citsensorservice_interface",
interfaces: [
"vendor.xiaomi.hardware.citsensorservice@1.0::ICitSensorService",
"vendor.xiaomi.hardware.citsensorservice@1.1::ICitSensorService",
],
}
prebuilt_hidl_interfaces {
name: "hidl_vendor_xiaomi_hardware_dtool_interface",
interfaces: [
"vendor.xiaomi.hardware.dtool@1.0::IDtool",
],
}
prebuilt_hidl_interfaces {
name: "hidl_vendor_xiaomi_hardware_micharge_interface",
interfaces: [
"vendor.xiaomi.hardware.micharge@1.0::IMiCharge",
],
}
prebuilt_hidl_interfaces {
name: "hidl_vendor_xiaomi_hardware_quickcamera_interface",
interfaces: [
"vendor.xiaomi.hardware.quickcamera@1.0::IQuickCameraService",
],
}
prebuilt_hidl_interfaces {
name: "hidl_vendor_xiaomi_hardware_tidaservice_interface",
interfaces: [
"vendor.xiaomi.hardware.tidaservice@1.0::ITidaService",
"vendor.xiaomi.hardware.tidaservice@1.1::ITidaService",
"vendor.xiaomi.hardware.tidaservice@1.2::ITidaService",
],
}
prebuilt_hidl_interfaces {
name: "hidl_vendor_xiaomi_sensor_citsensorservice_interface",
interfaces: [
"vendor.xiaomi.sensor.citsensorservice@1.1::ICitSensorService",
"vendor.xiaomi.sensor.citsensorservice@2.0::ICitSensorService",
],
}
prebuilt_hidl_interfaces {
name: "hidl_vendor_xiaomi_sensor_communicate_interface",
interfaces: [
"vendor.xiaomi.sensor.communicate@1.0::ISensorCommunicate",
],
}

View File

@@ -19,12 +19,12 @@ package vendor.xiaomi.hardware.displayfeature@1.0;
import @1.0::IDisplayFeatureCallback;
interface IDisplayFeature {
notifyBrightness(uint32_t brightness);
registerCallback(uint32_t displayId, IDisplayFeatureCallback callback) generates (Status status);
sendMessage(uint32_t index, uint32_t value, string cmd);
sendPanelCommand(string cmd) generates (Status status);
sendPostProcCommand(uint32_t cmd, uint32_t value) generates (Status status);
sendRefreshCommand() generates (Status status);
setFeature(uint32_t displayId, uint32_t caseId, uint32_t modeId, uint32_t cookie) generates (Status status);
registerCallback(uint32_t displayId, IDisplayFeatureCallback callback) generates (Status status);
setFunction(uint32_t displayId, uint32_t caseId, uint32_t modeId, uint32_t cookie) generates (Status status);
sendMessage(uint32_t index, uint32_t value, string cmd);
notifyBrightness(uint32_t brightness);
sendPanelCommand(string cmd) generates (Status status);
sendRefreshCommand() generates (Status status);
sendPostProcCommand(uint32_t cmd, uint32_t value) generates (Status status);
};

View File

@@ -14,8 +14,5 @@ cc_library_shared {
"libcutils",
"libutils",
],
static_libs: [
"libc++fs",
],
export_include_dirs: ["."],
}

View File

@@ -57,22 +57,6 @@
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.dolby.hardware.dms</name>
<version>2.0</version>
<interface>
<name>IDms</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.dolby_v3_6.hardware.dms360</name>
<version>2.0</version>
<interface>
<name>IDms</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.goodix.hardware.biometrics.fingerprint</name>
<version>2.1</version>
@@ -113,6 +97,30 @@
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.dolby.hardware.dms</name>
<version>2.0</version>
<interface>
<name>IDms</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.dolby_sp.hardware.dmssp</name>
<version>2.0</version>
<interface>
<name>IDms</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.dolby_v3_6.hardware.dms360</name>
<version>2.0</version>
<interface>
<name>IDms</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.goodix.hardware.fingerprintextension</name>
<version>1.0</version>
@@ -161,6 +169,14 @@
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.xiaomi.hardware.cameraperf</name>
<version>1.0</version>
<interface>
<name>IMiCameraPerfService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.xiaomi.hardware.campostproc</name>
<version>1.0</version>
@@ -169,6 +185,14 @@
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.xiaomi.hardware.citsensorservice</name>
<version>1.0-1</version>
<interface>
<name>ICitSensorService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.xiaomi.hardware.displayfeature</name>
<version>1.0</version>
@@ -177,6 +201,14 @@
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.xiaomi.hardware.dtool</name>
<version>1.0</version>
<interface>
<name>IDtool</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl" optional="true">
<name>vendor.xiaomi.hardware.fingerprintextension</name>
<version>1.0</version>
@@ -262,7 +294,6 @@
</hal>
<hal format="hidl" optional="true">
<name>vendor.xiaomi.hw.touchfeature</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>ITouchFeature</name>