Commit Graph

1182 Commits

Author SHA1 Message Date
Michael Bestas
6326bdad01 Remove leftover Performance Profiles support
Change-Id: Ib830ccbf3910b115b5979936a3b75c167bd57779
2023-07-22 18:42:47 +03:00
Michael Bestas
1a53318ab3 LineageSettingsProvider: Allow enabling lockscreen rotation by default
...and enable it by default for sw600dp

Change-Id: I0df4f0907591146a21d3da0e0d11e3213ad8767a
2023-07-20 17:28:53 +02:00
LineageOS Infra
ff85a9631f Automatic translation import
Change-Id: I50f9f3c49e364546190af1e886de350fd9e58cff
2023-07-15 18:07:57 +00:00
Tommy Webb
0c5c4f6664 ChargingControl: Additional log lines for deadline
Change-Id: I9ceb3b0df0095cb12408a6ae47be8fd8af6678a8
2023-07-13 17:20:21 +02:00
Tommy Webb
2b59462ac6 ChargingControl: Retry setting deadline if it fails
Do not save the target time unless setting deadline succeeds,
effectively allowing it to be retried later.

Change-Id: I572b935b088170d56623a33c5efd2292b1a67126
2023-07-13 17:20:21 +02:00
Luofan Chen
3c3140b8e0 ChargingControl: Don't set deadline if charging control is not enabled
Change-Id: I5e7570184294e8391e4908e449c1bffb07d9410d
2023-07-13 17:20:21 +02:00
Luofan Chen
1f36483aa7 ChargingControl: Drop default values for initially zero variables
Java generally sets the default values for fields to zero or null.

Change-Id: I7a993dfc70476ed5beb649cae42de2b125b897b9
2023-07-13 17:20:21 +02:00
Luofan Chen
1ed0e04da8 ChargingControl: Return early if lineage health HAL is not found
Change-Id: I2616224167a4fe5e59bdf01c5e124744bb8b2d51
2023-07-13 17:20:21 +02:00
Michael Bestas
63769995c1 Drop < lineage-16.0 database migration support
It is only possible to upgrade from 17.1 to 20.0 directly,
let's just drop all the old migration steps.

Change-Id: I04ec638f3b7c75d53629c8fec5523a0ccc7eabb5
2023-07-13 16:19:43 +02:00
Chirayu Desai
7e5dade283 Change existing migrations to use new helper methods
* We usually shouldn't touch existing migrations,
  they would have already ran for most (if not all) users,
  and don't run for existing users since they start at
  the latest version.
* However, we've recently discovered many issues with these
  migrations, and past reported issues are now starting to make
  sense (they can be explained by migration running over and over again)
* As such, let's fix this once and for all to make things clearer.
* We also tend to copy older migrations when writing soemthing new so it
  should help having these done :)

Change-Id: Ic45efc823da7ea8a137e79b3769a9ca53c2f8667
2023-07-13 16:19:43 +02:00
Tommy Webb
1c5a5dd010 Add helper methods for reading and writing settings
Add new private methods readSetting, readIntegerSetting,
readLongSetting, writeSetting, and writeSettingIfNotPresent
to reduce boilerplate and potential for code errors.

Change-Id: I9872cc50db86056cdc1588741600b66ee9d40f9f
2023-07-13 16:19:15 +02:00
Tommy Webb
663a948c50 Do not use transactions when reading settings
There is no need to use database transactions to simply read settings.
We also were not setting the transaction as successful, which was
causing the outer transaction for the whole onUpgrade operation to be
rolled back, meaning that some devices would be stuck at old db
versions and perform repeated migration attempts on every boot.

Issue: calyxos#1290
Change-Id: Icefe994379152f9a3aa6c0c5b447cc55d5c4cf46
2023-07-12 14:27:42 +03:00
Chirayu Desai
173b6d8693 Migrate side FPS settings
* Really shouldn't have touched an existing migration before
* Anywho, let's change it back to what it was but make it compile
* Then, let's migrate that old setting to the new AOSP setting,
  but flip it since it works differently.

Change-Id: I342d8c78aa8faeda5dcaafe9199deb51c570efd0
2023-07-12 14:27:38 +03:00
LuK1337
c407667d38 ChargingControl: Use ServiceManager.waitForDeclaredService()
It might take a while until health HAL is up, thus let's just wait for
it.

Change-Id: Ie929a25a2a774aedb4559662e9ad0a47f1b154e6
2023-07-10 18:58:47 +08:00
Michael W
9ed93717cb ChargingControl: No need to log a crash when not supported
Instead of relying on catching the exception later on, check if
ChargingControl is actually supported before checking if a specific
mode is

Change-Id: Icaf8d333842c9847bea00bedb4b302b7acd49bb3
2023-07-08 21:38:24 +02:00
LineageOS Infra
d487fb503f Automatic translation import
Change-Id: Id9bc669c714ad045d45da6bb5f31fd3cfdedbcb7
2023-07-01 16:12:20 +00:00
Luofan Chen
e6258aa75e ChargingControl: Handle cancel toggle correctly if bypass is not supported
Change-Id: Ib7e208bba554b76a067d70280785290d5a0ba08d
2023-06-28 11:38:05 +02:00
Luofan Chen
7f1c3b999c ChargingControl: Add cancel toggle for limit done notification
Change-Id: I4f969ae87e1f9aa264113f044ee850def33ad20f
2023-06-28 11:38:05 +02:00
Luofan Chen
9ada9b1b7d ChargingControl: Reset internal states on settings change
Change-Id: Ib49d6b5b9190a71f5447125ed1aa70da894e6c18
2023-06-28 11:38:05 +02:00
Luofan Chen
c2dbc74032 ChargingControl: Set a small margin for devices with bypass support
Change-Id: I1eddaa85f9dd47283af1fcd43d6fc207bcfd5546
2023-06-28 11:38:05 +02:00
LineageOS Infra
eee2b70594 Automatic translation import
Change-Id: I54bfe88fe79f568e701e48c5d3ebb29fd1578ea6
2023-06-20 16:28:06 +00:00
Michael Bestas
bf6f48ceb3 Update LineageDatabaseHelper for 13 QPR3
Change-Id: Iea691957d02c181c6409b5fc918a1b04d37369a2
2023-06-14 20:30:17 +03:00
LuK1337
9a0fe3bea6 sdk: Add static isChargingControlSupported(ctx) method
This will let us use it without bothering to handle RuntimeException
from HealthInterface contructor.

Change-Id: I768c250d1e527b6fd8e49a40452b98404062cc18
2023-06-13 14:24:16 +02:00
Wolfram Liebchen
95e2d729c9 Network traffic with center cutout [2/3]
A new setting NETWORK_TRAFFIC_POSITION decides, if the traffic display
is at the traditional center position or right or left.

Change-Id: I768259696be1186cb1dd4630c2b35540529a7f67
2023-06-11 15:45:06 +02:00
Luofan Chen
3ee210210d sdk: Implement Lineage health service
Change-Id: I772ccf6d323c24d681aa8468bf4318c7b73bd3f5
2023-06-09 18:04:47 +02:00
Luofan Chen
89941a9622 sdk: Extract base class for lineage base feature
So that it can be shared in multiple components

Change-Id: I96d1a5772b7185bf7c3d394a1b2c8f143d48e0c8
2023-06-09 18:04:47 +02:00
Luofan Chen
0e290483f3 sdk: Add requiresService attribute
Change-Id: I953444a53cd892d8e70941487709964fd671576a
2023-06-09 18:04:47 +02:00
Danny Trunk
738f26ef54 lineage-sdk: Add settings for charging control
Change-Id: Iba78705136d4b63cb0317b0826bf24c2d027a45b
2023-06-09 18:04:47 +02:00
LineageOS Infra
cd2c9124c7 Automatic translation import
Change-Id: Iba040a5e3a3283230dbe5cfaccc28275090dbf94
2023-06-01 12:49:27 +00:00
Joey
d5e7962c84 sdk: remove aar target
The aar target not only is broken, but it has become useless
since there's no resource in the sdk/res/res path.
A working aar would be no different than the jar produced
by the "org.lineageos.platform.sdk" target.

Change-Id: I06c482c5cacab035cd1dad96a7760d4d6cf24ebf
2023-05-17 20:55:33 +02:00
LineageOS Infra
528400a142 Automatic translation import
Change-Id: I6d7f4c50273d842d4eef721f5283a184b45293f1
2023-04-24 08:41:32 +00:00
Joe Feise
4b44a960c1 sdk: Escape network SSID and name when writing profiles.xml
SSIDs can contain ampersands, e.g., "V6 Cafe & Gift Shop". The & and
possibly other special chars need to be escaped when writing
profiles.xml.

Change-Id: Iffef33de22c37d8cb4b5048b92c9ef9c77e18819
2023-04-09 13:10:06 +02:00
Michael Bestas
8eb16e554c Automatic translation import
Change-Id: Id6d43a170500ccd1520e3d610fbadda166d6c560
2023-03-23 16:38:26 +02:00
Michael Bestas
9f63a522db Fix FINGERPRINT_WAKE_UNLOCK migration for devices not supporting it
Change-Id: I81469da5a1696f7ff92ff11216ba0b98459a9bde
2023-03-20 02:37:31 +02:00
Michael Bestas
dc0c1d8a5c Migrate FINGERPRINT_WAKE_UNLOCK to the new AOSP setting
Change-Id: If5ad35077cfa4fb222928e97db4d50b68a0567c3
2023-03-15 01:18:31 +02:00
Michael Bestas
38653151b5 Automatic translation import
Change-Id: I5d02fa1e686b141a185a62d637165519a574cb63
2023-02-13 16:05:25 +02:00
Michael W
5bd11e303d sdk: Kill app: Actually kill app
* Calling forceStopPackage with USER_CURRENT won't kill the app when
  started e.g. via "Shelter" work profile
* Find the uid of the current foreground app and pass that one
  instead of UserHandle.USER_CURRENT
* Note: UserHandle.USER_ALL would also kill the app, but all instances
  of it - which we don't want

Test:
- Go to Settings->System->Buttons and enable "Kill foreground app"
  as action for "Long edge swipe" - test it for PlayStore
- Install Shelter and setup your profile
- Open PlayStore from work profile
- Long swipe the edge:
  - Before: Toast appears, app stays open
  - After: Toast appears, app is actually closed

- Additionally: Open PlayStore from Work and Non-Work profile
- Long swipe edge for just work profile one and switch to own profile
  instance: App is not killed (expected, we just killed work instance)

Change-Id: I82154a6c021527013269f7ee2d1c46fedc14bf7c
2023-02-01 20:03:42 +01:00
SGCMarkus
1c6d5b120d sdk: add HFR privapp camera related resource to config.xml
Change-Id: Ife4bab9670c9f2e6a5233c67d58041cecc1b7c0b
2023-01-10 18:33:27 +01:00
Michael Bestas
26d0260ffd Automatic translation import
Change-Id: Iae8b40f39a8d9e541bf0943762f06691dccd4917
2023-01-10 04:41:43 +02:00
Michael Bestas
f863e2c629 Automatic translation import
Change-Id: I4c905a18a41650a8256e8fdcacdbed210d09b43a
2022-11-25 15:03:31 +02:00
LuK1337
c775185a87 sdk: Add aux camera related resources to config.xml
Change-Id: Ic19ea5b0ae4433564fe8a2f854a67fd42bfd7a5c
2022-11-02 17:32:21 +00:00
LuK1337
6ba68050a3 sdk: Introduce org.lineageos.platform.resources target
This lets us use SDK resources in frameworks/base/core.

Change-Id: Ia7c7116d4543684d6396bdbf3ceb814303f0555f
2022-11-02 17:31:48 +00:00
LuK1337
f89761cbe6 sdk: Use /> instead of <x></x> where applicable
Change-Id: Ia50bfa70d093b9be2df70007e1b76364a065101c
2022-11-02 17:31:23 +00:00
Bruno Martins
67a10447b3 TrustInterfaceService: Simplify hasUsbRestrictorInternal code
Change-Id: I4cb05e3749b0939207cd0dc2da1002bf0ceedf7b
2022-09-28 13:41:01 +02:00
Chirayu Desai
ab6e0410f5 TrustInterfaceService: Fix checking for Trust HAL availability
Change-Id: If7d6fd384ed752fa6483882e7aa80956ca9bafec
2022-09-28 11:53:13 +01:00
Oliver Scott
02eddd44ac Refactor network traffic code
* Made unmodified instance variables final
* Made single use instance variables local
* Optimized imports
* Updated all deprecated code

Change-Id: Ifbf76031760c622e7efd667f82998adbb7d798f7
2022-09-25 21:11:48 +02:00
Oliver Scott
fd4a90c6e0 Remove duplicate reading of offload tethering stats
The obtained interface stats already include offload tethering stats (https://cs.android.com/android/platform/superproject/+/master:packages/modules/Connectivity/service-t/src/com/android/server/net/NetworkStatsService.java;l=1903;drc=08ccd0d2e1b2eda92ea61d3061f86b881a4a0ef6)

Additionally, the removed code no longer compiles since it was moved to the Connectivity module.

Change-Id: I380e529011cdf108f009d8e5fb35f849fc7e3963
2022-09-25 21:11:48 +02:00
Michael Bestas
938f8dfd57 Migrate berry_black_theme to Secure table
AOSP theme settings live in Secure table, let's do the same

Change-Id: I31eafeb940fe50cdde03e12cb3431f4f325d772b
2022-09-25 19:51:16 +02:00
Chirayu Desai
500f74f78f Trust: restrict-usb: Check DPM for support
* Pixels have switched to the new AIDL HAL, so V1_3 doesn't exist there
* Switch to directly checking DPM since that's where we found this
  code in the first place, and it'll keep getting updated.

Change-Id: Icfc30b73984e82809c3838c421e05da7addaa6cb
2022-09-24 11:57:29 +02:00
Michael Bestas
607d627706 Automatic translation import
Change-Id: I9fc0e1028f194a6c7be2ab86f955837b79830c50
2022-09-22 15:29:45 +03:00