1963 Commits

Author SHA1 Message Date
TreeHugger Robot
0795bf8d62 Merge "Hook up data saver to battery saver." 2017-03-24 04:55:15 +00:00
Geoffrey Pitsch
ed767118f4 Ignore flaky notification test
Bug: 36551790
Test: runtest systemui-notification
Change-Id: I92f72a90afb2323a847149351bf1c6a911027e0b
2017-03-23 15:13:06 -04:00
jackqdyulei
29c82ab242 Hook up data saver to battery saver.
1. Add globalBatterySaverEnabled in PowerSaveState, which stores
the real battery saver mode, not the one for specific service.
2. Add "mRestrictBackgroundChangedInBsm" and
"mRestrictBackgroundBeforeBsm" to restore the mRestrictBackground
if necessary.
3. If user toggles the data saver when battery saver is on, don't
restore the data saver when battery saver is off.

Bug: 34693888
Test: FrameworksServicesTests
Change-Id: Ic50c1cae3fb110a228e59e5d1fd04c164e4b7274
2017-03-22 15:55:21 -07:00
Fyodor Kupolov
707af7c57b Merge "Added concurrency test" 2017-03-22 21:02:13 +00:00
Fyodor Kupolov
2290efde55 Added concurrency test
Test 2 threads repeatedly calling getAccounts while 1 thread calls
setAuthToken.

Example output:
I AccountManagerServiceTest: readTotalTime=1468 avg=36.7
I AccountManagerServiceTest: writeTotalTime=813 avg=40

Bug: 36485175
Test: AccountManagerServiceTest
Change-Id: Iee66339ceeb8f149eb9fc0906c537db60465d475
2017-03-22 12:29:14 -07:00
Bryce Lee
c344373ed4 Merge "Do not allow Tasks to influence orientation under some conditions." 2017-03-22 18:07:35 +00:00
Dan Shi
874a0916fc Merge "Add test configs to apct tests under frameworks/base" 2017-03-22 17:55:58 +00:00
Jorim Jaggi
541feb1ccf Merge "When snapshots are disabled, fill it with single color." 2017-03-22 17:03:00 +00:00
Jorim Jaggi
a359c9846d Merge "Add API to disable snapshotting of activities" 2017-03-22 16:42:57 +00:00
Bryce Lee
61fbcbcc94 Do not allow Tasks to influence orientation under some conditions.
When all AppWindowTokens belonging to a Task are closing, it should
not be considered for orientation. Likewise, if a task is moving to
the bottom, it should also not be considered.

Change-Id: Ie387457c413d5360afbb0ac8edb112f81feab81b
Fixes: 35699615
Test: bit FrameworksServicesTests:com.android.server.wm.TaskStackTests#testClosingAppDifferentStackOrientation
Test: bit FrameworksServicesTests:com.android.server.wm.TaskStackTests#testMoveTaskToBackDifferentStackOrientation
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerAppConfigurationTests#testTaskCloseRestoreOrientation
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerAppConfigurationTests#testTaskMoveToBackOrientation
2017-03-22 09:29:59 -07:00
TreeHugger Robot
b251fad07f Merge "Don't unlock the work profile if it is turned off." 2017-03-22 16:11:47 +00:00
Jorim Jaggi
8f4fe6eccb When snapshots are disabled, fill it with single color.
Test: Launch DisableScreenshotsActivity, go to recents, make sure
content is blue. Reopen activity from home, make sure starting
window is blue.

Bug: 31339431
Change-Id: I29689774c3cdcb784d8f5bfa4f947a6f35b91e01
2017-03-22 16:29:15 +01:00
TreeHugger Robot
2c98e18ce5 Merge "Null check! Now with a test" 2017-03-22 15:20:36 +00:00
Jorim Jaggi
0fe7ce968b Add API to disable snapshotting of activities
Test: runtest frameworks-services -c
com.android.server.wm.TaskSnapshotControllerTest
Test: Launch DisableScreenshotsActivity, go to recents, make sure
content is white.
Bug: 31339431

Change-Id: I329925d2fca389e561da3389a67fe888b5bb1033
2017-03-22 15:59:44 +01:00
TreeHugger Robot
26a547d5e4 Merge "Allow channels to have a user visible description." 2017-03-22 14:04:05 +00:00
Andrew Scull
8e87af5533 Don't unlock the work profile if it is turned off.
Test: Turn off work, lock and unlock device with PIN/password/pattern,
turn on work and now you get a screen lock prompt.
Test: runtest frameworks-services -c com.android.server.LockSettingsServiceTests

Change-Id: I0c6946af4ffb1546ffbd4d80c11fa4b8ab5555bc
2017-03-22 12:23:52 +00:00
TreeHugger Robot
a300ab2746 Merge "Fix logic errors when checking the caller." 2017-03-22 02:44:37 +00:00
TreeHugger Robot
ac9e6f7453 Merge "Implement runtime account update notifications." 2017-03-22 02:19:28 +00:00
Fyodor Kupolov
c1bacbd2f6 Merge "Support expiration of preloaded file cache" 2017-03-22 01:56:07 +00:00
Fyodor Kupolov
d225f0bfd5 Support expiration of preloaded file cache
When device is provisioned, we delete all files from /data/preloads
except file_cache. We should do best effort to keep file_cache during
the first config_keepPreloadsMinDays. After that,
persist.sys.preloads.file_cache_expired is set to 1, which indicates
that cache can be deleted when additional storage space is requested.

Bug: 34690396
Test: Manual + RetailDemoModeServiceTest
Change-Id: Ie584a9dd6689bcc5e6b3cb448e95dfe5f73d2eeb
2017-03-21 16:51:25 -07:00
Jeremy Joslin
3bddadd3e1 Fix logic errors when checking the caller.
A few methods were incorrectly ORing instead of ANDing the frontline
security check. Fixed and added tests.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Change-Id: I20531ad5a8df6fe9b9e2225198be25a2a070b603
2017-03-21 16:16:46 -07:00
Dmitry Dementyev
8882d881f9 Implement runtime account update notifications.
Test: manual, cts.
Change-Id: Iaf9fe4814c3d3c2ca2dca0a5bfa0f997e060bfeb
2017-03-21 15:54:00 -07:00
Julia Reynolds
8e0eb372c9 Null check! Now with a test
Test: runtest systemui-notification
Change-Id: I0b98b3dd6aeaa7e300bba98b7d7f7f5afae16596
Fixes: 36245468
2017-03-21 21:50:32 +00:00
TreeHugger Robot
48926cc1e6 Merge "Channel updates should trigger ranking updates" 2017-03-21 21:46:36 +00:00
Julia Reynolds
2c891c92fa Allow channels to have a user visible description.
Test: runtest systemui-notification, cts
Change-Id: I0d04b82c99deecad663d8cb0565563f00e8a1f56
2017-03-21 17:45:41 -04:00
TreeHugger Robot
74cb00696e Merge "Exfiltrate cert code from DevicePolicyManager" 2017-03-21 17:58:55 +00:00
Jorim Jaggi
2dde2b122f Merge changes I7f7a9842,I4c74b269
* changes:
  Implement new thumbnail loading strategy
  Also store reduced resolution screenshots
2017-03-21 15:53:52 +00:00
Julia Reynolds
a917a1149c Channel updates should trigger ranking updates
- Uid, not user id
- unspecified importance really does mean 'don't override'

Change-Id: Ia60aade179f70cd5d5278eed41c707b9ab6590e0
Fixes: 36007628
Fixes: 36355913
Test: manual, runtest systemui-notification
2017-03-21 11:23:46 -04:00
Bryce Lee
5c9fb3c527 Merge "Do not remove the default display during tests." 2017-03-21 14:33:27 +00:00
Geoffrey Pitsch
d9263306d5 Merge "Delete the Default Channel when an app starts using channels." 2017-03-21 14:12:22 +00:00
Jorim Jaggi
35e3f53a30 Also store reduced resolution screenshots
In order to speed up loading time when scrolling through it
in recents. They will be used in recents in the next CL. Also, we
use JPG instead as loading JPG is much faster than PNG.

Test: TaskSnapshotPersisterLoaderTest
Test: TaskSnapshotCacheTest
Bug: 34829962
Change-Id: I4c74b26969ae459bd3b1a42707011a49f425abd9
2017-03-21 14:58:50 +01:00
TreeHugger Robot
2bcca1d624 Merge "BZZZZZZT! BZZZZZT! New Vibrator APIs" 2017-03-21 13:40:36 +00:00
Sudheer Shanka
84a4895c9c Update AMS to wait for network state update if requested by the main thread.
Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
      runtest -c com.android.server.am.ActivityManagerInternalTest frameworks-services
      cts-tradefed run singleCommand cts-dev --module CtsHostsideNetworkTests
      and manual
Change-Id: I7d1052b9941c1fae51ff8ab1c9b89dca3919ccd2
2017-03-21 00:22:36 -07:00
Dan Shi
7f2afd2dff Add test configs to apct tests under frameworks/base
TouchLatency is needed by test TouchLatencyJankTestWear
UiBench is needed by test UiBenchJankTests

Details about test configs changes are tracked in doc
https://docs.google.com/document/d/1EWUjJ7fjy8ge_Nk0YQbFdRp8DSHo3z6GU0R8jLgrAcw/edit#

Bug: 35882476
Test: local test
make -j32 TouchLatency TouchLatencyJankTestWear  && \
tradefed.sh run template/local --template:map test=TouchLatencyJankTestWear \
      --test-tag testname --log-level-display VERBOSE
make -j32 UiBenchJankTests UiBench  && \
tradefed.sh run template/local --template:map test=UiBenchJankTests \
      --test-tag testname --log-level-display VERBOSE

Change-Id: I63f23e3a21ad1343607953958fb7bb0a5fb8c343
2017-03-21 00:05:14 -07:00
Sudheer Shanka
51ab3acf27 Add lastProcStateSeqDispatchedToObservers to UidRecord.
This will help in identifying the last procStateSeq for which AMS
notified NPMS about the process state change.

Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services

Change-Id: I741a8ffe31de92070f3ebbc9c4f95fc1c0a340cd
2017-03-20 23:27:49 -07:00
Sudheer Shanka
4c66f8b20d Merge "Update NPMS to notify AMS when network policy rules are updated." 2017-03-21 06:13:03 +00:00
Sudheer Shanka
e736185ee9 Update NPMS to notify AMS when network policy rules are updated.
Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerInternalTest frameworks-services
      runtest -c com.android.server.NetworkPolicyManagerServiceTest frameworks-services

Change-Id: I357fd5c80b7e6d3e63df95397e328c52f233958b
2017-03-20 17:34:09 -07:00
Bryce Lee
6272c7f83f Do not remove the default display during tests.
The default display is used by some tests that exercise features only
functional only on the default display (like policy rotation). This CL
makes this display not get removed with the created test displays and
ensures no collision in id space from a previous test run (done in the
test setup).

Change-Id: Ia14b9c023c779d263283fe8c7b512dca17ff312f
Fix: 36385757
Test: bit FrameworksServicesTests:com.android.server.wm.StackWindowControllerTests#testRemoveContainer_deferRemoval
2017-03-20 14:48:16 -07:00
Geoffrey Pitsch
1f17e024a1 Delete the Default Channel when an app starts using channels.
New apps should create their own channels.
Not using channels will silently fail.

STOPSHIPS:
Throw to provide better feedback for developers.
Delete the default channel for all apps that target O.

Test: runtest systemui-notification
Change-Id: Ic93f103efe397f563eaaf1c2e7d8bf9093b2b2e1
2017-03-20 16:49:59 -04:00
Michael Wright
7121697a5e BZZZZZZT! BZZZZZT! New Vibrator APIs
Replace the existing Vibrator APIs with a new class to encapsulate the
haptic effect information, and add the ability to control the vibration
strength.

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
      runtest systemui-notification
      Manual testing with $T/google_experimental/users/michaelwr/Vibrator

Bug: 30961353

Change-Id: Idbb9864a7b084c85e7b7de3257a0e6b40d9d91d6
2017-03-20 16:09:51 +00:00
Julia Reynolds
d0a5b1684a Don't backup deleted channels.
Change-Id: I58a23700c9f6ccf5d3d6b7fa9f80be78ef9421f0
Fixes: 36381209
Test: runtest systemui-notification
2017-03-20 14:55:16 +00:00
TreeHugger Robot
2903d13157 Merge "Better call emulation for DevicePolicyManagerTest" 2017-03-17 23:11:46 +00:00
Robin Lee
088d7aa9c1 Exfiltrate cert code from DevicePolicyManager
The intent is for this not to cause any behaviour changes, just to
make it easier to see what is going on with the code.

Permissions are checked in DevicePolicyManagerService. All calls to
CertificateMonitor are privileged.

Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases
Change-Id: I98224087315a62234732f08b53fe91884be86386
2017-03-17 19:44:53 +00:00
Robin Lee
2c68dadb20 Better call emulation for DevicePolicyManagerTest
Let's have several separate contexts instead of doing strange things
with package names in one monolithic context representing every single
user on the device at once, sometimes multiple times in the same call.

Syntax looks like:

        runAsCaller(callerContext, dpms, (dpm) -> {
            assertSomething(dpm.doSomething(caller, param));
        });

When a caller calls into DevicePolicyManager here's what happens:

PRE

- a new DevicePolicyManager is created with the caller context
- service context callingIdentity is saved
- the callingUid, callingPid, and callingPermissions are added to the service context

TEST

- client-side test code interacts with DevicePolicyManager using the caller context
- server-side coder under test runs as DevicePolicyManagerService using the service context

POST

- service context callingIdentity is restored to what it was before the test.

This should be easier to reason about.

Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases
Change-Id: I148e3f298b0a958639ce261e9cf91f6eb49fae4d
2017-03-17 19:44:46 +00:00
Andrii Kulian
c1b59ed73e Merge "Separate global and override config sent to client" 2017-03-17 15:39:37 +00:00
Andrii Kulian
446079600e Separate global and override config sent to client
There is some flakiness in View#onConfigurationChanged callback -
if ViewRootImpl receives config update earlier than ActivityThread,
it may not detect the configuration change and skip inner updates.
Also now ViewRootImpl assumes that it receives the global config as
a param, but instead it gets merged config from WM. This means that
ViewRootImpl#sConfigCallbacks was sending incorrect values to the
recipients.

This CL switches to sending global and override configuration to the
client separately. Also in case if there is a corresponding activity,
it first updates it and waits for update callback to ViewRootImpl.
This way global config and override config for activity will always
be set first and resources will be updated before inner state of
ViewRootImpl is updated.

Bug: 35870157
Bug: 34164473
Test: android.server.cts.ActivityManagerDisplayTests
Test: testOnMovedToDisplayCallback
Change-Id: Ic9e7541cf25ecfac6ec90e48f7efb0ece91f657e
2017-03-16 19:13:02 -07:00
Bryce Lee
6b9b130c98 Merge "Fix AppWindowTokenTests#testLandscapeSeascapeRotationByPolicy" 2017-03-16 21:39:21 +00:00
TreeHugger Robot
587b60282e Merge "frameworks/base: Add APCT tests to the device-tests suite." 2017-03-16 17:35:12 +00:00
Julia Reynolds
9bfba59417 Better deletions
- Allow apps to delete notification groups (which cascade to delete all
channels therein)
- Allow apps to get their groups, so they know what they might want to
delete
- Don't throw if someone tries to delete something that already doesn't
exist.

Change-Id: I5f6e25497c5da1e57b52737586e86097332f88f9
Fixes: 36245468
Fixes: 36127382
Test: runtest systemui-notification, cts
2017-03-16 14:32:50 +00:00
Julia Reynolds
41103f4212 Support for showing deleted channel count in settings.
Bug: 36119790
Test: runtest systemui-notification
Change-Id: Ie30243314d64ded66267d0dc85cc0ad940d917f8
2017-03-16 14:24:17 +00:00