1457 Commits

Author SHA1 Message Date
TreeHugger Robot
6b4061f895 Merge "Have forAllWindows return IME windows in order with IME target" 2016-12-03 02:49:12 +00:00
Phil Weaver
2f165944ce Support continuing dispatched a11y gestures.
Test: Ran the tests in this CL, as well as new CTS tests for
the new API.

Bug: 29477207
Change-Id: Ie5aba553286e954f7afe76ccfa97a7e8be9d75af
2016-12-02 15:52:38 -08:00
Wale Ogunwale
3c1170d849 Have forAllWindows return IME windows in order with IME target
If there is an IME target make sure to return the IME windows next
to the IME target when processing WindowContainer.forAllWindows().
Several users of forAllWindows are expecting this to be the cases so
it is close to the visual order.

Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests
Test: bit FrameworksServicesTests:com.android.server.wm.WindowLayersControllerTests
Change-Id: I737f88ca607ab2694391419d0d38060c03b53840
2016-12-02 14:44:52 -08:00
TreeHugger Robot
0730df7369 Merge "Allow some app windows to display above the IME." 2016-12-02 19:55:52 +00:00
Fyodor Kupolov
cf81eac793 Merge "Test permission grants for all privapps" 2016-12-02 19:02:29 +00:00
Michal Karpinski
70444d3ad5 DO NOT MERGE Extending DNS event reporting
This adds hostname, array of addresses, total count of IP addresses
and uid to the existing pipeline.
Currently ignores the new data it receives, further work will be
done in the subsequent CLs.

Test: for now just the benchmarking, in the future unit and CTS

Bug: 29748723

(cherry picked from commit 14c9d2d0df7fab2b0470c3c404f600d87d4f0f93)

Change-Id: I3941b8d6fc1dd578e2af6ed4d3c3d0a722c39918
2016-12-02 17:21:28 +00:00
Makoto Onuki
5436546589 Merge "ShortcutManager: Floating shortcuts shouldn't have target activities." 2016-12-02 16:34:59 +00:00
Wale Ogunwale
ca9e061256 Allow some app windows to display above the IME.
- Display child windows of the current IME target above the IME.
- Display app windows above the current IME target above the IME.

Regression in the functionality was introduce in
I6f8bf15ba246fac69c4a496ebb1d9e0b9b6a95a2 when we switch away from using
the window list for z-ordering and using the hierarchy which has the IME
above all app windows.

Change-Id: I399aab7fd5ad7327ef6bc29d48f6d9bf48a6ac6c
Fixes: 33128382
Test: bit FrameworksServicesTests:com.android.server.wm.WindowLayersControllerTests
2016-12-02 07:45:59 -08:00
Michal Karpinski
3db0a14ab0 Merge "DO NOT MERGE Rename the DnsEventListenerService to NetdEventListenerService" into nyc-mr2-dev 2016-12-02 09:26:31 +00:00
Fyodor Kupolov
a97c9066a2 Test permission grants for all privapps
Test that requested signature|privileged permissions are granted to all privileged apps.
If the mode is enforcing, also make sure permissions are whitelisted.

Test: test passes
Bug: 31008485
Change-Id: Id7f007a79477c46f40c12765873c563df6bc92cf
2016-12-01 16:11:24 -08:00
Makoto Onuki
106ff7a0a1 ShortcutManager: Floating shortcuts shouldn't have target activities.
Previously, even floating shortcuts (pinned but not dynamic nor
manifest) had target activities.  Now we're going to allow headless
apps to have pinned shortcuts, in which cases shortcuts won't have
target activities, let's just always remove target activities
from floating shortcuts.

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
... to Test8.

Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutManagerTestCases
Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutHostTestCases

Change-Id: I10e5b87338cafb90e6566b3526f892c5330c73e9
2016-12-01 23:09:52 +00:00
Makoto Onuki
b36c45fe30 Fix issue with apps restored to lower versions. am: fac592f64c
am: affadd52af

Change-Id: I159f53023179cb67b7225969f4c7220ddd0c03dc
2016-12-01 21:02:35 +00:00
Makoto Onuki
affadd52af Fix issue with apps restored to lower versions.
am: fac592f64c

Change-Id: I01601d1638a1ad23dcf2c57df75b81819ee3dce7
2016-12-01 20:57:03 +00:00
TreeHugger Robot
325fa50d8d Merge "Allow setting managing organization for the device" 2016-11-30 19:25:33 +00:00
Fyodor Kupolov
fd4f73c76c Merge "Support disabled/log/enforce in ro.control_privapp_permissions" 2016-11-30 18:50:11 +00:00
Bartosz Fabianowski
365a3db470 Allow setting managing organization for the device
The Profile Owner of a managed profile can set a string that will be
shown in the UI to identify the organization managing the profile.
This CL extends the functionality to the Device Owner of a managed
device.

Bug: 32692748
Test: DevicePolicyManagerTest unit test + CTS test in separate CL

Change-Id: I47295da2fd6485ebf0e890da13990a044accaf17
2016-11-30 18:28:10 +01:00
Bartosz Fabianowski
dd7f8dafd8 Allow DO to access DevicePolicyManager.isDeviceManaged()
This CL makes DPM.isDeviceManaged() accessible to the DO so that it
can be CTS-tested.

Bug: 32692748
Test: Device policy manager unit test + CTS & GTS in separate CLs

Change-Id: I5326e86b0ffee81d04bd48f0267044463a899b78
2016-11-30 11:09:22 +01:00
TreeHugger Robot
9f9e453b64 Merge "Unit test for getBindDeviceAdminTargetUsers" 2016-11-30 09:58:11 +00:00
Fyodor Kupolov
d072d14154 Support disabled/log/enforce in ro.control_privapp_permissions
Possible values:
 - disable - the feature is completely disabled - signature|privileged
   permissions are granted automatically without logging. Default behavior
 - log - log grants of signature|privileged permissions to privileged apps
   that were not whitelisted in /etc/permissions/privapp-permissions.xml.
 - enforce - enforce that only whitelisted permissions are granted.
   Only devices with ro.control_privapp_permission=enforce will pass CTS tests.

Test: Manual - device boots, permissions are granted
Bug:31008485
Change-Id: I24e0c75d2efc326c9fbec35efc92489313667212
2016-11-29 17:20:00 -08:00
TreeHugger Robot
84884684fe Merge "Some cleanups for window cropping functionality." 2016-11-30 00:24:16 +00:00
Robert Carr
fbbde85b04 Some cleanups for window cropping functionality.
At a high level I had two sorts of goals:

1. To remove the weird pinned logic in setSurfaceBoundariesLocked
2. To seperate base crop calculation, and animation exceptions, between
   window state and window state animator.

Itemized changes are as follows:

1. Rename updateSurfaceWindowCrop and calculateSurfaceWindowCrop to
   applyCrop/calculateCrop. It doesn't feel that "SurfaceWindow" was
   adding much.
2. Split screen space and window space (final v non) clip rect
   computation, to make clarity about when each one should be used.
3. Eliminate weird case for pinned stack in setSurfaceBoundaries by
   building it in to calculateFinalClipRect.
4. Extract calculateSystemDecorRect to WindowState as it mostly accesses
   window members.
5. Extract part of calculateCrop to WindowState as
   "calculatePolicyCrop". This was the part that fills mSystemDecorRect.
6. Extract wallpaper animation logic outside of calculatePolicyCrop

Test: bit FrameworksServicesTests:com.android.server.wm.WindowFrameTests
Change-Id: I8ff1dc6ec1206a34994f50ba44d765ab619efbff
2016-11-29 13:15:48 -08:00
Kenny Guy
58feeac96b Merge "Allow overriding max profile in debugable builds." 2016-11-29 20:12:17 +00:00
TreeHugger Robot
b57bd791bf Merge "Add user affiliation APIs" 2016-11-29 16:09:10 +00:00
TreeHugger Robot
d25cf04e98 Merge "Add explicit method to dismiss Keyguard" 2016-11-29 14:30:46 +00:00
Kenny Guy
02c8990bd6 Allow overriding max profile in debugable builds.
Support a system property on debugable builds to
override the max number of managed profiles to
allow easier dogfooding of multiple profiles.
Support 3 different badge colours for managed profiles.

Bug: 30473760
Test: runtest -c com.android.server.pm.UserManagerServiceCreateProfileTest frameworks-services
Test: runtest -c com.android.server.pm.UserManagerServiceUserInfoTest frameworks-services
Test: manual - attempting to create 2 profiles with adb fails, passes once I set the property.
Change-Id: Ie7fb19048a04a01572666f229283152254d0ffc3
2016-11-29 14:09:37 +00:00
Esteban Talavera
c9bb378a8b Add user affiliation APIs
Make setAffiliationIds public so that it can be used for COMP.
That way we can allow network logging and other features to
work on devices that have a DO and a managed profile.
Those features are currently restricted to single user devices but we'll
open them up to devices where all users are affiliated.

Also create a getter for that API.

Bug: 32326223
Test: m FrameworksServicesTests &&
 adb install \
   -r ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk &&
 adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest \
   -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ie443be887a6ca61a7f7a07e137757dceab7eb3d3
2016-11-29 12:15:09 +00:00
Fyodor Kupolov
fd6f4fb264 Parse packages in parallel
Introduced ParallelPackageParser. Parsing requests are processed by a
thread-pool (currently 4 threads). At any time, at most 10 results are kept
in RAM. This is enforced by the blocking queue.

scanDir has become a two-stage process:
1) Collects files for parsing and submit them to the parallel parser
2) Sequentially take elements from the parsing queue and process them by
   calling scanPackageLI (as before)

Test: manual - device boots, all packages are parsed
Test: ParallelPackageParserTest passes
Bug: 30792387
Change-Id: I07a64da4d83e355b2b1f1ab350e6d8087dfd2feb
2016-11-28 10:32:34 -08:00
Tony Mak
2f26b79eea Unit test for getBindDeviceAdminTargetUsers
Was meant to write test for bindDeviceAdminServiceAsUser, but
it can't be done without having tests for
getBindDeviceAdminTargetUsers first as bindDeviceAdminService depends
on getBindDeviceAdminTargetUsers.

A bit shocked by we didn't have any managed profile tests in
DevicePolicyManagerTest. Added managed profile support in the CL.

Bug: 32764274

Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java

Change-Id: If412e4f44c3ae998f69e17411f2503a97f80149f
2016-11-28 17:54:51 +00:00
Bartosz Fabianowski
8d76e72251 Allow DO to access bookkeeping information about its own actions
The getLastSecurityLogRetrievalTime(), getLastBugReportRequestTime()
and getLastNetworkLogRetrievalTime() methods are meant to be used by
system code. However, there is no harm in allowing the DO to access the
information they return - because it is information about actions that
the DO itself took.

The advantage of opening up these methods to the DO is that we can
CTS-test them.

Bug: 32692748
Test: DevicePolicyManager unit test + CTS test in separate CL

Change-Id: I1470fca2a82b9955f7aed5e8b50220bea8b56fc9
2016-11-25 12:36:20 +01:00
Michal Karpinski
7f9014bb9d DO NOT MERGE Rename the DnsEventListenerService to NetdEventListenerService
The service will be extended to include listening for connect events as well.

Test: this is just a renaming change

Bug: 29748723
Change-Id: I073187e354fc987222ec0108d7f0d3a422397d5e
2016-11-24 17:05:02 +00:00
Jorim Jaggi
058b69e58a Merge "Revert "WindowList be gone!"" 2016-11-23 17:03:50 +00:00
Jorim Jaggi
ffa5a9de0c Revert "WindowList be gone!"
This reverts commit 4551c8bbee4114fa884938dbe90ac0d06ca78fc5.

Reason for revert: Broke a lot of things!

Bug: 33098800
Bug: 33098294
Change-Id: I307b1c7ee39445d6155a4bbce2bf5f289de55285
2016-11-23 16:59:19 +00:00
Jorim Jaggi
241ae10b21 Add explicit method to dismiss Keyguard
The flag is a bit clunky for most cases, and a method is more
clear.

Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
android.server.cts.KeyguardTests

Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
android.server.cts.KeyguardLockedTests

Test: runtest systemui -c
com.android.systemui.keyguard.DismissCallbackRegistryTest

Bug: 30961403
Bug: 27422134
Change-Id: I39de90c7cfecd99350a74f72cd76418e337f2b79
2016-11-23 16:27:35 +01:00
TreeHugger Robot
3f5de07e92 Merge "Add visibility table to account manager database." 2016-11-23 00:09:51 +00:00
Dmitry Dementyev
e5768621de Add visibility table to account manager database.
Bug: https://b.corp.google.com/issues/33046496
Test: unit tests.
Change-Id: I92e94fb2185dbba965a5328048ada59fc2b5512a
2016-11-22 13:58:26 -08:00
Wale Ogunwale
23c25e7a3c Merge "WindowList be gone!" 2016-11-22 14:56:49 +00:00
Fyodor Kupolov
d4f9d37424 Merge "Presubmit test for PackageManager" 2016-11-21 23:58:01 +00:00
Makoto Onuki
fac592f64c Fix issue with apps restored to lower versions.
When restoring to a new device, if a restored app is not compatible
with the old version (e.g. lower version or different signature),
then we won't restore shortcuts, which is working as expected.

However when it happens, the shortcut manager forgot to "un-shadow"
the package information, causing the app to not have shortcuts at all.

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests

Bug 32999759

Change-Id: I89832360114de0ce1c57d763bcaccab4fdb87b6d
2016-11-21 13:49:31 -08:00
Wale Ogunwale
4551c8bbee WindowList be gone!
The use of DisplayContent.mWindow list to track all windows is
no longer needed as we can now get windows through the window
container hierarchy with methods like forAllWindows. The window
list was also a very complicated logic to understand and maintain,
so it won't be missed :)

Bug: 30060889
Test: Existing tests pass
Change-Id: I590cb33aa0f42bcd4a26ddce102f05e657f54144
2016-11-21 08:17:57 -08:00
Fyodor Kupolov
7cebbc8b22 Presubmit test for PackageManager
Added PackageManagerPresubmitTests. testPrivAppPermissions method
tests that core apps like systemui are getting all requested
signature|privileged permissions.

Test: PackageManagerPresubmitTests passes
Bug: 32935038
Bug: 31008485
Change-Id: I31c5c1a2613b8c1ddf927d2708d0361407342b87
2016-11-18 14:29:29 -08:00
TreeHugger Robot
29993074b0 Merge "Keep track of admin actions for DO disclosures" 2016-11-17 21:40:46 +00:00
Bartosz Fabianowski
b21b241f0f Keep track of admin actions for DO disclosures
This CL adds bookkeeping to DPMS which will allow us to tell the user
in the Settings UI whether/when the admin requested a bug report or
retrieved logs from the device.

Bug: 32692748
Test: Full DevicePolicyManagerTest unit test coverage; end-to-end tests
        will follow as Settings CTS verifier tests

Change-Id: I89728fce4b7e0ff061b354c73caf3742e95a3a3e
2016-11-17 20:52:03 +01:00
Nicolas Prévot
554140fc89 Merge "Check user restriction DISALLOW_REMOVE_USER in isProvisioningAllowed." 2016-11-17 11:35:42 +00:00
Wale Ogunwale
782b247fdb Merge "Fixed issue with IME displaying on-top of nav bar." 2016-11-16 21:58:07 +00:00
Wale Ogunwale
93726a41a0 Merge "Don't include sysUI insets on secondary displays" 2016-11-16 21:56:55 +00:00
Wale Ogunwale
44fbdf5b1e Fixed issue with IME displaying on-top of nav bar.
Caused by some recent refactoring. We now make sure the IME
has the higher animation layer in its base layer of the window
it is targeting.
Also, consolidated some of our test functions.

Bug: 32916670
Test: bit FrameworksServicesTests:com.android.server.wm.WindowLayersControllerTests
Change-Id: I0b1abd6fead981cfc810488cc785261abba5341d
2016-11-16 20:38:50 +00:00
Nicolas Prevot
56400a445f Check user restriction DISALLOW_REMOVE_USER in isProvisioningAllowed.
If DISALLOW_REMOVE_USER is set and there is already a managed profile:
isProvisioningAllowed() should return false

BUG:32629873
Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest -w
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I093bed0a4a54f83decf11716ebfd50dd4f17c089
2016-11-16 12:12:41 +00:00
Andrii Kulian
db8e106fa3 Don't include sysUI insets on secondary displays
Currently there is a single instance of WindowManagerPolicy
used in Window Manager and it is configured according to
primary display settings. Because of that it reports display
size with navigation bar insets even for secondary displays.

This CL adds displayId param, so it can adjust reported metrics
correctly when requested.

Bug: 32910901
Test: android.display.cts.DisplayTest
Change-Id: I14967fc13907c4fde17aed6a769d03cbde3ec1be
2016-11-16 05:04:03 +00:00
Jorim Jaggi
3c9006d842 Merge "Fix that window was not hidden after policy hiding animation" 2016-11-16 00:40:53 +00:00
Jorim Jaggi
af221d16de Fix that window was not hidden after policy hiding animation
When we removed WindowState.isOnScreenIgnoringKeyguard we forgot
to change WindowState.isOnScreen to also check policy visibility.

Test: runtest frameworks-services -c com.android.server.wm.WindowStateTests
Test: Open camera app, make sure status bar is hidden

Change-Id: I780f50c8ed3e675f2fab623fdba4fcfc5b6f1d5b
Fixes: 32890266
2016-11-15 14:59:57 -08:00