Commit Graph

1220 Commits

Author SHA1 Message Date
TreeHugger Robot
af52d9815a Merge "Add setting for GNSS location request update duration" into pi-dev 2018-04-18 18:10:04 +00:00
Philip P. Moltmann
cb58a83a19 Change allowed sound triggers to 1000
Test: Looked at settings on fresh device. Saw update. Looked at upgraded
device and saw change from 300 -> 1000
Fixes: 78112231

Change-Id: Iecb5b1250fa8613201ef8a85f8221aa8608785dc
2018-04-16 10:36:06 -07:00
Julia Reynolds
b2943a864e Merge "Show onboarding screen from dnd tile" into pi-dev 2018-04-11 19:36:41 +00:00
Julia Reynolds
c4e5ecf703 Show onboarding screen from dnd tile
Increase the DND version and reset the setting so those who
are upgrading P->P see the new flow.

Test: manual
Change-Id: I9286f022d1fa6520305ff03dbce54c4eec0e371a
Fixes: 77658931
2018-04-11 12:23:05 -04:00
Anton Philippov
ff25b5f118 Merge "Fix restore from higher SDKs in SettingsBackupAgent" into pi-dev 2018-04-11 13:08:44 +00:00
Anton Philippov
54c6d6c8a0 Fix restore from higher SDKs in SettingsBackupAgent
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
2018-04-10 22:52:28 +01:00
TreeHugger Robot
0e675bd901 Merge "Exempt tests for hidden APIs." into pi-dev 2018-04-10 16:34:05 +00:00
Mehdi Alizadeh
1264d880e2 Adds entries for Swipe Up Enable in Settings.Secure
Bug: 77549883
Test: None
Change-Id: Ie346c4f527fa014eadbfaa1d81d7f8a5f37f653f
2018-04-09 18:28:04 +00:00
Yu-Han Yang
ab3e7bdd62 Add setting for GNSS location request update duration
Bug: 77696830
Test: atest SettingsBackupTest
Change-Id: I4514070ba12de2d1c4c47c03a9bf70d8f57fe197
2018-04-06 11:44:21 -07:00
Nicolas Geoffray
b0284fb5de Exempt tests for hidden APIs.
Bug: 64382372
Bug: 74963051
Test: m
Change-Id: I5234dd6230f2bdd6ffccbf12b25a02d929d20161
2018-04-06 14:54:39 +01:00
Annie Meng
aeeb24e9cd Don't backup/restore screen brightness
We no longer want to backup and restore screen brightness as it could
leave the new device in an unusable state and doesn't make sense
cross-device.

Test: 1) atest SettingsBackupTest
2) atest SettingsValidatorsTest
3) Manual:
- Old backup set that has screen brightness does not restore with change
- Screen brightness does not backup or restore with change
Bug: 77583401
Merged-In: I8a6d950717e6aeb9bf6773c14708ee70069f9df0

Change-Id: I8a6d950717e6aeb9bf6773c14708ee70069f9df0
(cherry picked from commit 931b41b71a)
2018-04-06 12:48:23 +00:00
TreeHugger Robot
b1bcab2210 Merge "Implements GNSS satellite blacklist" into pi-dev 2018-04-05 23:28:19 +00:00
Yu-Han Yang
66c7ea91b4 Implements GNSS satellite blacklist
Bug: 38269641

Test: m -j ROBOTEST_FILTER=GnssSatelliteBlacklistHelperTest RunFrameworksServicesRoboTests
Test: atest SettingsBackupTest
Test: Tested with adb on device

Change-Id: Ifaa330bf74353ea5c8826f0000d1935258b8dbf2
2018-04-05 08:57:04 -07:00
Hall Liu
44e41012ec Move RTT system setting to Settings.Secure
Bug: 76449217
Test: manual
Change-Id: I85620d5b834aa7e04579212f3fd5cf6c0498b570
2018-04-05 01:18:02 +00:00
Artem Iglikov
5b53875fdc Clear app data before full restore for specified packages
In some cases (deferred restore) the app data needs to be cleared even
if the app has implemented backup agent. As a quick fix introduce
PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE secure setting, which
transport can fill prior to restore.

Bug: 69069240
Test: adb shell settings put secure packages_to_clear_data_before_full_restore com.google.android.apps.nexuslauncher && adb shell bmgr restore com.google.android.apps.nexuslauncher
Change-Id: I2a4651365d9cf4747f32d2ba69312f54cd03d118
2018-03-29 11:01:50 +01:00
Kweku Adams
a9c0bb17e0 Refactoring SystemSettingsProto to avoid method limit.
Bug: 76011704
Bug: 74975371
Test: flash device and check incident.proto output
and m EMMA_INSTRUMENT_STATIC=true EMMA_INSTRUMENT=true out/target/common/obj/APPS/CtsStatsdApp_intermediates/jacoco/work/instrumented/updated.stamp
and atest CtsIncidentHostTestCases:com.android.server.cts.SettingsIncidentTest

Change-Id: I30bb0f35dacd55c11603f9f8b9888c7d35df7a54
2018-03-27 11:44:42 -07:00
Kweku Adams
9081c76d75 Refactoring SecureSettingsProto to avoid method limit.
I'll do SystemSettingsProto in a separate CL.

Bug: 76011704
Bug: 74975371
Test: flash device and check incident.proto output
and m EMMA_INSTRUMENT_STATIC=true EMMA_INSTRUMENT=true out/target/common/obj/APPS/CtsStatsdApp_intermediates/jacoco/work/instrumented/updated.stamp
and atest CtsIncidentHostTestCases:com.android.server.cts.SettingsIncidentTest

Change-Id: I47d4843ff21bbdde0cdc0a1f5754c22c4e642aa7
2018-03-26 16:29:55 -07:00
TreeHugger Robot
cff4c5492e Merge "Refactoring GlobalSettingsProto to avoid method limit." into pi-dev 2018-03-26 20:11:09 +00:00
Jeff Sharkey
308093f53b Clear identity when asking for other users.
Bug: 76394640
Test: nope
Change-Id: I8d1530ed01669947e91725e905240729e31c7234
2018-03-25 22:54:16 -06:00
Kweku Adams
b4e545381f Refactoring GlobalSettingsProto to avoid method limit.
This is a large CL, so I'll do the other two protos in separate CLs.

Bug: 76011704
Bug: 74975371
Test: flash device and check incident.proto output
Change-Id: I285e6495b122c36eded9f6fc3afa39c92c293ed5
also: m EMMA_INSTRUMENT_STATIC=true EMMA_INSTRUMENT=true out/target/common/obj/APPS/CtsStatsdApp_intermediates/jacoco/work/instrumented/updated.stamp
also: atest CtsIncidentHostTestCases:com.android.server.cts.SettingsIncidentTest
2018-03-23 18:03:43 -07:00
TreeHugger Robot
8a696e9e09 Merge "Notify all running users for global settings change" into pi-dev 2018-03-23 23:17:21 +00:00
Anthony Stange
7a0493ec27 Add new key from Settings.java to settings.proto.
Bug: 71765044
Test: Presubmits

Change-Id: I28f19791e26a07c9bf6846bbf99c774682cdf18f
2018-03-23 11:15:37 +00:00
Svet Ganov
945864c704 Notify all running users for global settings change
Test: pass: atest android.provider.cts.SettingsTest
      pass: atest android.provider.cts.Settings_SystemTest
      pass: atest android.provider.cts.Settings_SecureTest
      pass: adb shell am instrument -w com.android.providers.setting.test
                /android.support.test.runner.AndroidJUnitRunner

Bug: 74547258

Change-Id: Ic8c76467248d5bea64eeb8c7321f552664b6a2a6
2018-03-22 21:59:57 -07:00
Julia Reynolds
224e2fb2ef Merge "Add vol up + power ringer toggle gesture" into pi-dev 2018-03-22 22:03:48 +00:00
Felipe Leme
4e561f83cb Merge "Renamed AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES." into pi-dev 2018-03-22 16:24:53 +00:00
Mike Digman
5527286e08 Add vol up + power ringer toggle gesture
It only runs when the screen is on.

Test: manual, invoking gesture with different system settings
Bug: 75252670
Change-Id: I934d0bbb0a9fffecf34ebaadf77f3e1241d4faf7
2018-03-22 10:55:24 -04:00
Felipe Leme
fd4003bf09 Renamed AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES.
The syntax of that setting changed from P Developer Preview1 to the final P, so
it's safer to use a new name than risk breaking devices during the update.

Bug: 74458004
Test: atest CtsAutoFillServiceTestCases:VirtualContainerActivityCompatModeTest\
FrameworksCoreTests:SettingsBackupTest

Change-Id: I1c507e8eae20f598dfe259178667ae6c2bc892ff
2018-03-21 16:36:25 -07:00
Maggie Wang
b2637dac49 Merge "Fix location settings bug on non-GPS devices" into pi-dev 2018-03-21 22:02:03 +00:00
Maggie
83e03f5559 Fix location settings bug on non-GPS devices
The old location_mode API hardcoded gps and network location provider when it enables/disables location, without checking whether the providers exist on device.
It causes bugs when used together with the new
LocationManager.setLocationEnabled() APIs.

This fix modified LocationManager.setLocationEnabled() API when user
tries to disable location on device. Besides turning off the providers
from LocationManager.getAllProviders(), it also turns off GPS and
network provider explicitly.

To reduce times of binding to the service and chance of race condition, we also
modified SettingsProvider.updateLocationProvidersAllowedLocked() to
accept a string param with multiple location providers to be
enabled or disalbed at the same time.

Bug: 73261572
Test: Manual on chromebook
Change-Id: I2e59e0d4cf395b98cd481af5d7f3c762274d7826
2018-03-21 12:14:47 -07:00
TreeHugger Robot
6ed6340e3c Merge changes from topic "SoundTriggerJobService-steps" into pi-dev
* changes:
  Throttle number of sound trigger operations / day
  Add SoundTriggerDetectionService
  Expose SoundTriggerManager and SoundTrigger APIs
2018-03-21 03:27:56 +00:00
Makoto Onuki
ad62f631be Merge "Revert "Dispatch global settings changes to all users."" into pi-dev 2018-03-20 23:31:02 +00:00
Makoto Onuki
542266d2dc Revert "Dispatch global settings changes to all users."
This reverts commit 989157e1a6.

Reason for revert: Crashing stuff -- http://b/76031092

Bug: 76031092
Change-Id: I190280b4f7bd2c6fda5d88fe25fd609d1cf6d7fb
2018-03-20 23:28:41 +00:00
Philip P. Moltmann
7e25b3d915 Throttle number of sound trigger operations / day
It is not clear when the day should start. Further a day might have
25 hours in the case of daylight savings time.
Hence a day in this case is the last 24 hours, not a calendar day.

Keeping track of the time of each operation might waste memory as we
don't need that much precision.

Hence keep track how many operations were performed in the last 24
hours in buckets of hours. If the total count reaches a maximum suppress
any further operations.

The maximum is configurable via global settings. It can be updated
by apps that have the appropriate permissions. Hence if the default
value turns out to be incorrect, it can be adjusted after release.

This does not throttle based on battery state as it is better to
completely unload the sound model to not even have a detection event.

Test: atest SoundTriggerDetectionServiceTests (separate CL)
      atest android.provider.SettingsBackupTest
Bug: 73829108
Change-Id: Ied8570b60b61b6a055bd2576d1502c1b36424efa
2018-03-20 13:57:14 -07:00
Philip P. Moltmann
18e3eb8168 Add SoundTriggerDetectionService
The service is meant to replace the PendingIntent based API. Once all
users of the PendingIntent based API switched the PendingIntent based API
will be removed.

To have as little as possible impact on the whole SoundTrigger framework
the RemoteSoundTriggerDetectionService class implements the same
interface as the PendingIntent based class. Hence the exising code has
very little change. Further once the old code can be removed the amount
of changed (and added) code is limited.

The RemoteSoundTriggerDetectionService -> SoundTriggerDetectionService
is a vanilla as possible service implementation. The special behaviors
are:
- The system holds a wakelock while service operations are in progress
and the service is bound as foreground. Hence the service can e.g.
listen to the microphone.
- Service operations have a certain amount of time they are allowed to
run. Once every operation is either finished or the the operation
exceeded the allotted time, the system calls onStopOperation for each
still pending operation. This is a similar model as for the commonly
used JobService.
  Please note that if the time allowed for an operation is 15s and
op1 was run as 0si, and op1 was run at 5s, the service is allowed to run
until 20s. Hence _both_ onStopOperations will happen at 20s. This is
done for ease of implementation but should not give the service more
power than calling onStopOperation exactly 15s after each operation is
triggered.
- If an operation is done before the allotted time is reached, the
service can declare the operation as finished manually by calling
onOperationFinished. This is a call back into the system, hence a
'client' binder is sent to the service. If the operation is finished
by calling this method onStopOperation will not be called.
- As the service instance might be killed and restored between
operations we add a opaque bundle 'params' to each operations. The users
of the API can use this to send data from the start command to the
operations. It can also just be set to null. The params are not meant to
store changing state in between operations. Such state needs to be
persisted using the regular methods (e.g. write it to disk)
- A service can be used for multiple recognition sessions. Each
recognition is uniquelity defined by its sound model UUID. Hence each
operation gets at least tree arguments: Operation ID, sound mode UUID, params
- As a small optimization the params are cached inside of the service
instance.

The time allowed for each operation is in a @SystemAPI global setting,
so the service can make sure it finishes the operations before they are
stopped. It might take some time to deliver the operations via the
binder, hence it is not recommended to try to use every last ms of
allotted time.

Test: atest SoundTriggerDetectionServiceTest (added in separate CL)
      atest android.provider.SettingsBackupTest
Change-Id: I47f813b7a5138a6f24732197813a605d29f85a93
Fixes: 73829108
2018-03-20 13:57:14 -07:00
TreeHugger Robot
039deb4390 Merge "Moves the settings changed logging for statsd." into pi-dev 2018-03-20 20:30:31 +00:00
TreeHugger Robot
4a99e98b48 Merge "Dispatch global settings changes to all users." into pi-dev 2018-03-20 18:56:27 +00:00
Svet Ganov
989157e1a6 Dispatch global settings changes to all users.
Test: manual

Bug: 74547258

Change-Id: Ia42381e8a74ff70b21d511764dd71f6107807060
2018-03-20 16:54:26 +00:00
Pavel Grafov
c5c9730202 Update work notifivation settings on upgrade.
Work notifications settings should only allows the user to cause
notifications to be redacted, not hidden alltogehter. If some user
had it hidden, change it to redacted on upgrade.

Bug: 64829587
Test: manual
Change-Id: Iff88638b2536481fb7ff66ac8a29512c95fbada6
2018-03-20 16:14:37 +00:00
David Chen
bd78991bc6 Moves the settings changed logging for statsd.
Previously, we wrote a log entry regardless of permission checks, so
the logging could be misleading. Now we only send the log to statsd
after verifying that this setting mutation is valid.

Test: Flashed onto marlin-eng and verified stats-log as expected.
Bug: 73493944
Change-Id: I2a8b052aa8c380ffc5d15caec089fffcdc5823f4
2018-03-19 17:11:03 -07:00
Roshan Pius
9c396677d9 Settings: Remove unused bg scan throttle settings
Bug: 68987915
Test: Compiles
Change-Id: I49b213f0d63f2a639e45c2239506787d31ae866a
Merged-In: Id878daa0f782ddc751e726ee19cdc1c8e5ea1bc2
2018-03-19 10:39:18 -07:00
Bill Yi
4c88cd65c1 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: Icb81b9c2336d04310365592f1cccb53dad0c0403
2018-03-19 06:12:52 -07:00
Michael Kwan
c5d0ed9f3c Merge "Modify time only mode flag into set of values instead of just one." into pi-dev 2018-03-17 22:05:38 +00:00
Michael Kwan
5f5a0bf00d Modify time only mode flag into set of values instead of just one.
The time only mode flag has not been used yet, so the change should
be low impact.

Bug: 38259902
Test: m -j32
Change-Id: Ie01870633dbaaf51989a148f105a995f58f0da4e
2018-03-16 12:34:19 -07:00
Bill Yi
3d2f4da75e Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: I510439c0816ad0b800b0eae982024b580a686333
2018-03-16 11:42:12 -07:00
Annie Meng
d069a888cf DO NOT MERGE Create a setting for backup/restore agent timeouts
Part of push to make backup and restore agent timeouts configurable. Creates
a Global setting for the current static BackupManagerService timeouts so
that they can be overriden with P/H. We keep the current default values,
which will be updated once we investigate what more appropriate values are.

Remame the constants to better reflect what they're used
for. Next, we will update the framework to use these constants.

This depends on the refactor of how we observe changes to key value
backup settings (ag/3709997).

Bug: 70276070
Test: m -j RunFrameworksServicesRoboTests ROBOTEST_FILTER=BackupAgentTimeoutParametersTest
Change-Id: Id506314ce0c8bd5e4d1d8b4001b26cbad0056c99
2018-03-15 17:43:56 +00:00
Pengquan Meng
c6556e7cb6 Merge "Telephony(MSIM): Default NW mode property for each slot" into pi-dev 2018-03-15 01:01:15 +00:00
Sandeep Gutta
2a7c0d377d Telephony(MSIM): Default NW mode property for each slot
For dual SIM devices, add provision to configure different default
Network modes for each slot, using the existing system property to
configure this default network modes.

Bug: 28384694
Test: manual - Checked different default NW mode can be set
for each slot.
Merged-Id: I72b11522cb51a425e28ddc407014387a20cb2cd7
Change-Id: I72b11522cb51a425e28ddc407014387a20cb2cd7
2018-03-14 11:53:04 -07:00
Kweku Adams
3699c36d24 incidentd: cleaning up settings.proto
This also fixes dumping of settings that use a prefix.

Since the proto isn't being used yet, I thought it would be nice to
clean it up so we start using it with a clean format.

Bug: 74611860
Test: flash device and check incident output.
Change-Id: Ib99ccab7929208cf8b4404715b0bd417852314c6
2018-03-13 13:36:05 -07:00
Beverly
09da25f00d Using zen duration preference
Test: make ROBOTEST_FILTER=ZenDurationDialogTest RunSettingsLibRoboTests -j40
Bug: 73741459
Change-Id: Ide76ac8016b84f128c47ad3731eeced25dce8c73
2018-03-07 13:57:59 -05:00
Annie Meng
292d895fb2 Merge "Validate restore of NetworkPolicy settings" into pi-dev 2018-03-07 17:07:51 +00:00