2076 Commits

Author SHA1 Message Date
David Stevens
4693956388 Compute the focused window in display focus order
A WindowContainer's children are sorted so the focused child is at the
end of the list, so RootWindowContainer needs to iterate from end to
start when looking for the focused window.

Bug: 36590788
Test: DisplayContentTests#testFocusedWindowMultipleDisplays
Change-Id: I56e6b7d2054bc1e74b54a4f99706a08d278fa2e1
2017-03-27 11:07:22 -07:00
Wale Ogunwale
5e5a68dc06 Fixed issue with SCREEN_ORIENTATION_BEHIND not working correctly
If an app specifies SCREEN_ORIENTATION_BEHIND, then use the orientation
of the app behind it regardless of the visibility state of the app
behind.

Fixes: 35281868
Test: bit FrameworksServicesTests:com.android.server.wm.WindowContainerTests
Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowTokenTests
Test: bit FrameworksServicesTests:com.android.server.wm.TaskStackTests
Change-Id: Ieba4e4bb1a7f47cd6f082491d37fcabcf5bd5199
2017-03-27 11:02:54 -07:00
Sudheer Shanka
deeb08fdcb Uncomment a test.
It was commented earlier because of a crash. Since that issue has been
fixed, uncomment the test.

Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
Change-Id: I5f2b1b0bffe032633f42c8c34ed8a7ae5a3dfc10
2017-03-27 10:57:01 -07:00
Sudheer Shanka
d292c15558 Merge "Update AMS to use NetworkManagementInternal.isNetworkRestrictedForUid." 2017-03-25 08:01:13 +00:00
Sudheer Shanka
c9d150dcbd Merge "Add NetworkManagementInternal.isNetworkRestrictedForUid." 2017-03-25 08:00:39 +00:00
Amin Shaikh
d601360904 Parse NotificationChannel ID meta-data.
- Add this new meta-data field on NetworkRecommendationProvider to NetworkScorerAppData

Bug: 36571359
Test: runtest frameworks-services
Change-Id: Ic8c594bea406fc5183a4919b808bce5159912650
2017-03-24 16:08:32 -07:00
TreeHugger Robot
84acb2e042 Merge "Added support for maxAspectRatio manifest attribute." 2017-03-24 22:42:16 +00:00
Phil Weaver
582fae1cf4 Merge "Restructure a11y shortcut settings" 2017-03-24 22:31:18 +00:00
Wale Ogunwale
55ddf8f9e5 Added support for maxAspectRatio manifest attribute.
- Allows an app to specify the maximum aspect ratio it supports.
- Support for overriding configuration and bounds at the activity
record and app window token level.

Test: cts/.../run-test CtsAppTestCases android.app.cts.AspectRatioTests
Test: bit FrameworksServicesTests:com.android.server.wm.WindowContainerTests
Test: bit FrameworksServicesTests:com.android.server.wm.WindowFrameTests
Bug: 36505427
Bug: 33205955
Bug: 35810513
Change-Id: Ib2d46ed0c546dd903d09d6bb7162a98bd390ba81
2017-03-24 13:48:40 -07:00
Sudheer Shanka
5918c6700b Update AMS to use NetworkManagementInternal.isNetworkRestrictedForUid.
And add global setting WAIT_FOR_NETWORK_TIMEOUT_MS.

Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
      cts-tradefed run singleCommand cts-dev --module CtsHostsideNetworkTests -t com.android.cts.net.HostsideRestrictBackgroundNetworkTests
      runtest -c android.provider.SettingsBackupTest frameworks-core
      and manual

Change-Id: I6949cd517255670e2ce21ab2de24271082461b11
2017-03-24 13:05:27 -07:00
Sudheer Shanka
62f5c17837 Add NetworkManagementInternal.isNetworkRestrictedForUid.
This will be used by the ActivityManagerService to decide if
an app needs to block for network or not.

Bug: 27803922
Test: runtest -c com.android.server.NetworkManagementInternalTest frameworks-services
      cts-tradefed run singleCommand cts-dev --module CtsHostsideNetworkTests -t com.android.cts.net.HostsideRestrictBackgroundNetworkTests
      and manual

Change-Id: I9e62406e2638f70497b43b5b41607df41aefd66c
2017-03-24 12:33:15 -07:00
TreeHugger Robot
0795bf8d62 Merge "Hook up data saver to battery saver." 2017-03-24 04:55:15 +00:00
Colin Cross
770324964a Enable multidex for dx
Enable multidex for dx where it is already enabled for jack.

Test: m -j ANDROID_COMPILE_WITH_JACK=false FrameworksServicesTests
Change-Id: I55a6951ef471930e7737d9f93aaaffb567d4a580
2017-03-23 18:08:41 -07: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
Phil Weaver
ce687c5e4a Restructure a11y shortcut settings
Separating the shortcut on/off from the shortcut service.
Enabling the shortcut to work from the lock screen if the
user wants it to.

Bug: 35872328
Bug: 35219988
Bug: 35443593
Test: Adjusted tests for shortcut controller, manually
activated shortcut in a variety of conditions.
Change-Id: Id39d33ec62eb5f11b76b2972089167dc7d4c625b
2017-03-22 16:36:12 -07: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