summaryrefslogtreecommitdiff
path: root/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java
Commit message (Collapse)AuthorAgeFilesLines
* Add setting to disable PIN animation and passwordAndreas Miko2023-03-141-0/+9
| | | | | | | | Test: Unit - atest SettingsRoboTests Test: Manual - Set PIN lock and enabled/disabled the setting to observe animation change during PIN entry Bug: b/204799468 Merged-In: I587b993ef5515a075442e82ebafae88bebdffc20 Change-Id: I587b993ef5515a075442e82ebafae88bebdffc20
* Do not restore auto-rotation setting when target device is a tabletbeatricemarch2023-01-311-0/+7
| | | | | | | | Test: atest SettingsProviderTest:SettingsBackupAgentTest and manual testing (Restore to a tablet, verify that the rotation setting is not restored, verify that the UI behaves as intended, verify that the correct SettingsBackupAgent logs are prinded. Restore to a phone verify that the rotation setting is restored) Bug: 265756332 Bug: 243489549 Fixes: 243489549 Change-Id: I9d34ee096c99f4a510398edd84fa97713945fe5d
* wifi: Fix unnecessary notification after restoring config from cloud.Les Lee2022-07-261-4/+3
| | | | | | | | | | | | | | The persistent randomzied MAC address is generated by hash function with key Ssid. It might be different in different device even if the key doesn't be changed. But the persist randomized MAC is not a user setting, it is generated by the frameworks. Ahe user would need to set up the ACL again anyways even if they use factory MAC. So it should not to notify user configuration is changed since it is not a user setting and user aware it since user is using a new device. BUg: 235591501 Test: Manual test, no notification show up. Change-Id: I08fef497df0c42115ee61e92a22009d32666da41
* wifi: Fix unnecessary notification after restoring config from cloud.Les Lee2022-05-101-1/+51
| | | | | | | | | | | | There are some configurations which are generated by frameworks. When restoring configuration from cloud, the restored config didn't include those configurations. It causes the configuration mismatch and show notification "configuration have changed". It should bypass them to avoid showing notification. Bug: 230411358 Test: manual test Change-Id: Icc58aa05f47a91fb150664e7247281dd77d3dbd8
* Close dangling cursorNikolas Havrikov2022-02-101-19/+21
| | | | | | | Bug: 218835043 Bug: 200920338 Test: make Change-Id: I8cdbe1a20457afe9632306aa3e2efd13a759c2c3
* Merge "Create a new key to backup Sim-specific data." into sc-v2-dev am: ↵TreeHugger Robot2021-11-301-1/+8
|\ | | | | | | | | | | | | | | 353f5de336 am: 6f556491e4 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16296209 Change-Id: I9d45c8d3502a049e5fb2a9270dfd33bec66ac93e
| * Create a new key to backup Sim-specific data.Jack Nudelman2021-11-301-1/+8
| | | | | | | | | | | | Bug: b/206309441 Test: b/206986278 Change-Id: I84b42690f8dd3de0cbd795cc13dd5f9ab5a7a725
* | Move APPLY_RAMPING_RINGER setting from Global to SystemLais Andrade2021-11-241-40/+48
| | | | | | | | | | | | | | | | | | The setting was introduced in the Global scope, but it should be configurable per user. Moving the existing setting to the new scope. Fix: 184165158 Test: VibrationSettingsTest, and manual check setting migration Change-Id: I676f07c31ba29992964c631a8327a7765fba6d50
* | Always log.d when restoring settings.Paul Hadfield2021-07-011-3/+1
|/ | | | | | | | | | | | | | This commit removes the `if (DEBUG)` wrapper so that we always debug log for settings that are restored by the backup agent. This will help investigating bug reports about some settings not getting restored, as we will then see the list of successfully restored settings in the bugreport. Restore is an infrequent operation so this doesn't add much noise to logs. Bug: 161106112 Change-Id: I0f07474fe211f5fcc6cf89ce701378265057b8f5 Test: atest com.android.providers.settings.SettingsBackupAgentTest
* Don't backup/restore sim-settings if Telephony not present.Jack Nudelman2021-02-161-6/+14
| | | | | | | Bug: 180023868 Bug: 179947838 Test: make, cts test that caught this issue no pass. Change-Id: Id898d135ed64a704cc4707dcb796664d9b08264b
* Call TelephonyProvider apis for backup/restore per-sim settings.Jack Nudelman2021-02-041-15/+43
| | | | | | | Bug: 172244913 Test: make, atest TelephonyProviderTest Change-Id: I1652172f003e2fd5ab08dfdbf63dadc64e034406
* Fix flag check for preserve settings featureRuslan Tkhakokhov2020-02-031-1/+1
| | | | | | | | getApplicationContext() returns null when calling to get Context object to pass to FeatureFlagUtils.isEnabled(). Replace with getBaseContext() Test: Verify the context is not null through logs Change-Id: I0c27c5bc09e3fc84abeafb0a4ead3357cacc3d2a
* Guard the preserve settings logic in SettingsBackupAgent with a flagRuslan Tkhakokhov2020-01-271-0/+6
| | | | | | | | | The flag will guard the feature in R and can be removed in the next release. Bug: 144838882 Test: atest SettingsBackupAgentTest Change-Id: I259a3f41304c40d8aac5ab5e4d24ae1027914b56
* Do not restore settings marked as preserved in SettingsBackupAgentRuslan Tkhakokhov2020-01-241-37/+121
| | | | | | | | | | | | Bug: 144838882 Test: atest SettingsProviderTest:SettingsBackupAgentTest Manual: 1) Run backup for settings 2) Change several settings 3) Run restore for settings 4) Through adb logcat verify settings changed in 2) are not restored Change-Id: Id309a9417b992eddddb9fe2830f2a691224af9af
* Softap: Let ap band changed notification to config changed.lesl2020-01-191-10/+6
| | | | | | | | | | | | | | | The softap supports more features which related hardware. The config store from cloud will meet the convert will not only for band but also for others config. Revise the code to make it more general. PS: UI wording change will in another CL# which need to discuss with UX designer. Bug: 142752869 Test: Manual test, restore from cloud to see if notification show or not. And check the log. Change-Id: I279e62841d4b14d3ba5b6792bc289c0adb8a223d
* Add ability to exclude settings from being restored.Al Sutton2019-12-171-22/+121
| | | | | | Bug: 143129051 Test: atest SettingsProviderTest Change-Id: Id5d367b0fb8386dbae4eb3e29c8c1e9ba3c547d6
* SettingsProvider: Use new API for softap config backup/restorelesl2019-12-121-16/+7
| | | | | | Bug: 142752869 Test: atest SettingsProviderTest Change-Id: I1f9a58099d37e11401459d307ffb6be570749e36
* Move AP Band Conversion notification to SettingsDavid Su2019-11-211-5/+3
| | | | | | | | | | | | | | | | | | SettingsBackupAgent will send out the notification itself instead of delegating it to WifiManager. Bug: 144218444 Test: Removed AP Band conversion check to always trigger notification when restoring from backup. Follow steps at: https://developer.android.com/guide/topics/data/testingbackup Verified that notification is displayed when restoring from backup. Verified that expanding notification by dragging down shows full notification text. Verified tapping on the notification opens the tethering Settings page, and also dismissed the notification. Change-Id: I729b1cbf443229687c086982d51b96f326b534e1
* Move device specific settings to back up into common package.Al Sutton2019-10-151-2/+3
| | | | | | | | This brings the list of device specific settings to backup into the same package as the other lists of settings which are backed up. Test: atest SettingsProviderTest Change-Id: Iea4bef49c356c92773cf189e455cf608b6cdc4e6
* Move the list of settings to backup out of the Settings classAl Sutton2019-08-281-6/+9
| | | | | | Bug: 139449903 Test: atest SettingsProviderTest Change-Id: Ia1636732e4b6458fd874a6748dddfcaf7d967545
* Move the validators out of the settings classAl Sutton2019-08-281-3/+6
| | | | | | | | | | | | | | | | | Currently the validators static initialiser gets triggered when the relevant settings class is accessed. Moving them out to the SettingsBackupAgent (which is the only place they're used) has two main advantages; 1) All apps accessing the Settings classes no longer trigger the static initialisers and so are faster. 2) Putting them in SettingsBackupAgent gets them off the bootclasspath of all apps and makes the framework jars smaller. Bug: 139449903 Test: atest SettingsProviderTest RunBackupFrameworksServicesRoboTests CtsBackupTestCases CtsBackupHostTestCases GtsBackupTestCases GtsBackupHostTestCases Change-Id: Ie740c1ea25a01c715964175094677af2e3328732
* Extract common display density configuraiton codeAl Sutton2019-08-281-2/+3
| | | | | | | | | | | | | | | | | We're currently importing the whole of SettingsLib into the Settings Backup Agent just to access a single static method. This seems to have contributed to a the regression which relates to b/139373401. This CL separates the 3 related methods out into their own build target so the amount of code included in SettingsBackupAgent is much smaller. A later CL will remove the original location after all usages have been redirected to this new location Bug: 139373401 Test: atest SettingsProviderTest SettingsLibRoboTests Change-Id: I36fbc21daddcf068491b58db01b66f540ac26cf7
* Move validators out to their own packageAl Sutton2019-08-191-1/+1
| | | | | | | | | | | Move the settings validators out to their own package so we can reason about them more easily. This is the first step in a journey which will end up with us not initialising them inside the Settings object which, in turn, will reduce boot times. Bug: 139449903 Test: atest RunBackupFrameworksServicesRoboTests CtsBackupTestCases CtsBackupHostTestCases GtsBackupTestCases GtsBackupHostTestCases Change-Id: I611d9855fa91bbbbb6b0996e8ed6d765dca74717
* Backup device informationAl Sutton2019-08-121-12/+193
| | | | | | | | | | | | | | | Adding the device information to the backup will allow us to restore data which is device specific if it's appropriate to do so (e.g. device density) The device specific settings which will be backed up are; Settings.Secure.DISPLAY_DENSITY_FORCED Test: atest SettingsProviderTest SettingsBackupTest Test: Manual - Density changes during SUW when setting is restored Fixes: 28437818 Change-Id: Ibc3595cdece3f1ccb4fccaff8212c1c3cb5c9756
* Several preferences lost during P->Q B&RRuslan Tkhakokhov2019-07-251-12/+31
| | | | | | | | | | SettingsBackupAgentduring restore doesn't account for the fact that some settings that were store in Global on source have been moved from to Secure. Fix it. Bug: 137948683 Test: 1. Do cloud B&R P->Q and ensure settings are restored 2. atest SettingsBackupTest Change-Id: Iefe451a7b3dd0ea1d4cb95a56a71cc3341b65d7c
* Switch to existing concat methodAl Sutton2019-07-171-16/+4
| | | | | | | | | Switch to using the existing concat method in ArrayUtils instead of having our own implementation. Bug: 28437818 Test: atest SettingsProviderTest Change-Id: I96a0b1c1d1fd87a7a685f49257d72346b01a0959
* SettingsBackupAgent: notify of apBand conversionRebecca Silberstein2018-06-191-0/+12
| | | | | | | | | | Added support to notify user of a change to their softap configuration preferences after being restored via SettingsBackupAgent. Bug: 80251951 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: manually confirmed configs are converted for different device Change-Id: I4cec15549d694cdb1a7b09f1426d027eec021122
* Fix restore from higher SDKs in SettingsBackupAgentAnton Philippov2018-04-101-0/+1
| | | | | | | | | | Actually skip the backup data for the unsupported key. Bug: 77867300 Test: manual (adb shell bmgr restore com.android.providers.settings from a backup set created by sdk 101) Change-Id: I3d6a97ecbc0b048a3d07329542771f434e7e154d
* Validate restore of NetworkPolicy settingsAnnie Meng2018-03-061-3/+3
| | | | | | | | | | | | | | | We want to catch potential exceptions that occur when restoring NetworkPolicy settings. Here, a DateTimeException can be thrown when we try to read the recurrence rule from the backup data and cannot parse a timezone. We also add GTS tests to validate that these catches persist and that we don't crash when given unexpected backup data to restore. Bug: 73942796 Test: gts-tradefed run gts -m GtsBackupHostTestCases -t com.google.android.gts.backup.NetworkPolicyRestoreHostSideTest Change-Id: I6f6ea09d2fff60b8d704c6160234e6f032321103 (cherry picked from commit 853097ca2c29d9bb708b6f600a7d46f2a2a77289)
* Omit inferred network policies from backup.Jeff Sharkey2018-02-241-1/+4
| | | | | | | | | | Inferred network policies might include carrier-protected data that we can't export per CDD. We continue to backup policies that have been explicitly set by the end user. Test: builds, boots Bug: 24786071 Change-Id: I9de3308dfde72435627e8042fee4bcbb480e92dc
* Add restore of Settings keys toMichal Karpinski2018-01-231-0/+33
| | | | | | | | | | | | | | | | | | | | SettingsBackupAgent.RESTORE_FROM_HIGHER_SDK_INT_SUPPORTED_KEYS Now that we have validators in place for all settings that are backed up. Also, add a setting to override restoreAnyVersion, which can be modified by Phenotype. Bug: 64988620 Bug: 72162887 Test: manual (P->P - master without changes to master with changes) Test: manual (Q->P = API29 -> API28) Test: a lot of other scenarios covered by our end-to-end tests Test: a GTS test with both settings that don't have validators and have values that wouldn't pass validation will be added in vendor/xts Change-Id: Ifaf94306984b5204c79648d48fd4056ad403196e
* Make SettingsProvider able to restoreAnyVersion, but onlyMichal Karpinski2018-01-161-0/+23
| | | | | | | | | | | | | | | for supported keys RestoreAnyVersion is supported only for K/V, as full backup of SettingsProvider has been deprecated (b/71746093). The supported keys whitelist only contains KEY_WIFI_NEW_CONFIG and KEY_NETWORK_POLICIES for now, and will be extended in future CLs. Bug: 64988620 Test: manual (P->P - master without changes to master with changes) Test: manual (Q->P = API29 -> API28) Test: a lot of other scenarios covered by our end-to-end tests Change-Id: I381617b5db9a33b24d400945cffbc59db78ebbd2
* Drop support for full backup of com.android.providers.settingsMichal Karpinski2018-01-091-59/+3
| | | | | | | | | | | | The only reason it was still there was adb backup. It's no longer needed since we support adb backup K/V since Oreo. Full restore code has to stay for backwards compatibility, but will not need to be made forward-compatible, since no backups will be made on P+. Test: adb backup com.android.providers.settings Bug: 71746093 Change-Id: I2e8f90d57ed73bb3e050c0e345afef4ad2d3fb82
* Add extra about SDK version that system restore happened fromMichal Karpinski2017-08-141-1/+9
| | | | | | | | to ACTION_SETTING_RESTORED intent Test: manual (system restore from N-MR1 and O) Bug: 64232609 Change-Id: I142df7acb11309bc4f5f185e45a1f91f86d0334a
* Backup all backupable settingsSvet Ganov2017-08-011-26/+49
| | | | | | | | | | | | | | | | | We were backing up only settings that are backupable and not null. However, for some settings null is a valid value meaning nothing. For example, the currently selected autofill service. Generally, if the setting is present in the settings database, we need to backup whatever the value is there as it was set by either the user or the system explicitly, otherwise the setting would not be present in the database, hence no attempt to back it up would be made. Test: manual bug:63631627 Change-Id: Iedffd7696fbcea9a2b211c9313b668ff3809a292
* Introduce legacy settings restore whitelistsChristopher Tate2017-06-061-5/+21
| | | | | | | | | | | | | On rare occasion we have settings keys that we no longer want to back up, but which we *do* want to process at restore time for support of legacy backup datasets. We now have a little bit of machinery for the idea of restore-only key whitelists, paralling the SETTINGS_TO_BACKUP dual-purpose whitelists. Bug 62263757 Test: manual Change-Id: Ic32ad679bc4b5028dd52dc71e9ab5836a76307c4
* Backup / restore additional lock screen settingsBryan Mawhinney2017-05-251-15/+38
| | | | | | | Bug: 22630260 Test: manual :-( Change-Id: I5c7f3c3a73398cdb14568fb3fcff9410afcef660
* SettingsBackupAgent: Remove redundant size parameterRoshan Pius2016-06-171-9/+6
| | | | | | | Remove the redundant size parameter in wifi backup/restore. BUG: 28967335 Change-Id: I8ae9b2bf3bc8eb2dd1fd6dd87fe7b1dcf0712382
* Use WifiManager for wifi backup/restoreRoshan Pius2016-06-091-577/+82
| | | | | | | | | | | | | | | Use the newly exposed WifiManager API's for backing up/restoring wifi related data. Remove all other wifi related logic from SettingsBackupAgent. There are 3 API's exposed by WifiManager for backup/restore: 1. retrieveBackupData - Data to be backed up in new format. 2. restoreBackupData - Restore from the new backup data format. 3. restoreOldBackupData - Restore from the old backup data format. BUG: 29075035 BUG: 28967335 Change-Id: I2dc379bc36af0a0824ed51fbe9aaebfd0a0114b0
* Don't remove existing EAP configurationsPaul Stewart2016-05-201-6/+7
| | | | | | | | | | | | | | | | | | When merging backed-up configurations with the current supplicant configuration, we read both configurations into a instance of WifiNetworkSettings. No EAP configurations should be restored as per b/25725016, however existing EAP configurations that already reside in wpa_supplicant.conf (presumably configured in SUW) should not be removed in the process. This CL adds a parameter to the "readNetworks" method to allow it to select whether or not EAP configurations should be read in. It is used to allow the "restoreWifiSupplicant" method to copy in EAP configurations from the existing wpa_supplicant.conf, but not out of the backup data. BUG: 28873992 Change-Id: I8b3e0c1a6629b3f1ca5055b1b2190e6b3ca4c033
* Merge "Enabled Network Policy Backup/Restore." into mm-wireless-devRitesh Reddy2016-02-101-15/+106
|\ | | | | | | | | | | | | am: d9c4bc0c4d * commit 'd9c4bc0c4db7a8b16d8ea0f58ed0615efc167f47': Enabled Network Policy Backup/Restore.
| * Enabled Network Policy Backup/Restore.Ritesh Reddy2016-02-081-15/+106
| | | | | | | | | | | | | | Added Backup Restore specific NetworkPolicySerializer to NetworkPolicy Class and related classes. Change-Id: I2a11e2afae8dd9e0ee0c3356e669a73f6a1361af
* | Merge "Enabling SoftAP Configuration Backup." into mm-wireless-devRitesh Reddy2016-02-101-63/+136
|\| | | | | | | | | | | | | am: c4a1188afd * commit 'c4a1188afd81b4b773e30ec184839bc1a82b355d': Enabling SoftAP Configuration Backup.
| * Enabling SoftAP Configuration Backup.Ritesh Reddy2016-02-081-63/+136
| | | | | | | | | | | | | | SoftAp Conf is backed up as a serialized WifiConfiguration object. Change-Id: Ib7f4d130600313a67b710b45df274e15f0baad24
* | Constrained allowable backup versionsRitesh Reddy2016-02-021-0/+5
| | | | | | | | | | | | | | | | | | | | Constrained the version on an incoming backup set to the highest version that the SettingsBackupAgent can handle. This is to deal with either corrupted backup sets or newer backup sets (when modifiying/downgrading the SettingsBackupAgent). Change-Id: I4d666e8d4541c0b86e656a73744837d03318c4ae
* | Revert "Enabled SoftAP Configuration Backup"Ritesh Reddy2016-02-011-68/+32
| | | | | | | | | | | | This reverts commit 188ae9dc22e0ecc0612c8bfe1efdb0e22acdc43e. Change-Id: I37e517d0e7a9a17614fa1b6890e1854346fd0138
* | Revert "Enabled NetworkPolicy backup and restore."Ritesh Reddy2016-02-011-50/+9
| | | | | | | | | | | | This reverts commit 9f548b00dcdd89e8d557223b8b99269ca7362c2e. Change-Id: If0081fa34333339e36f9e8b9a34a2e3a84e4638f
* | Enabled NetworkPolicy backup and restore.Ritesh Reddy2015-12-101-9/+50
| | | | | | | | | | | | | | Backing up NetworkPolicy through NetworkPolicyManager API Bug: 17857156 Change-Id: I2363e66a1b27f50b2454b4550a241a3d84bf4b7c
* | Enabled SoftAP Configuration BackupRitesh Reddy2015-12-081-32/+68
|/ | | | | | | Backing up SoftAP Configuration through WifiManager API. Bug: 5343116 Change-Id: If17effb98c3489246d817fa3612f3f11b9ead9ab
* Don't back up / restore EAP network definitionsChristopher Tate2015-11-181-0/+19
| | | | | | Bug 25725016 Change-Id: Idfef9dd53f2403bbe4c950493a0ab8fa66a3b7d4