Commit Graph

4063 Commits

Author SHA1 Message Date
Makoto Onuki
d3d249ab37 Merge "Add auto battery saver suggestion notification/dialog" into pi-dev
am: 452ae34af5

Change-Id: Ifaa72ab628c4fd319f0b1d23fe6d6ec7f9149477
2018-03-27 22:19:01 +00:00
Makoto Onuki
452ae34af5 Merge "Add auto battery saver suggestion notification/dialog" into pi-dev 2018-03-27 21:20:13 +00:00
Makoto Onuki
52c6295e22 Add auto battery saver suggestion notification/dialog
Spec: go/ebs-low-battery-mode-flow

- Basically when the user manually enables battery saver 4 times,
we show this notification to suggest turning on "scheduled"
(i.e. auto) battery saver.

- We show it through 8th time. If the user hits "no thanks",
or if auto-saver is enabled already, we will not show it.

- Introduced a new notification channel "HINTS" with
IMPORTANCE_DEFAULT.

Bug: 74120126
Test: Manual test with ll development/scripts/battery_simulator.py

Change-Id: I713abc59dc7caee6882ba848c3e3aabaf778c2bd
2018-03-27 10:42:05 -07:00
Tyler Gunn
baa5cc8fef Add exception catching for BlockedNumberContract methods used by Telecom.
The content resolver can throw in some instances when using the blocked
number provider.  Rather than crashing all of telecom, adding exception
handling to provide graceful fallback in these cases.

Test: Compile / build
Bug: 74965829
Merged-In: Iae4c2dfc912e0d2a4194deb62568ee2f78ce4e22
Change-Id: Iae4c2dfc912e0d2a4194deb62568ee2f78ce4e22
(cherry picked from commit b408ebe557)
2018-03-27 15:20:09 +00:00
Julia Reynolds
2d38ea9929 Merge "Add link to notification app listing in shade" into pi-dev
am: b429012907

Change-Id: I692a7829d800225b8db13fbb79e8224cf9d7b3b2
2018-03-27 14:25:09 +00:00
TreeHugger Robot
b429012907 Merge "Add link to notification app listing in shade" into pi-dev 2018-03-27 14:09:18 +00:00
Tyler Gunn
8b07cc5819 Merge "Add exception catching for BlockedNumberContract methods used by Telecom." am: 13791285aa
am: 7f4c7a1b88

Change-Id: Ibc4e5312b04abd5bad43f59c66a6f48a8150760e
2018-03-26 22:39:19 +00:00
Makoto Onuki
7e62948ab3 Merge "Sticky battery saver" into pi-dev
am: 110a7c20f4

Change-Id: Ieac07ecfaa0489d08a0bb9e2670da5b7e1a2d67c
2018-03-26 21:54:07 +00:00
TreeHugger Robot
110a7c20f4 Merge "Sticky battery saver" into pi-dev 2018-03-26 21:41:09 +00:00
Tyler Gunn
13791285aa Merge "Add exception catching for BlockedNumberContract methods used by Telecom." 2018-03-26 21:18:54 +00:00
Julia Reynolds
ed1c9af653 Add link to notification app listing in shade
Test: atest SystemUITests
Bug: 74318867
Change-Id: Ic309dfb08be0d41b7d524adc1b5910ab61b2d9fb
2018-03-26 17:14:48 -04:00
Makoto Onuki
a3cd7b9d53 Sticky battery saver
- When battery saver is enabled manually (i.e. via PM.setPowerSaveMode()),
it'll stick, and we'll re-enable battery saver even after a reboot
or a charge.

- Extracted all battery saver state transition logic into a separate
class.

Fix: 75033216
Bug: 74120126
Test: Manual test with "dumpsys battery set ...."
Test: atest $ANDROID_BUILD_TOP/frameworks/base/services/tests/servicestests/src/com/android/server/power/batterysaver/BatterySaverStateMachineTest.java
Change-Id: If020cd48f341b339783fe09dd35bc7199e737a52
Test: dumpsys power
Test: incident_report power
Test: atest CtsBatterySavingTestCases
2018-03-26 10:27:56 -07:00
Richard Ledley
6a29d0772d Merge "Add flag to control blocking Smart Replies for apps targeting an Android version below P." into pi-dev
am: 525b182864

Change-Id: I57974b8dc2b55d938ed48760654936d4bce61b11
2018-03-23 23:16:18 +00:00
Tyler Gunn
2ed0ab2f40 Add exception catching for BlockedNumberContract methods used by Telecom.
The content resolver can throw in some instances when using the blocked
number provider.  Rather than crashing all of telecom, adding exception
handling to provide graceful fallback in these cases.

Test: Compile / build
Bug: 74965829
Change-Id: I2e1accce3ed6fac4ec2b8e6a92585abf630b84fe
2018-03-23 14:39:37 -07:00
Richard Ledley
4069f7a167 Add flag to control blocking Smart Replies for apps targeting an Android version below P.
Bug: 73802997

Test: atest SmartReplyConstantsTest

Change-Id: Id340cba09da7931ff6a4689802b3a5f594852a72
(cherry picked from commit 28944cbdcf)
2018-03-23 21:14:27 +00:00
Alice Sheng
6036a2b5bf Merge "Add setting for disabling swap." into pi-dev
am: 7384995cf8

Change-Id: I2a8207237a5cf2e0b2d1be0996aece7542d9b90d
2018-03-23 19:47:06 +00:00
Alice Sheng
7384995cf8 Merge "Add setting for disabling swap." into pi-dev 2018-03-23 18:11:12 +00:00
Julia Reynolds
b598333775 Merge "Add vol up + power ringer toggle gesture" into pi-dev
am: 224e2fb2ef

Change-Id: I3b15061159a345a006dc0f5f532e93291ca1b383
2018-03-22 23:58:37 +00:00
Julia Reynolds
224e2fb2ef Merge "Add vol up + power ringer toggle gesture" into pi-dev 2018-03-22 22:03:48 +00:00
Alice Sheng
b32b1ad373 Add setting for disabling swap.
Bug: 73089999
Change-Id: I89c50ae2badcb75c52652acaeb181a3161233375
2018-03-22 13:00:13 -07:00
Felipe Leme
16f6c77d95 Merge "Renamed AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES." into pi-dev
am: 4e561f83cb

Change-Id: Id6e661b49cc9a28bb6464930210eac41f061d61a
2018-03-22 17:05:36 +00:00
Felipe Leme
4e561f83cb Merge "Renamed AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES." into pi-dev 2018-03-22 16:24:53 +00:00
Michael Plass
ad35dfa2a1 Merge "Add Settings.Global.WIFI_SCORE_PARAMS" into pi-dev
am: dddd69ef3e

Change-Id: I981b1d4fe36044e47b12051bf0dfd499eea2a155
2018-03-22 15:17:30 +00:00
Michael Plass
dddd69ef3e Merge "Add Settings.Global.WIFI_SCORE_PARAMS" into pi-dev 2018-03-22 15:03:51 +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
Tyler Gunn
b77daf6a8f Merge "Add Telecom debug setting for enabling enhanced call blocking." am: 727097a400
am: c0411e0be5

Change-Id: I99ba46420fb998112709d63abc502f6742e9558a
2018-03-21 23:18:23 +00:00
Tyler Gunn
727097a400 Merge "Add Telecom debug setting for enabling enhanced call blocking." 2018-03-21 21:02:24 +00:00
Makoto Onuki
16a0dd2d5e Implement new BS warning / notification flow (1/2)
- Show the battery saver confirmation dialog only for the first time.
- Start counting # of manual activations, which will be used in a
follow-up CL.

Bug: 74120126
Test: Manual tests with ./vendor/google_experimental/users/omakoto/android-battery-tester
Test: m -j ROBOTEST_FILTER=BatterySaverUtilsTest RunSettingsLibRoboTests
Test: cd frameworks/base/packages/SystemUI/tests && \
        atest src/com/android/systemui/power/PowerUITest.java src/com/android/systemui/power/PowerNotificationWarningsTest.java
Change-Id: If6a081a6222e6a87c4cd332364c89856e7648a36
2018-03-21 12:15:51 -07:00
Ben Lin
01cee8e686 Merge "Add new Intent start a package's Open By Default page directly." into pi-dev 2018-03-21 06:07:45 +00: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
Michael Plass
f1510fbe7a Add Settings.Global.WIFI_SCORE_PARAMS
For experimentally varying parameters of the framework's various wifi
scoring methods.

Bug: 65216267
Test: atest SettingsBackupTest
Change-Id: I6b1476aff8c18e4dd2b5ae8d41b5a48d2b4de283
2018-03-20 16:20:14 -07:00
Alice Sheng
0b08926fcb Merge "Revert "Revert "Add setting for enabling CPU frequency scaling.""" into pi-dev 2018-03-20 21:56:40 +00: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
Anthony Stange
c97870a91a DO NOT MERGE Add scan background mode to Settings.Global.
This enables us to mess with the different scan intervals and shift
clients to a different scan mode in the background based on what scan
interval values we choose for the different power modes.

Bug: 71765044
Test: None. Just adding a key.
Change-Id: Id48ebc521dd3fe8a68c9c4c0bdb1018ea5b3743e
2018-03-20 10:51:54 +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
Alice Sheng
59a9488f50 Revert "Revert "Add setting for enabling CPU frequency scaling.""
This reverts commit 6750352248.

Reason for revert: Added SElinux policy to allow the service to be started. Verified by local testing on the latest pi-wear-dev.

Bug: 74018496
Bug: 75974893
Change-Id: I9bd8939f6292be9c160e19ebdf934023792059ba
2018-03-19 23:46:56 +00:00
Alice Sheng
7723aed494 Merge "Revert "Add setting for enabling CPU frequency scaling."" into pi-dev 2018-03-19 22:38:25 +00:00
Alice Sheng
6750352248 Revert "Add setting for enabling CPU frequency scaling."
This reverts commit 2e8afd8736.

Reason for revert: SELinux Boot crash
Bug: 75974893

Change-Id: I4751530a1b460842130a495efe688aaf19b92638
2018-03-19 22:36:52 +00:00
TreeHugger Robot
f4f317798b Merge "Settings: Remove unused bg scan throttle settings" into pi-dev 2018-03-19 22:24:04 +00:00
TreeHugger Robot
e9b60f2cd3 Merge "Add setupwizard personalisation state to Settings" into pi-dev 2018-03-19 21:26:37 +00:00
Tyler Gunn
37ce669cf8 Add Telecom debug setting for enabling enhanced call blocking.
This feature is only available for certain carriers at the current time.
To facilitate test team productivity, adding a system setting which can
be accessed from the Telecom debug menu to enable this functionality.

Test: Manual
Bug: 28189985
Change-Id: I4c812cecd2832a722e5dc73b7c719a9e0594064d
2018-03-19 13:55:13 -07:00
Alice Sheng
1799f2b878 Merge "Add setting for enabling CPU frequency scaling." into pi-dev 2018-03-19 18:41:40 +00: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
Ajay Nadathur
702fc647f3 Add setupwizard personalisation state to Settings
bug: 74396457
Test: Manually tested and verified
Change-Id: I84b8cf7c45818131f903743b6c42cfeffe1c7194
Merged-In: I84b8cf7c45818131f903743b6c42cfeffe1c7194
2018-03-17 02:20:22 +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
Anthony Stange
ff54a35a0f Add scan background mode to Settings.Global.
This enables us to mess with the different scan intervals and shift
clients to a different scan mode in the background based on what scan
interval values we choose for the different power modes.

Bug: 71765044
Test: None. Just adding a key.
Change-Id: Id48ebc521dd3fe8a68c9c4c0bdb1018ea5b3743e
2018-03-16 16:07:45 +00: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
Primiano Tucci
d4b6c8c162 Merge "perfetto: Add setting to enable/disable traced" into pi-dev 2018-03-15 12:24:02 +00:00