Commit Graph

44 Commits

Author SHA1 Message Date
Bruno Martins
e2d1d6a391 LineageSettingsProvider: Allow to set a default for QS brightness slider
Change-Id: Ie9003e2c14e7f5ba1b34cd7c3c7ab95a3c9501cf
2023-10-03 22:23:44 +01:00
Michael Bestas
d072074908 Partially revert "LineageSettingsProvider: Support migration from cmsettings"
The migration happened in lineage 15.1,
we only support direct upgrades from 17.1.

This partially reverts commit e7008a222e.

Change-Id: Ic2acd93565e21475ea6f896941107230d880e890
2023-07-22 18:46:54 +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
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
Michael Bestas
bf6f48ceb3 Update LineageDatabaseHelper for 13 QPR3
Change-Id: Iea691957d02c181c6409b5fc918a1b04d37369a2
2023-06-14 20:30:17 +03: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
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
a97180fa58 Move trust usb setting to global, and drop keyguard from name
* We're expanding this to allow disabling usb devices always.

Change-Id: Ibdea983160ae88c3eb696540631facefc288b859
2022-03-24 14:46:11 +01:00
Oliver Scott
ca136deee2 Log failure to update DATABASE_VERSION
Change-Id: I7fc844acda3892cea68c1e9a44a89e87c997f789
2022-03-21 23:40:21 +01:00
Luca Stefani
b0d6dd92e8 sdk: s/UserHandle.USER_OWNER/UserHandle.USER_SYSTEM/g
USER_OWNER has been deprecated and replaced by USER_SYSTEM

Change-Id: I93b057a52dcdcb3760b7c2139bea2e25a624a78f
2022-03-07 22:42:53 +01:00
Oliver Scott
e385b0c2f3 Enable Restricted Networking Mode and allowlist INTERNET apps by default
* Handles fresh installs and upgrade scenarios
* Replaces network isolation feature

Change-Id: Ia35ba7cdc07ed9f49c09e2dd5275bfc233d9efe2
2022-01-05 00:44:55 +01:00
Bruno Martins
ea5bec56fd LineageSettings: Deprecate charging sound settings in favor of AOSP ones
There's no need to have our own settings for this when we can simply
override the existing AOSP ones.

Change-Id: I84e1f7286cd6b4ee68c62f17ad104c76031ee0ff
2021-12-31 17:20:56 +01:00
Michael Bestas
e9206cc3a3 LineageSettings: Remove "advanced_mode" setting
* This was a CyanogenMod feature that we never forward ported.

Change-Id: Idce22d57784132ff0676bce3e1dd55f9793c1a59
2021-11-07 00:44:32 +02:00
Michael Bestas
b1a4f1be15 lineage-sdk: Remove unused protected app/component code
Change-Id: Ie054c1da1381cd9ba0c10405ce50b5c727ad1987
2021-11-06 12:52:01 +02:00
Michael Bestas
eb64e79f86 lineage-sdk: Remove weather related code
* This has been untouched since 2016 and it depends on LockClock
  which has been dropped and was also untouched for years.
  There is no good weather provider without API restrictions,
  so just remove this dead code.

Change-Id: I6540006ce0d7339b7794b6ab207593afb161aa3d
2021-11-06 12:52:00 +02:00
Michael Bestas
2d0905bd68 lineage-sdk: Remove all code that is marked as Deprecated
Change-Id: I04581d30a5b4ef9d176d17c7aa3baf4b58e8d2af
2021-11-06 12:52:00 +02:00
Bruno Martins
1416383888 LineageSettings: Mark lookup features as deprecated
These are now handled directly in our Dialer app.

Change-Id: I8d1cd0963360a88be21fdda727725cdb7146723f
2021-06-06 00:20:35 +02:00
Bruno Martins
1bc4dc52ca LineageSettingsProvider: Allow overriding volume panel default location
Change-Id: Iad500afd0e4f0d65aed9905f9fd9fd8ada51fce9
2021-05-28 23:47:32 +02:00
LuK1337
9104aee9cd LineageSettingsProvider: Migrate keyboard/button backlight to 0.0f -> 1.0f range
Change-Id: I42123b2cc2acde35c5db9087f478be5adc63b3ec
2020-10-05 20:35:53 +01:00
Chippa-a
5802c11140 lineage-sdk: Update path for custom charging sound
Audio files were moved to /product on Android 10.
Moreover, align with AOSP and use the wireless sound
for wired usecase too.

In order to perform upgrade properly, handle the migration
for custom charging sound setting.

Change-Id: Ifb2085e3f56d777091d66544a72cdd75c843fb56
2020-04-21 15:05:56 +01:00
LuK1337
e530d7a126 lineage-sdk: Clean up imports
Change-Id: Ie14853382ebefd42fdf827e2999a2a2a6d0a1cd1
2019-09-10 16:10:48 -07:00
Hendrik Hagendorn
5ded0fcf6c sdk: Update for refactored battery icon options
* Handle the migration for old settings and default
   to Android's stock battery style.
 * Hiding battery icon is now achieved using icon blacklist
   via system tuner settings.

Change-Id: Ie41d71c774a34abe225e2c0a6a0a9fd4316189cd
2019-06-02 22:27:30 +01:00
Michael Bestas
fab8bbfd32 LineageSettingsProvider: Fix migration of FORCE_SHOW_NAVBAR
* It was moved from Global to System but no migration was in place
  to handle upgrades from previous versions.

Change-Id: If76243b0224dbc0138cf3c5dbc8aaeefa69f06a4
2019-02-04 22:39:33 +01:00
Han Wang
68a1d795d3 lineage-sdk: Remove useless logic on database upgrading
* The upgradeVersion < newVersion part is never reachable because we
   increase upgradeVersion unconditionally. Make it back to stage by
   nuking it as no one has experience issues before.

Change-Id: Icac1e18c192292ad3147fd4af4c862e93ef34ba5
2019-01-19 17:07:54 +01:00
LuK1337
50e230446a lineage-sdk: Fix setting default def_force_show_navbar value
* DEV_FORCE_SHOW_NAVBAR has been renamed and moved to System.

Change-Id: I5aecbd66769b332692a4b54a1ba1d88b4679ed1d
2018-12-04 14:32:11 +01:00
Sam Mortimer
cd0ec5ba84 LineageSettingsProvider: Cleanup after LINEAGE_SETUP_WIZARD_COMPLETED deprecation
Change-Id: I997759d1f79fae514566e6474ea7802c2c7d1f53
2018-10-05 18:46:34 +02:00
LuK1337
c5e6a03d01 sdk: Update default clock position
* Also migrate users using right clock so
  that they get the new default setting.

Change-Id: I2e38a16af46d77ff92ada268b8fc0927b0c4806c
2018-10-05 01:41:13 +02:00
LuK1337
cb1d854001 sdk: Add migration for /missing/ custom button actions
* Since we removed onehand from settings
  we need to make sure user doesn't have them
  set in settings otherwise we will hit
  ArrayIndexOutOfBoundsException exception.
* Fixes : BUGBASH-1525

Change-Id: I7a5737ecfe5e70c3f0108c03b3e8745eade80433
(cherry picked from commit eb8fc0648f645a265ce8d1b6daf575795eb69510)
2018-09-04 00:47:18 +02:00
Sam Mortimer
8daa2ca6ae LineageSettingsProvider: Don't set LINEAGE_SETUP_WIZARD_COMPLETED
*) This was initialized from Settings.Global.DEVICE_PROVISIONED and it is no
   longer possible to access system settings during provider startup since:
235272a216

*) LINEAGE_SETUP_WIZARD_COMPLETED has been deprecated since 14.1:
797a45aa69

*) We will later cleanup the unused setting during topic:pie-db-upgrade

Change-Id: I185648ca25995fae80362642d297573795d04bfa
2018-08-30 02:29:52 +02:00
LuK1337
9a5742fc33 sdk: Add default setting for clock position
* Will be used by devices with notch.

Change-Id: Ie2af3f4741637656054d97ecbb5f20553c6001fd
2018-07-26 21:43:26 +02:00
LuK1337
5c6b56138f LineageSettingsProvider: Fix default setting for DEV_FORCE_SHOW_NAVBAR
* It has been moved to Global.

Change-Id: I99dfa3742bd0c7963b4795b13afe5d4c8a0681c3
2018-02-23 21:05:56 +01:00
Sam Mortimer
e7008a222e LineageSettingsProvider: Support migration from cmsettings
*) Migrate database from cmsettings.db to lineagesettings.db

*) Remove old CMSettingsProvider.xml shared_prefs.

*) Remove the code to disable the PreBootReceiver component.
   PackageManager is not yet ready for component lookups when
   LineageSettings is called during fw/b service startups.
   However, the preboot intent is only sent when the build
   fingerprint changes so disabling it doesn't really buy us
   anything.  We also track and check migration state in
   sharedPrefs anyway.

Change-Id: I636f8315ce8a36f6d223d6a5accfe11c40ef9570
2018-01-27 13:25:35 +00:00
Sam Mortimer
c7a8ed54b5 lineage-sdk: DnD light brightness control for battery and notifications
*) Support separate normal and dnd led brightness levels for battery
   and notifications.

*) Move lineage-specific notification bundle extras definitions from fw/b
   to LineageNotification here in the sdk.

*) In addition to the existing bundle extra EXTRA_FORCE_SHOW_LIGHTS, add
   a new extra EXTRA_FORCE_LIGHT_BRIGHTNESS that can be used to override
   the brightness level set by a Lineage system setting brightness level
   on a per notification basis.  This is used by the brightness sliders
   in LineageParts that otherwise would have to juggle changing / restoring
   the system led brightness setting whenever the a slider is on display.

*) Disable all lights in dnd mode when lineage setting ZEN_ALLOW_LIGHTS
   is set to 0.

Change-Id: I917f402a291682b582f68c8324a33c461357dad9
2018-01-25 20:38:10 +00:00
Michael Bestas
99fba21024 lineage-sdk: Remove lineage status bar service
* Used for CM tiles API which is long dead

Change-Id: I66e8b57c035584aff5a4f5123388a4881e853a8f
2018-01-24 02:43:12 +02:00
Adrian DC
af41414b76 Multiple LEDs [2/2]: Remove feature support
* The feature was used only on Huashan since 2015

 * It serves only for a small part of the users
    who wanted to restrict to one light instead
    of three lights from the LEDs bar

 * Due to Oreo's new HIDL interfaces stack,
    the additional data holder would need
    a custom lights interface which is useless
    for a single device and a rare use case

Change-Id: Ie08a1d625c7ce00fefff5bc1159522207be69dbc
Signed-off-by: Adrian DC <radian.dc@gmail.com>
2017-10-14 14:18:27 +02:00
Sam Mortimer
ae2d7e15ce Remove PartnerInterface and LiveLockScreen
Change-Id: I8044de599ef6db8e9a1ff63e43dc2cea9c28d02a
2017-10-12 21:53:02 +00:00
Sam Mortimer
0912ee88c7 Remove theme support
Change-Id: I41f1d0fa1ecc98c2872d2569534e6f2ef686a726
2017-10-11 23:17:36 -07:00
Sam Mortimer
542742b751 lineage-sdk: rebrand step 2: update file contents
Change-Id: I9881acc57cdc0aeea2b296aac12a8af932d30aea
2017-10-06 09:40:24 -07:00
Sam Mortimer
5ede05bdca lineage-sdk: rebrand step 1: update paths
Change-Id: I4c2135d03d730a313a0638d0f857afa48fb220d3
2017-09-22 17:19:40 -07:00