Commit Graph

3907 Commits

Author SHA1 Message Date
Bookatz
9086762d56 Use statsd constants instead of literals
Instead of writing StatsLog.write(StatsLog.NAME, 1), we replace the 1
with the appropriate StatsLog constant.

Bug: 72749863
Test: still compiles

Change-Id: I68c8206de49df7e77ee66333dd633e4b70c7b226
2018-01-31 17:02:20 -08:00
Robin Lee
81ad972f39 Feature flag for stopping restricted profiles
Defaults to true by default. Some devices may override this to force the
restricted profile to stop when not in use to save all the memory it
consumes where that is an issue.

There is no framework / first-party code setting it, but since this
is checked every time a user switches into the profile rolling it out
should be relatively straightfoward.

Bug: 71626497
Test: make droid
Change-Id: I7a718c4fdd2d80131df083908129b715d94e824e
2018-01-30 19:46:25 +01:00
TreeHugger Robot
c9c029c70b Merge "Add setting/experiment for time only mode for watch type devices." 2018-01-26 23:59:25 +00:00
TreeHugger Robot
0193e5651f Merge "Add setting to control vibration intensity." 2018-01-26 00:09:09 +00:00
Michael Kwan
47abf8c143 Add setting/experiment for time only mode for watch type devices.
Bug: 38259902
Test: none
Change-Id: I884f488c8147e6611cbb9556041920cd7f938aab
2018-01-25 15:41:30 -08:00
Matthew Fritze
9bc0572151 Merge "Add Setting Slices Contract file" 2018-01-25 22:25:54 +00:00
TreeHugger Robot
15dc9d7ddd Merge "Internal Framework changes needed by DocumentUI's ScopedAccessProvider:" 2018-01-25 21:30:22 +00:00
Felipe Leme
23a0c7a009 Internal Framework changes needed by DocumentUI's ScopedAccessProvider:
- Changed AM.getGrantedUriPermissions() API.
- Made DocumentsContract.PATH_TREE public.

Also fixed related AM methods to use explicit for on some loops.

Bug: 63720392
Test: manual verification

Change-Id: I33bdcb949f4301534bd8467c8018d6f03b4588a4
2018-01-25 11:04:29 -08:00
TreeHugger Robot
50bdbe3e2f Merge "Add key to store location changer" 2018-01-25 17:59:24 +00:00
Narayan Kamath
8d82825c75 Support logging chained WorkSources from JobScheduler.
Controller by a feature flag, which this change also introduces.

Bug: 62390666
Bug: 70892390
Test: manual, via JobSchedulerTestApp
Test: CtsJobSchedulerTestCases

Change-Id: Ic7dfb7861f7987a1b6eeb4cf3851193e9ad7da84
2018-01-25 09:41:04 +00:00
Lifu Tang
0cba58f5df Add key to store location changer
Store location changer into Settings.Secure

Modify quick settings to identify itself as location changer

Bug: 68779883
Test: Manual
Change-Id: I2c7a599e1383102685994d876e7160e164436a08
2018-01-24 22:30:11 -08:00
Glen Kuhne
22ae9d5ca0 Carrier Network Available Notification setting
Adds a setting allowing user to toggle Carrier Network Available
Notification on and off.

Bug: 69310016
Test: Verified manually
Change-Id: I209cd216dd5fd5c790aca8f74707a7ef831edd6a
2018-01-25 02:37:38 +00:00
Jeremy Klein
2ffeef2a35 Merge "Add scan interval and window lengths to Settings.Global." am: d3dac85e46 am: 8c33c789ed
am: 4ec192fd26

Change-Id: Ieae2e96acac3f1372d4075145426065f666a221a
2018-01-24 23:46:11 +00:00
Michael Wright
35a0c676ee Add setting to control vibration intensity.
This patch adds two distinct vibration control settings: one for
notifications and ringtones, and one for haptic feedback. Since we don't
always have the exact intent of a given vibration, VibratorService will
do its best to classify each VibrationEffect into one of these two
categories and then scale the vibration accordingly based on the
intensity setting.

Bug: 64185329
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.VibratorTest
      cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.VibrationEffectTest
Change-Id: If16237f4782281aaab33e4a0f55c29f1a30ac493
2018-01-24 23:39:57 +00:00
Jeremy Klein
4ec192fd26 Merge "Add scan interval and window lengths to Settings.Global." am: d3dac85e46
am: 8c33c789ed

Change-Id: Ib86750eadcf5683faba4151e3f3373f04a387de1
2018-01-24 23:34:38 +00:00
Matthew Fritze
b8c4b481de Add Setting Slices Contract file
SettingsSlicesContract added with constants including
- Authority
- Authority Uri
- Keys for major platform settings

Fixes: 72101207
Test: none, constants only.
Change-Id: I29fdd8391182e3c9a5abc063c56f18ed1f5f834b
2018-01-24 10:44:55 -08:00
TreeHugger Robot
18ef0d5bef Merge "Use proper logic operators in package name validation" 2018-01-24 18:38:44 +00:00
Daniel Nishi
1da5ab0183 Merge "Add a new setting for Bluetooth on while driving." 2018-01-24 18:22:15 +00:00
TreeHugger Robot
41584b69fd Merge "Update crash dialog options." 2018-01-24 18:21:54 +00:00
Michal Karpinski
6fe6c8ef02 Use proper logic operators in package name validation
And add unit tests for common validators as atonement...

Test: atest frameworks/base/core/tests/coretests/src/android/provider/SettingsValidatorsTest.java
Bug: 64988620
Change-Id: I561319356cbca70da326586c2a762293c4ade9ed
2018-01-24 15:42:15 +00:00
Michal Karpinski
6e39b9556a Merge "Add restore of Settings keys to SettingsBackupAgent.RESTORE_FROM_HIGHER_SDK_INT_SUPPORTED_KEYS" 2018-01-24 10:37:27 +00:00
TreeHugger Robot
6154427d0c Merge "Added STORAGE_VOLUME_ACCESS_SETTINGS intent." 2018-01-24 06:09:21 +00:00
TreeHugger Robot
dc6a1c4b8a Merge "Propagate location mode properly from SettingsProvider" 2018-01-24 05:55:42 +00:00
Maggie Wang
d2c4f7f610 Merge "Deprecate location modes" 2018-01-24 01:47:54 +00:00
Jeremy Klein
45a9b5dbbc Add scan interval and window lengths to Settings.Global.
This will enable running experiments to determine the
effects on battery life of changing these values.

Bug: 71765044
Test: Just adding a key value here. This is basically a no-op.
Change-Id: I33a0b2da6e793ef508d020a3c2d321d5553c3fb1
2018-01-23 16:17:22 -08:00
Felipe Leme
d82096eca3 Added STORAGE_VOLUME_ACCESS_SETTINGS intent.
Applications typically use this action to ask the user to revert the
"Do not ask again" status of directory access requested made by
StorageVolume.createAccessIntent(directory).

Test: atest CtsAppSecurityHostTestCases:ScopedDirectoryAccessTest#testResetDoNotAskAgain
Test: adb shell am start -a android.settings.STORAGE_VOLUME_ACCESS_SETTINGS

Bug: 63720392

Change-Id: I1ed1a018a54013d88260e11ef9646aaed3a3a318
2018-01-23 14:02:35 -08:00
Makoto Onuki
8e49825e80 Propagate location mode properly from SettingsProvider
Bug: 72240163
Bug: 72037769
Test: atest $ANDROID_BUILD_TOP/cts/tests/tests/batterysaving/src/android/os/cts/batterysaving/BatterySaverLocationTest.java

Change-Id: I7bad1547aaad30aa5c47ef813cbfc14dad4a5cce
2018-01-23 11:54:51 -08:00
Andrew Sapperstein
5b679c4d17 Update crash dialog options.
Add app info to crash dialog. Show close (aka force stop) on all dialogs,
not just the repeat dialog.

Remove showing restart and mute by default. Add Settings.Global
configuration parameters for both in case we want to show those options again.

Also some minor cleanup (converting some members to locals).

Bug: 63703353
Bug: 70640329
Test: manual
Change-Id: I83a2b1a5ea0f6a2a9765d7648dab7c184bfbc43f
2018-01-23 10:52:15 -08:00
Maggie
aa080f9676 Deprecate location modes
1. Mark public fields as deprecated: LOCATION_MODE, LOCATION_MODE_HIGH_ACCURACY, LOCATION_MODE_SENSORS_ONLY,
LOCATION_MODE_BATTERY_SAVING, LOCATION_MODE_OFF.

2. Add new public  methods to LocationManager:
setLocationEnabled(boolean)
isLocationEnabled()
setLocationProviderEnabled(String, boolean)

3. Remove LOCATION_PREVIOUS_MODE and constant
LOCATION_MODE_PREVIOUS. Refactor code that references
LOCATION_MODE_PREVIOUS to use LocationManager.setLocationEnabled or
LOCATION_MODE_HIGH_ACCURACY.

4. Mark deprecated fields and methods as removed: LOCATION_PROVIDERS_ALLOWED, setLocationProviderEnabled(), isLocationProviderEnabled()

5. Refactor logic in Settings app and Quick Settings to call
LocationManager.setLocationEnabled() instead of setting location mode.

Bug: 70990911
Test: Manual
Change-Id: Ia49b385f8b6a358b62291983eb0146af0ecf8e02
2018-01-23 10:45:49 -08:00
Daniel Nishi
7976412772 Add a new setting for Bluetooth on while driving.
This also adds a feature flag to read to see if the feature is enabled
on a given device.

Bug: 66679618
Test: Used in Settings Robotest
Change-Id: Idb892aa78f244d026a8d4b7dc104d47e0f611085
2018-01-23 09:35:02 -08:00
Michal Karpinski
b52575c528 Add restore of Settings keys to
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
2018-01-23 15:54:33 +00:00
Julia Reynolds
c128c86481 Remove settings intent
There's no dedicated screen for it to go to.
Test: make
Bug: 63927402

Change-Id: I9fc3352b74e526b5bd43ac48626c0d469fae4899
2018-01-23 09:04:29 -05:00
Jong Wook Kim
16c5d2c8d2 Merge "Wifi MAC Randomization: Developer option change global settings" 2018-01-23 06:40:51 +00:00
Jong Wook Kim
0a20eda58d Wifi MAC Randomization: Developer option change global settings
Enabling/disabling the connected mac randomization toggle in developer options will change Settings.Global.WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLE, which the wifi framework can look at to decide whether or not to randomized mac addresses. Also added descriptions for the toggle in developer options.

Bug: 67908229
Bug: 71548421
Test: manual testing of checking that the option correctly displays and
logs to check that the toggle correctly changes values.
Change-Id: I48a2dc34d772b0e4ce7637df904b274c9fe1218f
2018-01-22 18:13:40 -08:00
Christine Franks
bae5e6bda1 Merge "Change selection strategy for ACTION_DISMISS_TIMER" 2018-01-22 23:23:25 +00:00
TreeHugger Robot
fb39fd90f0 Merge "Add the assisted dialing carrier config." 2018-01-22 21:56:25 +00:00
TreeHugger Robot
5d86f5e30f Merge "Add PH flag for P power model" 2018-01-22 20:34:44 +00:00
Lei Yu
d95e1d6edd Merge "Update comment for BATTERY_TIP_CONSTANTS" 2018-01-22 20:21:51 +00:00
Eric Erfanian
af7b8c0a67 Add the assisted dialing carrier config.
This is used to activate the feature and show the settings.

Remove @hide from the public APIS.

Design doc:
go/assisted-dialing-dd-v1

Test: manual
Bug: 63934304
Change-Id: I09ea52720bf2439537e2f4ad32afb14f5df25f71
2018-01-22 19:23:04 +00:00
Nancy Zheng
d57c1df388 Merge "Add setting/experiment for small battery devices to have all forced app standby enabled except for when the device is charging." 2018-01-22 17:59:35 +00:00
Michal Karpinski
29a7472974 Split string properly in package name validator
Test: atest frameworks/base/core/tests/coretests/src/android/provider/SettingsValidatorsTest.java
Bug: 64988620
Change-Id: I35b93a9ba317dc31494bffb7ad3576ad7290220f
2018-01-20 14:31:29 +00:00
Mike Ma
fae87da498 Add PH flag for P power model
Add P/H experiment flags for Android P power model. The flags will share
the existing Settings.Global.BATTERY_STATS_CONSTANTS. Key
"track_cpu_active_cluster_time" controls KernelUidCpuActiveTimeReader
and KernelUidCpuClusterTimeReader. Key "read_binary_cpu_time" will be
used in a future optimization.
Bug: 68982314
Test: local build and manual test

Change-Id: Ie84fd5265dc65dd0d46ac347cefa32ad92d643ee
2018-01-19 20:07:20 -08:00
Nancy Zheng
525aaa13dc Add setting/experiment for small battery devices to have
all forced app standby enabled except for when the device
is charging.

Reverting the revert of this CL. The only change is to use
EXTRA_PLUGGED instead of EXTRA_STATUS in detecting charging
state. Verified that this passes CTS test for battery saver.

Bug: 69259147
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/ForceAppStandbyTrackerTest.java
Test: atest CtsBatterySavingTestCases
Change-Id: I4f3ffc0c865a1a3a035b6d9d6838b5056b666eb9
2018-01-19 15:27:42 -08:00
jackqdyulei
8732119521 Update comment for BATTERY_TIP_CONSTANTS
Bug: 70570352
Test: Build
Change-Id: Ibb702ddacdf1111a249c75541a87849713de1195
2018-01-19 14:24:54 -08:00
TreeHugger Robot
20220cdb72 Merge "Add validators for all Settings.Secure settings that are backed up" 2018-01-19 21:53:29 +00:00
Michal Karpinski
964943ab98 Add validators for all Settings.Secure settings that are backed up
A few no longer used settings were removed from SETTINGS_TO_BACKUP.

And extend the unit test to fail if new ones are added without
a validator. Also fail to boot in that case.

Ref: go/android-p-backed-up-settings
Test: atest frameworks/base/core/tests/coretests/src/android/provider/SettingsValidatorsTest.java
Bug: 64988620
Change-Id: I94b4039c9f54c341aec72b62579be3dd8bd84dbb
2018-01-19 19:40:46 +00:00
Makoto Onuki
bd9b0cf9b0 Merge "Make DEBUG_FPS_DIVISOR updatable via setting for possible experiments" 2018-01-19 18:11:01 +00:00
Michal Karpinski
8f0d71e3ee Merge "Add validators for all Settings.Global settings that are backed up" 2018-01-19 11:44:13 +00:00
Michal Karpinski
ebd9998326 Merge "Add SettingsValidators class and a test for validators enforcement" 2018-01-19 11:42:52 +00:00
Makoto Onuki
5cc9f721ce Merge "Revert "Add setting/experiment for small battery devices to have"" 2018-01-18 23:10:54 +00:00