135 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
216 changed files with 4510 additions and 124 deletions

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
//
@@ -13,24 +13,16 @@ android_app {
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 {
name: "org.lineageos.euicc.xml",
relative_install_path: "permissions",
filename: "org.lineageos.euicc.xml",
src: "org.lineageos.euicc.xml",
product_specific: true,
}
prebuilt_etc {
name: "hidden-api-whitelist-org.lineageos.euicc.xml",
relative_install_path: "sysconfig",

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\":[\"OP591BL1\",\"OP5929L1\",\"OP594DL1\",\"OP595DL1\",\"OP5D0DL1\",\"OP5D55L1\"],\"illustration_lottie\":\"sim_illustration_lottie_bottom\"}]}</string>
<string name="sim_slot_mappings_json">{\"sim-slot-mappings\":[{\"devices\":[\"OP594DL1\",\"OP595DL1\",\"OP5D55L1\"],\"esim-slot-ids\":[1],\"psim-slot-ids\":[0]},{\"devices\":[\"OP591BL1\",\"OP5929L1\",\"OP5D0DL1\"],\"esim-slot-ids\":[],\"psim-slot-ids\":[0,1]}]}</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>

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

@@ -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

@@ -10,6 +10,7 @@ android_app {
certificate: "platform",
platform_apis: true,
privileged: true,
system_ext_specific: true,
optimize: {

View File

@@ -6,11 +6,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.lineageos.pen">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<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"

View File

@@ -5,7 +5,6 @@
-->
<exceptions>
<exception package="org.lineageos.pen">
<permission name="android.permission.ACCESS_FINE_LOCATION" fixed="false" />
<permission name="android.permission.BLUETOOTH_CONNECT" fixed="false" />
<permission name="android.permission.BLUETOOTH_SCAN" fixed="false" />
<permission name="android.permission.POST_NOTIFICATIONS" fixed="false" />

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

@@ -17,14 +17,24 @@ 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()
@@ -43,6 +53,30 @@ class PenService : Service() {
}
}
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)
@@ -56,12 +90,28 @@ class PenService : Service() {
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()
}
@@ -69,8 +119,16 @@ class PenService : Service() {
val adapter = bluetoothManager.adapter
@Suppress("DEPRECATION") adapter.enable()
val scanner = adapter.bluetoothLeScanner
scanner.startScan(
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)
@@ -97,6 +155,29 @@ class PenService : Service() {
)
}
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

View File

@@ -16,4 +16,3 @@
| 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 |
| QTI_GPT_UTILS | USE_BSG_FRAMEWORK | Enable BSG framework feature | true |

View File

@@ -19,7 +19,8 @@ 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_TURBO, &value) != 0 &&
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);
@@ -34,7 +35,8 @@ ndk::ScopedAStatus AntiFlicker::setEnabled(bool enabled) {
return status;
}
unsigned int value = enabled;
if (isEnabled != enabled && ioctl(mOplusDisplayFd, PANEL_IOCTL_SET_PWM_TURBO, &value) != 0 &&
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);

View File

@@ -29,7 +29,7 @@
android:key="doze_enable"
android:title="@string/ambient_display_enable_title" />
<SwitchPreference
<SwitchPreferenceCompat
android:key="always_on_display"
android:disableDependentsState="true"
android:title="@string/ambient_display_always_on_title"
@@ -55,7 +55,7 @@
android:key="proximity_sensor"
android:title="@string/proximity_sensor_title">
<SwitchPreference
<SwitchPreferenceCompat
android:key="gesture_pocket"
android:defaultValue="false"
android:icon="@drawable/ic_pocket"

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2024 The LineageOS Project
* SPDX-FileCopyrightText: 2021-2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
@@ -11,18 +11,18 @@ import android.content.Context
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.widget.CompoundButton
import androidx.preference.*
import androidx.preference.ListPreference
import androidx.preference.Preference
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreferenceCompat
import com.android.settingslib.widget.MainSwitchPreference
class DozeSettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener,
CompoundButton.OnCheckedChangeListener {
private lateinit var alwaysOnDisplayPreference: SwitchPreference
private lateinit var switchBar: MainSwitchPreference
class DozeSettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener {
private lateinit var alwaysOnDisplayPreference: SwitchPreferenceCompat
private var pickUpPreference: ListPreference? = null
private var pocketPreference: SwitchPreference? = null
private var pocketPreference: SwitchPreferenceCompat? = null
private val handler = Handler(Looper.getMainLooper())
@@ -41,8 +41,8 @@ class DozeSettingsFragment : PreferenceFragmentCompat(), Preference.OnPreference
}
val dozeEnabled = Utils.isDozeEnabled(requireContext())
switchBar = findPreference(Utils.DOZE_ENABLE)!!
switchBar.addOnSwitchChangeListener(this)
val switchBar = findPreference<MainSwitchPreference>(Utils.DOZE_ENABLE)!!
switchBar.onPreferenceChangeListener = this
switchBar.isChecked = dozeEnabled
alwaysOnDisplayPreference = findPreference(Utils.ALWAYS_ON_DISPLAY)!!
@@ -80,27 +80,29 @@ class DozeSettingsFragment : PreferenceFragmentCompat(), Preference.OnPreference
}
override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
if (preference.key == Utils.ALWAYS_ON_DISPLAY) {
Utils.enableAlwaysOn(requireContext(), newValue as Boolean)
when (preference.key) {
Utils.ALWAYS_ON_DISPLAY -> {
val isChecked = newValue as Boolean
Utils.enableAlwaysOn(requireContext(), isChecked)
}
Utils.DOZE_ENABLE -> {
val isChecked = newValue as Boolean
Utils.enableDoze(requireContext(), isChecked)
Utils.checkDozeService(requireContext())
if (!isChecked) {
Utils.enableAlwaysOn(requireContext(), false)
alwaysOnDisplayPreference.isChecked = false
}
alwaysOnDisplayPreference.isEnabled = isChecked
pickUpPreference?.isEnabled = isChecked
pocketPreference?.isEnabled = isChecked
}
}
handler.post { Utils.checkDozeService(requireContext()) }
return true
}
override fun onCheckedChanged(buttonView: CompoundButton, isChecked: Boolean) {
Utils.enableDoze(requireContext(), isChecked)
Utils.checkDozeService(requireContext())
switchBar.isChecked = isChecked
if (!isChecked) {
Utils.enableAlwaysOn(requireContext(), false)
alwaysOnDisplayPreference.isChecked = false
}
alwaysOnDisplayPreference.isEnabled = isChecked
pickUpPreference?.isEnabled = isChecked
pocketPreference?.isEnabled = isChecked
}
}

30
eSimSwitcher/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: "OplusEsimSwitcher",
defaults: ["SettingsLibDefaults"],
srcs: ["src/**/*.kt"],
resource_dirs: ["res"],
certificate: "platform",
platform_apis: true,
system_ext_specific: true,
privileged: true,
privapp_allowlist: "org.lineageos.settings.esimswitcher.xml",
static_libs: [
"androidx.core_core",
"androidx.preference_preference",
"org.lineageos.settings.resources",
"vendor.oplus.hardware.esim-V1-java",
],
optimize: {
proguard_flags_files: ["proguard.flags"],
},
}

View File

@@ -0,0 +1,50 @@
<?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.settings.esimswitcher">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.SECURE_ELEMENT_PRIVILEGED_OPERATION" />
<application
android:directBootAware="true"
android:label="@string/device_settings_app_name"
android:persistent="true"
android:theme="@style/Theme.SubSettingsBase">
<activity
android:exported="false"
android:label="@string/esim_settings_title"
android:name=".EsimSettingsActivity">
<intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.wireless" />
<meta-data android:name="com.android.settings.icon"
android:resource="@drawable/ic_settings_esim" />
<meta-data android:name="com.android.settings.icon_tintable"
android:value="true" />
<meta-data android:name="com.android.settings.order"
android:value="-10" />
<meta-data android:name="com.android.settings.profile"
android:value="primary_profile_only" />
</activity>
<receiver
android:exported="true"
android:name=".BootCompletedReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
</manifest>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<privapp-permissions package="org.lineageos.settings.esimswitcher">
<permission name="android.permission.SECURE_ELEMENT_PRIVILEGED_OPERATION"/>
</privapp-permissions>
</permissions>

View File

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

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M480,680L640,520L584,464L520,526L520,360L440,360L440,526L376,464L320,520L480,680ZM240,880Q207,880 183.5,856.5Q160,833 160,800L160,320L400,80L720,80Q753,80 776.5,103.5Q800,127 800,160L800,800Q800,833 776.5,856.5Q753,880 720,880L240,880ZM240,800L720,800Q720,800 720,800Q720,800 720,800L720,160Q720,160 720,160Q720,160 720,160L434,160L240,354L240,800Q240,800 240,800Q240,800 240,800ZM240,800Q240,800 240,800Q240,800 240,800L240,800L434,800L720,800Q720,800 720,800Q720,800 720,800L720,800Q720,800 720,800Q720,800 720,800L240,800Z"/>
</vector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">eSIM ayarları</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Virtual SIM kart istifadə etmək üçün operator profilini endirib aktivləşdirin</string>
<string name="esim_toggle_dialog">eSIM-i fəallaşdırsanız, SIM 2 sıradan çıxarılacaq. Yenə də fəallaşdırılsın?</string>
<string name="esim_toggle_dialog_cancel">İmtina</string>
<string name="esim_toggle_dialog_ok">Fəallaşdır</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">eSIM настройки</string>
<string name="esim_toggle_title">Дигитален SIM (eSIM)</string>
<string name="esim_toggle_summary">Изтеглете и активирайте файл на оператор, за да използвате виртуална SIM карта</string>
<string name="esim_toggle_dialog">SIM 2 ще бъде спряна, ако включите eSIM. Включване въпреки това?</string>
<string name="esim_toggle_dialog_cancel">Отказ</string>
<string name="esim_toggle_dialog_ok">Включване</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">Configuració eSIM</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Baixa i activa un perfil d\'operador per utilitzar una targeta SIM virtual</string>
<string name="esim_toggle_dialog">La SIM 2 es desactivarà si activeu l\'eSIM. Voleu habilitar-la igualment?</string>
<string name="esim_toggle_dialog_cancel">Cancel·la</string>
<string name="esim_toggle_dialog_ok">Habilita</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">eSIM settings</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Download and activate an operator profile to use a virtual SIM card</string>
<string name="esim_toggle_dialog">SIM 2 will be disabled if you enable eSIM. Enable it anyway?</string>
<string name="esim_toggle_dialog_cancel">Cancel</string>
<string name="esim_toggle_dialog_ok">Enable</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">eSIM settings</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Download and activate an operator profile to use a virtual SIM card</string>
<string name="esim_toggle_dialog">SIM 2 will be disabled if you enable eSIM. Enable it anyway?</string>
<string name="esim_toggle_dialog_cancel">Cancel</string>
<string name="esim_toggle_dialog_ok">Enable</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">eSIM settings</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Download and activate an operator profile to use a virtual SIM card</string>
<string name="esim_toggle_dialog">SIM 2 will be disabled if you enable eSIM. Enable it anyway?</string>
<string name="esim_toggle_dialog_cancel">Cancel</string>
<string name="esim_toggle_dialog_ok">Enable</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">eSIM settings</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Download and activate an operator profile to use a virtual SIM card</string>
<string name="esim_toggle_dialog">SIM 2 will be disabled if you enable eSIM. Enable it anyway?</string>
<string name="esim_toggle_dialog_cancel">Cancel</string>
<string name="esim_toggle_dialog_ok">Enable</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">تنظیمات سیم‌کارت مجازی</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">برای استفاده از سیم‌کارت مجازی، پیکربندی یک اپراتور را بارگیری و فعال کنید</string>
<string name="esim_toggle_dialog">اگر سیم مجازی را فعال کنید سیم‌کارت دوم شما غیرفعال خواهد شد. آیا ادامه می‌دهید؟</string>
<string name="esim_toggle_dialog_cancel">لغو</string>
<string name="esim_toggle_dialog_ok">فعال‌سازی</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">Paramètres eSIM</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Télécharger et activer un profil d\'opérateur pour utiliser une carte SIM virtuelle</string>
<string name="esim_toggle_dialog">La carte SIM 2 sera désactivée si vous activez l\'eSIM. L\'activer quand même ?</string>
<string name="esim_toggle_dialog_cancel">Annuler</string>
<string name="esim_toggle_dialog_ok">Activer</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">Socruithe eSIM</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Íoslódáil agus gníomhaigh próifíl oibreora chun cárta SIM fíorúil a úsáid</string>
<string name="esim_toggle_dialog">Díchumasófar SIM 2 má chumasóidh tú eSIM. Ar mhaith leat é a chumasú ar aon nós?</string>
<string name="esim_toggle_dialog_cancel">Cealaigh</string>
<string name="esim_toggle_dialog_ok">Cumasaigh</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">eSIM-beállítások</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">A virtuális SIM használatához töltse le és aktiválja a kapott profilt</string>
<string name="esim_toggle_dialog">A 2.SIM letiltásra kerül, ha engedélyezi az eSIM-et. Engedélyezi?</string>
<string name="esim_toggle_dialog_cancel">Mégsem</string>
<string name="esim_toggle_dialog_ok">Engedélyezés</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">Impostazioni eSIM</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Scarica e attiva un profilo operatore per utilizzare una SIM virtuale</string>
<string name="esim_toggle_dialog">La SIM 2 sarà disabilitata se abiliti la eSIM. Abilitarla comunque?</string>
<string name="esim_toggle_dialog_cancel">Annulla</string>
<string name="esim_toggle_dialog_ok">Abilita</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">eSIM 設定</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">仮想 SIM カードを使用するには、オペレータプロファイルをダウンロードして有効化してください</string>
<string name="esim_toggle_dialog">eSIM を有効にすると SIM2 は無効になります。それでも有効にしますか?</string>
<string name="esim_toggle_dialog_cancel">キャンセル</string>
<string name="esim_toggle_dialog_ok">有効化</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">eSIM-პარამეტრები</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">ჩამოტვირთეთ და აამოქმედეთ მომწოდებლის პროფილი, რომ გამოიყენოთ წარმოსახვითი SIM-ბარათი</string>
<string name="esim_toggle_dialog">SIM 2 გაითიშება, თუ ჩაირთვება eSIM. მაინც გსურთ განაგრძოთ?</string>
<string name="esim_toggle_dialog_cancel">გაუქმება</string>
<string name="esim_toggle_dialog_ok">ჩართვა</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">Ustawienia eSIM</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Pobierz i aktywuj profil operatora, aby używać wirtualnej karty SIM</string>
<string name="esim_toggle_dialog">Karta SIM 2 zostanie wyłączona, jeśli włączysz kartę eSIM. Włączyć ją mimo to?</string>
<string name="esim_toggle_dialog_cancel">Anuluj</string>
<string name="esim_toggle_dialog_ok">Włącz</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">Configurações do eSIM</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Baixe e ative um perfil de operadora para usar um cartão SIM virtual</string>
<string name="esim_toggle_dialog">O SIM 2 será desativado se você ativar o eSIM. Ativar mesmo assim?</string>
<string name="esim_toggle_dialog_cancel">Cancelar</string>
<string name="esim_toggle_dialog_ok">Ativar</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">Definições do eSIM</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Transferir e ativar um perfil de operador para usar um cartão SIM virtual</string>
<string name="esim_toggle_dialog">O SIM 2 será desativado se ativar o eSIM. Ativar mesmo assim?</string>
<string name="esim_toggle_dialog_cancel">Cancelar</string>
<string name="esim_toggle_dialog_ok">Ativar</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">Setări eSIM</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Descărcați și activați un profil de operator pentru a utiliza o cartelă SIM virtuală</string>
<string name="esim_toggle_dialog">Cardul SIM 2 va fi dezactivat dacă activați eSIM. Îl activați oricum?</string>
<string name="esim_toggle_dialog_cancel">Anulare</string>
<string name="esim_toggle_dialog_ok">Activează</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">Настройки eSIM</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Загрузите и активируйте профиль оператора для использования виртуальной SIM-карты</string>
<string name="esim_toggle_dialog">SIM-карта 2 будет отключена, если вы включите eSIM. Включить ее в любом случае?</string>
<string name="esim_toggle_dialog_cancel">Отмена</string>
<string name="esim_toggle_dialog_ok">Вкл.</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">Nastavitve eSIM</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Prenesi in omogoči profil operaterja za uporabo navidezne kartice SIM</string>
<string name="esim_toggle_dialog">SIM 2 bo onemogočen, če omogočite eSIM. Omogoči vseeno?</string>
<string name="esim_toggle_dialog_cancel">Prekliči</string>
<string name="esim_toggle_dialog_ok">Omogoči</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">eSIM அமைப்புகள்</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">மெய்நிகர் செறிவு அட்டையைப் பயன்படுத்த, இயக்கித் தற்குறிப்பைப் பதிவிறக்கிச் செயற்படுத்துக</string>
<string name="esim_toggle_dialog">நீர் eSIM ஐச் செயற்படுத்தினால், SIM 2 முடக்கப்படும். இருந்தாலும் செயற்படுத்தவா?</string>
<string name="esim_toggle_dialog_cancel">விலக்குக</string>
<string name="esim_toggle_dialog_ok">இயக்குக</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">eSIM تەڭشىكى</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">مەۋھۇم SIM كارتىنى ئىشلىتىش ئۈچۈن مەشغۇلاتچىنىڭ تەرجىمىھالىنى چۈشۈرۈپ ۋە ئاكتىپلايدۇ</string>
<string name="esim_toggle_dialog">ئەگەر eSIM نى قوزغاتسىڭىز SIM 2 چەكلىنىدۇ. ئۇنى قوزغىتىۋېرەمسىز؟</string>
<string name="esim_toggle_dialog_cancel">ۋاز كەچ</string>
<string name="esim_toggle_dialog_ok">قوزغات</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">Cài đặt eSIM</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Tải và kích hoạt hồ sơ nhà mạng để sử dụng thẻ SIM ảo</string>
<string name="esim_toggle_dialog">SIM 2 sẽ bị vô hiệu hoá nếu như bạn bật eSIM. Bạn vẫn muốn bật chứ?</string>
<string name="esim_toggle_dialog_cancel">Huỷ</string>
<string name="esim_toggle_dialog_ok">Bật</string>
</resources>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">eSIM 设置</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">下载并激活运营商配置文件以使用虚拟 SIM 卡</string>
<string name="esim_toggle_dialog">启用 eSIM 后SIM 2 将被禁用。是否仍然启用 eSIM </string>
<string name="esim_toggle_dialog_cancel">取消</string>
<string name="esim_toggle_dialog_ok">启用</string>
</resources>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<string name="esim_settings_title">eSIM settings</string>
<string name="esim_toggle_title">eSIM</string>
<string name="esim_toggle_summary">Download and activate an operator profile to use a virtual SIM card</string>
<string name="esim_toggle_dialog">SIM 2 will be disabled if you enable eSIM. Enable it anyway?</string>
<string name="esim_toggle_dialog_cancel">Cancel</string>
<string name="esim_toggle_dialog_ok">Enable</string>
</resources>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2025 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<SwitchPreferenceCompat
android:key="esim_toggle"
android:title="@string/esim_toggle_title"
android:summary="@string/esim_toggle_summary" />
</PreferenceScreen>

View File

@@ -0,0 +1,43 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package org.lineageos.settings.esimswitcher
import android.content.BroadcastReceiver
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.util.Log
class BootCompletedReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
Log.d(TAG, "Received boot completed intent")
val hasNonRemovableEuicc = context.resources.getIntArray(
com.android.internal.R.array.non_removable_euicc_slots
).isNotEmpty()
setComponentEnabled(context, EsimSettingsActivity::class.java.name, hasNonRemovableEuicc)
}
private fun setComponentEnabled(context: Context, component: String, enabled: Boolean) {
val name = ComponentName(context, component)
val pm = context.packageManager
val newState = if (enabled) {
PackageManager.COMPONENT_ENABLED_STATE_ENABLED
} else {
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
}
if (pm.getComponentEnabledSetting(name) != newState) {
pm.setComponentEnabledSetting(name, newState, PackageManager.DONT_KILL_APP)
}
}
companion object {
private const val TAG = "OplusEsimBootReceiver"
}
}

View File

@@ -0,0 +1,92 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package org.lineageos.settings.esimswitcher
import android.content.Context
import android.os.ServiceManager
import android.os.SystemProperties
import android.se.omapi.Channel
import android.se.omapi.Reader
import android.se.omapi.SEService
import android.se.omapi.Session
import android.util.Log
import kotlinx.coroutines.asExecutor
import kotlinx.coroutines.Dispatchers
import vendor.oplus.hardware.esim.IOplusEsim
class EsimController(private val context: Context) {
private val hasSN220Chipset = SystemProperties.get(NFC_CONFIG_FILE_NAME_PROP).contains("SN220")
private val oplusEsimService by lazy {
IOplusEsim.Stub.asInterface(ServiceManager.getService("${IOplusEsim.DESCRIPTOR}/default"))
}
fun currentGpioState() = oplusEsimService?.esimGpio ?: 0
fun toggleEsimState(state: Int) {
val gpioState = currentGpioState()
Log.d(TAG, "Current eSIM status = $gpioState")
if (state == gpioState) {
Log.d(TAG, "No need to change eSIM state")
return
}
oplusEsimService?.setUimPower(0)
if (hasSN220Chipset) {
specialSetEsimGpio(if (gpioState == 0) 1 else 0)
/* oplusEsimService?.setUimPower(1) done via SEService.OnConnectedListener */
} else {
oplusEsimService?.setEsimGpio(if (gpioState == 0) 1 else 0)
oplusEsimService?.setUimPower(1)
}
}
private fun specialSetEsimGpio(state: Int) {
var seService: SEService? = null
val listener = object : SEService.OnConnectedListener {
override fun onConnected() {
Log.d(TAG, "SEService connected")
val service = seService ?: return
try {
val reader = service.readers.firstOrNull { it.name == "eSE1" }
val session = reader?.openSession()
val channel = session?.openLogicalChannel(null)
oplusEsimService?.setEsimGpio(state)
oplusEsimService?.setUimPower(1)
channel?.close()
session?.close()
} catch (e: Exception) {
Log.e(TAG, "Failed to open eSE session", e)
} finally {
try {
service.shutdown()
} catch (e: Exception) {
Log.e(TAG, "Failed to shutdown SEService", e)
}
}
}
}
try {
seService = SEService(context, Dispatchers.IO.asExecutor(), listener)
} catch (e: Exception) {
Log.e(TAG, "Failed to start SEService", e)
}
}
companion object {
private const val TAG = "OplusEsimController"
private const val NFC_CONFIG_FILE_NAME_PROP = "persist.vendor.nfc.config_file_name"
}
}

View File

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

View File

@@ -0,0 +1,51 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package org.lineageos.settings.esimswitcher
import android.app.AlertDialog
import android.os.Bundle
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreferenceCompat
import org.lineageos.settings.esimswitcher.R
class EsimSettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener {
private lateinit var controller: EsimController
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.esim_settings, rootKey)
controller = EsimController(requireContext())
val switcher = findPreference<SwitchPreferenceCompat>(ESIM_TOGGLE_KEY)
switcher?.isChecked = controller.currentGpioState() == 1
switcher?.onPreferenceChangeListener = this
}
override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
val enable = newValue as Boolean
if (enable) {
AlertDialog.Builder(requireContext())
.setMessage(R.string.esim_toggle_dialog)
.setNegativeButton(R.string.esim_toggle_dialog_cancel) { dialog, _ ->
dialog.dismiss()
}
.setPositiveButton(R.string.esim_toggle_dialog_ok) { dialog, _ ->
dialog.dismiss()
controller.toggleEsimState(1)
(preference as? SwitchPreferenceCompat)?.isChecked = true
}
.show()
return false
} else {
controller.toggleEsimState(0)
return true
}
}
companion object {
private const val ESIM_TOGGLE_KEY = "esim_toggle"
}
}

25
folio-daemon/Android.bp Normal file
View File

@@ -0,0 +1,25 @@
cc_binary {
name: "folio-daemon",
init_rc: ["folio_daemon.rc"],
shared_libs: [
"libandroid",
"libcutils",
"liblog",
],
srcs: ["main.cpp"],
cflags: [
"-DLOG_TAG=\"folio-daemon\"",
"-DLOG_NDEBUG=0",
] + [
"-Wall",
"-Werror",
],
owner: "google",
system_ext_specific: true,
}

View File

@@ -0,0 +1,11 @@
service folio-daemon /system_ext/bin/folio-daemon
class late_start
user system
group system uhid
disabled
on property:init.svc.zygote=running
start folio-daemon
on property:init.svc.zygote=stopped
stop folio-daemon

161
folio-daemon/main.cpp Normal file
View File

@@ -0,0 +1,161 @@
/*
* SPDX-FileCopyrightText: 2017 The Android Open Source Project
* SPDX-FileCopyrightText: 2023-2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
#include <android/looper.h>
#include <android/sensor.h>
#include <cutils/log.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/input.h>
#include <linux/uinput.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
// Hall-effect sensor type
#define SENSOR_TYPE 33171002
#define RETRY_LIMIT 120
#define RETRY_PERIOD 30 // 30 seconds
#define WARN_PERIOD (time_t)300 // 5 minutes
/*
* This simple daemon listens for events from the Hall-effect sensor and writes
* the appropriate SW_LID event to a uinput node. This allows the screen to be
* locked with a magnetic folio case.
*/
int main(void) {
int uinputFd;
int err;
struct uinput_user_dev uidev;
ASensorManager* sensorManager = nullptr;
ASensorRef hallSensor;
ALooper* looper;
ASensorEventQueue* eventQueue = nullptr;
time_t lastWarn = 0;
int attemptCount = 0;
ALOGI("Started");
uinputFd = TEMP_FAILURE_RETRY(open("/dev/uinput", O_WRONLY | O_NONBLOCK));
if (uinputFd < 0) {
ALOGE("Unable to open uinput node: %s", strerror(errno));
goto out;
}
err = TEMP_FAILURE_RETRY(ioctl(uinputFd, UI_SET_EVBIT, EV_SW)) |
TEMP_FAILURE_RETRY(ioctl(uinputFd, UI_SET_EVBIT, EV_SYN)) |
TEMP_FAILURE_RETRY(ioctl(uinputFd, UI_SET_SWBIT, SW_LID));
if (err != 0) {
ALOGE("Unable to enable SW_LID events: %s", strerror(errno));
goto out;
}
memset(&uidev, 0, sizeof(uidev));
snprintf(uidev.name, UINPUT_MAX_NAME_SIZE, "uinput-folio");
uidev.id.bustype = BUS_VIRTUAL;
uidev.id.vendor = 0;
uidev.id.product = 0;
uidev.id.version = 0;
err = TEMP_FAILURE_RETRY(write(uinputFd, &uidev, sizeof(uidev)));
if (err < 0) {
ALOGE("Write user device to uinput node failed: %s", strerror(errno));
goto out;
}
err = TEMP_FAILURE_RETRY(ioctl(uinputFd, UI_DEV_CREATE));
if (err < 0) {
ALOGE("Unable to create uinput device: %s", strerror(errno));
goto out;
}
ALOGI("Successfully registered uinput-folio for SW_LID events");
// Get Hall-effect sensor events from the NDK
sensorManager = ASensorManager_getInstanceForPackage(nullptr);
looper = ALooper_forThread();
if (looper == nullptr) {
looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS);
}
eventQueue = ASensorManager_createEventQueue(sensorManager, looper, 0, NULL, NULL);
/*
* As long as we are unable to get the sensor handle, periodically retry
* and emit an error message at a low frequency to prevent high CPU usage
* and log spam. If we simply exited with an error here, we would be
* immediately restarted and fail in the same way indefinitely.
*/
while (true) {
time_t now = time(NULL);
hallSensor = ASensorManager_getDefaultSensorEx(sensorManager, SENSOR_TYPE, true);
if (hallSensor != nullptr) {
break;
}
if (++attemptCount >= RETRY_LIMIT) {
ALOGE("Retries exhausted; exiting");
goto out;
} else if (now > lastWarn + WARN_PERIOD) {
ALOGE("Unable to get Hall-effect sensor");
lastWarn = now;
}
sleep(RETRY_PERIOD);
}
err = ASensorEventQueue_registerSensor(eventQueue, hallSensor, 0, 0);
if (err < 0) {
ALOGE("Unable to register for Hall-effect sensor events");
goto out;
}
ALOGI("Starting polling loop");
// Polling loop
while (ALooper_pollOnce(-1, NULL, NULL, NULL) > ALOOPER_POLL_TIMEOUT) {
ASensorEvent sensorEvent;
while (ASensorEventQueue_getEvents(eventQueue, &sensorEvent, 1) > 0) {
// 0 means closed; 1 means open
int isClosed = sensorEvent.data[0] > 0.0f ? 0 : 1;
struct input_event event;
event.type = EV_SW;
event.code = SW_LID;
event.value = isClosed;
err = TEMP_FAILURE_RETRY(write(uinputFd, &event, sizeof(event)));
if (err < 0) {
ALOGE("Write EV_SW to uinput node failed: %s", strerror(errno));
goto out;
}
// Force a flush with an EV_SYN
event.type = EV_SYN;
event.code = SYN_REPORT;
event.value = 0;
err = TEMP_FAILURE_RETRY(write(uinputFd, &event, sizeof(event)));
if (err < 0) {
ALOGE("Write EV_SYN to uinput node failed: %s", strerror(errno));
goto out;
}
ALOGI("Sent lid %s event", isClosed ? "closed" : "open");
}
}
out:
// Clean up
if (sensorManager != nullptr && eventQueue != nullptr) {
ASensorManager_destroyEventQueue(sensorManager, eventQueue);
}
if (uinputFd >= 0) {
close(uinputFd);
}
// The loop can only be exited via failure or signal
return 1;
}

View File

@@ -102,6 +102,31 @@ aidl_interface {
],
}
aidl_interface {
name: "vendor.oplus.hardware.displaypanelfeature",
system_ext_specific: true,
odm_available: true,
local_include_dir: "aidl",
srcs: ["aidl/vendor/oplus/hardware/displaypanelfeature/*.aidl"],
stability: "vintf",
owner: "oplus",
backend: {
cpp: {
enabled: true,
},
java: {
enabled: false,
},
},
versions_with_info: [
{
version: "1",
imports: [],
},
],
}
aidl_interface {
name: "vendor.oplus.hardware.esim",
system_ext_specific: true,
@@ -127,6 +152,39 @@ aidl_interface {
],
}
aidl_interface {
name: "vendor.oplus.hardware.olc2",
system_ext_specific: true,
vendor_available: true,
local_include_dir: "aidl",
srcs: ["aidl/vendor/oplus/hardware/olc2/*.aidl"],
stability: "vintf",
owner: "oplus",
backend: {
cpp: {
enabled: true,
},
java: {
sdk_version: "module_current",
},
},
versions_with_info: [
{
version: "1",
imports: [],
},
{
version: "2",
imports: [],
},
{
version: "3",
imports: [],
},
],
}
aidl_interface {
name: "vendor.oplus.hardware.osense.client",
system_ext_specific: true,
@@ -206,6 +264,39 @@ aidl_interface {
],
}
aidl_interface {
name: "vendor.oplus.hardware.stability.oplus_project",
system_ext_specific: true,
vendor_available: true,
local_include_dir: "aidl",
srcs: ["aidl/vendor/oplus/hardware/stability/oplus_project/*.aidl"],
stability: "vintf",
owner: "oplus",
backend: {
cpp: {
enabled: true,
},
java: {
sdk_version: "module_current",
},
},
versions_with_info: [
{
version: "1",
imports: [],
},
{
version: "2",
imports: [],
},
{
version: "3",
imports: [],
},
],
}
aidl_interface {
name: "vendor.oplus.hardware.touch",
system_ext_specific: true,
@@ -234,3 +325,33 @@ aidl_interface {
},
],
}
aidl_interface {
name: "vendor.oplus.hardware.urcc",
system_ext_specific: true,
vendor_available: true,
local_include_dir: "aidl",
srcs: ["aidl/vendor/oplus/hardware/urcc/*.aidl"],
stability: "vintf",
owner: "oplus",
backend: {
cpp: {
enabled: true,
},
ndk: {
gen_log: true,
},
java: {
sdk_version: "module_current",
},
},
versions_with_info: [
{
version: "1",
imports: [],
},
],
frozen: true,
}

View File

@@ -0,0 +1,13 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.oplus.hardware.displaypanelfeature;
@VintfStability
interface IDisplayPanelFeature {
int getDisplayPanelFeatureValue(int featureId, inout int[] featureValues);
int setDisplayPanelFeatureValue(int featureId, in int[] featureValues);
int getDisplayPanelInfo(int featureId, out List<String> panelInfo);
}

View File

@@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.oplus.hardware.olc2;
@VintfStability
parcelable ExceptionInfo {
long time;
int exceptionId;
int exceptionType;
int level;
long atomicLogs;
String logParams;
}

View File

@@ -0,0 +1,13 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.oplus.hardware.olc2;
@VintfStability
parcelable ExceptionRecord {
int exception_id;
int dropped;
long expire;
}

View File

@@ -0,0 +1,14 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.oplus.hardware.olc2;
@VintfStability
parcelable FileInfo {
String path;
int mode;
long size;
long mtime;
}

View File

@@ -0,0 +1,11 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.oplus.hardware.olc2;
@VintfStability
interface IGaiaEventListener {
void onGaiaEvent(in byte[] event);
}

View File

@@ -0,0 +1,34 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.oplus.hardware.olc2;
import android.os.ParcelFileDescriptor;
import vendor.oplus.hardware.olc2.ExceptionInfo;
import vendor.oplus.hardware.olc2.FileInfo;
import vendor.oplus.hardware.olc2.IGaiaEventListener;
import vendor.oplus.hardware.olc2.IOplusLogCoreEventCallback;
@VintfStability
interface IOplusLogCore {
int enableExceptionMonitor(boolean enabled);
int olcRaiseException(in ExceptionInfo exceptionInfo);
int pullDroppedExceptions();
int registerEventCallback(IOplusLogCoreEventCallback callback);
int unregisterEventCallback(IOplusLogCoreEventCallback callback);
boolean doShell(String command);
boolean doShellBlocking(String command);
ParcelFileDescriptor getFileDescriptor(String path, int flags);
FileInfo getFileInfo(String path);
List<FileInfo> getFileInfoList(String path, boolean recursive);
boolean removePath(String path);
void registerGaiaEventListener(IGaiaEventListener listener);
void unregisterGaiaEventListener(IGaiaEventListener listener);
void sendGaiaEvent(in byte[] event);
}

View File

@@ -0,0 +1,15 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.oplus.hardware.olc2;
import vendor.oplus.hardware.olc2.ExceptionInfo;
import vendor.oplus.hardware.olc2.ExceptionRecord;
@VintfStability
interface IOplusLogCoreEventCallback {
void onDroppedExceptions(in ExceptionRecord[] records);
void onException(in ExceptionInfo exception);
}

View File

@@ -0,0 +1,14 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.oplus.hardware.olc2;
@VintfStability
@Backing(type="int")
enum StatusCode {
SUCCESS = 0,
FAILURE_UNKNOWN = 1,
FAILURE_ARGS_INVALID = 2,
}

View File

@@ -0,0 +1,51 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.oplus.hardware.stability.oplus_project;
@VintfStability
interface IOplusProject {
int get_eng_version();
String get_force_reboot();
int get_ftmmode();
String get_hungtask();
String get_mt_gpio();
String get_ocp();
String get_opboot();
int get_operator_name();
String get_oplusocp_status(int pmic_id);
String get_opluspoff_reason(int pmic_id);
String get_opluspon_reason(int pmic_id);
int get_pcb_version();
String get_phoenix();
String get_pmic_info();
String get_poff_reason();
String get_pon_reason();
int get_project();
int get_rf_type();
int get_sau();
String get_serial_ID();
String get_shutdown_detect();
boolean is_ufs_devices();
String miscModule2Load();
String miscModuleBlocklist();
String miscReadLinkedModules();
int[] readAgingData(int type);
String read_theia_node(int theia_node_id);
boolean saveAgingData(int type, in int[] saveAgingData, int length);
boolean set_opboot(String opboot);
boolean set_phoenix(String monitoring_command);
boolean set_shutdown_detect(String shutdown_detect_value);
boolean write_theia_node(int theia_node_id, String theia_data);
String get_dram_freq();
String read_op1_record_info();
boolean write_op1_record_info(String op1_logs_data);
}

View File

@@ -0,0 +1,28 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.oplus.hardware.urcc;
import vendor.oplus.hardware.urcc.IUrccCallback;
import vendor.oplus.hardware.urcc.UrccRequestData;
import vendor.oplus.hardware.urcc.UrccRequestParcel;
@VintfStability
interface IUrcc {
void urccInit();
int urccResCtlRequest(in UrccRequestParcel mUrccRequestParcel);
int urccResCtlRelease(int mhandle);
UrccRequestData[] urccResStateRequest(in UrccRequestParcel mUrccRequestParcel);
int urccResListeningRegister(in UrccRequestParcel mUrccRequestParcel, IUrccCallback urccCallback);
int urccResListeningUnRegister(int mhandle);
String urccPropertyGet(String name);
int urccPropertySet(String name, String value);
int urccThermalListeningRegister(in int[] types, IUrccCallback urccCallback);
int urccThermalListeningUnRegister(int mhandle);
int uahNotifyExt(int src, int type, in int[] args);
int setRelatedSysInfo(int cmd, in byte[] info);
int urccRuleCtl(int ruleId, int status, in UrccRequestData[] ruleData);
void uahResCtlRequestBypass(in UrccRequestParcel mRequestParcel);
}

View File

@@ -0,0 +1,13 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.oplus.hardware.urcc;
import vendor.oplus.hardware.urcc.UrccRequestData;
@VintfStability
interface IUrccCallback {
void onCallback(in UrccRequestData[] urccRequestDataArr);
}

View File

@@ -0,0 +1,15 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.oplus.hardware.urcc;
@VintfStability
parcelable UrccRequestData {
String desc;
String res_Path;
String res_Value;
int res_Id;
int event_Id;
}

View File

@@ -0,0 +1,26 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.oplus.hardware.urcc;
import vendor.oplus.hardware.urcc.IUrccCallback;
import vendor.oplus.hardware.urcc.UrccRequestData;
@VintfStability
parcelable UrccRequestParcel {
String identity;
String[] mParams;
UrccRequestData[] mUrccRequestData;
byte[] otherData;
String pkgName;
IUrccCallback urccCallback;
int type;
boolean screenoff_support;
int prio;
int callingPID;
int callingUID;
long duration;
int handle;
}

View File

@@ -0,0 +1 @@
2a77fa43b874c191dea05b1585626a634d85ad6d

View File

@@ -0,0 +1,29 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.oplus.hardware.displaypanelfeature;
@VintfStability
interface IDisplayPanelFeature {
int getDisplayPanelFeatureValue(int featureId, inout int[] featureValues);
int setDisplayPanelFeatureValue(int featureId, in int[] featureValues);
int getDisplayPanelInfo(int featureId, out List<String> panelInfo);
}

View File

@@ -0,0 +1,29 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.oplus.hardware.displaypanelfeature;
@VintfStability
interface IDisplayPanelFeature {
int getDisplayPanelFeatureValue(int featureId, inout int[] featureValues);
int setDisplayPanelFeatureValue(int featureId, in int[] featureValues);
int getDisplayPanelInfo(int featureId, out List<String> panelInfo);
}

View File

@@ -0,0 +1 @@
bb7fb312b7196dcfe210468e8f19730d2a44bc76

View File

@@ -0,0 +1,32 @@
/*
* SPDX-FileCopyrightText: 2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.oplus.hardware.olc2;
@VintfStability
parcelable ExceptionInfo {
long time;
int exceptionId;
int exceptionType;
int level;
long atomicLogs;
String logParams;
}

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