1226 Commits

Author SHA1 Message Date
Phil Weaver
a46f009bbf Merge "Add tests for MagnificationController." 2016-11-03 23:11:55 +00:00
Etan Cohen
8402d511c9 Merge "Update service test runner to allow test args" am: 56b92e8191 am: dde9ea21e4 am: 10840d1897
am: be8e13de60

Change-Id: I48302e70e01fb290634f66bd679268fea0ede22d
2016-11-03 20:45:31 +00:00
Etan Cohen
10840d1897 Merge "Update service test runner to allow test args" am: 56b92e8191
am: dde9ea21e4

Change-Id: I59d572e233720ecf0ddc6cbb5893323b563a3241
2016-11-03 20:32:54 +00:00
Etan Cohen
dde9ea21e4 Merge "Update service test runner to allow test args"
am: 56b92e8191

Change-Id: Ib5f44685228bab61d50dea4c5bd226c4b80c2dd1
2016-11-03 20:26:29 +00:00
Etan Cohen
56b92e8191 Merge "Update service test runner to allow test args" 2016-11-03 20:18:53 +00:00
Phil Weaver
89e3ffc66c Add tests for MagnificationController.
Also refactoring the class to make it easier to test and
chaning behavior where the current behavior seemed poorly
defined.

Refactoring:
- Combined all handlers into one.
- Simplified animation to use a ValueAnimator.
- Eliminated ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE
  setting. Move rest of settings reading into mockable class.
- Move callbacks from WindowManager into the main class.
- Pulled out my instrumented Handler from the
  MotionEventInjectorTest into its own class so I can reuse
  it.

Behavior changes:
- Always constraining out-of-bounds values rather than
  refusing to change them.
- Constraining offsets on bounds changes. We previously
  left them alone, even if they were out of bounds.
- Keeping track of the animation starting point. We were
  interpolating between the current magnification spec
  and the final one. This change means the magnification
  animates to a different profile.

Test: This CL adds tests. I've also run a11y CTS.

Bugs: 31855954, 30325691

Change-Id: Ie00e29ae88b75d9fe1016f9d107257c9cf6425bb
2016-11-03 13:00:47 -07:00
Torne (Richard Coles)
ab5d0ba22e resolve merge conflicts of 0d16fa4 to master
Change-Id: I3c01fe6f5439885d28c6d28415004b26845f06b0
2016-11-03 15:09:34 +00:00
Richard Coles
0092dbabe0 Merge "Fix WebViewUpdateServiceTest failures when using Thread without Looper." am: be19fe5e8a
am: 9c47f5c87a

Change-Id: Ia5d867468080e0e48a4e5b3c08b1ee627e16cebe
2016-11-03 14:48:05 +00:00
Richard Coles
9c47f5c87a Merge "Fix WebViewUpdateServiceTest failures when using Thread without Looper."
am: be19fe5e8a

Change-Id: I85e2e13f395dac085616838670c19ddbedc67e9d
2016-11-03 14:42:08 +00:00
Julia Reynolds
3f2e215cd6 Merge "Replace test TODOs with ACTION." 2016-11-03 13:42:29 +00:00
TreeHugger Robot
02e17d27b1 Merge "[DPM] Management and retrieval of network logs" 2016-11-02 23:28:10 +00:00
TreeHugger Robot
82df4ef603 Merge "Added support for window TYPE_PRESENTATION" 2016-11-02 21:50:40 +00:00
Julia Reynolds
1864ff5dae Replace test TODOs with ACTION.
Also call packagemanager less.

Test: runtest
Change-Id: Icff2a5b9e7fff49ef8cf7b643c198707a6089007
2016-11-02 15:58:11 -04:00
Wale Ogunwale
5b6714c2fa Added support for window TYPE_PRESENTATION
Switched presentation feature to use new window TYPE_PRESENTATION
and also add its own window token to the display the presentation
is running on. This is needed as window manager no longer allows
tokens to have windows on multiple displays.

Bug: 32566372
Test: Presentation mode works.
Change-Id: I9c2998311b65640743b8e23ec4f10bf1ffbfd785
2016-11-02 18:25:34 +00:00
Fyodor Kupolov
668868baf5 Merge "Do not exclude partial users that are not being removed" 2016-11-02 16:44:12 +00:00
Geoffrey Pitsch
b879cc614f Move notification tests into separate APK.
This will allow us to hook into a presubmit step without
bringing in the other tests.

Compile notification source directly into test APK, for
faster development.

Test: runtest --path
frameworks/base/services/tests/notification/
Change-Id: I04dbcec892cbd375ba1334f59e6b58bcafe80151
2016-11-02 09:17:27 -04:00
Michal Karpinski
f77ee4f1b7 [DPM] Management and retrieval of network logs
This CL follows up on ag/1530343 and adds:
1) Various network events.
2) Retrieval method in DPM and APIs in DeviceAdminReceiver.
3) Extension of NetworkLogger and it's NetworkLoggingHandler.

Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/NetworkEventTest.java
Bug: 29748723
Change-Id: I42a1a477e7c75c109a3982f809c22732b814e8b2
2016-11-02 09:00:21 +00:00
Jorim Jaggi
5974b4df49 Merge changes from topic 'keyguard_refactor'
* changes:
  The big keyguard transition refactor (6/n)
  The big keyguard transition refactor (5/n)
  The big keyguard transition refactor (4/n)
  The big keyguard transition refactor (3/n)
  The big keyguard transition refactor (2/n)
  The big keyguard transition refactor (1/n)
2016-11-02 02:14:15 +00:00
Julia Reynolds
73481c8837 Merge "Some channel model updates" 2016-11-02 01:20:20 +00:00
Fyodor Kupolov
6e99d3f044 Do not exclude partial users that are not being removed
Otherwise maxSupportedUsers limit can be exceeded by creating users in
parallel.

Test: Manual cmd line + UI guest create/switch/remove + UserManagerTest
Bug: 32485535
Change-Id: I490a70501f3643980bbfb1c95940b9ae3f20ccee
2016-11-01 17:18:59 -07:00
Jorim Jaggi
73294b6cf7 The big keyguard transition refactor (4/n)
Nuke KeyguardScrim

Test: Kill SystemUI while lockscreen is showing, make sure nothing
is visible when being killed.

Bug: 32057734
Change-Id: I9f8d1e5a0e0f968460d8170627a849623c6a7245
2016-11-01 15:36:21 -07:00
Jorim Jaggi
77e1043229 The big keyguard transition refactor (3/n)
Notify activity manager when dreaming showing state changed so
KeyguardController can update the occluded state when the device
is dreaming.

Test: Set dreaming while charging, wait until screen times out,
make sure that dream is occluding Keyguard.
Bug: 32057734
Change-Id: Ied6f485d9b4a1526cb4cd5f0701f86b1ea05830a
2016-11-01 15:36:00 -07:00
Jorim Jaggi
5a108c225a The big keyguard transition refactor (2/n)
Introduce UnknownVisibilityController, which keeps track of apps that
may or may not be visible when launching an activity behind Keyguard.
When Keyguard is occluded and we launch another activity, we don't
know whether we still have to keep Keyguard occluded until the app
has gone through the resume path and issued a relayout call to update
the Keyguard flags.

This class keeps track of that state and defers the app transition
until the unknown visibility of all apps is resolved.

Test:
1) Have an occluding activity that starts another occluding
activity, ensure that there is no flicker.
2) Have an occluding activity while the Keyguard is insecure, start
a DISMISS_KEYGUARD activity, ensure there is no flicker.
3) runtest frameworks-services -c com.android.server.wm.UnknownVisibilityControllerTest

Bug: 32057734
Change-Id: I5145b272722ab8c31dd7c5383286f5c9473e26a4
2016-11-01 14:06:49 -07:00
Jorim Jaggi
fe762344f4 The big keyguard transition refactor (1/n)
The heart of this change are two things:
1) Instead of using the force hide mechanism to hide windows behind
Keyguard, we actually make the activities invisible in activity manager.
2) When Keyguard is going away, we change the visibilities in activity
manager and run an app transition.

At the very core we move the responsibility of hiding activities to
ActivityStack, which checks whether Keyguard is showing, and then
hides all non-show-when-locked activities. For that, we need to check
whether any window of an activity has SHOW_WHEN_LOCKED set. We
introduce a callback from WM -> AM in case these Keyguard flags have
changed.

Furthermore, we decide whether to occlude Keyguard in KeyguardController,
which just checks whether the top activity has SHOW_WHEN_LOCKED set. When
this state changes, we prepare an occlude/unocclude app transition, and
in PWM we just inform the Keyguard about the animation so SysUI can play
along this animations in a mostly synchronized manner.

Since we now use an app transition when unlocking the phone, we get
lockscreen launch animations for free - window manager automatically
waits until the activity is drawn, or directly executes the transition
if there is nothing to animate. Thus, we can remove all the infrastructure
around "waitingForActivityDrawn".

The logic to show/hide non-app windows is moved to policy, and we add the
ability to run animations on non-app windows when executing an app
transition.

Test:
1) runtest frameworks-services -c com.android.server.wm.AppTransitionTests
2) Manually test unlocking Keyguard:
2a) Without security
2b) With security
2c) With security but trusted
2d) Portrait while activity behind is in landscape
3) Test launching things from Keyguard
3a) Without security
3b) With security
3c) Launch camera without security
3d) Launch camera with security
3e) Launch camera with securtiy and trusted
3f) Launch voice affordance
4) Set no notifications on lockscreen, drag down, make sure you get
the correct animation
5) Test clicking "emergency" on bouncer
5b) Test "Emergency info" on emergency dialer
5c) Test clicking edit button on emergency info, should show pattern on
Keyguard

Bug: 32057734
Change-Id: Icada03cca74d6a612c1f988845f4d4f601087558
2016-11-01 13:53:32 -07:00
Julia Reynolds
85769915e7 Some channel model updates
- Apps cannot update their channel settings after creation.
- Importance is required when creating a channel.
- Some method name changes.
- Ranker can't modify fields a user has changed.
- High and Max importance mean the same thing.
- The default channel adopts app wide settings on creation.
- The default channel is limited to importance low once target api is post n mr1
  unless the user changed it.

Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/notification

Change-Id: I73c449a6abe6d709046de79c5c54339cb2edf0b8
2016-11-01 19:31:34 +00:00
Gustav Sennton
86f7bbe134 Fix WebViewUpdateServiceTest failures when using Thread without Looper.
Add some more methods to SystemInterface to avoid calling into the rest
of the framework from WebViewUpdateServiceTests.

Also convert WebViewUpdateServiceTest to use non-deprecated test
utilities.

Test: make sure tests in WebViewUpdateServiceTest pass.
Bug: 32364900
Change-Id: I8cf67568bb7e551e1c011028e0bb4e15c0e9f2bb
2016-11-01 14:39:48 +00:00
Robert Carr
e4ee8f8ab8 Add some more computeFrameLw tests.
This time for producing insets in the fullscreen case.

Test: bit FrameworksServicesTests:com.android.server.wm.WindowFrameTests
Change-Id: I2566572af996f024d4b07c3bac945bc8ef7005b9
2016-10-31 16:40:50 -07:00
TreeHugger Robot
c3a0627f10 Merge changes If8232b90,I3176837e
* changes:
  Deobfuscate computeFrameLw parameters.
  Begin series of computeFrame unit tests
2016-10-31 21:23:30 +00:00
TreeHugger Robot
423af758c9 Merge "Introduced ReadOnlyWindowList" 2016-10-31 21:15:46 +00:00
Wale Ogunwale
f7cab10b79 Introduced ReadOnlyWindowList
7th and Final step in making the modification of a display's
WindowList private to DisplayContent.
ReadOnlyWindowList provides an interface for external classes to
DisplayContent to access the window list without being able to
modify it. This will be important in upcoming CLs where it is
important for us to keep track of when the window list changes.

Bug: 30060889
Test: Manual testing and existing tests pass.

Change-Id: I4de0b258a40fd4b21ef9cc9e3401488f76d25f83
2016-10-31 12:28:13 -07:00
Yorke Lee
fed503cb46 Merge "Add new methods to ITaskStackListener" 2016-10-31 19:05:03 +00:00
Lorenzo Colitti
7072f32b32 Merge changes from topic 'frameworks-net-tests'
* changes:
  Move the connectivity tests to frameworks/base/tests/net.
  De-guava BroadcastInterceptingContext and move it to testutils.
  Move FakeSettingsProvider to a common location.
2016-10-31 04:16:51 +00:00
Yorke Lee
bd54c2aab6 Add new methods to ITaskStackListener
Refactor task change notification logic into a separate class
TaskChangeNotificationController.

Add ActivityManagerService.unregisterTaskStackChangedListener

Add a no-op implementation that clients can subclass to avoid
having to reimplement all new methods when they are added.

Add new methods:
onTaskAdded
onTaskRemoved
onTaskMovedToFront
onTaskDescriptionChanged
onActivityRequestedOrientationChanged
onTaskFinishing

Design doc:
https://docs.google.com/document/d/1IgWZ44rKe9k1CzkjP2Mohv12OgRD1FxH8oLAyzhvCY4/edit#heading=h.yhzl6os0dbo5

Cherry-picked from I8302d6d3baf1ac1ca928765fe203091b9fab4070

Bug: 32277482
Test: Verify that callbacks are called in dummy implementations

Change-Id: I2ac2b870147ef049f3ee05fc5916c99332334526
2016-10-28 14:58:19 -07:00
Robert Carr
16a4e3cbf7 Begin series of computeFrame unit tests
Start with a fixture and some simple unit tests
for WindowState.computeFrame.

Test: bit FrameworksServicesTests:com.android.server.wm.WindowFrameTests
Change-Id: I3176837ee60dbd474f22a3b1857f19b4e82afee7
2016-10-28 13:13:50 -07:00
Wale Ogunwale
07bcab787e Add windows to window tokens in expected z-order
Decouple the logic for adding window to a position in the parent
window token from the position we are adding the window to in the
window list. The window token now adds the windows in order based
on the rules the rest of the system is using which makes the code
a little more straightforward to follow.

Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowTokenTests
Change-Id: Ic9b724fba02279a0c4e92508d39e5e35171b6d8d
2016-10-28 12:54:05 -07:00
Lorenzo Colitti
ecc986d430 Move the connectivity tests to frameworks/base/tests/net.
This will give us a good place to put all the networking tests.

Fix: 31479480
Test: adb  shell am instrument -w -e notClass com.android.server.connectivity.tethering.TetherInterfaceStateMachineTest 'com.android.frameworks.tests.net/android.support.test.runner.AndroidJUnitRunner'  # PASS
Change-Id: I4b389f7f4e33a996885b38670f585e58ca66f777
2016-10-28 17:12:36 +09:00
Lorenzo Colitti
281a17c958 De-guava BroadcastInterceptingContext and move it to testutils.
Removing the static dependency on guava reduces test compile time
by about 20 seconds on a Z840, thus substantially speeding up the
compile/test cycle.

Make FutureIntent public instead of package-private because it is
used directly by NetworkPolicyManagementServiceTest, which as of
this CL is now in a different package.

Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest  # PASS
Test: runtest frameworks-services -c com.android.server.NetworkPolicyManagerServiceTest  # PASS
Test: runtest frameworks-services -c com.android.server.net.NetworkStatsServiceTest  # PASS
Test: runtest frameworks-services -c com.android.server.NetworkManagementServiceTest  # Already failing.
Bug: 31479480
Change-Id: Ifab32c9214e9caab71dbf93b3d3ca88df6f49636
2016-10-28 17:12:36 +09:00
Lorenzo Colitti
7df1a82802 Move FakeSettingsProvider to a common location.
Test: runtest frameworks-util -c com.android.internal.util.test.FakeSettingsProviderTest
Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest
Test: runtest frameworks-services -c com.android.server.retaildemo.PreloadAppsInstallerTest
Test: runtest frameworks-services -c com.android.server.retaildemo.RetailDemoModeServiceTest
Bug: 31479480
Change-Id: I82a1a1a7219cf1385092b84d85eddf9dda90c685
2016-10-28 17:12:31 +09:00
Etan Cohen
31dc3db9a4 Update service test runner to allow test args
Change order of arguments - runner must be last argument.

Test: executed test with arguments
Change-Id: I9e69246281bce9814300fadc7e5d97ecf1a2bad2
2016-10-27 10:34:47 -07:00
Michal Karpinski
8c32fd2d33 Extending DNS event reporting
am: 6e54239e50

Change-Id: I64e6a48fbbaa734447069b073c3499ef71af907c
2016-10-27 17:28:15 +00:00
Michal Karpinski
6e54239e50 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
Change-Id: Ice7db208282934e74f0e1808ffbae96d476c4216
(cherry picked from commit 14c9d2d0df7fab2b0470c3c404f600d87d4f0f93)
2016-10-27 16:39:21 +00:00
Glen Kuhne
8902f81589 Merge "Move ipconnectivity.proto to services-proto.jar" 2016-10-27 16:27:27 +00:00
Hugo Benichi
0ef948d76c Merge "ConnectivityServiceTest: mark flaky test as such" 2016-10-27 05:21:33 +00:00
Hugo Benichi
c8c1027762 ConnectivityServiceTest: mark flaky test as such
This patch extracts into its own independent test a test sub-block looking
for a race condition when not waiting on handlers to become idle:
there is no way to prevent the race from not happening when looking for
it this way. This makes the test flakky.

This new independent test is tagged with @FlakkyTest(tolerance = 3).

Test: ConnectivityServiceTest passes, with higher probability.
Bug: 31479480
Change-Id: Ic0e2ffbe669f2ea8cc62e8a0d4763703368db019
2016-10-27 09:38:54 +09:00
Glen Kuhne
0719940ce4 Move ipconnectivity.proto to services-proto.jar
Moved ipconnectivity.proto from services.core.jar to
framework-protos.jar.
Replaced 'mergeFrom' MessageNano base class calls, with 'parseFrom'
IpConnectivityLog calls.

This solves an issue where the services.jar would conflict with
duplicate nano proto base class definitions in other .jars
(wifi-service.jar).

Bug: 32261442
Test: Existing unit tests pass
Change-Id: I49100935fcae2e85e12eaa7f3462864f3a340b97
2016-10-26 10:18:46 -07:00
Christopher Wiley
34077850ba Merge "Add script to expedite running passing tests" am: 4d1c2922f0 am: 2bb707b1c1 am: c65ca7708a
am: a415d687b7

Change-Id: I7dd927246b912593f3138f6e274ed75d8d260e16
2016-10-25 23:18:58 +00:00
Christopher Wiley
c65ca7708a Merge "Add script to expedite running passing tests" am: 4d1c2922f0
am: 2bb707b1c1

Change-Id: I42f000895fcba0c12c5301578a791ce17668df3d
2016-10-25 23:10:49 +00:00
Christopher Wiley
2bb707b1c1 Merge "Add script to expedite running passing tests"
am: 4d1c2922f0

Change-Id: I1b85b8ffd3f6de26d3226f5b1e1475ad87e8def6
2016-10-25 23:06:51 +00:00
Christopher Wiley
012ab10642 Add script to expedite running passing tests
Developers can run this script from within a shell where they have
source'd build/envsetup.sh and lunched a target.  It builds, installs,
and runs whitelisted test packages.

Bug: None
Test: This script is useful for iterating rapidly on unittests.

Change-Id: I44c32a0f75da1be2c69a8b1a67c0080a68def738
2016-10-25 14:05:29 -07:00
Christopher Wiley
fbc27b1e9e Merge "Add unit tests for Tethering.isTetherProvisioningRequired" am: 836ffa6e1c am: c29f2575f2 am: a7bb5ad809
am: 2ae41619ae

Change-Id: Iee7c8575ee22a494e2657e15e1aaae9b05a37045
2016-10-25 18:43:16 +00:00