Commit Graph

1277 Commits

Author SHA1 Message Date
Bruno Martins
442a313610 sdk: Remove touch HIDL support
Change-Id: I688f8abadb009588b628c9b8d342d32ab824e562
2025-06-24 20:51:25 +01:00
Alexander Martinz
987c5b8570 Android.bp: use defaults and file groups
Change-Id: I90280166ed35945d0ddbfdb4bbb533f5d9c6988d
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2025-06-17 06:43:57 +00:00
LineageOS Infra
146083f942 Automatic translation import
Change-Id: I3403ac9e4df256199eb8dbd6d459c99d0b0faa6c
2025-06-15 14:13:36 +00:00
Cosmin Tanislav
4c5cc9538b lineage-sdk: implement search button play/pause
Change-Id: I409e7633893dd94601fb67bb2cea35868f10af1e
2025-06-11 22:45:11 +03:00
Cosmin Tanislav
907bce40dd lineage-sdk: use single validator for hardware keys
Change-Id: Ifbc2c275e4b2270c87894a782a7b92cc84479788
2025-06-11 22:45:11 +03:00
althafvly
b1685ba11a sdk: Register network callback only if it is enabled.
Change-Id: I8c11ac84e9a18c38c5909a8d012c8e3badfe1a16
2025-06-07 11:23:18 +00:00
Michael Bestas
75b3ededc4 sdk: Fix UserContentObserver build
Change-Id: Ic0f38473b3d1f1a59deafc7810ecffd37d9ba0fc
2025-06-07 09:36:54 +00:00
Luca Stefani
f65d1c05e5 Wire up AIDL touch HAL
Change-Id: Ic1c24f10f8ca6282270660f11987b57353548efc
2025-06-06 20:56:31 +00:00
Alexander Martinz
af0f5c3945 sdk: Intent: unhide actions
These may be interesting to other apps.

Change-Id: If662e4edc71d21026af2c143ab14755e115870a2
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2025-05-26 18:12:39 +00:00
Alexander Martinz
55c5769a19 sdk: unhide palette utilities
It does not make sense to hide away such lovely code.
Let it be used by others, given that it lives within
the sdk.

Change-Id: Iab4605e77fd3425049df68ebbeaa3bd247874795
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2025-05-26 18:12:39 +00:00
Alexander Martinz
c8eeb1755d LineageSettings: fix api lint
Fix a typo and hide a validator, which was not hidden
by mistake.

```
lineage-sdk/sdk/src/java/lineageos/providers/LineageSettings.java:2776: warning: Field LineageSettings.Secure.GESTURE_BACK_EXCLUDE_TOP_VALIDATOR references hidden type lineageos.providers.LineageSettings.Validator. (ErrorWhenNew) [HiddenT
ypeParameter]
lineage-sdk/sdk/src/java/lineageos/providers/LineageSettings.java:2776: error: Class lineageos.providers.LineageSettings.Validator is hidden but was referenced (in field type) from public field lineageos.providers.LineageSettings.Secure.G
ESTURE_BACK_EXCLUDE_TOP_VALIDATOR [ReferencesHidden]
lineage-sdk/sdk/src/java/lineageos/providers/LineageSettings.java:2942: warning: Field LineageSettings.Secure.VOLUME_PANEL_ON_LEFT_VALIDATOR references hidden type lineageos.providers.LineageSettings.Validator. (ErrorWhenNew) [HiddenTypeP
arameter]
lineage-sdk/sdk/src/java/lineageos/providers/LineageSettings.java:2942: error: Class lineageos.providers.LineageSettings.Validator is hidden but was referenced (in field type) from public field lineageos.providers.LineageSettings.Secure.V
OLUME_PANEL_ON_LEFT_VALIDATOR [ReferencesHidden]
```

Change-Id: I71db41bc6f797d77fb281c989d9dcd7299036a25
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2025-05-26 18:12:39 +00:00
Trogel
f96d14bc55 health: Update charging control if next alarm is changed
Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/8744
Change-Id: I390f7c2110add51f776f56d9de1ab690721e2e21
2025-05-02 10:54:24 +00:00
Trogel
76d8b695a2 health: Don't turn on charging control if not plugged in
Also cancel a possibly existing charging control notification.

Previously charging control was turned on when settings were changed and
on system start even if no charger was plugged in, thus possibly showing
the charging control notification.

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/8610
Change-Id: I78c47f026aa47ac756cc6eca12157ea58bda58fd
2025-05-02 10:49:50 +00:00
LineageOS Infra
515b58b86e Automatic translation import
Change-Id: If884f464eada97216ee27133f41ab85c2b6d32b9
2025-05-01 16:33:19 +00:00
LuK1337
e0d5a13470 health: Allow Limit/Toggle providers for MODE_AUTO/MODE_MANUAL
They are supposed to support these modes according to
isChargingControlModeSupported().

Change-Id: I13ccbc62eda3fa347c10e8f8a4a8ecac4db0fee0
2025-04-22 16:31:18 +02:00
LineageOS Infra
1847da10de Automatic translation import
Change-Id: Ic774d045db14388f510b43427c038145665ce058
2025-04-15 13:55:19 +00:00
Luca Stefani
a9f9b20db8 Move NotificationGroup to lineage-sdk
Change-Id: I64d9a3331ad81d689dddb6c3a5ef301bf0c89bc8
2025-04-13 18:22:38 +00:00
LuK1337
dea5d334d6 health: Select correct provider on init
Fixes the following crash on boot when trying to use deadline mode:

E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: android.display
E AndroidRuntime: java.lang.RuntimeException: Failed to boot service org.lineageos.platform.internal.health.HealthInterfaceService: onBootPhase threw an exception during phase 1000
E AndroidRuntime: 	at com.android.server.SystemServiceManager.startBootPhase(SystemServiceManager.java:321)
E AndroidRuntime: 	at com.android.server.am.ActivityManagerService.finishBooting(ActivityManagerService.java:5199)
E AndroidRuntime: 	at com.android.server.am.ActivityManagerService.bootAnimationComplete(ActivityManagerService.java:5330)
E AndroidRuntime: 	at com.android.server.wm.WindowManagerService.performEnableScreen(WindowManagerService.java:3970)
E AndroidRuntime: 	at com.android.server.wm.WindowManagerService.-$$Nest$mperformEnableScreen(WindowManagerService.java:0)
E AndroidRuntime: 	at com.android.server.wm.WindowManagerService$H.handleMessage(WindowManagerService.java:5885)
E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:109)
E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:232)
E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:317)
E AndroidRuntime: 	at android.os.HandlerThread.run(HandlerThread.java:85)
E AndroidRuntime: 	at com.android.server.ServiceThread.run(ServiceThread.java:49)
E AndroidRuntime: Caused by: java.lang.RuntimeException: Unsupported operation
E AndroidRuntime: 	at org.lineageos.platform.internal.health.ccprovider.ChargingControlProvider.onBatteryChanged(ChargingControlProvider.java:107)
E AndroidRuntime: 	at org.lineageos.platform.internal.health.ccprovider.ChargingControlProvider.update(ChargingControlProvider.java:40)
E AndroidRuntime: 	at org.lineageos.platform.internal.health.ChargingControlController.updateChargeControl(ChargingControlController.java:412)
E AndroidRuntime: 	at org.lineageos.platform.internal.health.ChargingControlController.handleSettingChange(ChargingControlController.java:447)
E AndroidRuntime: 	at org.lineageos.platform.internal.health.ChargingControlController.onStart(ChargingControlController.java:265)
E AndroidRuntime: 	at org.lineageos.platform.internal.LineageBaseFeature.start(LineageBaseFeature.java:39)
E AndroidRuntime: 	at org.lineageos.platform.internal.health.HealthInterfaceService.onBootPhase(HealthInterfaceService.java:86)
E AndroidRuntime: 	at com.android.server.SystemServiceManager.startBootPhase(SystemServiceManager.java:318)
E AndroidRuntime: 	... 10 more
E Zygote  : System zygote died with fatal exception

Change-Id: Id177ec9fe814b4cf33d2853e7674463c5fd5b7ca
2025-04-12 23:07:42 +02:00
LineageOS Infra
5f6ea17cbe Automatic translation import
Change-Id: I6961c6888346996dadbf4aaf786fd6fa2c7b9171
2025-04-07 16:25:25 +00:00
Oliver Scott
e55f7e32de health: Implement charge limit mode
Change-Id: I6d4f03a62555bd07ec70d23745506c7759b715ab
2025-03-27 14:09:09 +00:00
Oliver Scott
6881d5f44e ChargingControl: Prevent crash against very frequent power toggle
Log:

12-04 00:04:42.661  1499  1499 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: main
12-04 00:04:42.661  1499  1499 E AndroidRuntime: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.ACTION_POWER_DISCONNECTED flg=0x4000010 (has extras) } in org.lineageos.platform.internal.health.ChargingControlController$2@7432f8e
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0(LoadedApk.java:1822)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at android.app.LoadedApk$ReceiverDispatcher$Args.$r8$lambda$mcNAAl1SQ4MyJPyDg8TJ2x2h0Rk(Unknown Source:0)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:959)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:100)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:232)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:317)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at com.android.server.SystemServer.run(SystemServer.java:985)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at com.android.server.SystemServer.main(SystemServer.java:669)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:583)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:864)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: Receiver not registered: org.lineageos.platform.internal.health.ChargingControlController$LineageHealthBatteryBroadcastReceiver@7c6b69a
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:1674)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1901)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at org.lineageos.platform.internal.health.ChargingControlController.onPowerDisconnected(ChargingControlController.java:325)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at org.lineageos.platform.internal.health.ChargingControlController.onPowerStatus(ChargingControlController.java:336)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at org.lineageos.platform.internal.health.ChargingControlController.-$$Nest$monPowerStatus(Unknown Source:0)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at org.lineageos.platform.internal.health.ChargingControlController$2.onReceive(ChargingControlController.java:290)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0(LoadedApk.java:1814)
12-04 00:04:42.661  1499  1499 E AndroidRuntime: 	... 11 more

Change-Id: Ic2c1df60881ea06bd2cd3f6b68ea3ff7c1273153
2025-03-27 14:07:25 +00:00
Michael Bestas
38be42ce0a sdk: Cleanup imports
find . -name "*.java" | xargs java -jar \
~/bin/google-java-format-1.25.2-all-deps.jar \
--aosp --fix-imports-only --replace

Change-Id: If39579285c13cecdb3592d8ccf0605b8030b340e
2025-03-23 12:06:59 +02:00
Michael Bestas
989dd336c1 Disable use_resource_processor for org.lineageos.platform-res
Change-Id: Ic27b48d612ad089be0376b32591d5ce9b8e4f716
2025-03-09 11:23:26 +02:00
LuK1337
e395199695 health: Catch all setCharging*() exceptions
Technically, this should be fixed device side, but random failure when
HAL side fails shouldn't crash the system either.

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/8391
Change-Id: Iedd869cbd74e4a5535655c977b8ead74e8d5868d
2025-02-24 21:23:38 +01:00
Luofan Chen
a5c37aced7 health: Rename msToUTCString to msToHMSString
Change-Id: I1d8a28eee49056e73917c052180fd7328eb7fbd5
2025-02-22 16:34:11 +00:00
наб
436d750313 health: Format notification's target time according to locale
Fixes: 8a7af5a974
Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/8317
Change-Id: I2c059da77c54c4fea11bdbabd1dde752f74ca6cf
2025-02-16 12:03:53 +00:00
LineageOS Infra
2772796326 Automatic translation import
Change-Id: Ib252621063045843d0a6d1655d98fe86f37b2725
2025-02-15 15:47:20 +00:00
Aaron Kling
ce38f734e5 lineage-sdk: Add setting for atv two button mute
To allow volume up and down to mute

Change-Id: Iccc119605292983bc50de39f59af45e59116a685
2025-02-14 19:16:35 +00:00
Michael Bestas
b9be94a473 sdk: Get rid of lineageos.os.{Build,Concierge}
Change-Id: I7b781deb1330810caa193b822bcc02b9610e53b0
2025-02-10 18:13:48 +02:00
LineageOS Infra
cc0d50aac5 Automatic translation import
Change-Id: Iab649a8c8f2082c1f4e7fd01bc491507d6b5ba57
2025-02-01 14:28:35 +00:00
LuK1337
2b130050dd sdk: Support breath LED mode
Change-Id: I9ec757a784dc3fb3afcb6f909f10e2eee86502ea
2025-01-18 12:19:21 +01:00
LineageOS Infra
4796ff52f4 Automatic translation import
Change-Id: Ibd246d935ef5a5013b7266c79cd6d8a3a30417b8
2025-01-15 20:54:49 +00:00
Luofan Chen
8a7af5a974 ChargingControl: Decouple charging control and main logic
The existing Hardware Abstraction Layer (HAL) supports two distinct
control modes: TOGGLE and DEADLINE, each offering unique capabilities.
For instance, the TOGGLE mode allows for control over both charging
time and limit, while the DEADLINE mode only enables control over the
charging time. Managing these separate logic streams within a single
ChargingControlController class complicates the development process.

This commit separates the specific charging control logic — determining
what to send to the HAL—from the primary logic. The charging control
module now offers providers tailored to each HAL-supported charging
control mode, allowing for limit control, time control, or both. When
required, the ChargingControlController invokes these specific providers.

This commit also saparates other parts, like notifications, from the
main logic, to a saparate class.

This separation simplifies the codebase. Moreover, when introducing a new
mode in the HAL, developers only need to implement the corresponding
provider's logic based on the mode's capabilities. And minimal changes
are needed in the primary logic.

Change-Id: Ie40020c2df4141d4aa6385c8f5565821af942755
2025-01-13 10:22:07 +00:00
Michael W
8709a3a505 sdk: Optimize imports
Reordering and removing unused ones

Change-Id: I1fff9c6f11c71022dbf4207ee042d2ee2ff77ee6
2025-01-04 13:44:39 +01:00
Michael W
97ea132c03 sdk: FloatMath is deprecated
We should use Math instead

Change-Id: I0271486ad866521a544c4f9b54ec92965fc047b0
2025-01-04 13:44:39 +01:00
Michael W
423cec2b12 sdk: A few finals don't hurt
And a few language features (HashMap constructors, collapsing
catch blocks, method references)
plus two typos

Change-Id: I9ae2f7c006c5f2f9c7c99eab81059c08bece1202
2025-01-04 13:44:39 +01:00
Michael W
28185f0f54 sdk: Call Handler()'s correct constructor
The constructor for Handler() without an explicit Looper is deprecated

Change-Id: I75caeed0d0abc6047b39f652dd241547ff56cf3b
2025-01-04 13:44:39 +01:00
Michael W
87c969771b sdk: Use BluetoothManager.getAdapter()
* BluetoothAdapter.getDefaultAdapter() is deprecated since sdk 31
* Also fixes wrong naming for mBluetoothAdapter which was local
  and thus didn't need the prefix "m"

Change-Id: I003fe06fbd8958cde0fdd71d61710272e32a2ca5
2025-01-04 13:44:39 +01:00
Andy CrossGate Yan
5e5212c76b sdk: Try getting LineageHardwareService again before checking for it
Currently if LineageHardwareManager couldn't get LineageHardwareService
on its first try, it stays disconnected and wouldn't retry in time.
Several one-time isSupported() checks during boot would then fail,
resulting in missing features e.g. HWC2-based LiveDisplay.

Change-Id: I85e6866543798ed4a805db5c99a28ef8a39335cc
2025-01-01 17:41:19 +08:00
LuK1337
59c2643018 LineageSettingsProvider: Migrate tethering_allow_vpn_upstreams to AOSP
Change-Id: I1453d075f39c0e11a0fd056924d9ec5957928c26
2024-12-20 18:54:18 +02:00
Luca Stefani
1963836822 Deprecate org.lineageos.platform.lineagesettings
Changing APEX modules behavior is as annoying as it can be.

Futhermore this target was used for a single setting entry that can be
easily replaced by using the AOSP settings provider, that is already
accessible in the module.

Change-Id: I0d2aa32dc4f3057d29bf59126c5a2dc3a4043c21
2024-12-20 13:35:29 +01:00
Christian Hoffmann
4e9ea61e32 TrustInterfaceService: Allow BAL
Change-Id: Icade42a394c6501871a47274a84371fa681bf1fa
2024-12-20 03:52:54 +00:00
LineageOS Infra
b503f5ce9b Automatic translation import
Change-Id: I4d17c0562b6c733cc38d1cb90582aff968faa77a
2024-12-16 06:29:59 +00:00
Bruno Martins
b9a622ad20 sdk: Remove no longer used ACTION_UPDATE_POWER_MENU intent
Change-Id: If83d4430a71d66e17ec3b30660a83b4c22ec59ff
2024-12-05 09:09:27 +00:00
LineageOS Infra
1a4083ad67 Automatic translation import
Change-Id: Iee7bc64d903f0bef4fc20e4774730d68b0ce84a2
2024-12-02 02:54:17 +00:00
LineageOS Infra
eed35b8aad Automatic translation import
Change-Id: I8902b6005532ade17489e89fa4b29104fb4bcd41
2024-11-16 06:48:07 +00:00
Michael Bestas
5a577dc607 sdk: Make it REUSE compatible
Change-Id: Iba2bcaf5e677eafebc48c6aca3d3625f821d6e27
2024-11-07 13:28:42 +00:00
Michael Bestas
87d20850bf sdk: Remove unused .gitignore
Change-Id: If3eb2d25aa93b2a210c424e06e64412643a18532
2024-11-07 13:28:42 +00:00
Michael Bestas
5efaee2299 sdk: Remove SettingsProvider tests
Change-Id: I3abde5201b7d103b038f98c05fdf0026a7834ea8
2024-11-07 13:28:42 +00:00
Michael Bestas
756427f973 sdk: Remove unused proguard.txt
Change-Id: I342a9bb9865bd6958a64f46953d5aa1f6ca3d287
2024-11-07 13:28:42 +00:00