300 Commits

Author SHA1 Message Date
7d360415b3 sepolicy: qti: Allow system server to detect oem charging
Signed-off-by: AnierinB <anierin@evolution-x.org>
2025-12-18 00:24:51 -05:00
DragonEmperor9480
fe4412bb0a sepolicy: adress fingerprint denials
*1565  1775 E [ANC_TAC][File]: AncMkDir: fail to mkdir /data/vendor/fingerprint/info, errno = 13, errnostr = Permission denied
*667   667 W qseecomd: type=1400 audit(0.0:82): avc:  denied  { write } for  name="debase_context" dev="sda2" ino=565 scontext=u:r:tee:s0 tcontext=u:object_r:vendor_persist_fingerprint_file:s0 tclass=file permissive=0
*1565  1565 W fingerprint@2.1: type=1400 audit(0.0:106): avc:  denied  { write } for  name="tee_bind_core" dev="proc" ino=4026532098 scontext=u:r:hal_fingerprint_default:s0 tcontext=u:object_r:proc:s0 tclass=file permissive=0
*667   667 W qseecomd: type=1400 audit(0.0:107): avc:  denied  { write } for  name="debase_context" dev="sda2" ino=565 scontext=u:r:tee:s0 tcontext=u:object_r:vendor_persist_fingerprint_file:s0 tclass=file permissive=0
*1565  1565 W fingerprint@2.1: type=1400 audit(0.0:78): avc:  denied  { write } for  name="tee_bind_core" dev="proc" ino=4026532098 scontext=u:r:hal_fingerprint_default:s0 tcontext=u:object_r:proc:s0 tclass=file permissive=0
*1565  1565 W fingerprint@2.1: type=1400 audit(0.0:79): avc:  denied  { read } for  name="u:object_r:serialno_prop:s0" dev="tmpfs" ino=3880 scontext=u:r:hal_fingerprint_default:s0 tcontext=u:object_r:serialno_prop:s0 tclass=file permissive=0
*1565  1565 W fingerprint@2.1: type=1400 audit(0.0:80): avc:  denied  { create } for  name="image_raw" scontext=u:r:hal_fingerprint_default:s0 tcontext=u:object_r:fingerprint_vendor_data_file:s0 tclass=dir permissive=0
2025-12-18 00:24:51 -05:00
4e809bad82 sepolicy: qti: Allow system_server to r/w oplus_chg nodes 2025-12-18 00:24:51 -05:00
Broly1
3a67714e73 keyhandler: Move Alert Slider to Sound settings and remove icon 2025-12-18 00:24:51 -05:00
Adhitya Mohan
7e3ba94d63 Add icon and summary for alert slider settings 2025-12-18 00:24:51 -05:00
Adhitya Mohan
30213e2d7d Keyhandler: Export Keyhandler setting and service 2025-12-18 00:24:51 -05:00
inferno0230
ef8fe6b810 sensors: Bump android.hardware.sensors to V3-ndk
Signed-off-by: inferno0230 <mail@inferno0230.in>
2025-12-18 00:24:51 -05:00
Alcatraz323
d0197cd72f 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-12-18 00:24:51 -05:00
Ghosuto
2b53411014 dolby: Update to use new tooltip position provider API 2025-12-18 00:24:51 -05:00
Sugakesshaa
d8cb024d17 vintf: Add oplus Dolby Atmos entries to FCM
Change-Id: Ifc4dff53e516f33b9e5581d56ce6f9c00f0da8cf
2025-12-18 00:24:51 -05:00
Sugakesshaa
67136ee52e dolby: Create a split makefile for Dolby
Change-Id: Ie191d7af0ee55c44cc939fc5dd1b6e45c965dbf4
2025-12-18 00:24:51 -05:00
Adithya R
7cd00758e3 sepolicy: qti: Add sepolicy for Dolby Atmos
Change-Id: I8c41ff32e579cec9c871d6a0177ca027034281c8
2025-12-18 00:24:51 -05:00
Sugakesshaa
547c534e78 dolby: Rebrand to oplus
Change-Id: Ic54a93647c0dcbe3b1ef8b576d80cc4c6bf74992
2025-12-18 00:24:51 -05:00
Fabian Leutenegger
d415ac0ee6 dolby: Switch to MaterialTheme settingsBackground for EqualizerScreen background color
Change-Id: I546e3528814276eb857a650cb6c173d914550fb5
2025-12-18 00:24:51 -05:00
Bruno Martins
c6473358e2 dolby: Use all shared resources from devicesettings
Change-Id: Icd7f381c574ea36eb4d797cefd60ba9f1a0941bd
2025-12-18 00:24:51 -05:00
Pranav Vashi
b8724aa866 dolby: Remove deprecated PlainTooltipBox
Change-Id: I70ffff5ba30c5eeaff431e46c82eaf05d46e4cb0
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-12-18 00:24:51 -05:00
basamaryan
914817d98a dolby: Fix build with kotlinc 1.9.0
Reformat the code while at it

Change-Id: I4f9fdc9d25eb57240612cff1b3bef3663014f9a8
2025-12-18 00:24:51 -05:00
Michael Bestas
f07d367656 dolby: Convert to SwitchPreferenceCompat
Change-Id: Ic1cbaba37d499da1855af9c3930f2df426e2d3af
2025-12-18 00:24:51 -05:00
Chaohui Wang
89d6684342 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-12-18 00:24:51 -05:00
Peter Kalauskas
190ae7f321 dolby: Enable use_resource_processor for all sysui deps
This will make the build faster

Test: m checkbuild
Bug: 295208392
Change-Id: I0c1bd901429bbe3bf81c1530e156735f8637a96e
2025-12-18 00:24:51 -05:00
Adithya R
26c913ccf8 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-12-18 00:24:51 -05:00
Adithya R
a0995b6e0a 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-12-18 00:24:51 -05:00
Pranav Vashi
15f18a41a4 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-12-18 00:24:51 -05:00
Adithya R
989b6ba659 dolby: Restore current profile _after_ resetting profiles
Ensure to end the onBootCompleted routine with the correct profile set.

Change-Id: I2d5f74a7c0145af2f9d064cd98fa2dc70e5a7acd
2025-12-18 00:24:51 -05:00
Adithya R
9dd8c18207 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-12-18 00:24:51 -05:00
Adithya R
a6b49ee233 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-12-18 00:24:51 -05:00
Adithya R
632f3b911c dolby: Rewrite in Kotlin
Some cleanup and restructuring while we're at it.

Change-Id: I2f1fc53c202d91421c7b6af68c814c25398a62e4
2025-12-18 00:24:51 -05:00
Adithya R
1eba7d34b1 dolby: Revert "Re-enable speaker virtualization after bootup"
No longer necessary

Change-Id: Iac820eafa71ea3e4ccaad2bfa0fb76c37279a22a
2025-12-18 00:24:51 -05:00
Adithya R
198ba59f78 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-12-18 00:24:51 -05:00
Sugakesshaa
f4ec6bf221 sepolicy: qti: Allow powerhal write to /proc
Change-Id: Id894d56fdf0df323e75004c90c0b904eb450837c
2025-12-18 00:24:51 -05:00
Sugakesshaa
04e927cc2b sepolicy: qti: Allow binder calls for sensor hal to system_server
Change-Id: Ic624ff754f0bf7f60f443a449987e30ca2691dfd
2025-12-18 00:24:51 -05:00
pjgowtham
2a0aa8bc2f aidl: sensors: Add clang-format
Change-Id: Ifece344ef765d5437eefd59ecbe4cd50ce1295f5
2025-12-18 00:24:51 -05:00
pjgowtham
7ae38ca1be overlay/sensors: Configure Doze brightness sensor
Oplus doze brightness sensors either reports 0 or 1

0.0 - Dark environment
1.0 - Bright environment

aod_light_mode value of 1 enables qcom,mdss-dsi-aod-low-mode-command
and any other value would enable qcom,mdss-dsi-aod-high-mode-command

Change-Id: I98e3ea6abe0375ca75dad1b82e0bc6a1551cbb0e
2025-12-18 00:24:51 -05:00
pjgowtham
ce36f84afa overlay: qssi: Define quick_pickup sensor string
Tests: Ensure quick pickup works when the "Lift to check phone"
is enabled under settings (with fingerprint enrolled)

Change-Id: I00626512dcca51d666e37dda4b281575bf1a2ea7
2025-12-18 00:24:51 -05:00
Sebastiano Barezzi
f0548bef78 overlay: qssi: Enable config_dozePulsePickup
Change-Id: Ice5cd780eb77e2ae78a3a84a0140c321ad84f143
2025-12-18 00:24:51 -05:00
pjgowtham
71ce131ef7 sepolicy: qti: Label sensors AIDL multihal
Change-Id: I51d1f5542f3bb6922d0f3d9b39777bc8b1ff58ff
Signed-off-by: Vaisakh Murali <mvaisakh@statixos.com>
2025-12-18 00:24:51 -05:00
pjgowtham
5e83463f05 aidl: sensors: Standardize qti.sensor.amd to glance sensor
Change-Id: I65150cffde2bd8a48c33b26a0f139a24687f8591
2025-12-18 00:24:50 -05:00
Sugakesshaa
c5a2cb2eb0 aidl: sensors: Invert value for pickup gesture event
- oplus pickup sensor inverts the value for it to work properly;
- Hence, invert the event check for it to work accordingly.

thanks to @ cyberknight777 for the idea

Test: Build, test lift to check phone.

Change-Id: If09de1758823e2246106d6e278ecc80ca5327ee5
2025-12-18 00:24:50 -05:00
Cosmin Tanislav
4b0fdb9d0d aidl: sensors: Change standard tilt_detector to pickup_gesture
* ignore non-wakeup sensor variant
* ignore events that do not properly match a pickup

pjgowtham: The tilt_detector sensor already has inverted sensor events
for it to be any useful as standard sensor. Thus repurpose them as
pickup sensor.

Change-Id: Ibe2f9fee1551da613713d40c1b8d0a26d38a93ae
Signed-off-by: ralph950412 <ralph950412@gmail.com>
Signed-off-by: Sugakesshaa <sugakesshaa@pixelos.net>
2025-12-18 00:24:50 -05:00
Cosmin Tanislav
1c66bbfeeb aidl: sensors: Avoid target name conflicts
Change-Id: Ib6426caf68fe1a7a7f637bdc5c4f0036866f8b78
Signed-off-by: ralph950412 <ralph950412@gmail.com>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2025-12-18 00:24:50 -05:00
Arian
9e9b0fe2fa aidl: sensors: Change default applicable license to Android-Apache-2.0
hardware_interfaces_license is not available here.

Change-Id: I8c8d00cdeda2739c3e4419f979f1fbf0ef66fc0a
2025-12-18 00:24:50 -05:00
ralph950412
fb0c0864fa aidl: sensors: Import 2.X sensors hal proxy
* From android-14.0.0_r15

Change-Id: Id6f37920db2869574ca1b8e04c10e6ec3268ad4b
Signed-off-by: ralph950412 <ralph950412@gmail.com>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2025-12-18 00:24:50 -05:00
ralph950412
5c416f8e40 aidl: sensors: Import aidl sensors MultiHal
* From android-14.0.0_r15

Change-Id: Id7d8dfae1290bdba84d5a9f4c6583d54a2769ba8
Signed-off-by: ralph950412 <ralph950412@gmail.com>
2025-12-18 00:24:50 -05:00
pjgowtham
3513c6826a aidl: vibrator: Use THUD effect from wly for DOUBLE_CLICK
Change-Id: I4f1a718254ca1df5167956371e11b4102b10094c
2025-12-18 00:24:50 -05:00
pjgowtham
126f7853e0 aidl: vibrator: Minimize code for ledVibratorDevice
This fixes vibration on ziti where it works only when strace is used.

* Minimize code wherever applicable.
* Remove writes to /rtp since we are not using them.

Change-Id: I385fe64b33e541bc398e58dbbf67a728edff8b24
2025-12-18 00:24:50 -05:00
pjgowtham
7d6707f4c0 sepolicy: qti: Allow init to write to usb nodes for enabling OTG
Change-Id: I14d209d1d04ba6aae077f828a71f5683b4a6405c
2025-12-18 00:24:50 -05:00
ppanzenboeck
0cad8a424d cleanup rebase + fix sepolicy for 16 2025-12-18 00:24:20 -05:00
ppanzenboeck
6604548518 move oos cam oplus-fwk libs to hardware/oplus [2/2] 2025-12-18 00:24:20 -05:00
cjh1249131356
d8d3c133fb sepolicy: Add rules for NrModeSwitcher
Signed-off-by: cjh1249131356 <cjh1249131356@gmail.com>
2025-12-18 00:24:20 -05:00
cjh1249131356
3edb8fe6e9 sepolicy: Add OnePlus Camera rules for sm8250
Co-authored-by: chandu078 <chandudyavanapelli03@gmail.com>
Signed-off-by: cjh1249131356 <cjh1249131356@gmail.com>
2025-12-18 00:24:19 -05:00
LineageOS Infra
2c82644337 Automatic translation import
Change-Id: Id59722076a2b9d1abc2de913c996ebf08a25db63
2025-12-15 15:29:41 +00:00
chandu078
8738bcd8ae uah-client: Add missing stub symbols
Change-Id: I890f2566a8ad975a5b834046b73633dea5703913
2025-12-12 12:26:30 +00:00
chandu078
9f60507abc sepolicy: qti: Label corvette wakeup nodes
Also sort labels for wakeup nodes.

Change-Id: Iac6ba514e7b2236e1e9c3c1063a99c372acdb360
2025-12-12 07:31:00 +00:00
LineageOS Infra
43a27ff0b8 Automatic translation import
Change-Id: I1eba54c14c2dac35bc8d7ec2457e70ca499694b5
2025-12-01 14:53:10 +00:00
LuK1337
c0a67cae2b doze: Fix ClassCastException on pickup pref change
Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/9633
Change-Id: I6662f7a11fd7aae4df86e534b1900ea1b04281f5
2025-11-30 16:42:47 +01:00
chandu078
db91ce039b oplus-fwk: Add OsenseResClient and OplusUIFirstManager stubs
Required for OOS 16.0.0 blobs.

Change-Id: Ie3921eb1f62771885f69ad76a570def89e9286ac
2025-11-28 18:42:14 +00:00
Bruno Martins
9a1f70d171 doze: Use new method to listen for preference changes
Usage of addOnSwitchChangeListener(OnCheckedChangeListener) is
deprecated. The Javadoc explicitly says:

  Use setOnPreferenceChangeListener(OnPreferenceChangeListener) instead.

Change-Id: I71e0e3f86ff339a312cac1e09106f6d5d15b7e43
2025-11-27 22:57:01 +00:00
Bruno Martins
824602c65f oplus-fwk: Stub NetworklessManager
Nonsense required for OOS 16.0.1 blobs.

Change-Id: Ic031af55b55b216679803116198a3d15d1fc31e4
2025-11-25 23:41:38 +01:00
Bruno Martins
32308a2cc3 KeyHandler: Modernize ButtonSettings
Fully convert to AndroidX fragments and stop overriding
OnOptionsItemSelected(IMenuItem).

Change-Id: I56261b2bfd47bd5dd75ca52cb463e76309a14dce
2025-11-23 22:48:37 +00:00
Bruno Martins
7aa2810650 KeyHandler: Switch to SwitchPreferenceCompat
Change-Id: Ib4bb4f4dab43555e24828018913ae9690c6afe88
2025-11-23 22:11:04 +00:00
Michael Bestas
c9363253e9 doze: Convert to SwitchPreferenceCompat
Change-Id: Ic1cbaba37d499da1855af9c3930f2df426e2d3af
2025-11-23 22:04:30 +00:00
Bruno Martins
b5a8e6c32a sepolicy: qti: Label /dev/sec_dev
Change-Id: I770bf6d8b69e937bbda75db3a59e39c308368c82
2025-11-17 21:58:23 +00:00
anky894
464b1d35eb oplus: Introduce dummy liboplus-uah-client
Change-Id: Ifc628f858a38ea9976a5796fdf8a9193e3281524
2025-11-16 14:53:47 +00:00
Bruno Martins
0c554081c2 interfaces: Update vendor.oplus.hardware.olc2 to V3
Change-Id: Ib79e5b332948d65b7581f1960f1d5e0f30bb1dcb
2025-11-16 11:01:25 +00:00
Bruno Martins
9582ba05f9 interfaces: Update vendor.oplus.hardware.olc2 to V2
Change-Id: If47efd073e0a9b06a041cd71ab6b835add894176
2025-11-16 11:01:25 +00:00
Bruno Martins
81fa629d76 interfaces: Add vendor.oplus.hardware.olc2 V1
Change-Id: I0872fdf9ca2e5987d54ef5e851be1aea8c620f6d
2025-11-16 11:01:25 +00:00
Bruno Martins
6f268cde54 sepolicy: qti: Label battery gauge daemon
It has the same label as wlchgd in OOS:

odm/etc/selinux/precompiled_file_contexts:/(vendor|odm)/bin/hw/gauged u:object_r:wlchg_exec:s0
odm/etc/selinux/precompiled_file_contexts:/(vendor|odm)/bin/hw/wlchgd u:object_r:wlchg_exec:s0

Change-Id: Ic1d5fe8bac3459cb45053cc92e4b2e7881821ca6
2025-11-16 10:05:39 +00:00
LineageOS Infra
ac5f626358 Automatic translation import
Change-Id: I19dd56c3567497e9aea2b5940acc10afc72e1115
2025-11-15 18:01:54 +00:00
Bruno Martins
768b9a517e interfaces: Update IOplusProject to V3
Change-Id: Ibfb3338f73ad24f480a4c590fc095cf640dcec85
2025-11-15 15:35:06 +00:00
Bruno Martins
1bab687397 interfaces: Update IOplusProject to V2
Change-Id: I628f7aa3ed07b5c02fd0a07a3e41a3cfb7291bb5
2025-11-15 15:34:52 +00:00
Bruno Martins
09a9918362 interfaces: Introduce vendor.oplus.hardware.stability.oplus_project V1
Change-Id: Ia2337de26393070367076a04acbf0cbb87291206
2025-11-15 14:54:36 +00:00
Bruno Martins
3e90c6d758 vintf: Bump ISubsys and ISubsysRadio aidl versions
As required for OOS 16:

ERROR: files are incompatible: The following instances are in the device manifest but not specified in framework compatibility matrix:
    vendor.oplus.hardware.subsys_interface.subsys.ISubsys/default (@5)
    vendor.oplus.hardware.subsys_interface.subsys_radio.ISubsysRadio/slot1 (@8)
    vendor.oplus.hardware.subsys_interface.subsys_radio.ISubsysRadio/slot2 (@8)

Change-Id: I2511ea82ccce5a4f219a38e87b892c06445c1226
2025-11-15 12:26:56 +00:00
chandu078
baeef85734 vintf: Bump vendor.oplus.hardware.charger to V9
As seen in OOS 16.

Change-Id: Ife1c267191591815c0067fe8fe401f40de6cc0bc
2025-11-13 21:15:47 +00:00
Bruno Martins
03e2ea4da3 interfaces: Add AIDL and HIDL IDisplayPanelFeature
Change-Id: I01a16fbb24ddbc02460788edfc05b83410f6a36e
2025-11-09 15:35:28 +00:00
Marc Bourgoin
d80f587aa0 sepolicy: Remove commonized ST NFC labels
They are moved to qcom sepolicy_vndr

Change-Id: Ifdc5a3a4a51e172de4c685a833c2da4ca114d5ce
2025-11-09 09:45:29 +00:00
inferno0230
105ddc3159 Euicc: Add OnePlus 12R support
Change-Id: I36ce9a1cc828f4157f340e34e4ca1ff5bdaff1a1
Signed-off-by: inferno0230 <mail@inferno0230.in>
2025-11-07 11:37:35 +00:00
LuK1337
64d9d1da29 Euicc: Make JSON mappings more readable
Change-Id: I5e10327407962c8328ab73a6e5faee1da639c00d
2025-11-07 11:37:31 +00:00
LuK1337
14641e5c16 Euicc: Make JSON mappings untranslatable
Change-Id: I438b90a69e55f62bd02c875a9a0ee40aa08d011b
2025-11-07 11:37:27 +00:00
DroidFreak32
8bbf9c4146 eSimSwitcher: Restrict activity to primary profile only
This avoids the "Choose Profile" popup every time the activity
is started when Android for Work is set up on the device or when using
apps like Shelter.

Change-Id: I716176445e6a9d9f8877c651a8f5524bfcef48b3
2025-11-06 18:16:49 +00:00
Bruno Martins
19793f68d5 eSimSwitcher: Support targets using SE
Co-authored-by: LuK1337 <priv.luk@gmail.com>
Change-Id: I8be990cd691b4ca84701f68c84ea0e807f22c647
2025-11-06 14:08:05 +01:00
Bruno Martins
881fa7ab5f Introduce eSIM switcher app
Icon taken from google/material-design-icons.

Co-authored-by: LuK1337 <priv.luk@gmail.com>
Change-Id: I28216910c39f4ee690d2e69d39158413422bfe8d
2025-11-06 14:08:05 +01:00
inferno0230
f8ef7eae09 livedisplay: Use PWM pulse for IAntiFlicker if available
Change-Id: I03331c4dc123a95b0882318af48aa4f22e0d13b7
Signed-off-by: inferno0230 <mail@inferno0230.in>
2025-11-04 23:57:18 +00:00
inferno0230
91123cb96a kernel-headers: Add PANEL_IOCTL_{GET,SET}_PWM_PULSE
Change-Id: Ia81c01fd2eb707e06d1cf40f90585f2da01fe934
Signed-off-by: inferno0230 <mail@inferno0230.in>
2025-11-04 23:57:18 +00:00
LuK1337
88ba34dba5 Euicc: Migrate to privapp_allowlist
Change-Id: I52aa7e1d8a158be2a252d2949f5207551a1a4070
2025-11-04 13:33:53 +01:00
LineageOS Infra
4add258572 Automatic translation import
Change-Id: I1cc36db194d97b53ce1582b92ae864b7e6da4c5d
2025-11-01 19:48:35 +00:00
LuK1337
507e831020 Pen: Support Goodix BT MAC prefix
add device 2: /dev/input/event9
  bus:      0005
  vendor    22d9
  product   386a
  version   0101
  name:     "OnePlus Pencil Pro Mouse"
  location: "XX:XX:XX:XX:XX:XX"
  id:       "f8:6f:de:XX:XX:XX"
  version:  1.0.1
  events:
    KEY (0001): BTN_MOUSE             BTN_RIGHT             BTN_MIDDLE
    REL (0002): REL_X                 REL_Y                 REL_WHEEL             REL_WHEEL_HI_RES
    MSC (0004): MSC_SCAN
  input props:
    <none>

Change-Id: Iebff07ee1a7fc34fc3cd806d9dc00a88f26688a7
2025-10-31 16:16:42 +01:00
LuK1337
6788b965d2 Pen: Support Maxeye vendor ID
add device 4: /dev/input/event12
  bus:      0005
  vendor    330a
  product   0001
  version   0101
  name:     "OPPO Pencil 2"
  location: "XX:XX:XX:XX:XX:XX"
  id:       "c0:87:06:XX:XX:XX"
  version:  1.0.1
  events:
    KEY (0001): KEY_F21
    MSC (0004): MSC_SCAN
  input props:
    <none>

Change-Id: I89fff6e3cc24d159bd72175fb078286194016786
2025-10-26 15:25:25 +01:00
LuK1337
55fecc58e7 Pen: Simplify stylus identification
Change-Id: Ica177eab3a1b1e9fe4f63a3f2eda7afd5e44cd7e
2025-10-26 15:25:25 +01:00
inferno0230
f549d68095 sepolicy: qti: Label oplus,ufcs_protocol wakeup node
As seen on OnePlus Ace 2 Pro (xigua)

Change-Id: Icc04b17df095d8c8f5360551573129237cc3f724
Signed-off-by: inferno0230 <mail@inferno0230.in>
2025-10-20 16:38:08 +05:30
LuK1337
1adb147c70 sensors: Skip first fp state event
We don't want to report initial state as otherwise that might result in
unwanted AOD UDFPS icon illumination after locking the device.

Change-Id: I4b595fcd0013b62c7d22a97e0243b39b5f1dcb16
2025-10-19 23:42:35 +02:00
LuK1337
8e78ae9adb Pen: Get rid of location permission
https://developer.android.com/develop/connectivity/bluetooth/bt-permissions#assert-never-for-location

Change-Id: Ied5bd77a692a459cd25def85860ae6b940238879
2025-10-17 17:38:11 +02:00
LuK1337
fe717b29aa Pen: Wait up to 5s for BLE scanner to be available
I'm too lazy to do this properly, this much easier and not like we have
UI to worry about.

Change-Id: If678fa861c9c25b159dbea4a8429777a4665ab51
2025-10-05 10:51:38 +02:00
LuK1337
34f36e2f7f folio-daemon: Remove unwanted event count check
No idea what was the point of it, but it prevents us from listening to
sensor events when device is asleep.

Change-Id: Id7ce79e8cce051256ee15d8b8f342726af085976
2025-10-03 17:24:10 +02:00
LuK1337
b759d9e88b folio-daemon: Fix ALooper_pollOnce() return value check
Fixes: e9f090f ("folio-daemon: PollOnce instead of PollAll")
Change-Id: I651a1614c85d0729f960a7dc524b45118d6de932
2025-10-03 17:24:06 +02:00
Christian Hoffmann
3216027fe1 folio-daemon: Do not use batching for hall sensor
* hallMinDelay is 0, so just drop fetching it
* Using batching wakes up the system so frequently and
* unnecessarily that it never allowed deep sleep
* Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/8261

Change-Id: I597676b2dc93ab5581442f8c74734e18ff7217e3
2025-10-03 16:54:11 +02:00
LuK1337
af9087a995 sepolicy: qti: Allow folio_daemon to find virtual_device_native_service
10-03 16:43:17.001   611   611 E SELinux : avc:  denied  { find } for pid=6977 uid=1000 name=virtualdevice_native scontext=u:r:folio_daemon:s0 tcontext=u:object_r:virtual_device_native_service:s0 tclass=service_manager permissive=0

Change-Id: I4900e1649d6e93d7eefa2c1027f362d1109fdf60
2025-10-03 16:45:11 +02:00
LuK1337
80fe8c3c7d Pen: Support overriding peak refresh rate when pen is connected
Change-Id: Ic65abaeb124613f9251905404eb77b67a63e28f1
2025-10-02 20:27:07 +00:00
LuK1337
5c3146f7b0 sepolicy: qti: Add sepolicy for folio-daemon
Change-Id: I72294055d6dfa548c50ba9be5a842aba8e86e709
2025-10-02 22:16:41 +02:00
LuK1337
b3a4339f74 folio-daemon: Migrate to SPDX license header
Change-Id: If31c35027d24cba99833f48e05bf32e9e5ef32a0
2025-10-02 22:16:41 +02:00
LuK1337
593f97fade folio-daemon: Run clang-format
Change-Id: Ie874df9fa83b923e113fb47c56e257655c398c2b
2025-10-02 22:15:44 +02:00
LuK1337
08742df8f6 folio-daemon: Add init rc
Change-Id: Ic8e4b1956b3d5f47bd05a04db0edb69d54380137
2025-10-02 22:15:44 +02:00
LuK1337
410aa3511d folio-daemon: Move to /system_ext
Change-Id: Ib2d5dba4197fb8499cb778e41ef0fe30cb8db012
2025-10-02 22:15:44 +02:00
Christian Hoffmann
144646e6ec folio-daemon: Explicity request wakeup version of hall sensor
Change-Id: Iafd2c2cc5afc1ae6b1354ad6bbeb3b3f95bfa3ee
2025-10-02 22:15:44 +02:00
LuK1337
ed88bdc5cc folio-daemon: Flip sensor event data check
Change-Id: I5fe3969500f2f72308741c299b0a09ac8152f973
2025-10-02 22:15:44 +02:00
LuK1337
285eccf3de folio-daemon: Update sensor type
0x010003fe) bu52053nvx Oplus Hall Effect Sensor Wakeup | ROHM            | ver: 393228 | type: qti.sensor.hall_effect(33171002) | perm: n/a | flags: 0x00000003

Change-Id: Id6887fe8651758530e6ca2225f26743396e61195
2025-10-02 22:15:43 +02:00
Michael Bestas
a5621a3541 folio-daemon: Convert Android.mk to bp
Change-Id: I52813cd047f685db97f9994d81cd28225a2c1b10
2025-10-02 22:15:23 +02:00
Christian Hoffmann
e9f090f2a6 folio-daemon: PollOnce instead of PollAll
* Fixes build error.

Change-Id: I62019c3116a3ee697923595904f1d66d6842957b
2025-10-02 22:15:22 +02:00
Andrew Lehmer
f362a930ea folio-daemon: Avoid UAF with stale sensor handle
It is possible for sensor handles retrieved using
ASensorManager_getDefaultSensor() to become stale if the underlying
binder connection to the sensor service gets reset. This can be
triggered by ASensorManager_createEventQueue(), so any sensor handle
retrieved prior to this call may become stale, resulting in a use-after-
free when the handle is eventually registered with the queue. To avoid
this, the event queue is created before retrieving or registering the
sensor.

Bug: 150225255
Test: No longer crashes with proof-of-concept on Pixel 2 XL.
Change-Id: I243f6c68c734af3eb5488855d965a894b5fb99e5
2025-10-02 21:35:24 +02:00
Jiyong Park
74306993ea folio-daemon: Disable modules that can't be built in PDK
Modules that can't be built in PDK are disabled when TARGET_BUILD_PDK is
true

Bug: 71361051
Test: lunch aosp_walleye-userdebug
PDK_FUSION_PLATFORM_ZIP=vendor/pdk/walleye/walleye-userdebug/platform/platform.zip m -j

Change-Id: I2cc7ab6d667daab7d3566baf8a9b473cafc4e452
2025-10-02 21:35:24 +02:00
Lennart Wieboldt
bc1b861c9c folio-daemon: Remove LOCAL_CLANG := true
Clang is the default compiler since nougat.

Change-Id: I565e25f9f688a979eac41de0eee4a88b24099098
Signed-off-by: Lennart Wieboldt <lennart.1997@gmx.de>
2025-10-02 21:35:24 +02:00
Chih-Hung Hsieh
244c88cb10 folio-daemon: Use -Werror
* Remove unused local variable.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I96228277b9c81b71e73e4e376d86cdea6cbcb647
2025-10-02 21:35:24 +02:00
Dan Albert
01689599c6 folio-daemon: Add missing includes.
Change-Id: I74ce25b3b5c918e371140b91f82ec00ff571f9fe
Exempt-From-Owner-Approval: trivial cleanup
Test: mma
Bug: None
2025-10-02 21:35:24 +02:00
Jeff Vander Stoep
e67b5c7075 folio-daemon: Move to system
Remove Treble violations.

Bug: 36867326
Bug: 62387246
Test: loaded on taimen, checked dmesg, and tested daemon with magnet
Change-Id: I4662b41206b94cae6ac9843b5dc7e1452003c63c
2025-10-02 21:35:24 +02:00
Andrew Lehmer
6044b3541f folio-daemon: Retry slowly on failure
Bug: 38001818
Test: loaded on taimen
Change-Id: I3f5a8cbf0faca3b5d027dcd74f1b16de80fdbee2
2025-10-02 21:35:24 +02:00
Andrew Lehmer
a73d6486f0 folio-daemon: Exit when poll returns zero events
Bug: 37402669
Test: loaded on walleye, issued `adb shell stop`, checked `top`
Change-Id: I7d43cab39809b6b156eb26195df2c913991e5c96
2025-10-02 21:35:24 +02:00
Andrew Lehmer
ed4caad386 folio-daemon: Improve logging for debugging
Bug: 37402669
Test: loaded on walleye
Change-Id: I9cfd071158386d3eb15a5b81656b09452c7fed15
2025-10-02 21:35:24 +02:00
Andrew Lehmer
d292aa03ba oplus: Add support for folio cases
Bug: 35243564
Test: Used magnet to wake and lock device. Also tested during suspend.
Change-Id: I4b819e12cc23a3d7a8ce048e208c15eac4f8d6c5
2025-10-02 21:35:24 +02:00
LineageOS Infra
090d5f2b5c Automatic translation import
Change-Id: I9d71722a8e84ba8d1503995031ba92beaba044ef
2025-10-01 23:32:41 +00:00
dianlujitao
403ddc3d92 sepolicy: qti: Allow rules for subsystem_daemon
Change-Id: I22040ac0d0ab70f32de07a5ac451d41f045433a9
2025-09-20 16:21:04 +01:00
dianlujitao
0eff57e0e6 sepolicy: qti: Fix wrong macro usages
Change-Id: I6e6a52ecf8fb223fc87c51bb8fa191bd1115a3e2
2025-09-20 16:20:41 +01:00
dianlujitao
95ad0c188e sepolicy: qti: Support both context prefixes in oplusreserve partition
Also apply some minor clean-ups while at it.

Change-Id: I7676bf126099222ef56b2f639aba1ab62f662361
2025-09-20 14:38:44 +01:00
Bruno Martins
45a45e8eeb sepolicy: qti: Let qcril look into /mnt/vendor/oplusreserve
Change-Id: Iaa6425e662c83b660af9a3bf1371faa0faf494b3
2025-09-20 16:36:30 +08:00
dianlujitao
8dfc2b9662 sepolicy: qti: Allow init to label vendor_reserve_partition
[    0.983556] init: Running restorecon...
[    0.989819] selinux: SELinux: Could not set context for /dev/block/platform/soc/1d84000.ufshc/by-name/oplusreserve2:  Permission denied
[    0.989819] audit: type=1400 audit(10810748.011:9): avc:  denied  { relabelto } for  pid=1 comm="init" name="oplusreserve2" dev="tmpfs" ino=35 scontext=u:r:init:s0 tcontext=u:object_r:vendor_reserve_partition:s0 tclass=lnk_file permissive=0

Change-Id: I5b356016e6f5e2b2564179eb2b87bf99c4ee78e2
2025-09-20 16:36:30 +08:00
dianlujitao
481fb35dce sepolicy: qti: Label wireless charging device and daemon
Change-Id: I3d56dd86eecdfb18aba55e64e4b7d362441b1935
2025-09-20 08:34:04 +00:00
Bruno Martins
471f49b51d sepolicy: qti: Allow touchDeamon to stop itself
As seen on devices without OplusTouch support:

[   14.155867] init: Unable to set property 'ctl.stop' from uid:0 gid:0 pid:1991: Invalid permissions to perform 'stop' on 'touchDaemon'
[   14.155902] type=1107 audit(1758323930.135:13): uid=0 auid=4294967295 ses=4294967295 subj=u:r:init:s0 msg='avc:  denied  { set } for property=ctl.stop$touchDaemon pid=1991 uid=0 gid=0 scontext=u:r:oplus_touchdaemon:s0 tcontext=u:object_r:ctl_stop_prop:s0 tclass=property_service permissive=0'

Change-Id: Iacc073b0b74713c268966c69480cf02d543d395a
2025-09-20 00:27:19 +00:00
LuK1337
bfbb9381b4 sepolicy: qti: Allow camera HAL to find osense_service
09-19 22:25:35.045   925   925 E SELinux : avc:  denied  { find } for pid=1634 uid=1047 name=osensemanager scontext=u:r:hal_camera_default:s0 tcontext=u:object_r:osense_service:s0 tclass=service_manager permissive=0

Change-Id: I45f432e8378c726ef0026e5a1c9456b36b6929e1
2025-09-19 21:54:00 +00:00
dianlujitao
b4a2a6b744 sepolicy: qti: Allow eSIM HAL to access /mnt/vendor/oplusreserve
Change-Id: I07b964681f472d4d5c38be3d5aa1afd8604a1642
2025-09-19 21:24:16 +00:00
dianlujitao
77a47a0df2 sepolicy: qti: Allow vendor.lineage.touch to access binder
[    4.389706] type=1400 audit(1758283865.674:53): avc:  denied  { call } for  comm="servicemanager" scontext=u:r:servicemanager:s0 tcontext=u:r:hal_lineage_touch_default:s0 tclass=binder permissive=0

Change-Id: I338d3fd5cb80035905c6c509eb53da61a2aa0338
2025-09-19 21:11:36 +00:00
LuK1337
88b4e237fc sepolicy: qti: Let vendor_init set vendor_camera_prop
Required for erhai's vendor.qti.camera.provider-service_64.rc:

on property:sys.boot_completed=1
    setprop vendor.oplus.camera.cam0.count 0
    setprop vendor.oplus.camera.cam3.count 0
    setprop vendor.oplus.camera.error.camlist 0

Change-Id: I7b9c50f5532a8c809b2061f8c6eedc08d7a18802
2025-09-19 22:20:00 +02:00
dianlujitao
5e1bf232a7 sepolicy: qti: Label thermal engine prop
Change-Id: I14766b69fd83031083730a445c958a5e1027bd34
2025-09-19 22:15:26 +02:00
inferno0230
eafb8b4a7e sepolicy: qti: Label more SM8650 wakeup nodes
Needed by OnePlus Pad 2 (caihong)

Change-Id: Ia134dfadb0d05ebe2728c1899534ccd85930f3d2
Signed-off-by: inferno0230 <mail@inferno0230.in>
2025-09-16 09:52:40 +02:00
LineageOS Infra
81bd03c42f Automatic translation import
Change-Id: I471279ee8af9e2d3c7c95f572bbd809d680a0535
2025-09-15 16:55:00 +00:00
LuK1337
93353b7fe4 readme: Remove USE_BSG_FRAMEWORK variable
See: 18ef7dd547
Change-Id: I874e5cf669a5f068cc8b8cf058e6e26c8401d883
2025-09-14 18:10:13 +02:00
LuK1337
e0ed208f22 interfaces: Add vendor.oplus.hardware.urcc V1
Change-Id: I1b483913586c45717d86f3faa036d5afe3077858
2025-09-14 12:51:33 +02:00
kok-o3
3fc8912155 sepolicy: qti: Label SM7675 wakeup nodes
Change-Id: I0f7f1dec0f8f9da88afd17233898ceb5c4a23ec5
2025-09-13 21:39:40 +02:00
inferno0230
34a24318a8 sepolicy: qti: Label SM7550 charging sysfs path
Change-Id: Ia79079f3df34714e5a8f9294d3db6048552609e6
Signed-off-by: inferno0230 <mail@inferno0230.in>
2025-09-09 22:06:47 +02:00
LuK1337
495cfb6640 sepolicy: qti: Allow vendor_init to set vendor_fingerprint_prop
Change-Id: Icc898bba9d8a06b79e1cfcf34412871471a9bdf7
Signed-off-by: inferno0230 <mail@inferno0230.in>
2025-09-09 19:54:53 +05:30
dianlujitao
7a643a4105 sepolicy: qti: Move proc_horae to vendor
This fixes booting AOSP GSIs.

Fixes: 8acb73ff6a ("sepolicy: qti: Add support for horae service")
Change-Id: Ica812bb31d6c60b4ec5f6837de7712bd0c275543
2025-09-07 15:29:03 +08:00
dianlujitao
8ae5447fc5 Euicc: Add China version support
Despite lack of native eSIM hardware, this enables managing removable
eUICCs through EuiccGoogle

Change-Id: I9d5a360dde85ede18761ff795641e199507ff688
2025-09-06 14:39:20 +00:00
LuK1337
20b9ca79d6 livedisplay: Use PWM turbo for IAntiFlicker if available
Change-Id: I4162f79c5309038dfff1bd00f2ca8a726c7eb206
2025-09-06 13:56:59 +00:00
LuK1337
b7e4686284 kernel-headers: Add PANEL_IOCTL_{GET,SET}_PWM_TURBO
Change-Id: I0c63693be15a09baa582d14113b642e086e94d6e
2025-09-06 13:56:59 +00:00
grep
641f44934c vintf: Bump vendor.oplus.hardware.charger to V8
lexus shipped with V8.

Change-Id: I0b4733fcb7f5e3ac0834b8526e1ec5a99fd0e8c3
2025-09-06 12:25:27 +02:00
Bruno Martins
d2e134e7c0 interfaces: Mark all aidl interfaces as system_ext_specific
Change-Id: I62d8099cae1d3c2cbe98d5bc514a0713eb84cbe9
2025-09-05 17:11:22 +01:00
Bruno Martins
860533d2bb interfaces: Update ICharger all the way to V8
V7 adds GET_RX_DISABLE_STATUS and SET_RX_DISABLE enum entries on top of
V6 and V8 finally adds only GET_BATTERY_SEC_IC_TEST_STATUS.

Change-Id: I134bac4ffc536280dbb778a4a349943b67c175dc
2025-09-05 15:49:48 +01:00
Bruno Martins
70168c51f2 interfaces: Bump ICharger directly to V5
Looks like V4 never existed.

Change-Id: I1999da190461411913e98d98c258a2825fb039d5
2025-09-05 15:48:10 +01:00
Bruno Martins
c0d70dc0f9 interfaces: Update ICharger to V3
Change-Id: Ife15bb3b9f51dbc83bb975a7603f47985e1178bd
2025-09-05 15:47:13 +01:00
Bruno Martins
e8d95112d7 interfaces: Update ICharger to V2
Change-Id: I2ffe384dad647c3e115d6bb1d2e7d85e94d720e5
2025-09-05 15:46:18 +01:00
Bruno Martins
8c1e19bdb8 interfaces: Add vendor.oplus.hardware.charger V1
Change-Id: Ia3916a80e106c3b92428b1239c0fae90b8a5eaf3
2025-09-05 15:45:00 +01:00
Bruno Martins
a9438581bb sepolicy: qti: Add inital eSIM support
Change-Id: Iae2d3c17a6eb5a9b1c71198c8ac861ad4e5f85d5
2025-09-05 13:42:42 +00:00
Bruno Martins
63795ed4d4 sepolicy: qti: Update compatibility mapping files
Change-Id: I6d10fa03042e4f360a494a7eb2c9ffd0502c86a4
2025-09-04 16:05:55 +01:00
chandu078
8acb73ff6a sepolicy: qti: Add support for horae service
Service required for thermal management, as it reports and updates shell
temperature to /proc/shell-temp.

Change-Id: I02e2ddeda461cbb2ead1348edc6ebf57b8f7fdde
2025-09-04 13:30:17 +01:00
LuK1337
3633fe6cbe oplus: Get rid of in_ prefix
Change-Id: Ibdafd315098ccc54ec19f298bdb28cb894017489
2025-09-04 11:17:09 +00:00
pjgowtham
b122025d2d Introduce vendor.oplus.hardware.performance-service
Dummy service named differently from the stock one to avoid conflicts.

This can be used on devices that do not include CPU ricing, but still
require the service to register for camera and prebuilt audio stack to
actually work.

Change-Id: I41087aefe9af57e7a1161a3a71ab3b9e849925f2
2025-09-04 10:14:22 +00:00
pjgowtham
8ecfa3412a interfaces: Add vendor.oplus.hardware.performance V1
Change-Id: I5a56cdc826495e1770905e3286bcbc2bef0cf2a3
2025-09-04 10:16:09 +01:00
LineageOS Infra
826524b2cb Automatic translation import
Change-Id: I433a0975161c90f6e9cec98e824f56c3c80e39a1
2025-09-01 14:54:29 +00:00
Bruno Martins
8393454ee6 usb_compositions: Restore QCOM VID/PID combos for diag
This re-allows installing Qualcomm drivers for accessing diag,
serial_cdev, rmnet (and others) devices. Needed for QPST Flash Tool.

Change-Id: Iafe2236bb63adb005bfecae46887c58c69db8ca2
2025-09-01 14:03:27 +00:00
dianlujitao
0b09eeb4b7 KeyHandler: Populate tri-state-key state on boot
Change-Id: I11e785b5824d581f748e038f292c8846b2a13a0f
2025-09-01 14:50:41 +01:00
LuK1337
23a4f0c429 sepolicy: qti: Add system_oplus_radio_prop to *.ignore.cil
Change-Id: If943028a54f7a7f32f289bf080f6565052bdaf40
2025-08-31 20:00:33 +02:00
pjgowtham
0ad31fba1e sepolicy: qti: Let qti secure_element rw /dev/nq-nci
vendor.qti.secu: type=1400 audit(0.0:2346): avc:  denied  { getattr }
for  path=/dev/nq-nci dev=tmpfs ino=1371
scontext=u:r:hal_secure_element_default:s0
tcontext=u:object_r:nfc_device:s0 tclass=chr_file permissive=1

Spotted on ferrari.

Change-Id: I8869fffae3cc6028b6b8ff009bd84108e2a53ada
2025-08-25 13:59:35 +02:00
pjgowtham
9b27b2665b fingerprint: Shim property_get() as well
On OnePlus Nord CE3 (ziti), shimming `__system_property_get()` is not
enough. Without this change, `vendor.fingerprint.cali` is set to 0 when
`ro.boot.vbmeta.device_state` is unset.

Test: Ensure adb logcat | grep "lcd LockState" does not show up as NULL
      Ensure adb shell getprop vendor.fingerprint.cali is 1
Change-Id: I913f00db1542a28aaaa11dba93fcce67b39717bf
2025-08-25 09:49:43 +00:00
pjgowtham
1477e8b42e sepolicy: qti: Label awinic vibrator sysfs for ziti
Change-Id: I6543983b6de8f7852015ea6a304be9aa809dc65f
2025-08-24 21:23:41 +05:30
LuK1337
4af7f26d3f sepolicy: qti: oplusSensor -> oplus_sensor
Matches new AIDL naming style.

Change-Id: I93a22091f54df5c48d105bc82d51b90bcf1e59e3
2025-08-22 10:06:40 +02:00
pjgowtham
04441ff343 sepolicy: qti: Label and add rules for oplusSensor AIDL
Change-Id: I451d7bf6bb110ed900ff5258cdcf6566945ab490
2025-08-22 10:06:39 +02:00
pjgowtham
93e8cfc069 sepolicy: qti: Let vendor_hal_oplusSensor_default search /dev/block
Change-Id: I248bd96c9753a4c9f51643368a0a5f67d52729df
2025-08-22 09:58:37 +02:00
pjgowtham
17d525da8f sepolicy: qti: Let hal_oplus_charger_aidl rw /dev/oplus_chg
Change-Id: I222aed7542f5750a3fe2f062998237bc00d22a3a
2025-08-22 09:49:45 +02:00
pjgowtham
af977627d4 sepolicy: qti: Let hal_oplus_charger_aidl rw vendor_sysfs_battery_supply
Change-Id: I058aad89acba10eaae84734341d30d1efa8e4a2f
2025-08-22 09:49:45 +02:00
pjgowtham
00c112c97a sepolicy: qti: Update qseecom rules for fingerprint
Change-Id: I34cbd4642f1c03446d1e57da079e5e495c2326cc
2025-08-22 07:43:54 +00:00
pjgowtham
9914060348 sepolicy: qti: Label goodix fingerprint property
W /system/bin/init: type=1107 audit(0.0:13): uid=0 auid=4294967295
ses=4294967295 subj=u:r:init:s0 msg='avc:  denied  { set } for
property=gf.debug.dump_data pid=1873 uid=1000 gid=1000
scontext=u:r:hal_fingerprint_default:s0 tcontext=u:object_r:default_prop:s0
tclass=property_service permissive=0'

Change-Id: I07acc42f6a5cba7e7b94f8473feb0540eee9096c
2025-08-22 07:43:54 +00:00
pjgowtham
abe43816a2 sepolicy: qti: Let camera hal rw /proc/qcom_flash
On Ziti (OnePlus Nord CE 3), this seems necessary for the torchlight
function to work.

Change-Id: I37ac5d7a1578d939d61728e8292c47b2fa9d870d
2025-08-22 09:35:36 +02:00
pjgowtham
655f8c1814 sepolicy: qti: Label wly wakeup nodes
wly / # cat /sys/devices/platform/soc/984000.i2c/i2c-5/5-003b/name
p9415-rx
wly / # cat /sys/devices/platform/soc/990000.i2c/i2c-6/6-004b/name
synaptics-s3908
wly / # cat /sys/devices/platform/soc/a84000.i2c/i2c-8/8-0028/name
sn-nci

Change-Id: I8aef0c21df2af86b06515ef609729c352770a260
2025-08-22 09:28:01 +02:00
pjgowtham
8da66b3786 sepolicy: qti: Label ferrari wakeup nodes
ferrari / # cat /sys/devices/platform/soc/990000.i2c/i2c-5/5-004b/name
synaptics-s3908
ferrari / # cat /sys/devices/platform/soc/a84000.i2c/i2c-7/7-0028/name
sn-nci

Change-Id: Ia2af6499a912697694ee24f209726a974887545f
2025-08-22 09:26:25 +02:00
pjgowtham
19cd98ab96 sepolicy: qti: Label lunaa/ziti wakeup nodes
lunaa / # cat /sys/devices/platform/soc/a84000.i2c/i2c-1/1-0008/name
st21nfc
lunaa / # cat /sys/devices/platform/soc/a94000.i2c/i2c-2/2-0038/name
fts
ziti / # ls /sys/devices/platform/soc/a94000.spi/spi_master/spi1/spi1.0/
driver           fts_rw_reg  supplier:18200000.rsc:rpmh-regulator-ldoc12
driver_override  input       supplier:18200000.rsc:rpmh-regulator-ldoc3
fts_dump_reg     modalias    supplier:f000000.pinctrl
fts_esd_check    of_node     supplier:regulator.36
fts_fw_version   power       supplier:regulator.47
fts_hw_reset     statistics  uevent
fts_irq          subsystem   wakeup

Change-Id: I2933a1fb695f72cd859d6654947ac37bd7f3f77f
2025-08-21 17:22:41 +05:30
LuK1337
4ee6ecda7e livedisplay: Add IAdaptiveBacklight support
Change-Id: Id11b96f58efb494b05e089d9954139d0c01366be
2025-08-18 00:16:52 +02:00
LuK1337
ef177ba4aa kernel-headers: Add PANEL_IOCTL_{GET,SET}_CABC_STATUS
Change-Id: I011b689bbba2888d3d7bf94cfc8e012d2ea3bfaf
2025-08-17 23:55:40 +02:00
LuK1337
622f8070f3 livedisplay: Migrate to AIDL
Change-Id: I8dbe9ed99549aff3e7fcff553482a4c45aae67ef
2025-08-17 23:40:08 +02:00
basamaryan
55dd4cee89 sepolicy: qti: Label missing SM8350 wakeup nodes
MT2111_IND / # cat /sys/devices/platform/soc/884000.i2c/i2c-10/10-0028/name
sn-nci
MT2111_IND / # cat /sys/devices/platform/soc/990000.i2c/i2c-7/7-004b/name
synaptics-s3908

Change-Id: I76b2da5f17b2b64254a8f21e328352bb0743bcf0
2025-08-17 21:19:08 +02:00
Michael Bestas
fc992cd6c8 overlay: qssi: Remove deprecated telephony overlays
These are no longer wired up and should be set in CarrierConfig
where needed

Change-Id: Ie16d41b2ee73c77c3475dd0b24e4d46804195a5c
2025-08-15 21:39:22 +00:00
Cosmin Tanislav
037413d7ac overlay: qssi: Remove unused config_speed_up_audio_on_mt_calls
Change-Id: I2860ab34e0252418236a4d90623b4fbfc6ad994a
2025-08-15 21:39:11 +00:00
dianlujitao
d3b35847b1 IFAAService: Wire up oplus fingerprint pay AIDL
Change-Id: Ibbac7e3c4d6591b712cbdcfb3eda955fbb78f8f3
2025-08-10 15:38:47 +01:00
dianlujitao
6be8136317 Import IFAAService from hardware/xiaomi
Change-Id: I55b8c0d1a8832b85f90fb0874d93a146be772176
2025-08-10 15:38:47 +01:00
dianlujitao
179e2abe46 sepolicy: qti: Add support for fingerprint pay
Change-Id: I298b9b1c8b733c05fd16687ec06fa9dd916e972c
2025-08-10 15:38:45 +01:00
dianlujitao
5d5ed9cad8 Add vendor.oplus.hardware.biometrics.fingerprintpay-V1 AIDL interface
Based on CPH2653_15.0.0.840

Change-Id: I65d6755874e96b905c4a528dcdf000d30a159314
2025-08-09 11:04:37 +01:00
dianlujitao
0d8b5aa9d4 sepolicy: Move attributes to public
Change-Id: I527559b1a970cbbeefff0825a494be0d577ecda3
2025-08-09 11:04:37 +01:00
Vivekachooz
08ff2f8522 sepolicy: qti: Label missing sm6375 wakeup nodes
Change-Id: Ia2123ff041617a39d34bc691d9cc662a2f60daec
2025-08-08 20:17:33 +05:30
Sebastiano Barezzi
91ac590976 overlay: qssi: Drop MMS user agent overlays
* Current profile URL points to a 404 page

Change-Id: I92f3ded52dda04f6cec5709d51c84b32f39d8095
2025-08-06 17:18:07 +02:00
LuK1337
f9faa7d9ed sepolicy: qti: Remove unwanted newline at the end of genfs_contexts
Accidentally introduced with e8f2b8aacd.

Change-Id: I6b902f867f6282781073a635a69ac8cc77575c4e
2025-08-02 22:35:44 +02:00
dianlujitao
5be9c6e55b Introduce nrmodeswitcher
This configures the NR mode to "SA Preferred" upon each boot (a setting
that persists even after a factory reset), which is desirable in most
cases. The mode can be customized using ro.vendor.radio.auto_nr_mode:
  0: NSA Preferred
  1: NSA Only
  2: SA Only
  3: SA Preferred

Change-Id: I86ad739167a51af04c041887a93462bf5bb5e32f
2025-07-30 22:45:08 +01:00
pjgowtham
29a150eca3 wvmkiller: Restart widevine hal 1.4 on disabling L1
Change-Id: I7690e13524418204c005e3e562dc951a90bdbdd1
2025-07-30 22:42:26 +01:00
dianlujitao
39ad2e265c Add vendor.oplus.hardware.radio-V2 AIDL interface
Based on oplus-telephony-common.jar from qssi_64-user 15 AP3A.240617.008 1748422485332 release-keys

Change-Id: I90058c22ca1317967605690165efd0c5c4504fed
2025-07-27 10:31:02 +01:00
dianlujitao
8fa8bee879 Add vendor.oplus.hardware.radio-V1 AIDL interface
Based on oplus-telephony-common.jar from qssi-user 14 UKQ1.230924.001 1699668118465 release-keys

Change-Id: I3b29f44a9e3a3c2b2c5fd843d3d19b37eb0037c0
2025-07-27 10:31:02 +01:00
Bruno Martins
9315077c67 interfaces: Add vendor.oplus.hardware.esim V1
Change-Id: I7cbbdc8910073261b3f07603b3dc012de3fdbfc0
2025-07-27 10:31:02 +01:00
Bruno Martins
a2bf842855 sepolicy: qti: Label oplus sensor props
Change-Id: I72fca9f8507cace163f1e344d60f619d1d87e3e9
2025-07-27 10:31:02 +01:00
chandu078
5da3fbb258 sepolicy: qti: Allow rild to search oplus_reserve_file
Change-Id: I4d700def0c84da2cda2af8e88b6cac224b6dffc3
2025-07-26 21:20:50 +05:30
Bruno Martins
21cab7e9a9 usb_compositions: 0x05C6 -> 0x22D9
Wrong VID causes ADB/USB issues on Windows.

Change-Id: Iadf9c00b679af90614553957142ae839c9d74492
Signed-off-by: inferno0230 <mail@inferno0230.in>
2025-07-22 22:05:34 +00:00
Bruno Martins
3b02db249a sepolicy: qti: Add support for pogo pin keyboard
Change-Id: I941e779c380f85edb61c69fcf891dacd40921d9f
2025-07-19 23:46:02 +01:00
Bruno Martins
8ae42047ec vintf: Add pogo pin keyboard interface
Change-Id: I13e53a96f10ad82d450b4acb7106e4aa39e7686c
2025-07-19 23:46:02 +01:00
LuK1337
e8f2b8aacd sepolicy: qti: Label OnePlus Pad 3 wakeup nodes
Change-Id: Ife85a0aee81ee79c115aeaf475b130fae7177fa1
2025-07-19 18:36:42 +00:00
LuK1337
f6bd8f76c4 sepolicy: qti: Add rules for nvram{_qmi,_server}
Spotted on erhai.

Change-Id: Idec44370c5e51fd65394fd7c9523b905d9a400d1
2025-07-19 18:36:42 +00:00
LuK1337
d4cfb60cf7 Introduce OplusPen
Change-Id: Icfc9d2d8172aa01bf1c71a5a23a8e6387660a746
2025-07-19 18:36:42 +00:00
LineageOS Infra
d58d8728aa Automatic translation import
Change-Id: I06723c2cb0ac2c6d2d6c693eb2927ffd7f9f54a7
2025-07-15 17:08:20 +00:00
Bruno Martins
363fa24baa vintf: Update fwk matrix for OOS 15.0.2
Change-Id: I3b851053dc540ee94b49128119ddb06146b5c6ed
2025-07-12 17:53:54 +00:00
Bruno Martins
a18c5e4bd5 sepolicy: qti: Label reserve files
Not everything is used, but it doesn't hurt to be labeled.

Change-Id: I540ab1c8617702d36a1da62feb3c5db2dd00ad99
2025-07-12 17:04:16 +01:00
LuK1337
c890a7708a sepolicy: qti: Use custom label for oplus subsys_imsrtp
Matches stock ROM (and fixes build for older platforms).

Also, it seems like the previous rule was wrong anyway given that it
allowed wrong domain to register this service.

Change-Id: Iad2e3e9a4b1b73c989571d37ae58cac91b018ecb
2025-07-08 09:46:45 +02:00
Michael Bestas
8c9358776c sepolicy: qti: Remove duplicate labels
Change-Id: I3575e6bad93b2f9d69f94033944c44b7f9fbc243
2025-07-07 13:52:00 +03:00
Bruno Martins
1a462ed83c touch: Implement GloveMode support
Change-Id: I1bb2f502e5b6947dfb2d68572b098d0e5b058c28
2025-07-06 23:56:31 +01:00
Bruno Martins
74dbc92458 Euicc: Add OnePlus 13 support
Change-Id: I970d9fbc0ee975962887ea0d61beeee5001183cf
2025-07-06 23:56:31 +01:00
chandu078
6c901c1bef sepolicy: qti: Bring up support for dodge (OnePlus 13)
Co-authored-by: Bruno Martins <bgcngm@gmail.com>
Change-Id: I63828b2c1cb27524845cc63271c0978de78b3374
Signed-off-by: chandu078 <chandudyavanapelli03@gmail.com>
2025-07-06 23:56:31 +01:00
dianlujitao
12190ecbc4 aidl: vibrator: qti: load effects from blobs
Change-Id: I55350bea3b7c4f31a62b60a6792ba2a343c72970
2025-07-06 23:01:45 +01:00
dianlujitao
b0fb5146b2 vintf: add more AIDL services to device FCM
Change-Id: I1f61cb7a96d23ce90fa6be7a2431015b2a727be1
2025-07-06 14:51:27 +01:00
DtHnAme
00f0edf25e power: Implement DT2W through OplusTouch
Co-authored-by: Maitreya25 <maitreyapatni25@gmail.com>
Co-authored-by: Mashopy <eliasgheeraert@gmail.com>
Co-authored-by: Bruno Martins <bgcngm@gmail.com>
Change-Id: I5ad57428aeefe68c8a188aa1e445f4091cbc0d8a
2025-07-06 14:51:26 +01:00
Maitreya25
165c5e47a9 touch: Support interfacing with stock OplusTouch service
Co-authored-by: inferno0230 <mail@inferno0230.in>
Co-authored-by: Mashopy <eliasgheeraert@gmail.com>
Co-authored-by: Bruno Martins <bgcngm@gmail.com>
Change-Id: I305ac931dac35a7fa422745f4250ffb1145c3bf6
2025-07-06 15:39:16 +02:00
LuK1337
8b6ff63e03 touch: Introduce vendor.oplus.hardware.touch-headers
Change-Id: If93b1305f7ee82f2c954969f83c052d0b3a2772b
2025-07-06 15:39:15 +02:00
chandu078
a6255edcb4 sepolicy: qti: Bring up support for waffle (OnePlus 12)
Co-authored-by: John Galt <johngaltfirstrun@gmail.com>
Change-Id: I5b3a87dda201c5779ab4826352ffddc3d1ce4fd2
Signed-off-by: chandu078 <chandudyavanapelli03@gmail.com>
2025-07-04 03:12:32 +01:00
bengris32
07c948a77c oplus-fwk: Add OplusNecManager stub implementation
* Required by RMX3572 (RMX3572_11.F.08_2080_202407301657) IMS stack.

Change-Id: I471f990a5f3717f0db4d289b8cf6764e10cd47e3
Signed-off-by: bengris32 <bengris32@protonmail.ch>
2025-07-04 02:08:46 +00:00
Bruno Martins
bb5f08081e sepolicy: qti: Rewrite touchdaemon rules
Change-Id: I313ef308979b3428fbb3a01ae44b4a914b479b34
2025-06-29 14:52:38 +00:00
Fenglin Wu
e42da48bbd vibrator: qti: Add external control support for sun platform
Add haptics module in sun platform to support external control.

Change-Id: Ie735e8fb50912156b680fd2bf4a0d38c7d2f1c77
2025-06-29 14:48:01 +00:00
LuK1337
d9b3335f6a vintf: Add ICameraRfiService V3
Spotted on erhai.

Change-Id: I6c3e87167d25f4354ace385f3f0c5d9f114c2bf1
2025-06-29 16:11:45 +02:00
Fenglin Wu
332e7e4baf vibrator: qti: Add external control support for pineapple
Pineapple SOC uses PMIC that has haptics module can support external
control. Add support for it.

Change-Id: I471561a91be8fd054d34dc83860b5b53b8026706
Signed-off-by: madmax7896 <madmax78968@gmail.com>
2025-06-21 11:44:48 +00:00
Bruno Martins
a50f0d25f8 sepolicy: qti: Remove redundant rules
Change-Id: Ic7dd3562f8d84d83180317acc75ee7a3d147c8fa
2025-06-21 11:29:33 +00:00
LuK1337
3f8e847483 sepolicy: qti: LC_ALL=C sort wakeup nodes
Change-Id: Ib92a476695552d848d5d13a856012bf64bff8615
2025-06-19 15:20:16 +02:00
chandu078
f875d13162 Euicc: Add OnePlus 12 support
Change-Id: I9a3c9f37ce3e905ea1c69a8877f99201dc758b52
Signed-off-by: chandu078 <chandudyavanapelli03@gmail.com>
2025-06-19 15:04:28 +02:00
chandu078
a0c3a0b5fb vintf: Update fwk matrix to support waffle
Based on relevant interfaces from CPH2581_15.0.0.510(EX01)

Change-Id: Iaddd07fdfcf8d06642ce091c55051292ea545aef
Signed-off-by: chandu078 <chandudyavanapelli03@gmail.com>
2025-06-18 18:29:51 +00:00
Michael Bestas
b3c23f51f2 overlay: qssi: Remove deprecated config_mobile_tcp_buffers/networkAttributes
Change-Id: Ieda947e283cde11cf74a01dc1b438e1deeb902c9
2025-06-16 22:28:48 +01:00
Bruno Martins
dc9a1d06e2 touch: Use CHECK_EQ(a, b) assertion
Change-Id: I7522c86f168a2a5226b2ef28903afa74cee62997
2025-06-07 19:00:50 +01:00
Bruno Martins
ae39496553 touch: Enable HighTouchPollingRate by default
Every new device supports the feature.

Change-Id: I9a08dfb6f8f416af99f9811aa1fa1f1166d2b9f4
2025-06-06 20:56:56 +00:00
Bruno Martins
a79e50e87a touch: Add soong configuration for features
Change-Id: I73870f82b6dfc5f9b13e1a450796060bc8dc58f1
2025-06-06 20:56:56 +00:00
Bruno Martins
cfceb7c1c3 touch: Migrate to AIDL
Change-Id: I7fc7992744df049835213c58261eb81579d6f3c1
2025-06-06 20:56:56 +00:00
LuK1337
90b33a8325 powershare: Use EX_SERVICE_SPECIFIC exception code for setEnabled()
Makes it match hardware/lineage/interfaces/powershare/aidl/default.

Change-Id: I5a4978cc7b62127dd00795dd6aaff10c2f2ade38
2025-05-27 00:39:02 +02:00
Michael Bestas
8e39a4f7a4 configs: Create usb_compositions.conf with OPPO USB IDs
Change-Id: I5ed2df909951675e9a9a9dfbe3c7ff7ddcdaeafe
2025-05-23 20:50:10 +00:00
Bruno Martins
7f612125c2 powershare: Migrate to AIDL
Change-Id: I181478469e0de7e913a8e3fb665155b63a74f63a
2025-05-10 11:48:17 +00:00
Alexander Koskovich
c085cde213 sepolicy: qti: Label missing wakeup node on OP9
Error opening kernel wakelock stats for: wakeup85 (../../devices/platform/soc/990000.i2c/i2c-9/9-0048/wakeup/wakeup85): Permission denied

Change-Id: I2ade1c6a791bc3f184cba70c763b8b511b526cea
2025-04-27 04:27:01 +00:00
Bruno Martins
ec00c65468 powershare: Fix PowerShare QS tile state toggle
Assuming that the node exists and is writable, this was always
returning true, causing the QS tile state to look as turned on
even after disabling the feature.

Change-Id: I6c833438e500a8050cd0a27fe576d789e86a727e
2025-04-25 13:10:19 +00:00
Bruno Martins
9ca0fcaa96 vintf: Mark all HALs as optional
Change-Id: Ic00e778bd4e60c7ba1b3e4d2a25f79bca8277cfc
2025-04-21 00:05:19 +01:00
LineageOS Infra
df48e72f9c Automatic translation import
Change-Id: I92ebfad3057ce416cbc2f3567d30924b8b634a2d
2025-04-15 13:55:17 +00:00
Mashopy
406d2da3d3 vibrator: richtap: Fixup service declaration for loading AAC effects
The previous declaration was resulting in non-working vibrator effects
on vitamin due to the perms being set too late and the service running
too soon at the same time.

This match vitamin's vendor.oplus.hardware.vibrator-service declaration.

Change-Id: Iec7bf9c070da280b9b4920b4d85a22abea3aad67
2025-04-13 23:45:55 +00:00
Mashopy
4cdcb94010 oplus: Run bpfix
Change-Id: Ida4dd24167f0f15b1e67a3ae3f73454caa4e1f6e
2025-04-13 23:45:13 +00:00
LuK1337
1fc2c39807 sepolicy: qti: Label just crtc early_wakeup
Prevents us from overriding QCOM sepolicy rules.

Change-Id: I8c7446b4aa04503af7efc11a53f67b1edb6e3b1e
2025-04-09 19:21:16 +02:00
LineageOS Infra
93e25021b2 Automatic translation import
Change-Id: Ife02e8ee27d8d656c6a24e28b86ffaab03b762e2
2025-04-07 16:25:24 +00:00
Bruno Martins
ba4c32da03 oplus: Declare hidl_pixelworks_feature_interface
Change-Id: I0896a93cc6c44628d5b79c75e58db9dcf6f58683
2025-04-06 00:51:34 +01:00
Bruno Martins
d5f168f6a8 aidl: vibrator: Drop compile_multilib from dummy richtap lib
Not necessarily needed and prevents builds to start on 32-bit-only
targets with this repository also present.

Change-Id: Ic9838753240a25883d591b4be385691f2e070a07
2025-03-31 17:39:50 +00:00
Bruno Martins
fd03aaaed9 fingerprint: Do not notify AIDL HAL about touch events
As previously noticed with uff fingerprint HIDL HAL, Oplus makes
use of touch down/up events for product testing. With the most
recent AIDL HAL, entering the code paths for factory tests breaks
fingerprint registration.

By setting halHandlesDisplayTouches prop to true, the framework
will skip passing the display touch events in ISession#onPointerDown
and ISession#onPointerUp down to the HAL.

Change-Id: I194719f27c182d044c0f4e349c3e0ef032361fbd
2025-03-28 08:03:04 +00:00
Edwin Moquete
a6435e6bc0 doze: Fix compilation on V QPR2
Change-Id: If1693603abc530af3b761b53396f2dda8225177e
2025-03-12 23:35:45 +00:00
Cosmin Tanislav
18ef7dd547 oplus: switch to common QCOM AIDL bootctrl HAL
Change-Id: I04ab771d3b1c38b58913607fbff1bb3b55e1fe25
2025-03-12 04:36:08 +00:00
LuK1337
41fb946c65 audio_amplifier: Add lahaina SoC
Change-Id: Icb52dd78e34e6cfd8f4f3e93917f32e9660ca602
2025-03-07 14:53:54 +01:00
e50dfe2d6c doze: Move to PreferenceFragmentCompat
PreferenceFragment was deprecated in API level 28.

https://developer.android.com/jetpack/androidx/releases/preference#1.1.0

Change-Id: Ie8a4b04bd588afbbbc5882349ddbc05f988f80bf
Signed-off-by: AnierinB <anierin@evolution-x.org>
2025-02-26 23:00:34 +00:00
Bruno Martins
aaf90056ca sepolicy: qti: Address new denials with fingerprint AIDL HAL
Change-Id: I6c0834bc7fba8e9ea7bb1955e8ff29b7009de383
2025-02-26 00:22:54 +00:00
LuK1337
7591d33cea fingerprint: Add a shim to manipulate fingerprint SensorProps
OPlus fingerprint AIDL reports sensor properties through custom system
properties rather than the standard IFingerprint::getSensorProps
interface, so AOSP is not aware of them.

Provide a shim to hijack the binder interface and standardize these
custom system properties.

These properties are read from TA and automatically set when the
fingerprint AIDL starts. Possible values are based on observation from
OplusCommercialEngineerMode.apk.

Co-authored-by: dianlujitao <dianlujitao@lineageos.org>
Change-Id: Ia25e0c007af845c14fb98cb201bac334d70a74a4
2025-02-26 00:22:54 +00:00
Bruno Martins
63127da10c fingerprint: Move shims and UDFPS extension out of HIDL
Change-Id: I29e31088c6380076221ad419a195a460079165d6
2025-02-26 00:22:54 +00:00
Bruno Martins
48f3da9e08 sepolicy: Label commondcs service and adjust rules
Change-Id: If5d76109413e54c9f5a78aea7490b71dd7687d1e
2025-02-26 00:22:54 +00:00
Bruno Martins
5134fa4830 Introduce vendor.oplus.hardware.commondcs-service
Change-Id: I4d91094cc2274a168b147a53d5ebe412a867e920
2025-02-26 00:22:54 +00:00
Bruno Martins
9f1f2c1765 interfaces: Add vendor.oplus.hardware.commondcs V1
Change-Id: I181fd1da49dc124ebfe631f9139149327ed4f847
2025-02-26 00:22:54 +00:00
Albert Tang
2f24de9fb5 audio_amplifier: Add holi SoC
Change-Id: Iea9d6e446d9e394eafced3062232a4a65f577296
2025-02-22 20:40:55 +01:00
LuK1337
c0e82d61b6 audio_amplifier: Use hw_module_t->dso instead of RTLD_NEXT
W audio_amplifier: amp_module_open: enable_snd_device not found (undefined symbol: enable_snd_device)
E audio_hw_primary: Amplifier initialization failed

Change-Id: If313889c4749c589d0682982f1d804e4069ffff9
2025-02-22 20:40:55 +01:00
Michael Bestas
ee64733e0f Remove no longer used Android.mk guard
Change-Id: Ia284075607a1ce3d9312c593258d0b1afcd868b2
2025-02-19 22:58:04 +00:00
Michael Bestas
fff84ef56b audio_amplifier: Convert to blueprint
dlopen audio.primary instead of linking against it to avoid soong
namespace hell.

Change-Id: Ic9d420864cb5a6f1018210a84f0f3e6636550caa
2025-02-19 22:58:04 +00:00
Alexander Winkowski
5a4c2cf7a4 audio_amplifier: Make all the functions static
Change-Id: I64b94b6995399b773046928528d9fe5a29cb26f9
2025-02-19 22:58:04 +00:00
Alexander Winkowski
1166219abe audio_amplifier: Fix PCM device check
It should've been && instead of ||, but pcm_open() always
returns a valid pointer, so we just drop the NULL check.

Change-Id: Ibf1d0b34b02ca5910cd4c1bee4d55a04205e2203
2025-02-19 22:58:04 +00:00
Bruno Martins
1177faa26d sepolicy: qti: Allow audio HAL to read debug audio props
Change-Id: Ibe64d56f8451ee1d90f4087ca45e075424a4749b
2025-02-16 17:17:57 +00:00
Bruno Martins
d6563515fa sepolicy: qti: Label ro.sys.engineering.pre prop
Change-Id: I5b25f13b158df6a3e0b63efde70f8750798875e4
2025-02-16 17:17:57 +00:00
LineageOS Infra
81d0ee9346 Automatic translation import
Change-Id: I2607a25274068809ee540c55b4afd42270b5d96a
2025-02-15 15:47:19 +00:00
Bruno Martins
a4ba2641dd sepolicy: qti: Remove duplicate snxxx AIDL rules
These now became a duplicate of qcom/sepolicy_vndr.

Change-Id: I7cac7b77322d88181d0a119ce0b28c678c0202e0
2025-02-14 08:44:04 +00:00
LuK1337
8d237bfc07 bootctrl: Remove HIDL variants
No longer used by anything.

Change-Id: I2dc8a42f8f758b8247eb7b14846e731c48d1601e
2025-02-11 19:05:16 +00:00
Michael Bestas
8aa74e5081 gpt-utils: Make BSG/SG configurable
Change-Id: Ibbadee63bddcf03a259649aec9cb0dab6c206833
2025-02-11 19:05:16 +00:00
Bruno Martins
95e9749902 interfaces: Update OplusTouch to V2
Change-Id: I6982de269930a321a58d5145470ccef5b2da4e45
2025-02-11 01:41:54 +00:00
John Galt
37688c9479 sepolicy: qti: add rules for URCC
Change-Id: I449705696de0bc303df6ae27ef322f2cc74b95b5
2025-02-11 00:18:26 +00:00
John Galt
e3197d473f interfaces: unfreeze touch aidl
Allows building deps for proprietary touch stack

Change-Id: I647b27fa1985fa0ed1bff389295cc6333006495e
2025-02-11 00:18:26 +00:00
Dr-chen99
07bc326cf0 sepolicy: qti: Add touch aidl service as a client of power hal
Change-Id: I4824fadf7c4d590bc7adc3c35996d9101b820022
Signed-off-by: pppig236 <priv@pppig236.com>
2025-02-11 00:18:26 +00:00
John Galt
31ea1b8880 vintf: add oplus touch and urcc
Change-Id: I62ab1be42e0c54b8762a0375127225b87f28c92e
2025-02-11 00:18:26 +00:00
Dr-chen99
2ef6bca1a6 interfaces: import touch aidl
Change-Id: I72363277a140dadf08c39823072578d99dc65753
Signed-off-by: pppig236 <priv@pppig236.com>
2025-02-11 00:18:22 +00:00
pjgowtham
331acdbd34 sepolicy: qti: Label and write rules for oplus_consumer_ir device
Change-Id: I4bb3275183250531324f0a396be0c83c6a5b30fe
2025-02-08 23:25:14 +00:00
pjgowtham
c342915eda Introduce android.hardware.ir-service.oplus
Change-Id: Iffeb34f8c7864dad223d20e1de2a819a345678c6
2025-02-08 23:25:14 +00:00
Bruno Martins
465fa45b1a sepolicy: qti: Partially hide labels of services relocated by Oneplus
Keeping these common labels will break sm8650+ due to no longer existing
types, so make available only when applicable to legacy-um, sm8450 and
sm8550.

Change-Id: Ieb9c703c4cdf1d25bdccd7352055978b14cde8fd
2025-02-08 18:05:17 +00:00
Bruno Martins
71f8171439 oplus: Deprecate NXP NFC and old HALs for good
Seems like these are not used anymore.

Change-Id: I7cf12951fae70d87ef4e33e89c0aa88529c08ac4
2025-02-08 15:50:02 +00:00
Sebastiano Barezzi
ad80010b94 oplus: Keep a single clang-format in rootdir
Change-Id: Iffe5b37c311dc0ed0c9b5c91a2f94e9ff72f4a8a
2025-02-07 19:17:25 +00:00
LuK1337
b2c137ff35 aidl: vibrator: Clean up aac_vibra_function.h
Change-Id: I9ec5c9631679624d8dc710e790d84895de183d54
2025-02-07 12:49:19 +01:00
Bruno Martins
d2bc42dafc aidl: vibrator: Add dummy libaacvibrator shared_lib
All targets must provide it and dummy one will be overriden.

Change-Id: I64b6180e93cf2c34382282dc8574bf79814f096e
2025-02-07 01:09:54 +00:00
Cosmin Tanislav
fe3c661e29 sepolicy: qti: let vibrator service access richtap dev
Change-Id: I19cf413ebe128ac952e2f5237907b7bb7afcbc7f
2025-02-07 00:34:41 +00:00
Cosmin Tanislav
2823ba9b6c sepolicy: qti: label richtap vibrator service
Change-Id: I9e08ded8362b359b60523c07c172d26706e4246d
2025-02-07 00:34:41 +00:00
Cosmin Tanislav
538d6790d0 aidl: vibrator: implement richtap vibrator service
Change-Id: Ieab0cfca22c0fd8a63c33ce2a6a21e982e57aee8
2025-02-07 00:34:28 +00:00
Bruno Martins
32be43fe84 aidl: vibrator: Place modded QTI impl into its own dir
Change-Id: Ie21de7e1ddfd964c9d1b4a838521503887dcc994
2025-02-06 23:12:37 +00:00
Tim Zimmermann
2ac71df739 aidl: Add missing vintf version entries
* This is required for devices using a target-level that actually
  has these HALs in their compatibility matrix

Change-Id: I29cba455ab92e7708ece405bb29ea1c46e46cf41
2025-02-06 23:12:34 +00:00
dianlujitao
309c373f06 bootctrl: add AIDL variants
Change-Id: I2dbcd362490b171f402c080485226d90d8ffaa84
2025-02-06 20:21:18 +00:00
LineageOS Infra
566dd12b55 Automatic translation import
Change-Id: Ife9b592c7f9c5cee1c4b6745bacc1b135870ffca
2025-02-01 14:28:34 +00:00
dianlujitao
2194d3fbac gpt-utils: Add OTA support for pdp partition
Change-Id: Ide7bf934a2592fe50027ff0836190d3b20ea390b
2025-01-30 19:39:40 +08:00
LAVEENA FULWANI
5d9c06b541 gpt-utils: Adding partitions in PTN_SWAP_LIST
Change-Id: I9fadf0a5ff04b44a1cf9172c48a3e87c03511bc6
2025-01-30 19:39:40 +08:00
Roopesh Nataraja
cf82d4e147 gpt-utils: Add OTA support for spuservice partition
Add spuservice partition to PTN_SWAP_LIST to support OTA handling.

Change-Id: I733bd2844e0788b9cc12a33d66e1cc67c6cbc52a
2025-01-30 19:39:40 +08:00
Anubhav
ca7d3a1466 gpt-utils: Fixes in oem-recovery in gpt_boot_chain_swap
Change-Id: I503a51a8aa685534d0f1d5d45ea4d1a539cb07ee
2025-01-30 19:39:40 +08:00
dianlujitao
e773c45961 Revert "gpt-utils: Check ufs device first before checking partition names"
This reverts commit 5cea739d3d.

Change-Id: I2518a79a3fef78a307e6fbf65bfd34dfb49069b8
2025-01-30 19:39:40 +08:00
Karra Harshitha
4d04a8c99b gpt-utils: Add OTA support for pvmfw partition
Add pvmfw partition to PTN_SWAP_LIST
to support OTA handling.

Change-Id: I7bf22c0e9316a7390f133b4651d6fd3f89999b3d
2025-01-30 19:39:40 +08:00
Anthony Adamo
1da51d9614 gpt-utils: Add OTA support for cpucp_dtb partition
add entry for the new cpucp_dtb  partition to the PTN_SWAP_LIST
to support OTA handeling.

Change-Id: Ie36eeffe360be4cb929569d232cab63be3029d09
2025-01-30 19:39:40 +08:00
Bruno Martins
cbbcc714d4 sepolicy: Add service context for ICameraRfiService
Change-Id: Id0b2a950b057202788cee676737837a0d8ecff6f
2025-01-15 20:24:47 +00:00
Bruno Martins
24eb056d25 vintf: Update fwk matrix for OOS 15
Change-Id: I5138658f3db9ef12c15086c3bbcc2a2035eff816
2025-01-15 20:24:29 +00:00
patr_
8691a3526e sepolicy: qti: Move some SM8150/SM8250 wakeup nodes to qcom sepolicy
All of these are labeled already for lito.

Change-Id: I9a6e04b9119826eb95f2003812fca12e13641ae1
2024-12-27 21:50:53 +00:00
patr_
d168819307 vintf: Add version 1.0 for vendor.oplus.hardware.cameraMDM
Used on avicii.

Change-Id: Ib02fb994f391bd015ec2171cfa13690e847b032a
2024-12-08 01:31:58 +01:00
LineageOS Infra
77522b8050 Automatic translation import
Change-Id: Iee296c9cee2dadf859ee0d808824b8e0ecd06224
2024-12-02 02:54:15 +00:00
LuK1337
9bb70db51d sepolicy: qti: Allow sensors to read /proc/oplusVersion/*
E sensors-hal: ambient_light:131, fail to open /proc/oplusVersion/prjName
E sensors-hal: is_aging_vesion:59, fail to open /proc/oplusVersion/engVersion

Change-Id: I2c4f9e00e689a7fa0650d53868b9921d5e8d001c
2024-11-27 18:56:15 +01:00
LuK1337
3899884705 oplus: Add README file with Soong options documentation
Change-Id: I5e8748b748782a654e94ae5ebf69961d4bf9bd46
2024-11-23 20:55:08 +01:00
LuK1337
60f641a773 vibrator: Migrate to select()
Change-Id: I625cfa648f321ba5f3b3d255a42b4d489a7abaef
2024-11-22 22:15:24 +01:00
LuK1337
8b3ffd3d7b livedisplay: Migrate to select()
Change-Id: I5d2d6f351431c13c36bcb7118e3fe5babfbe1872
2024-11-22 21:48:41 +01:00
LuK1337
5acd6429ef touch: Migrate to select()
Change-Id: I92f7a7100c16b133f24c9cc9882093324f64452f
2024-11-22 21:24:49 +01:00
665 changed files with 21474 additions and 3823 deletions

1
.clang-format Symbolic link
View File

@@ -0,0 +1 @@
../../build/soong/scripts/system-clang-format

View File

@@ -1,5 +1,5 @@
//
// Copyright (C) 2022-2023 The LineageOS Project
// SPDX-FileCopyrightText: 2022-2025 The LineageOS Project
// SPDX-License-Identifier: Apache-2.0
//
@@ -7,7 +7,6 @@ soong_namespace {
imports: [
"hardware/google/interfaces",
"hardware/google/pixel",
"hardware/qcom-caf/bootctrl",
],
}
@@ -17,3 +16,10 @@ prebuilt_hidl_interfaces {
"vendor.oplus.hardware.cameraextension@1.0::ICameraExtensionService",
],
}
prebuilt_hidl_interfaces {
name: "hidl_pixelworks_feature_interface",
interfaces: [
"vendor.pixelworks.hardware.feature@1.0::IIrisFeature",
],
}

View File

@@ -1,5 +0,0 @@
ifneq ($(filter $(call my-dir),$(PRODUCT_SOONG_NAMESPACES)),)
include $(call all-subdir-makefiles)
endif

View File

@@ -0,0 +1,39 @@
//
// Copyright (C) 2024-2025 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
android_app {
name: "DSPVolumeSynchronizer",
certificate: "platform",
srcs: ["src/**/*.java"],
platform_apis: true,
privileged: true,
system_ext_specific: true,
static_libs: [
"androidx.core_core",
"SettingsLib",
],
required: [
"privapp-permissions-dspvolume",
"config-dspvolume",
],
}
prebuilt_etc {
name: "privapp-permissions-dspvolume",
relative_install_path: "permissions",
src: "privapp-permissions-dspvolume.xml",
system_ext_specific: true,
filename_from_src: true,
}
prebuilt_etc {
name: "config-dspvolume",
relative_install_path: "sysconfig",
src: "config-dspvolume.xml",
system_ext_specific: true,
filename_from_src: true,
}

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.lineageos.dspvolume.xiaomi"
android:versionCode="1"
android:versionName="1.0"
android:sharedUserId="android.uid.system">
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<application
android:label="@string/app_name"
android:persistent="true"
android:defaultToDeviceProtectedStorage="true"
android:directBootAware="true">
<receiver
android:name=".BootReceiver"
android:exported="true"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
<intent-filter android:priority="999">
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<service
android:name=".VolumeListenerService" />
</application>
</manifest>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<config>
<allow-in-power-save package="org.lineageos.dspvolume.xiaomi" />
<hidden-api-whitelisted-app package="org.lineageos.dspvolume.xiaomi" />
</config>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<privapp-permissions package="org.lineageos.dspvolume.xiaomi">
<permission name="android.permission.INTERACT_ACROSS_USERS" />
<permission name="android.permission.INTERACT_ACROSS_USERS_FULL" />
<permission name="android.permission.MODIFY_AUDIO_SETTINGS" />
<permission name="android.permission.RECEIVE_BOOT_COMPLETED" />
</privapp-permissions>
</permissions>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- App Name -->
<string name="app_name">DSP Volume Synchronizer</string>
</resources>

View File

@@ -0,0 +1,16 @@
package org.lineageos.dspvolume.xiaomi;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class BootReceiver extends BroadcastReceiver {
@Override
public void onReceive(final Context context, Intent intent) {
if (context == null) {
return;
}
context.startService(new Intent(context, VolumeListenerService.class));
}
}

View File

@@ -0,0 +1,28 @@
package org.lineageos.dspvolume.xiaomi;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;
import android.util.Log;
import android.os.Bundle;
public class VolumeListenerReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (context == null) {
return;
}
if(intent.getIntExtra("android.media.EXTRA_VOLUME_STREAM_TYPE", 0) == AudioManager.STREAM_MUSIC) {
AudioManager audioManager = context.getSystemService(AudioManager.class);
int current = intent.getIntExtra(
"android.media.EXTRA_VOLUME_STREAM_VALUE",
0
);
audioManager.setParameters("volume_change=" + current + ";flags=8");
}
}
}

View File

@@ -0,0 +1,30 @@
package org.lineageos.dspvolume.xiaomi;
import android.app.Service;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.os.IBinder;
import androidx.annotation.Nullable;
public class VolumeListenerService extends Service {
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("android.media.VOLUME_CHANGED_ACTION");
registerReceiver(new VolumeListenerReceiver(), intentFilter);
AudioManager audioManager = getSystemService(AudioManager.class);
int current = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
audioManager.setParameters("volume_change=" + current + ";flags=8");
return super.onStartCommand(intent, flags, startId);
}
}

View File

@@ -1,5 +1,5 @@
//
// Copyright (C) 2023 The LineageOS Project
// Copyright (C) 2023-2025 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
@@ -8,33 +8,24 @@ android_app {
name: "OplusEuicc",
srcs: ["src/**/*.kt"],
resource_dirs: ["res"],
sdk_version: "current",
product_specific: true,
certificate: "platform",
privileged: true,
privapp_allowlist: "org.lineageos.euicc.xml",
optimize: {
proguard_flags_files: ["proguard.flags"],
},
required: [
"org.lineageos.euicc.xml",
"hidden-api-whitelist-org.lineageos.euicc.xml",
],
}
prebuilt_etc {
sub_dir: "permissions",
name: "org.lineageos.euicc.xml",
filename: "org.lineageos.euicc.xml",
src: "org.lineageos.euicc.xml",
product_specific: true,
}
prebuilt_etc {
sub_dir: "sysconfig",
name: "hidden-api-whitelist-org.lineageos.euicc.xml",
relative_install_path: "sysconfig",
filename: "hidden-api-whitelist-org.lineageos.euicc.xml",
src: "hidden-api-whitelist-org.lineageos.euicc.xml",
product_specific: true,

View File

@@ -1,9 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 The LineageOS Project
SPDX-FileCopyrightText: 2023-2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="sim_illustration_lottie_mappings_json">{\"sim_illustration_lottie_mappings\":[{\"devices\":[\"OP594DL1\"],\"illustration_lottie\":\"sim_illustration_lottie_bottom\"}]}</string>
<string name="sim_slot_mappings_json">{\"sim-slot-mappings\":[{\"devices\":[\"OP594DL1\"],\"esim-slot-ids\":[1],\"psim-slot-ids\":[0]}]}</string>
<string name="sim_illustration_lottie_mappings_json" translatable="false">
{
\"sim_illustration_lottie_mappings\": [
{
\"devices\": [
\"OP591BL1\",
\"OP5929L1\",
\"OP594DL1\",
\"OP595DL1\",
\"OP5CF9L1\",
\"OP5D0DL1\",
\"OP5D35L1\",
\"OP5D55L1\"
],
\"illustration_lottie\": \"sim_illustration_lottie_bottom\"
}
]
}
</string>
<string name="sim_slot_mappings_json" translatable="false">
{
\"sim-slot-mappings\": [
{
\"devices\": [
\"OP594DL1\",
\"OP595DL1\",
\"OP5D35L1\",
\"OP5D55L1\"
],
\"esim-slot-ids\": [
1
],
\"psim-slot-ids\": [
0
]
},
{
\"devices\": [
\"OP591BL1\",
\"OP5929L1\",
\"OP5CF9L1\",
\"OP5D0DL1\"
],
\"esim-slot-ids\": [],
\"psim-slot-ids\": [
0,
1
]
}
]
}
</string>
</resources>

24
IFAAService/Android.bp Normal file
View File

@@ -0,0 +1,24 @@
//
// Copyright (C) 2022-2025 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
android_app {
name: "IFAAService",
srcs: [
"src/**/*.kt",
"src/**/*.aidl",
],
aidl: {
local_include_dirs: ["src"],
},
static_libs: [
"vendor.oplus.hardware.biometrics.fingerprintpay-V1-java",
],
certificate: "platform",
platform_apis: true,
system_ext_specific: true,
}

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2022-2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.ifaa.aidl.manager">
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<application
android:label="@string/app_name"
android:persistent="true">
<service
android:name=".IfaaService"
android:exported="true">
<intent-filter>
<action android:name="org.ifaa.aidl.manager.IfaaManagerService" />
</intent-filter>
</service>
</application>
</manifest>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2022-2024 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="app_name">IFAAService</string>
</resources>

View File

@@ -0,0 +1,19 @@
//
// Copyright (C) 2022 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
package org.ifaa.aidl.manager;
interface IfaaManagerService {
int getSupportBIOTypes();
int startBIOManager(int authType);
String getDeviceModel();
byte[] processCmd(inout byte[] param);
int getVersion();
String getExtInfo(int authType, String keyExtInfo);
void setExtInfo(int authType, String keyExtInfo, String valExtInfo);
int getEnabled(int bioType);
int[] getIDList(int bioType);
}

View File

@@ -0,0 +1,197 @@
/*
* SPDX-FileCopyrightText: 2022-2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package org.ifaa.aidl.manager
import android.app.KeyguardManager
import android.app.Service
import android.content.Intent
import android.graphics.Point
import android.hardware.fingerprint.FingerprintManager
import android.os.IBinder
import android.os.ServiceManager
import android.os.SystemProperties
import android.provider.Settings
import android.util.Log
import android.view.WindowManager
import org.json.JSONObject
import vendor.oplus.hardware.biometrics.fingerprintpay.IFingerprintPay
class IfaaService : Service() {
private var _fpPayService: IFingerprintPay? = null
private val fpPayServiceDeathRecipient = IBinder.DeathRecipient {
Log.i(LOG_TAG, "aidl FingerprintPay hal died, reset hal proxy!")
_fpPayService = null
}
private val fingerprintManager by lazy { getSystemService(FingerprintManager::class.java)!! }
private val keyguardManager by lazy { getSystemService(KeyguardManager::class.java)!! }
private val windowManager by lazy { getSystemService(WindowManager::class.java)!! }
override fun onBind(intent: Intent) = object : IfaaManagerService.Stub() {
private val _supportBIOTypes by lazy {
when (SystemProperties.get(FP_TYPE_PROP, "")) {
"back", "side", "front" -> AUTH_TYPE_FINGERPRINT
"ultrasonic", "optical" -> AUTH_TYPE_OPTICAL_FINGERPRINT
else -> AUTH_TYPE_NOT_SUPPORT
}
}
override fun getSupportBIOTypes() = _supportBIOTypes
override fun startBIOManager(authType: Int) = when (authType) {
AUTH_TYPE_FINGERPRINT -> {
applicationContext.startActivity(
Intent(Settings.ACTION_SECURITY_SETTINGS).apply {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
)
COMMAND_OK
}
else -> COMMAND_FAIL
}
private val _deviceModel by lazy { SystemProperties.get(IFAA_MODEL_PROP, "OPLUS-Default") }
override fun getDeviceModel() = _deviceModel
override fun processCmd(param: ByteArray) = try {
getFpPayService()?.ifaa_invoke_command(param)
} catch (e: Exception) {
Log.e(LOG_TAG, "processCmdImpl: ifaa_invoke_command aidl failed", e)
null
}
override fun getVersion() = 4
override fun getExtInfo(authType: Int, keyExtInfo: String) = when (keyExtInfo) {
KEY_GET_SENSOR_LOCATION -> initExtString()
else -> ""
}
override fun setExtInfo(authType: Int, keyExtInfo: String, valExtInfo: String) {
// Do nothing
}
override fun getEnabled(bioType: Int): Int {
if (!keyguardManager.isKeyguardSecure) {
Log.e(LOG_TAG, "No secure keyguard set.")
return BIOMETRIC_NOUSE_NOSET_KEYGUARD
}
return when (bioType) {
AUTH_TYPE_FINGERPRINT -> when {
!fingerprintManager.isHardwareDetected -> {
Log.e(LOG_TAG, "Fingerprint hardware not available!")
BIOMETRIC_NOUSE_SYSTEMLOCKED
}
fingerprintManager.enrolledFingerprints.isNullOrEmpty() -> {
Log.e(LOG_TAG, "Fingerprint not enrolled!")
BIOMETRIC_NOUSE_NOT_ENROLLED
}
else -> BIOMETRIC_USE_READY
}
else -> 0
}
}
override fun getIDList(bioType: Int): IntArray? = when (bioType) {
AUTH_TYPE_FINGERPRINT -> {
val enrolledFingerprintIds = fingerprintManager.enrolledFingerprints?.map {
it.biometricId
}?.toIntArray()
Log.w(LOG_TAG, "getIDList: ${enrolledFingerprintIds}!")
enrolledFingerprintIds
}
else -> null
}
}
private fun getFpPayService() = _fpPayService ?: run {
val binder = ServiceManager.getService("${IFingerprintPay.DESCRIPTOR}/default")
IFingerprintPay.Stub.asInterface(binder)?.also {
binder.linkToDeath(fpPayServiceDeathRecipient, 0)
_fpPayService = it
}
}
private val defaultDisplayDimension by lazy {
val dim1 = displayNoVerify?.supportedModes?.maxByOrNull { it.physicalHeight }
?.run { Point(physicalWidth, physicalHeight) }
val dim2 = windowManager.maximumWindowMetrics.bounds
.run { Point(width(), height()) }
dim1?.let { Point(maxOf(dim1.x, dim2.x), maxOf(dim1.y, dim2.y)) } ?: dim2
}
private val iconDiameter by lazy { SystemProperties.getInt(FP_ICON_SIZE_PROP, 190) }
// Coordinates of the upper left corner
private val iconLocation by lazy {
val iconLocationBottom = SystemProperties.getInt(FP_ICON_LOCATION_PROP, 278)
Point(
(defaultDisplayDimension.x - iconDiameter) / 2,
defaultDisplayDimension.y - iconLocationBottom - iconDiameter / 2
)
}
private fun initExtString() = run {
val displayDimension = windowManager.maximumWindowMetrics.bounds.run {
Point(width(), height())
}
val scale = { pos: Point ->
Point(
pos.x * displayDimension.x / defaultDisplayDimension.x,
pos.y * displayDimension.y / defaultDisplayDimension.y
)
}
val scaledLocation = scale(iconLocation)
val scaledDiameter = scale(Point(iconDiameter, iconDiameter))
JSONObject().apply {
put("type", 0)
put("fullView", JSONObject().apply {
put("startX", scaledLocation.x)
put("startY", scaledLocation.y)
put("width", scaledDiameter.x)
put("height", scaledDiameter.y)
put("navConflict", true)
})
}.toString()
}
companion object {
private val LOG_TAG = IfaaService::class.simpleName!!
private const val AUTH_TYPE_NOT_SUPPORT = 0
private const val AUTH_TYPE_FINGERPRINT = 1
private const val AUTH_TYPE_OPTICAL_FINGERPRINT = 1.shl(4).or(AUTH_TYPE_FINGERPRINT)
private const val BIOMETRIC_USE_READY = 1000
private const val BIOMETRIC_NOUSE_SYSTEMLOCKED = 1001
private const val BIOMETRIC_NOUSE_NOT_ENROLLED = 1002
private const val BIOMETRIC_NOUSE_NOSET_KEYGUARD = 1003
private const val COMMAND_OK = 0
private const val COMMAND_FAIL = -1
// Populated by fingerprint HAL
private const val FP_TYPE_PROP = "persist.vendor.fingerprint.sensor_type"
private const val FP_ICON_SIZE_PROP = "persist.vendor.fingerprint.optical.iconsize"
private const val FP_ICON_LOCATION_PROP = "persist.vendor.fingerprint.optical.iconlocation"
// NOTE: Populate ifaaModel from /my_stock/etc/sys_alipay_model_list.json
private const val IFAA_MODEL_PROP = "sys.oplus.ifaa.model"
private const val KEY_GET_SENSOR_LOCATION = "org.ifaa.ext.key.GET_SENSOR_LOCATION"
}
}

View File

@@ -2,7 +2,6 @@ android_app {
name: "KeyHandler",
srcs: ["src/**/*.kt"],
resource_dirs: ["res"],
certificate: "platform",
platform_apis: true,

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018, 2021-2022 The LineageOS Project
Copyright (C) 2018, 2021-2025 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.
@@ -17,6 +17,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:sharedUserId="android.uid.system"
package="org.lineageos.settings.device">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
@@ -41,17 +42,19 @@
<!-- Additional button settings (Button settings) -->
<activity
android:name=".ButtonSettingsActivity"
android:label="@string/button_panel_title"
android:exported="false">
android:label="@string/alert_slider_category_title"
android:exported="true">
<intent-filter>
<action android:name="org.lineageos.settings.device.ADDITIONAL_BUTTONS_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
<action android:name="com.android.settings.action.IA_SETTINGS" />
</intent-filter>
<meta-data
android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.sound" />
</activity>
<service
android:name=".KeyHandler"
android:permission="KeyHandlerService"
android:exported="false" />
android:exported="true" />
</application>
</manifest>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="alert_slider_category_title">Плъзгач за предупреждение</string>
<string name="alert_slider_selection_dialog_title">Действие</string>
<string name="alert_slider_top_position">Горна позиция </string>
<string name="alert_slider_middle_position">Средна позиция</string>
<string name="alert_slider_bottom_position">Долна позиция</string>
<string name="alert_slider_mode_none">Нищо</string>
<string name="alert_slider_mode_silent">Без звук</string>
<string name="alert_slider_mode_normal">Нормален</string>
<string name="alert_slider_mode_vibration">Вибрация</string>
<string name="alert_slider_mode_dnd_priority_only">Само важни</string>
<string name="alert_slider_mode_dnd_total_silence">Тотална тишина</string>
<string name="alert_slider_mode_dnd_alarms_only">Само будилници</string>
<string name="alert_slider_mute_media_title">Заглуши</string>
<string name="alert_slider_mute_media_summary">Заглуши само когато се превключва в тих режим</string>
</resources>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="alert_slider_category_title">نوار لغزنده هشدار</string>
<string name="alert_slider_selection_dialog_title">عمل</string>
<string name="alert_slider_top_position">موقعیت بالا</string>
<string name="alert_slider_middle_position">موقعیت وسط</string>
<string name="alert_slider_bottom_position">موقعیت پایین</string>
<string name="alert_slider_mode_none">هیچ</string>
<string name="alert_slider_mode_silent">بی‌صدا</string>
<string name="alert_slider_mode_normal">عادی</string>
<string name="alert_slider_mode_vibration">لرزش</string>
<string name="alert_slider_mode_dnd_priority_only">فقط اولویت ها</string>
<string name="alert_slider_mode_dnd_total_silence">سکوت کامل</string>
<string name="alert_slider_mode_dnd_alarms_only">فقط هشدار ها</string>
<string name="alert_slider_mute_media_title">رسانه بی صدا</string>
<string name="alert_slider_mute_media_summary">هنگام جابجایی به بی‌صدا، رسانه را بی‌صدا کنید</string>
</resources>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="alert_slider_category_title">מתג התראות</string>
<string name="alert_slider_selection_dialog_title">פעולה</string>
<string name="alert_slider_top_position">ממוקם למעלה</string>
<string name="alert_slider_middle_position">ממוקם באמצע</string>
<string name="alert_slider_bottom_position">ממוקם למטה</string>
<string name="alert_slider_mode_none">ללא</string>
<string name="alert_slider_mode_silent">שקט</string>
<string name="alert_slider_mode_normal">רגיל</string>
<string name="alert_slider_mode_vibration">רטט</string>
<string name="alert_slider_mode_dnd_priority_only">עדיפות בלבד</string>
<string name="alert_slider_mode_dnd_total_silence">מושתק לחלוטין</string>
<string name="alert_slider_mode_dnd_alarms_only">שעון מעורר בלבד</string>
<string name="alert_slider_mute_media_title">השתקת מדיה</string>
<string name="alert_slider_mute_media_summary">השתקת מדיה במעבר להשתקה</string>
</resources>

View File

@@ -17,5 +17,5 @@
<string name="alert_slider_mode_dnd_total_silence">Silêncio total</string>
<string name="alert_slider_mode_dnd_alarms_only">Somente alarmes</string>
<string name="alert_slider_mute_media_title">Silenciar mídia</string>
<string name="alert_slider_mute_media_summary">Silenciar mídia ao mudar para modo silencioso</string>
<string name="alert_slider_mute_media_summary">Silenciar mídia ao mudar para o modo silencioso</string>
</resources>

View File

@@ -4,5 +4,10 @@
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="alert_slider_selection_dialog_title">Åtgärd</string>
<string name="alert_slider_mode_none">Inget</string>
<string name="alert_slider_mode_normal">Normal</string>
<string name="alert_slider_mode_vibration">Vibration</string>
<string name="alert_slider_mode_dnd_priority_only">Endast prioritet</string>
<string name="alert_slider_mode_dnd_alarms_only">Endast alarm</string>
</resources>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="alert_slider_top_position">முதற் நிலை</string>
<string name="alert_slider_middle_position">நடு நிலை</string>
<string name="alert_slider_bottom_position">கீழ் நிலை</string>
<string name="alert_slider_mode_none">இல்லை</string>
<string name="alert_slider_mode_silent">ஒலியின்மை</string>
</resources>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="alert_slider_category_title">ئاگاھلاندۇرۇش سىيرىغۇچ</string>
<string name="alert_slider_selection_dialog_title">مەشغۇلات</string>
<string name="alert_slider_top_position">چوققا نۇقتا</string>
<string name="alert_slider_middle_position">ئوتتۇرا نۇقتا</string>
<string name="alert_slider_bottom_position">ئاستى نۇقتا</string>
<string name="alert_slider_mode_none">يوق</string>
<string name="alert_slider_mode_silent">ئۈنسىز</string>
<string name="alert_slider_mode_normal">ئادەتتىكى</string>
<string name="alert_slider_mode_vibration">تىترەت</string>
<string name="alert_slider_mode_dnd_priority_only">ئالدىنلىقلا</string>
<string name="alert_slider_mode_dnd_total_silence">تامامەن ئۈنسىز</string>
<string name="alert_slider_mode_dnd_alarms_only">قوڭغۇراقلا</string>
<string name="alert_slider_mute_media_title">ۋاسىتە ئۈنسىز</string>
<string name="alert_slider_mute_media_summary">ئۈنسىز ھالەتكە ئالماشتۇرغاندا ۋاسىتىنى ئۈنسىزلەيدۇ</string>
</resources>

View File

@@ -5,7 +5,7 @@
-->
<resources>
<!-- Alert slider -->
<string name="alert_slider_category_title">Alert slider</string>
<string name="alert_slider_category_title">Alert slider settings</string>
<string name="alert_slider_selection_dialog_title">Action</string>
<string name="alert_slider_top_position">Top position</string>
<string name="alert_slider_middle_position">Middle position</string>

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 The LineageOS Project
SPDX-FileCopyrightText: 2021-2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="@string/alert_slider_category_title">
<SwitchPreference
<SwitchPreferenceCompat
android:key="config_mute_media"
android:title="@string/alert_slider_mute_media_title"
android:summary="@string/alert_slider_mute_media_summary"

View File

@@ -1,20 +1,26 @@
/*
* Copyright (C) 2021-2024 The LineageOS Project
* SPDX-FileCopyrightText: 2021-2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package org.lineageos.settings.device
import android.os.Bundle
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
class ButtonSettingsActivity : CollapsingToolbarBaseActivity() {
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
fragmentManager.beginTransaction().replace(
com.android.settingslib.collapsingtoolbar.R.id.content_frame,
ButtonSettingsFragment()
).commit()
supportFragmentManager
.beginTransaction()
.replace(
com.android.settingslib.collapsingtoolbar.R.id.content_frame,
ButtonSettingsFragment(),
TAG
).commit()
}
companion object {
private const val TAG = "ButtonSettingsActivity"
}
}

View File

@@ -1,31 +1,15 @@
/*
* Copyright (C) 2021 The LineageOS Project
* SPDX-FileCopyrightText: 2021-2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package org.lineageos.settings.device
import android.os.Bundle
import android.view.MenuItem
import androidx.preference.PreferenceFragment
import androidx.preference.PreferenceFragmentCompat
class ButtonSettingsFragment : PreferenceFragment() {
class ButtonSettingsFragment : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.button_panel)
activity.actionBar!!.setDisplayHomeAsUpEnabled(true)
}
override fun addPreferencesFromResource(preferencesResId: Int) {
super.addPreferencesFromResource(preferencesResId)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.home -> {
activity.finish()
return true
}
}
return super.onOptionsItemSelected(item)
setPreferencesFromResource(R.xml.button_panel, rootKey)
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2023 The LineageOS Project
* Copyright (C) 2021-2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
@@ -41,10 +41,18 @@ class KeyHandler(context: Context) : DeviceKeyHandler {
private var wasMuted = false
private val broadcastReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
val stream = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, -1)
val state = intent.getBooleanExtra(AudioManager.EXTRA_STREAM_VOLUME_MUTED, false)
if (stream == AudioSystem.STREAM_MUSIC && !state) {
wasMuted = false
when (intent.action) {
AudioManager.STREAM_MUTE_CHANGED_ACTION -> {
val stream = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, -1)
val state = intent.getBooleanExtra(
AudioManager.EXTRA_STREAM_VOLUME_MUTED, false
)
if (stream == AudioSystem.STREAM_MUSIC && !state) {
wasMuted = false
}
}
Intent.ACTION_BOOT_COMPLETED -> populateKeyState(false)
}
}
}
@@ -52,7 +60,10 @@ class KeyHandler(context: Context) : DeviceKeyHandler {
init {
context.registerReceiver(
broadcastReceiver,
IntentFilter(AudioManager.STREAM_MUTE_CHANGED_ACTION)
IntentFilter().apply {
addAction(AudioManager.STREAM_MUTE_CHANGED_ACTION)
addAction(Intent.ACTION_BOOT_COMPLETED)
}
)
}
@@ -67,15 +78,19 @@ class KeyHandler(context: Context) : DeviceKeyHandler {
return event
}
when (File("/proc/tristatekey/tri_state").readText().trim()) {
"1" -> handleMode(POSITION_TOP)
"2" -> handleMode(POSITION_MIDDLE)
"3" -> handleMode(POSITION_BOTTOM)
}
populateKeyState(true)
return null
}
private fun populateKeyState(vibrate: Boolean) {
when (File("/proc/tristatekey/tri_state").readText().trim()) {
"1" -> handleMode(POSITION_TOP, vibrate)
"2" -> handleMode(POSITION_MIDDLE, vibrate)
"3" -> handleMode(POSITION_BOTTOM, vibrate)
}
}
private fun vibrateIfNeeded(mode: Int) {
when (mode) {
AudioManager.RINGER_MODE_VIBRATE -> vibrator.vibrate(
@@ -89,7 +104,7 @@ class KeyHandler(context: Context) : DeviceKeyHandler {
}
}
private fun handleMode(position: Int) {
private fun handleMode(position: Int, vibrate: Boolean) {
val muteMedia = sharedPreferences.getBoolean(MUTE_MEDIA_WITH_SILENT, false)
val mode = when (position) {
@@ -124,7 +139,10 @@ class KeyHandler(context: Context) : DeviceKeyHandler {
}
}
}
vibrateIfNeeded(mode)
if (vibrate) {
vibrateIfNeeded(mode)
}
}
}

30
Pen/Android.bp Normal file
View File

@@ -0,0 +1,30 @@
//
// SPDX-FileCopyrightText: 2025 The LineageOS Project
// SPDX-License-Identifier: Apache-2.0
//
android_app {
name: "OplusPen",
srcs: ["src/**/*.kt"],
certificate: "platform",
platform_apis: true,
privileged: true,
system_ext_specific: true,
optimize: {
proguard_flags_files: ["proguard.flags"],
},
required: [
"default-permissions_org.lineageos.pen",
],
}
prebuilt_etc {
name: "default-permissions_org.lineageos.pen",
system_ext_specific: true,
src: "default-permissions_org.lineageos.pen.xml",
sub_dir: "default-permissions",
filename_from_src: true,
}

33
Pen/AndroidManifest.xml Normal file
View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.lineageos.pen">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<application
android:label="@string/app_name"
android:persistent="true"
android:usesNonSdkApi="true">
<receiver
android:exported="true"
android:name=".BootCompletedReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<service
android:exported="false"
android:name=".PenService" />
</application>
</manifest>

View File

@@ -0,0 +1,12 @@
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<exceptions>
<exception package="org.lineageos.pen">
<permission name="android.permission.BLUETOOTH_CONNECT" fixed="false" />
<permission name="android.permission.BLUETOOTH_SCAN" fixed="false" />
<permission name="android.permission.POST_NOTIFICATIONS" fixed="false" />
</exception>
</exceptions>

3
Pen/proguard.flags Normal file
View File

@@ -0,0 +1,3 @@
-keep class org.lineageos.pen.* {
*;
}

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: Material Design Authors / Google LLC
SPDX-License-Identifier: Apache-2.0
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#000000"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="@android:color/white"
android:pathData="M167,840Q146,845 130.5,829.5Q115,814 120,793L160,602L358,800L167,840ZM358,800L160,602L618,144Q641,121 675,121Q709,121 732,144L816,228Q839,251 839,285Q839,319 816,342L358,800ZM675,200L261,614L346,699L760,285Q760,285 760,285Q760,285 760,285L675,200Q675,200 675,200Q675,200 675,200Z" />
</vector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Qələm taxılıb</string>
<string name="tap_to_connect">Bağlanmaq üçün toxunun</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Дигитална писалка е сдвоена</string>
<string name="tap_to_connect">Натисни за сдвояване</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Bolígraf adjunt</string>
<string name="tap_to_connect">Toqueu per connectar</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Pero připojeno</string>
<string name="tap_to_connect">Klepnutím připojit</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Η γραφίδα προσαρτήθηκε</string>
<string name="tap_to_connect">Πατήστε για σύνδεση</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Pen attached</string>
<string name="tap_to_connect">Tap to connect</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Pen attached</string>
<string name="tap_to_connect">Tap to connect</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Pen attached</string>
<string name="tap_to_connect">Tap to connect</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Pen attached</string>
<string name="tap_to_connect">Tap to connect</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Bolígrafo adjunto</string>
<string name="tap_to_connect">Toca para conectar</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">قلم متصل شد</string>
<string name="tap_to_connect">برای اتصال ضربه بزنید</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Stylo attaché</string>
<string name="tap_to_connect">Appuyer pour connecter</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Peann ceangailte</string>
<string name="tap_to_connect">Tapáil chun ceangal</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Toll mellékelve</string>
<string name="tap_to_connect">A csatlakoztatáshoz érintse meg</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Penna attaccata</string>
<string name="tap_to_connect">Tocca per connettere</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">עט מצורף</string>
<string name="tap_to_connect">נגיעה להתחברות</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">ペンを装着しました</string>
<string name="tap_to_connect">タップして接続</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">კალამი მიუერთდა</string>
<string name="tap_to_connect">შეეხეთ მიერთებისთვის</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Dołączone pióro</string>
<string name="tap_to_connect">Dotknij, aby połączyć</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Caneta anexada</string>
<string name="tap_to_connect">Toque para conectar</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Caneta anexada</string>
<string name="tap_to_connect">Toque para conectar</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Stilou atașat</string>
<string name="tap_to_connect">Atingeți pentru a conecta</string>
</resources>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="tap_to_connect">Нажмите, чтобы подключить</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Pisalo priključeno</string>
<string name="tap_to_connect">Tapnite za povezavo</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">எழுத்தாணி இணைக்கப்பட்டது</string>
<string name="tap_to_connect">இணைக்கத் தட்டுக</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">قەلەم ئۇلاندى</string>
<string name="tap_to_connect">چېكىلسە باغلىنىدۇ</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">Đã gắn bút</string>
<string name="tap_to_connect">Chạm để kết nối</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="pen_attached">笔已连接</string>
<string name="tap_to_connect">轻触以连接</string>
</resources>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<!-- Max supported refresh rate when using pen. -->
<string name="config_penSupportedRefreshRate" translatable="false"></string>
</resources>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="app_name" translatable="false">OplusPen</string>
<string name="pen_attached">Pen attached</string>
<string name="tap_to_connect">Tap to connect</string>
</resources>

View File

@@ -0,0 +1,22 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package org.lineageos.pen
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log
class BootCompletedReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
Log.d(TAG, "Received boot completed intent")
context.startService(Intent(context, PenService::class.java))
}
companion object {
private const val TAG = "OplusPenBootReceiver"
}
}

View File

@@ -0,0 +1,226 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package org.lineageos.pen
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.app.Service
import android.bluetooth.BluetoothManager
import android.bluetooth.le.ScanCallback
import android.bluetooth.le.ScanFilter
import android.bluetooth.le.ScanResult
import android.bluetooth.le.ScanSettings
import android.content.Context
import android.content.Intent
import android.database.ContentObserver
import android.hardware.input.InputManager
import android.os.Handler
import android.os.IBinder
import android.os.UEventObserver
import android.provider.Settings
import android.provider.Settings.System.PEAK_REFRESH_RATE
import android.util.Log
class PenService : Service() {
private val bluetoothManager by lazy { getSystemService(BluetoothManager::class.java) }
private val inputManager by lazy { getSystemService(InputManager::class.java) }
private val notificationManager by lazy { getSystemService(NotificationManager::class.java) }
private val penSupportedRefreshRate by lazy { getString(R.string.config_penSupportedRefreshRate) }
private val handler by lazy { Handler(mainLooper) }
private val observer = object : UEventObserver() {
private val lock = Any()
override fun onUEvent(event: UEvent) {
synchronized(lock) {
val pencilStatus = event.get("pencil_status") ?: return
val pencilAddr = event.get("pencil_addr")?.chunked(2)?.joinToString(":") {
it.uppercase()
} ?: return
when (pencilStatus) {
"0" -> notificationManager.cancel(NOTIFICATION_ID)
"1" -> postNotification(pencilAddr)
}
}
}
}
private val inputObserver = object : InputManager.InputDeviceListener {
override fun onInputDeviceAdded(deviceId: Int) {
overridePeakRefreshRateIfNeeded()
}
override fun onInputDeviceRemoved(deviceId: Int) {
overridePeakRefreshRateIfNeeded()
}
override fun onInputDeviceChanged(deviceId: Int) {
// Do nothing
}
}
private val peakRefreshRateSettingsObserver by lazy {
object : ContentObserver(handler) {
override fun onChange(selfChange: Boolean) {
super.onChange(selfChange)
overridePeakRefreshRateIfNeeded()
}
}
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
intent?.getStringExtra(EXTRA_PENCIL_ADDR)?.let {
bondBtDevice(it)
}
return START_STICKY
}
override fun onBind(intent: Intent?): IBinder? = null
override fun onCreate() {
super.onCreate()
if (!penSupportedRefreshRate.isEmpty()) {
contentResolver.registerContentObserver(
Settings.System.getUriFor(PEAK_REFRESH_RATE),
false,
peakRefreshRateSettingsObserver
)
peakRefreshRateSettingsObserver.onChange(true)
inputManager.registerInputDeviceListener(inputObserver, handler)
}
observer.startObserving("DEVPATH=/devices/virtual/oplus_wireless/pencil")
}
override fun onDestroy() {
super.onDestroy()
if (!penSupportedRefreshRate.isEmpty()) {
contentResolver.unregisterContentObserver(peakRefreshRateSettingsObserver)
inputManager.unregisterInputDeviceListener(inputObserver)
}
observer.stopObserving()
}
private fun bondBtDevice(pencilAddr: String) {
val adapter = bluetoothManager.adapter
@Suppress("DEPRECATION") adapter.enable()
val scanner = run {
repeat(50) {
adapter.bluetoothLeScanner?.let {
return@run it
}
Thread.sleep(100)
}
return@run null
}
scanner?.startScan(
listOf(ScanFilter.Builder().setDeviceAddress(pencilAddr).build()),
ScanSettings.Builder()
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
.setReportDelay(0L)
.build(),
object : ScanCallback() {
override fun onScanResult(callbackType: Int, result: ScanResult) {
super.onScanResult(callbackType, result)
scanner.stopScan(this)
result.device.createBond()
}
override fun onBatchScanResults(results: MutableList<ScanResult>) {
super.onBatchScanResults(results)
scanner.stopScan(this)
}
override fun onScanFailed(errorCode: Int) {
super.onScanFailed(errorCode)
scanner.stopScan(this)
}
}
)
}
private fun overridePeakRefreshRateIfNeeded() {
val isPenConnected = inputManager.inputDeviceIds.firstOrNull {
val device = inputManager.getInputDevice(it) ?: return@firstOrNull false
if (device.vendorId != 0x22D9 && device.vendorId != 0x330A) {
// Not an OPPO/Maxeye vendor ID
return@firstOrNull false
}
if (device.bluetoothAddress?.startsWith("C0:87:06") == false &&
device.bluetoothAddress?.startsWith("F8:6F:DE") == false) {
// Not a Maxeye/Goodix MAC prefix
return@firstOrNull false
}
return@firstOrNull true
} != null
val peakRefreshRate = Settings.System.getString(contentResolver, PEAK_REFRESH_RATE)
if (isPenConnected && peakRefreshRate == "Infinity") {
Settings.System.putString(contentResolver, PEAK_REFRESH_RATE, penSupportedRefreshRate)
} else if (!isPenConnected && peakRefreshRate == penSupportedRefreshRate) {
Settings.System.putString(contentResolver, PEAK_REFRESH_RATE, "Infinity")
}
}
private fun postNotification(pencilAddr: String) {
val adapter = bluetoothManager.adapter
if (adapter.bondedDevices.contains(adapter.getRemoteDevice(pencilAddr))) {
Log.e(TAG, "$pencilAddr already bonded, bailing out")
return
}
if (notificationManager.getNotificationChannel(NOTIFICATION_CHANNEL_ID) == null) {
notificationManager.createNotificationChannel(
NotificationChannel(
NOTIFICATION_CHANNEL_ID,
NOTIFICATION_CHANNEL_ID,
NotificationManager.IMPORTANCE_HIGH
)
)
}
val contentIntent = PendingIntent.getService(
this,
0,
Intent(this, PenService::class.java).apply {
putExtra(EXTRA_PENCIL_ADDR, pencilAddr)
},
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT
)
val notification = Notification.Builder(this, NOTIFICATION_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_stylus)
.setContentTitle(getString(R.string.pen_attached))
.setContentText(getString(R.string.tap_to_connect))
.setContentIntent(contentIntent)
.setAutoCancel(true)
.build()
notificationManager.notify(NOTIFICATION_ID, notification)
}
companion object {
private const val TAG = "OplusPenService"
private const val EXTRA_PENCIL_ADDR = "pencil_addr"
private const val NOTIFICATION_CHANNEL_ID = "OplusPen"
private const val NOTIFICATION_ID = 1000
}
}

18
README.md Normal file
View File

@@ -0,0 +1,18 @@
# hardware/oplus
## Soong options
| Namespace | Variable | Description | Default |
| --------- | -------- | ----------- | ------- |
| OPLUS_LINEAGE_LIVEDISPLAY_HAL | ENABLE_AB | Enable AdaptiveBacklight feature | false |
| OPLUS_LINEAGE_LIVEDISPLAY_HAL | ENABLE_AF | Enable AntiFlicker feature | false |
| OPLUS_LINEAGE_LIVEDISPLAY_HAL | ENABLE_DM | Enable DisplayModes feature | false |
| OPLUS_LINEAGE_LIVEDISPLAY_HAL | ENABLE_PA | Enable PictureAdjustment feature | true |
| OPLUS_LINEAGE_LIVEDISPLAY_HAL | ENABLE_SE | Enable SunlightEnhancement feature | true |
| OPLUS_LINEAGE_TOUCH_HAL | ENABLE_GM | Enable GloveMode feature | false |
| OPLUS_LINEAGE_TOUCH_HAL | ENABLE_HTPR | Enable HighTouchPollingRate feature | true |
| OPLUS_LINEAGE_TOUCH_HAL | ENABLE_TG | Enable TouchscreenGesture feature | true |
| OPLUS_LINEAGE_TOUCH_HAL | INCLUDE_DIR | Device specific include dir path | |
| OPLUS_LINEAGE_TOUCH_HAL | USE_OPLUSTOUCH | Use and interface with stock OplusTouch | false |
| OPLUS_LINEAGE_VIBRATOR_HAL | INCLUDE_DIR | Device specific include dir path | |
| OPLUS_LINEAGE_VIBRATOR_HAL | USE_EFFECT_STREAM | Enable effect stream feature | false |

22
aidl/commondcs/Android.bp Normal file
View File

@@ -0,0 +1,22 @@
//
// Copyright (C) 2025 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
cc_binary {
name: "vendor.oplus.hardware.commondcs-service",
vendor: true,
relative_install_path: "hw",
init_rc: ["vendor.oplus.hardware.commondcs-service.rc"],
vintf_fragments: ["vendor.oplus.hardware.commondcs-service.xml"],
srcs: [
"CommonDcsAidlHalService.cpp",
"service.cpp",
],
shared_libs: [
"libbase",
"libbinder_ndk",
"vendor.oplus.hardware.commondcs-V1-ndk",
],
}

View File

@@ -0,0 +1,26 @@
/*
* Copyright (C) 2025 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "CommonDcsAidlHalService.h"
namespace aidl {
namespace vendor {
namespace oplus {
namespace hardware {
namespace commondcs {
ndk::ScopedAStatus CommonDcsAidlHalService::notifyMsgToCommonDcs(
const std::vector<StringPair>& data, const std::string& logTag, const std::string& eventId,
int32_t* _aidl_return) {
*_aidl_return = 0;
return ndk::ScopedAStatus::ok();
}
} // namespace commondcs
} // namespace hardware
} // namespace oplus
} // namespace vendor
} // namespace aidl

View File

@@ -0,0 +1,27 @@
/*
* Copyright (C) 2025 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <aidl/vendor/oplus/hardware/commondcs/BnCommonDcsAidlHalService.h>
namespace aidl {
namespace vendor {
namespace oplus {
namespace hardware {
namespace commondcs {
struct CommonDcsAidlHalService : public BnCommonDcsAidlHalService {
ndk::ScopedAStatus notifyMsgToCommonDcs(const std::vector<StringPair>& data,
const std::string& logTag, const std::string& eventId,
int32_t* _aidl_return) final;
};
} // namespace commondcs
} // namespace hardware
} // namespace oplus
} // namespace vendor
} // namespace aidl

View File

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

View File

@@ -0,0 +1,4 @@
service vendor.commondcs /vendor/bin/hw/vendor.oplus.hardware.commondcs-service
class hal
user system
group system

View File

@@ -0,0 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>vendor.oplus.hardware.commondcs</name>
<version>1</version>
<fqname>ICommonDcsAidlHalService/default</fqname>
</hal>
</manifest>

19
aidl/ir/Android.bp Normal file
View File

@@ -0,0 +1,19 @@
cc_binary {
name: "android.hardware.ir-service.oplus",
vendor: true,
relative_install_path: "hw",
init_rc: ["android.hardware.ir-service.oplus.rc"],
vintf_fragments: ["android.hardware.ir-service.xml"],
srcs: [
"ConsumerIr.cpp",
"service.cpp",
],
shared_libs: [
"android.hardware.ir-V1-ndk",
"libbase",
"libbinder_ndk",
],
header_libs: [
"kernel_headers.oplus",
],
}

77
aidl/ir/ConsumerIr.cpp Normal file
View File

@@ -0,0 +1,77 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#include "ConsumerIr.h"
#include <aidl/android/hardware/ir/ConsumerIrFreqRange.h>
#include <android-base/logging.h>
#include <android-base/unique_fd.h>
#include <oplus/oplus_ir_core.h>
namespace aidl {
namespace android {
namespace hardware {
namespace ir {
static constexpr int32_t MAX_PATTERN_TIME = 2000000;
static constexpr int32_t MIN_FREQ = 20000;
static constexpr int32_t MAX_FREQ = 60000;
ConsumerIr::ConsumerIr() : supportedFreqs({{MIN_FREQ, MAX_FREQ}}) {}
::ndk::ScopedAStatus ConsumerIr::getCarrierFreqs(std::vector<ConsumerIrFreqRange>* _aidl_return) {
*_aidl_return = supportedFreqs;
return ::ndk::ScopedAStatus::ok();
}
::ndk::ScopedAStatus ConsumerIr::transmit(int32_t carrierFreqHz,
const std::vector<int32_t>& pattern) {
if (carrierFreqHz < MIN_FREQ || carrierFreqHz > MAX_FREQ) {
LOG(ERROR) << "Invalid carrier frequency: " << carrierFreqHz;
return ::ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
int32_t totalTime = 0;
for (int32_t value : pattern) {
if (value < 0) {
LOG(ERROR) << "Invalid pattern value: " << value;
return ::ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
totalTime += value;
}
if (totalTime > MAX_PATTERN_TIME) {
LOG(ERROR) << "Pattern is too long: " << totalTime << " us";
return ::ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
::android::base::unique_fd fd(open("/dev/oplus_consumer_ir", O_WRONLY));
if (!fd.ok()) {
LOG(ERROR) << "Failed to open /dev/oplus_consumer_ir: " << strerror(errno);
return ::ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
size_t paramsSize = sizeof(struct pattern_params) + pattern.size() * sizeof(int32_t);
auto params = std::unique_ptr<struct pattern_params, decltype(&free)>(
static_cast<pattern_params*>(malloc(paramsSize)), free);
if (!params) {
LOG(ERROR) << "Failed to allocate memory for IR params";
return ::ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
params->carrier_freq = carrierFreqHz;
params->size = pattern.size();
memcpy(params->pattern, pattern.data(), pattern.size() * sizeof(int32_t));
int result = ioctl(fd, IR_SEND_PATTERN, params.get());
return result < 0 ? ::ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION)
: ::ndk::ScopedAStatus::ok();
}
} // namespace ir
} // namespace hardware
} // namespace android
} // namespace aidl

30
aidl/ir/ConsumerIr.h Normal file
View File

@@ -0,0 +1,30 @@
/*
* SPDX-FileCopyrightText: 2025 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:
ConsumerIr();
private:
::ndk::ScopedAStatus getCarrierFreqs(std::vector<ConsumerIrFreqRange>* _aidl_return) override;
::ndk::ScopedAStatus transmit(int32_t carrierFreqHz,
const std::vector<int32_t>& pattern) override;
std::vector<ConsumerIrFreqRange> supportedFreqs;
};
} // namespace ir
} // namespace hardware
} // namespace android
} // namespace aidl

View File

@@ -0,0 +1,9 @@
on boot
chown system system /dev/oplus_consumer_ir
chmod 0644 /dev/oplus_consumer_ir
service vendor.ir-default /vendor/bin/hw/android.hardware.ir-service.oplus
class hal
user system
group system
interface aidl android.hardware.ir.IConsumerIr/default

View File

@@ -0,0 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.ir</name>
<version>1</version>
<fqname>IConsumerIr/default</fqname>
</hal>
</manifest>

25
aidl/ir/service.cpp Normal file
View File

@@ -0,0 +1,25 @@
/*
* SPDX-FileCopyrightText: 2025 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> consumerIr = ndk::SharedRefBase::make<ConsumerIr>();
const std::string instance = std::string() + ConsumerIr::descriptor + "/default";
binder_status_t status =
AServiceManager_addService(consumerIr->asBinder().get(), instance.c_str());
CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
}

View File

@@ -0,0 +1,46 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#define LOG_TAG "AdaptiveBacklightService"
#include <android-base/logging.h>
#include <fcntl.h>
#include <livedisplay/oplus/AdaptiveBacklight.h>
#include <oplus/oplus_display_panel.h>
namespace aidl {
namespace vendor {
namespace lineage {
namespace livedisplay {
AdaptiveBacklight::AdaptiveBacklight() : mOplusDisplayFd(open("/dev/oplus_display", O_RDWR)) {}
ndk::ScopedAStatus AdaptiveBacklight::getEnabled(bool* _aidl_return) {
unsigned int value;
if (ioctl(mOplusDisplayFd, PANEL_IOCTL_GET_CABC_STATUS, &value) != 0) {
LOG(ERROR) << "Failed to read current AdaptiveBacklight state";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
*_aidl_return = value > 0;
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus AdaptiveBacklight::setEnabled(bool enabled) {
bool isEnabled;
if (auto status = getEnabled(&isEnabled); !status.isOk()) {
return status;
}
unsigned int value = enabled;
if (isEnabled != enabled && ioctl(mOplusDisplayFd, PANEL_IOCTL_SET_CABC_STATUS, &value) != 0) {
LOG(ERROR) << "Failed to set AdaptiveBacklight state";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
return ndk::ScopedAStatus::ok();
}
} // namespace livedisplay
} // namespace lineage
} // namespace vendor
} // namespace aidl

View File

@@ -0,0 +1,90 @@
//
// SPDX-FileCopyrightText: 2019-2025 The LineageOS Project
// SPDX-License-Identifier: Apache-2.0
//
filegroup {
name: "vendor.lineage.livedisplay-oplus-ab",
srcs: ["AdaptiveBacklight.cpp"],
}
filegroup {
name: "vendor.lineage.livedisplay-oplus-af",
srcs: ["AntiFlicker.cpp"],
}
filegroup {
name: "vendor.lineage.livedisplay-oplus-dm",
srcs: ["DisplayModes.cpp"],
}
filegroup {
name: "vendor.lineage.livedisplay-oplus-se",
srcs: ["SunlightEnhancement.cpp"],
}
cc_library_headers {
name: "vendor.lineage.livedisplay-oplus-headers",
vendor_available: true,
export_include_dirs: ["include"],
}
cc_binary {
name: "vendor.lineage.livedisplay-service.oplus",
init_rc: ["vendor.lineage.livedisplay-service.oplus.rc"],
vintf_fragments: select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_AB"), {
"true": ["vendor.lineage.livedisplay-service.oplus-ab.xml"],
default: [],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_AF"), {
"true": ["vendor.lineage.livedisplay-service.oplus-af.xml"],
default: [],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_DM"), {
"true": ["vendor.lineage.livedisplay-service.oplus-dm.xml"],
default: [],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_PA"), {
"false": [],
default: ["vendor.lineage.livedisplay-service.oplus-pa.xml"],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_SE"), {
"false": [],
default: ["vendor.lineage.livedisplay-service.oplus-se.xml"],
}),
relative_install_path: "hw",
srcs: [
":vendor.lineage.livedisplay-sdm-pa",
":vendor.lineage.livedisplay-sdm-utils",
":vendor.lineage.livedisplay-oplus-ab",
":vendor.lineage.livedisplay-oplus-af",
":vendor.lineage.livedisplay-oplus-dm",
":vendor.lineage.livedisplay-oplus-se",
"service.cpp",
],
shared_libs: [
"libbase",
"libbinder_ndk",
"libbinder",
"libutils",
"vendor.lineage.livedisplay-V1-ndk",
],
header_libs: [
"kernel_headers.oplus",
"vendor.lineage.livedisplay-sdm-headers",
"vendor.lineage.livedisplay-oplus-headers",
],
cflags: select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_AB"), {
"true": ["-DENABLE_AB=true"],
default: ["-DENABLE_AB=false"],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_AF"), {
"true": ["-DENABLE_AF=true"],
default: ["-DENABLE_AF=false"],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_DM"), {
"true": ["-DENABLE_DM=true"],
default: ["-DENABLE_DM=false"],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_PA"), {
"false": ["-DENABLE_PA=false"],
default: ["-DENABLE_PA=true"],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_SE"), {
"false": ["-DENABLE_SE=false"],
default: ["-DENABLE_SE=true"],
}),
proprietary: true,
}

View File

@@ -0,0 +1,50 @@
/*
* SPDX-FileCopyrightText: 2022-2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#define LOG_TAG "AntiFlickerService"
#include <android-base/logging.h>
#include <fcntl.h>
#include <livedisplay/oplus/AntiFlicker.h>
#include <oplus/oplus_display_panel.h>
namespace aidl {
namespace vendor {
namespace lineage {
namespace livedisplay {
AntiFlicker::AntiFlicker() : mOplusDisplayFd(open("/dev/oplus_display", O_RDWR)) {}
ndk::ScopedAStatus AntiFlicker::getEnabled(bool* _aidl_return) {
unsigned int value;
if (ioctl(mOplusDisplayFd, PANEL_IOCTL_GET_PWM_PULSE, &value) != 0 &&
ioctl(mOplusDisplayFd, PANEL_IOCTL_GET_PWM_TURBO, &value) != 0 &&
ioctl(mOplusDisplayFd, PANEL_IOCTL_GET_DIMLAYER_BL_EN, &value) != 0) {
LOG(ERROR) << "Failed to read current AntiFlicker state";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
*_aidl_return = value > 0;
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus AntiFlicker::setEnabled(bool enabled) {
bool isEnabled;
if (auto status = getEnabled(&isEnabled); !status.isOk()) {
return status;
}
unsigned int value = enabled;
if (isEnabled != enabled && ioctl(mOplusDisplayFd, PANEL_IOCTL_SET_PWM_PULSE, &value) != 0 &&
ioctl(mOplusDisplayFd, PANEL_IOCTL_SET_PWM_TURBO, &value) != 0 &&
ioctl(mOplusDisplayFd, PANEL_IOCTL_SET_DIMLAYER_BL_EN, &value) != 0) {
LOG(ERROR) << "Failed to set AntiFlicker state";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
return ndk::ScopedAStatus::ok();
}
} // namespace livedisplay
} // namespace lineage
} // namespace vendor
} // namespace aidl

View File

@@ -1,6 +1,5 @@
/*
* Copyright (C) 2019 The LineageOS Project
*
* SPDX-FileCopyrightText: 2019-2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
@@ -13,11 +12,10 @@
#include <oplus/oplus_display_panel.h>
#include <fstream>
namespace aidl {
namespace vendor {
namespace lineage {
namespace livedisplay {
namespace V2_1 {
namespace implementation {
static const std::string kModeBasePath = "/sys/class/drm/card0-DSI-1/";
static const std::string kDefaultPath = "/data/vendor/display/default_display_mode";
@@ -30,8 +28,8 @@ const std::map<int32_t, DisplayModes::ModeInfo> DisplayModes::kModeMap = {
{3, {"Brilliant", 4, 0}},
};
DisplayModes::DisplayModes(std::shared_ptr<V2_0::sdm::SDMController> controller)
: mController(std::move(controller)),
DisplayModes::DisplayModes(std::shared_ptr<sdm::SDMController> controller)
: mController(controller),
mOplusDisplayFd(open("/dev/oplus_display", O_RDWR)),
mCurrentModeId(0),
mDefaultModeId(0) {
@@ -43,31 +41,31 @@ DisplayModes::DisplayModes(std::shared_ptr<V2_0::sdm::SDMController> controller)
setDisplayMode(mDefaultModeId, false);
}
// Methods from ::vendor::lineage::livedisplay::V2_1::IDisplayModes follow.
Return<void> DisplayModes::getDisplayModes(getDisplayModes_cb resultCb) {
std::vector<V2_0::DisplayMode> modes;
// Methods from ::aidl::vendor::lineage::livedisplay::BnDisplayModes follow.
ndk::ScopedAStatus DisplayModes::getDisplayModes(std::vector<DisplayMode>* _aidl_return) {
std::vector<DisplayMode> modes;
for (const auto& entry : kModeMap) {
modes.push_back({entry.first, entry.second.name});
}
resultCb(modes);
return Void();
*_aidl_return = modes;
return ndk::ScopedAStatus::ok();
}
Return<void> DisplayModes::getCurrentDisplayMode(getCurrentDisplayMode_cb resultCb) {
resultCb({mCurrentModeId, kModeMap.at(mCurrentModeId).name});
return Void();
ndk::ScopedAStatus DisplayModes::getCurrentDisplayMode(DisplayMode* _aidl_return) {
*_aidl_return = {mCurrentModeId, kModeMap.at(mCurrentModeId).name};
return ndk::ScopedAStatus::ok();
}
Return<void> DisplayModes::getDefaultDisplayMode(getDefaultDisplayMode_cb resultCb) {
resultCb({mDefaultModeId, kModeMap.at(mDefaultModeId).name});
return Void();
ndk::ScopedAStatus DisplayModes::getDefaultDisplayMode(DisplayMode* _aidl_return) {
*_aidl_return = {mDefaultModeId, kModeMap.at(mDefaultModeId).name};
return ndk::ScopedAStatus::ok();
}
Return<bool> DisplayModes::setDisplayMode(int32_t modeID, bool makeDefault) {
ndk::ScopedAStatus DisplayModes::setDisplayMode(int32_t modeID, bool makeDefault) {
const auto iter = kModeMap.find(modeID);
if (iter == kModeMap.end()) {
return false;
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
if (mOplusDisplayFd >= 0) {
ioctl(mOplusDisplayFd, PANEL_IOCTL_SET_SEED, &iter->second.seedMode);
@@ -85,11 +83,10 @@ Return<bool> DisplayModes::setDisplayMode(int32_t modeID, bool makeDefault) {
if (mOnDisplayModeSet) {
mOnDisplayModeSet();
}
return true;
return ndk::ScopedAStatus::ok();
}
} // namespace implementation
} // namespace V2_1
} // namespace livedisplay
} // namespace lineage
} // namespace vendor
} // namespace aidl

View File

@@ -0,0 +1,46 @@
/*
* SPDX-FileCopyrightText: 2022-2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#define LOG_TAG "SunlightEnhancementService"
#include <android-base/logging.h>
#include <fcntl.h>
#include <livedisplay/oplus/SunlightEnhancement.h>
#include <oplus/oplus_display_panel.h>
namespace aidl {
namespace vendor {
namespace lineage {
namespace livedisplay {
SunlightEnhancement::SunlightEnhancement() : mOplusDisplayFd(open("/dev/oplus_display", O_RDWR)) {}
ndk::ScopedAStatus SunlightEnhancement::getEnabled(bool* _aidl_return) {
unsigned int value;
if (ioctl(mOplusDisplayFd, PANEL_IOCTL_GET_HBM, &value) != 0) {
LOG(ERROR) << "Failed to read current SunlightEnhancement state";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
*_aidl_return = value > 0;
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus SunlightEnhancement::setEnabled(bool enabled) {
bool isEnabled;
if (auto status = getEnabled(&isEnabled); !status.isOk()) {
return status;
}
unsigned int value = enabled;
if (isEnabled != enabled && ioctl(mOplusDisplayFd, PANEL_IOCTL_SET_HBM, &value) != 0) {
LOG(ERROR) << "Failed to set SunlightEnhancement state";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
return ndk::ScopedAStatus::ok();
}
} // namespace livedisplay
} // namespace lineage
} // namespace vendor
} // namespace aidl

View File

@@ -0,0 +1,30 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <aidl/vendor/lineage/livedisplay/BnAdaptiveBacklight.h>
namespace aidl {
namespace vendor {
namespace lineage {
namespace livedisplay {
class AdaptiveBacklight : public BnAdaptiveBacklight {
public:
AdaptiveBacklight();
// Methods from ::aidl::vendor::lineage::livedisplay::BnAdaptiveBacklight follow.
ndk::ScopedAStatus getEnabled(bool* _aidl_return) override;
ndk::ScopedAStatus setEnabled(bool enabled) override;
private:
int mOplusDisplayFd;
};
} // namespace livedisplay
} // namespace lineage
} // namespace vendor
} // namespace aidl

View File

@@ -0,0 +1,30 @@
/*
* SPDX-FileCopyrightText: 2021-2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <aidl/vendor/lineage/livedisplay/BnAntiFlicker.h>
namespace aidl {
namespace vendor {
namespace lineage {
namespace livedisplay {
class AntiFlicker : public BnAntiFlicker {
public:
AntiFlicker();
// Methods from ::aidl::vendor::lineage::livedisplay::BnAntiFlicker follow.
ndk::ScopedAStatus getEnabled(bool* _aidl_return) override;
ndk::ScopedAStatus setEnabled(bool enabled) override;
private:
int mOplusDisplayFd;
};
} // namespace livedisplay
} // namespace lineage
} // namespace vendor
} // namespace aidl

View File

@@ -0,0 +1,49 @@
/*
* SPDX-FileCopyrightText: 2019-2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <aidl/vendor/lineage/livedisplay/BnDisplayModes.h>
#include <livedisplay/sdm/SDMController.h>
#include <map>
namespace aidl {
namespace vendor {
namespace lineage {
namespace livedisplay {
class DisplayModes : public BnDisplayModes {
public:
DisplayModes(std::shared_ptr<sdm::SDMController> controller);
using DisplayModeSetCallback = std::function<void()>;
inline void registerDisplayModeSetCallback(DisplayModeSetCallback callback) {
mOnDisplayModeSet = callback;
}
// Methods from ::aidl::vendor::lineage::livedisplay::BnDisplayModes follow.
ndk::ScopedAStatus getDisplayModes(std::vector<DisplayMode>* _aidl_return) override;
ndk::ScopedAStatus getCurrentDisplayMode(DisplayMode* _aidl_return) override;
ndk::ScopedAStatus getDefaultDisplayMode(DisplayMode* _aidl_return) override;
ndk::ScopedAStatus setDisplayMode(int32_t modeID, bool makeDefault) override;
private:
struct ModeInfo {
std::string name;
int32_t displayModeId;
uint32_t seedMode;
};
static const std::map<int32_t, ModeInfo> kModeMap;
std::shared_ptr<sdm::SDMController> mController;
int32_t mOplusDisplayFd;
int32_t mCurrentModeId;
int32_t mDefaultModeId;
DisplayModeSetCallback mOnDisplayModeSet;
};
} // namespace livedisplay
} // namespace lineage
} // namespace vendor
} // namespace aidl

View File

@@ -0,0 +1,30 @@
/*
* SPDX-FileCopyrightText: 2019-2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <aidl/vendor/lineage/livedisplay/BnSunlightEnhancement.h>
namespace aidl {
namespace vendor {
namespace lineage {
namespace livedisplay {
class SunlightEnhancement : public BnSunlightEnhancement {
public:
SunlightEnhancement();
// Methods from ::aidl::vendor::lineage::livedisplay::BnSunlightEnhancement follow.
ndk::ScopedAStatus getEnabled(bool* _aidl_return) override;
ndk::ScopedAStatus setEnabled(bool enabled) override;
private:
int mOplusDisplayFd;
};
} // namespace livedisplay
} // namespace lineage
} // namespace vendor
} // namespace aidl

View File

@@ -0,0 +1,76 @@
/*
* SPDX-FileCopyrightText: 2019-2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#define LOG_TAG "vendor.lineage.livedisplay-service-oplus"
#include <android-base/logging.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
#include <binder/ProcessState.h>
#include <livedisplay/oplus/AdaptiveBacklight.h>
#include <livedisplay/oplus/AntiFlicker.h>
#include <livedisplay/oplus/DisplayModes.h>
#include <livedisplay/oplus/SunlightEnhancement.h>
#include <livedisplay/sdm/PictureAdjustment.h>
using ::aidl::vendor::lineage::livedisplay::AdaptiveBacklight;
using ::aidl::vendor::lineage::livedisplay::AntiFlicker;
using ::aidl::vendor::lineage::livedisplay::DisplayModes;
using ::aidl::vendor::lineage::livedisplay::SunlightEnhancement;
using ::aidl::vendor::lineage::livedisplay::sdm::PictureAdjustment;
using ::aidl::vendor::lineage::livedisplay::sdm::SDMController;
int main() {
android::ProcessState::self()->setThreadPoolMaxThreadCount(1);
android::ProcessState::self()->startThreadPool();
LOG(INFO) << "LiveDisplay HAL service is starting.";
std::shared_ptr<SDMController> controller =
ENABLE_DM || ENABLE_PA ? std::make_shared<SDMController>() : nullptr;
std::shared_ptr<AdaptiveBacklight> ab =
ENABLE_AB ? ndk::SharedRefBase::make<AdaptiveBacklight>() : nullptr;
std::shared_ptr<AntiFlicker> af = ENABLE_AF ? ndk::SharedRefBase::make<AntiFlicker>() : nullptr;
std::shared_ptr<DisplayModes> dm =
ENABLE_DM ? ndk::SharedRefBase::make<DisplayModes>(controller) : nullptr;
std::shared_ptr<PictureAdjustment> pa =
ENABLE_PA ? ndk::SharedRefBase::make<PictureAdjustment>(controller) : nullptr;
std::shared_ptr<SunlightEnhancement> se =
ENABLE_SE ? ndk::SharedRefBase::make<SunlightEnhancement>() : nullptr;
if (ab) {
std::string instance = std::string() + AdaptiveBacklight::descriptor + "/default";
binder_status_t status = AServiceManager_addService(ab->asBinder().get(), instance.c_str());
CHECK_EQ(status, STATUS_OK);
}
if (af) {
std::string instance = std::string() + AntiFlicker::descriptor + "/default";
binder_status_t status = AServiceManager_addService(af->asBinder().get(), instance.c_str());
CHECK_EQ(status, STATUS_OK);
}
if (dm) {
std::string instance = std::string() + DisplayModes::descriptor + "/default";
binder_status_t status = AServiceManager_addService(dm->asBinder().get(), instance.c_str());
CHECK_EQ(status, STATUS_OK);
}
if (pa) {
std::string instance = std::string() + PictureAdjustment::descriptor + "/default";
binder_status_t status = AServiceManager_addService(pa->asBinder().get(), instance.c_str());
CHECK_EQ(status, STATUS_OK);
}
if (se) {
std::string instance = std::string() + SunlightEnhancement::descriptor + "/default";
binder_status_t status = AServiceManager_addService(se->asBinder().get(), instance.c_str());
CHECK_EQ(status, STATUS_OK);
}
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,4 @@
service vendor.livedisplay-hal /vendor/bin/hw/vendor.lineage.livedisplay-service.oplus
class late_start
user system
group system

View File

@@ -1,6 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>vendor.oplus.hardware.osense.client</name>
<version>1</version>
<fqname>IOsenseAidlHalReporter/default</fqname>
</hal>
</manifest>

View File

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

Some files were not shown because too many files have changed in this diff Show More