1740 Commits

Author SHA1 Message Date
Eugene Susla
e7181b197c Merge "Introduce a Setting for auto revoke teamfood settings" into rvc-dev 2020-03-30 21:58:40 +00:00
Eugene Susla
c6909ffe20 Introduce a Setting for auto revoke teamfood settings
Test: presubmit
Bug: 146513245
Change-Id: I57e20694528e6e2e94957e66d03cbf292c305f0d
2020-03-30 12:29:26 -07:00
Soonil Nagarkar
39766392a7 DO NOT MERGE Refactor appops across location
-Add a new app ops helper to make testing easier.
-Consolidate app identity within CallerIdentity class.
-Remove location age restriction for coarse locations, was a bit
arbitrary.
-Remove listener identifiers from LM. These were not being properly
propagated and add a lot of binder overhead with what appears to be
little benefit since we have featureIds, which contain much better
information.
-Remove appops checks from some GNSS APIs that shouldn't require it.
-Move location fudger into location providers and reset them after mock
providers are used so that offset information cannot be leaked.

Bug: 149375028
Test: presubmits + manual
(cherry picked from commit 6033344baaa8aa10b89a779864b7f5f82f4baf32)
Change-Id: I18e2cf3c39836f31d28180e1a4613df4ad675ab7
2020-03-28 13:59:26 -07:00
Yurii Zubrytskyi
95955373b8 Merge "[settings] Add a knob to turn off incremental default" into rvc-dev 2020-03-28 08:34:55 +00:00
Yurii Zubrytskyi
4a90c80aa9 [settings] Add a knob to turn off incremental default
A new value in global settings for the adb to determine if the
device allows using incremental installations by default.

Bug: 150183149
Test: builds
Change-Id: I64e8fafcacbb790fa469629136a7dacbfd34e800
2020-03-27 23:25:35 -07:00
Fabian Kozynski
1f8d91de8c Merge "Add Secure Setting for Controls" into rvc-dev 2020-03-27 17:16:48 +00:00
Rhed Jao
dba485be4c Merge "A new setting key to hold targets of the a11y button" into rvc-dev 2020-03-27 06:37:05 +00:00
Menghan Li
fea8d184c2 Merge "Accessibility Service & Shortcut Redesign - Remove “volume key shortcut” setting (5/n)" into rvc-dev 2020-03-26 00:21:50 +00:00
Fabian Kozynski
bcaf0efea3 Add Secure Setting for Controls
Also:
* added to backed up settings.
* fixed imports

Test: build
Test: change setting through adb.
Bug: 152212779
Change-Id: Ia6cc7e9fb7f93842cfbf248f3e88c1d964656409
2020-03-25 09:30:13 -04:00
Rhed Jao
10e4b5f0b0 A new setting key to hold targets of the a11y button
Roll back the changes of ACCESSIBILITY_BUTTON_TARGET_COMPONENT to
support previous behavior of the a11y button. Also, create another
setting key to hold shortcut targets of the a11y button which is
assigned by the user from the settings app.

Bug: 152263232
Test: atest SettingsProviderTest
Change-Id: I7a70e8c8495cefe6632efddbb322a323aa1168c7
Merged-in: I7a70e8c8495cefe6632efddbb322a323aa1168c7
2020-03-25 04:10:08 +00:00
menghanli
390f8f9be9 Accessibility Service & Shortcut Redesign - Remove “volume key shortcut” setting (5/n)
- Target to fix migration issue to support a user revoked the accessibility shortcut before upgrading to R, but wants to to apply new hardware shortcut design in R.
- The switchbar of accessibility_shortcut_enabled was removed in (1/n), so we should also remove related checker in controller.

Bug: 142529032
Test: atest AccessibilityShortcutControllerTest
Change-Id: I48f8d88c4192e894b9e210221e5dc7e701344623
2020-03-25 07:46:41 +08:00
Roshan Pius
849a6f78a5 WifiMigration: Add a settings key to indicate migration is complete
Bug: 151888061
Test: Manual verification (ensured that this method returns null after
first reboot)

Change-Id: Ie8ad397c7b68e35cfa7b696ef22d84f376cf3fe7
2020-03-23 18:48:28 -07:00
TreeHugger Robot
00562369ed Merge "Do not preserve settings changed by 'android' package" into rvc-dev 2020-03-20 22:02:19 +00:00
Junyu Lai
841583ae51 Merge changes I7eaca623,Ic94da540,If330e853,Ie2d229be,Ic6b2f10f into rvc-dev
* changes:
  [SM08] Add NetworkTemplate unit test for fetching mobile data usage
  [SM07] Make combine subtype configurable from Settings
  [SM05] Enable record mobile network stats by collapsed rat type
  [SM04] Support fetching data with NetworkTemplate with subType
  [SM02] Support record mobile network stats by collapsed rat type
2020-03-19 06:29:38 +00:00
junyulai
1be2d732e0 [SM07] Make combine subtype configurable from Settings
Note that enabling/disabling would not take effect until device
reboot. This will be addressed in follow-up patch.

Test: 1. atest NetworkStatsServieTest SettingsBackupTest
      2. adb shell settings put global netstats_combine_subtype_enabled 1|0
Bug: 146415925

Change-Id: Ic94da540afa479ed18f1b6fbda4ae3216c37476b
Merged-In: Ic94da540afa479ed18f1b6fbda4ae3216c37476b
(cherry picked from commit c4f77ac90bf2e48a655ad19b162fe74a23bf3fb0)
2020-03-19 01:40:55 +00:00
Ruslan Tkhakokhov
67c3fa3072 Do not preserve settings changed by 'android' package
Bug: 144838882
Test: atest SettingsProviderTest:SettingsStateTest

System reinitialises some settings to the same value after reboot (e.g.
bluetooth_on, accessibility_enabled, font_scale). Such modifications
shouldn't set isPreserved flag.

Change-Id: Ib929bf7d544b78202691eff3ae2ac75f2c209aa2
2020-03-18 22:49:15 +00:00
Rubin Xu
243c57f079 Merge "Replace COMMON_CRITERIA_MODE setting with getter API" into rvc-dev 2020-03-18 18:42:28 +00:00
Jay Aliomer
221945ad93 Merge "Migrate dark theme settings" into rvc-dev 2020-03-12 15:34:07 +00:00
Jay Aliomer
df6bdb5baf Migrate dark theme settings
When restoring settings from a different phone,
UiModeManager did not update the new settings.
Now, the settings are loaded from local storage and changes applied
when the SettingsHelper restores a value of interest

Bug: 138671559
Test: manual test: reset phone1, setup, used data transfer tool to restore from phone2, check dark mode is the same as phone 2
Change-Id: I861bec342b3284e0f398c8610fcc6881c27601a5
2020-03-12 15:33:23 +00:00
Rubin Xu
f07973239a Replace COMMON_CRITERIA_MODE setting with getter API
Per API review feedback, global settings are discouraged in favour
of fine-grained getter APIs.

Bug: 149999040
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testCommonCriteriaMode
Test: atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testCommonCriteriaMode
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Change-Id: Ia810f67409ce2b482bca06f1e21df2f98d12ccfd
2020-03-12 12:03:15 +00:00
Ruslan Tkhakokhov
71888e5fa1 Enforce MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE permission
Bug: 150877732
Test: 1. atest SettingsProviderTest
      2. atest PreservedSettingsRestoreHostSideTest (with
      MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE granted to shell)
Change-Id: I5536233b2084a31161185235195e2a6b25b4c3d1
2020-03-11 10:59:31 +00:00
Ruslan Tkhakokhov
c6947ef608 Merge "Reset isValuePreservedInRestore in Setting::reset()" into rvc-dev 2020-03-11 01:27:08 +00:00
Bill Yi
302b54ed30 Import translations. DO NOT MERGE
Auto-generated-cl: translation import
Change-Id: Ia99492307aaac5f11141da67c8c242a28447d338
2020-03-07 20:12:00 -08:00
Sudheer Shanka
cd629dd39a Merge "Add a limit on how much data an app can acquire a lease on." into rvc-dev 2020-03-06 22:39:06 +00:00
Ruslan Tkhakokhov
8c7effd4c7 Reset isValuePreservedInRestore in Setting::reset()
Bug: 150842661
Test: 1. atest SettingsStateTest
      2. atest PreservedSettingsRestoreHostSideTest

Reset operation brings a setting to its default state. This should
include isValuePreservedInRestore which is false for a newly initialized
setting.

Change-Id: Ife317e2ac9dbaae9d3f2abe770407558e7bdd775
2020-03-06 19:00:37 +00:00
Rhed Jao
a4bb7e44da Support long press accessibility button (1/n)
Adds a new setting key to support long press accessibility
button.

Bug: 150587818
Test: atest SettingsProviderTest
Change-Id: I1ca1e01867a937690f7a5e5b27d595cd0a83e395
2020-03-06 06:18:51 +00:00
Bill Yi
19c0f1ea7c Import translations. DO NOT MERGE
Auto-generated-cl: translation import
Change-Id: I34e14ac313d125ce931d1e3f1f741e0a389eafb3
2020-03-03 11:25:49 -08:00
Blake Kragten
ef0da07d27 Add Enhanced Connectivity To Backup Tests
Settings.Global.ENHANCED_CONNECTIVITY_ENABLED was not added to the
SettingsBackupTest.  Adding to test to fix android.provider.SettingsBackupTest#globalSettingsBackedUpOrBlacklisted

Bug: 150207643
Test: atest SettingsProviderTest
Test Result:
[1/107] android.provider.SettingsBackupTest#systemSettingsBackedUpOrBlacklisted: PASSED (26ms)
[2/107] android.provider.SettingsBackupTest#globalSettingsBackedUpOrBlacklisted: PASSED (0ms)

Change-Id: Ia5c225919c54594d17cbdfa4d8268be0aeb995b9
2020-02-25 12:56:14 -08:00
Sudheer Shanka
364364ba41 Add a limit on how much data an app can acquire a lease on.
+ Allow this limit to be modified using DeviceConfig properties.
+ Support DeviceConfig.getProperties() in TestableDeviceConfig.

Bug: 144155182
Test: atest --test-mapping apex/blobstore
Test: atest services/tests/mockingservicestests/src/com/android/server/testables/TestableDeviceConfigTest.java
Test: atest services/tests/mockingservicestests/src/com/android/server/am/CachedAppOptimizerTest.java
Change-Id: I28e67a27771be04ed1d37f367abd392505adc5c4
2020-02-24 05:52:33 +00:00
Joshua Duong
2076c04333 Add Settings.Global.ADB_WIFI_ENABLED.
ADB_ENABLED historically meant the state for USB debugging. Since
wireless debugging can be enabled separately, define another setting
for it.

BUG: b/111434128

Test: make
Exempt-From-Owner-Approval: approved in aosp_master
Change-Id: If3abca8e77381d6832f55d55a43c52ee1a1267d1
2020-02-21 02:21:08 +00:00
Hugh Chen
f786c7fa6c Merge "Add Settings.Global.ADVANCED_BATTERY_USAGE_AMOUNT" 2020-02-19 10:20:28 +00:00
Bill Yi
074e2f2120 Import translations. DO NOT MERGE
Change-Id: Id8b2a0f8ca9782ba4c4e0899ba19cedfff8d0fef
Auto-generated-cl: translation import
2020-02-18 10:42:04 -08:00
hughchen
e3fae2d4b9 Add Settings.Global.ADVANCED_BATTERY_USAGE_AMOUNT
Bug: 149609340
Test: Build pass
Change-Id: If90e3f5482f551884c016fd78c9f8165e728347b
2020-02-17 18:54:46 +08:00
TreeHugger Robot
6fb74aeefc Merge "Adds the validator adaptive_sleep back to SystemSettingsValidators" 2020-02-14 15:07:31 +00:00
Yi Jiang
33b64c03bb Adds the validator adaptive_sleep back to SystemSettingsValidators
Test: atest SettingsProviderTest
BUG: 149476174

Change-Id: Ic744181383c79220f5cfa127d96b387fcf9ecba9
2020-02-13 11:12:15 -08:00
lesl
c7cfb00c84 wifi: Update softap config notification changed wording
Bug: 147877229
Test: Manual test to check UI wording (Screenshot updated on bug)
Change-Id: Ie6c9af967c878924611ddf557b2b20ebd0b57b59
2020-02-13 11:30:14 +08:00
Yi Jiang
5040954f68 Merge "Moves Adaptive Sleep's settings from Settings.System to Settings.Secure" 2020-02-12 00:48:58 +00:00
Fiona Campbell
004e36da64 Merge "Add support for brightness as a float" 2020-02-11 18:51:02 +00:00
Yi Jiang
38f5a0683b Moves Adaptive Sleep's settings from Settings.System to Settings.Secure
Test: atest AdaptiveSleepPreferenceControllerTest
Test: atest AdaptiveSleepDetailPreferenceControllerTest
Bug: 139319542

Change-Id: Icd09a3291214194179d49d4e68032ba04fdfd040
2020-02-11 17:52:24 +00:00
Fiona Campbell
d4eb295196 Add support for brightness as a float
Change the framework to handle brightness as a float rather than an int.

Test: AutomaticBrightnessControllerTest
BrightnessConfigurationTest
BrightnessMappingStrategyTest
BrightnessUtilsTest
DevicePolicyManagerTest
DisplayManagerServiceTest
DisplayTest
DozeScreenBrightnessTest
PowerManagerTest
PowerManagerVrTest
SettingsProviderTest

Exempt-From-Owner-Approval: Changing param from int to float

Change-Id: I413641cd987c5ec8f82753c0388a33f85a9682de
2020-02-10 23:44:40 +00:00
Bohdan Petrivskyy
b98925df5c Fixes "package doesn't belong to uid" exception for DeviceConfig
clients calling DeviceConfig's access methods as root or shell.

Test: manually tested

Bug: 148801653

Change-Id: I2fdc84a0dbe84ffd3eeb5e994f14c7f5fd8d8b69
2020-02-06 20:02:17 +00:00
TreeHugger Robot
53a8d4a2ce Merge "Remove obsolete Settings unit tests" 2020-02-06 02:40:02 +00:00
Soonil Nagarkar
1d39e34eee Remove obsolete Settings unit tests
Bug: 140250974
Test: atest SettingsProviderTest
Change-Id: Id5f0e87d822be8b72693d6a24d32fbc714064b46
2020-02-05 14:49:10 -08:00
Matt Pape
71b8672f40 Merge "Respect forceNonSystemPackage param when creating new Setting objects." 2020-02-05 20:30:12 +00:00
Matt Pape
d3748577b6 Respect forceNonSystemPackage param when creating new Setting objects.
Previously, new settings created via DeviceConfig.setProperty() resulted
in the forceNonSystemPackage param being ignored and the makeDefault
param being overwritten to true. This caused new Setting objects added
this way to always save their initial value as the default value. This
caused problems in tests that tried to make local changes and later
reset them to the prior state.

Test: atest FrameworksCoreTests:DeviceConfigTest
Bug: 147862338
Change-Id: I98a4585fc39cb8c39e630c0dcd318b05a085fcc3
2020-02-05 09:38:32 -08:00
TreeHugger Robot
ad954091f4 Merge "Fix SettingsIncidentTest#testBasicStructure" 2020-02-04 23:21:41 +00:00
Mike Ma
490d671f31 Fix SettingsIncidentTest#testBasicStructure
When writing to a nested message field using ProtoOutputStream, need
to call ProtoOutputStream#start() before and ProtoOutputStream#end()
after.

Fixes: 146684453
Test: atest CtsIncidentHostTestCases SettingsIncidentTest#testBasicStructure
Change-Id: Ib4b858ec74c400c6d2ba78d1aca02b2d2102235b
2020-02-04 13:09:24 -08:00
Ruslan Tkhakokhov
efd9c181eb Fix flag check for preserve settings feature
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
2020-02-03 23:44:34 +00:00
TreeHugger Robot
1320c7b707 Merge changes I259a3f41,Id309a941
* changes:
  Guard the preserve settings logic in SettingsBackupAgent with a flag
  Do not restore settings marked as preserved in SettingsBackupAgent
2020-02-02 16:28:38 +00:00
Howard Ro
c240f07117 Merge "Use FrameworkStatsLog instead of StatsLog" 2020-01-31 19:04:45 +00:00