Commit Graph

33 Commits

Author SHA1 Message Date
lumark
7570cac60e Propogate per-display IME status to SysUI
CL [1] introduced SystemUI to support updating IME window status per
display. (i.e. IStatusBarService#setImeWindowStatus left TODO item to
add displayId parameter to select the target display.)

For IMMS, we applied this API base on current token's displayId, and refined
the code flow in Sysui to reset IME window state for non-target display's
NavBar when single IME switch to another display case.

And make sure some cases in IMMS should reset IME window status:
- When current method unbind.
- When current top window focus display is not same as current token's display.
  (That means the input session may connected but IME window not
  yet attached. Note that it doesn't include external display without
  system decoration and show IME window on default display case since it
  is intentional behavior and we still need to update status for this
  case.)

Also added testSetImeWindowStatusWhenImeSwitchOnDisplay in
NavigationBarFragmentTest to enhance the ability of verifying external
navigation bar.

[1]: 24e7a9fdb5

Bug: 127309955
Bug: 117478341
Test: atest NavigationBarFragmentTest
Test: manual as below steps:
      - Pre-condition:
          1. Enable desktop mode.
          2. Create simulated display.
      - Use case 1):
          1. Launch an activity with input field on simulated display.
          2. Bring up the IME there, expect back key icon on external
             NavBar will changed when IME bring up.
          3. Tap on primary display or launch an activity there.
	     (or pressing home key)
          4. Expect IME will hide & back key icon on external NavBar will
             set back.
      - Use case 2):
          1. Launch activity with input field on default display.
          2. Tapping EditText in activity on default display.
	  3. Expect IME will bring up here and back key icon on default
	     display will changed when IME bring up.
          4. Launch activity without input field in external display.
	     (i.e. clock app)
          5. Expect Both Default & external display's nav bar back key icon
	     will set back.

Change-Id: Ia414b8aea631e295cccd6f6da44d04bad16545c7
2019-04-19 13:33:21 +08:00
Adrian Roos
11dfd279a3 WindowInsets: populate system gesture and tappable element insets
Also fixes an infinite recursion when invoking
TestableContext.(un)registerComponentCallbacks().

Test: atest WindowInsetsPolicyTest
Bug: 126511573
Change-Id: I5c9f40054493a83746bce6124d72412e8eb8a0d1
2019-04-01 15:46:13 +02:00
Brett Chabot
84151d91f7 Migrate frameworks/base/tests/testables and its users to androidx.test
See go/jetpack-test-android-migration

This is the internal version of AOSP change aosp/908373

Test: m -j TestablesTests NetworkStackTests FrameworksServicesTests SystemUITests FrameworksUiServicesTests ExtServicesUnitTests WmTests FrameworksCoreTests

Exempt-From-Owner-Approval: automated package name refactoring; already reviewed on AOSP
Change-Id: Ib04d80954bd8536914d88c66b28e6632e60a6245
2019-03-01 16:54:09 +00:00
Jason Monk
9424af7315 Add support for dagger injection with fragments
Convert NavigationBarFragment as a proof of concept and remove all
references to Dependency from NavigationBarFragment.

Test: atest SystemUITests
Change-Id: I0cdb5bc6ac455fce91e67b9e449cb7b78b1da9a4
2018-12-19 16:07:46 -05:00
Kweku Adams
00e3a37e1a Initial unit test for DeviceIdleController.
This just tests the standard progression into deep idle mode. Exit
conditions and light idle flow is not tested yet.

Bug: 116512267
Test: atest com.android.server.DeviceIdleControllerTest
Change-Id: I015c10871cd00d7a6be19c0b13fd4b3926c9fdf0
2018-10-03 14:01:27 -07:00
Jason Monk
759e91212d Disable main looper holding
It might make failures more clear

Test: runtest systemui
Bug: 110417074
Change-Id: I9880998af42016b9d625cc3e890a94b282f49df0
2018-07-20 16:12:46 -04:00
Jason Monk
e1c0c2cb8d Fix leak where system held onto slice providers
Test: uiservicestests
Bug: 110985973
Change-Id: Ie8fab3c7b8c22d302825fb147d2c3468f9ae7172
2018-07-03 11:08:32 -04:00
Jason Monk
1e352f4c34 Fix testable looper threading
In the case where an annotation was not used and the TestableLooper
was manually created, then the messages would be executed on the wrong
thread.

Also switch some handlers over to async, might save us a little time.

Test: runtest --path frameworks/base/tests/testables
Bug: 79550837
Change-Id: I70a36449ae08eb5799e2dad41a5d258bb51a3fd3
2018-05-16 10:15:33 -04:00
Adrian Roos
3150dbf7a5 WM Tests: Use a separate WindowManager instance per test
Fixes a bunch of flakes, where the WindowManagerService instance
was reused between tests, which caused delayed callbacks from a
previous test affecting state of a future test.

Also introduces a DexmakerShareClassLoaderRule to manage
the 'dexmaker.share_classloader' property instead of sprinkling
error prone System.setProperty() invocations all over the tests.

Change-Id: Ic9445d1b2cef594e79365c425632aabced6343a9
Fixes: 76111404
Fixes: 75991352
Fixes: 75991878
Fixes: 75992153
Test: atest services/tests/servicestests DexmakerShareClassLoaderRuleTest packages/SystemUI/tests packages/SystemUI/shared/tests
2018-03-29 21:27:47 +00:00
Jason Monk
1fc931a38a Switch to inline mockito for a bunch of tests
So we can mock final stuff

Test: The tests
Change-Id: Ia3a47c6655c4b0b9af0aea0ee6f8f6cb9ebaab09
2018-02-18 13:02:25 -05:00
Julia Reynolds
437cdb1464 Inline noti blocking is now in the form of a question
And has an 'undo' flow that matches snoozing.

Test: runtest systemui
Bug: 63927402
Change-Id: Idc17b8d950bc3da7ec9fe035dc8a65146d12c456
2018-01-10 12:56:57 -05:00
Jason Monk
d01cef91b0 Add TestablePermissons, which allows basic control
Test: runtest --path frameworks/base/tests/testables
Change-Id: I8db323cfc26f592e2e002c9328ab97bc130d559b
2017-12-08 09:49:08 -05:00
Adrian Roos
e1856fe710 WM: Add PhoneWindowManagerLayoutTest
Test: runtest -x services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java
Change-Id: I85af4bdd023a274233362d42628de19483b0c4ea
2017-11-28 14:11:09 +01:00
Jason Monk
338ef17396 Merge "Add system to avoid a crash stopping tests from running" into oc-dr1-dev am: f10fcafcdf
am: 8a9769d60f

Change-Id: I46ef31c53bdfa4793aa00455396dd63330d0061d
2017-06-28 13:51:58 +00:00
Jason Monk
c429f690e5 Add system to avoid a crash stopping tests from running
Add a system such that when a crash happens on the main thread, it is
delayed until the tests complete, then thrown.

Also mark some old flaky tests as not flaky as they should be good
now.

Test: runtest systemui
Change-Id: Ic18a38daf4a93dab63549d834fa00f295644fbf1
Fixes: 62935720, 62251903, 62529569
2017-06-27 14:48:45 -04:00
Siarhei Vishniakou
3998a5ccc6 Merge "Revive DeadZone" into oc-dev am: b278424fa6 am: 305fe47d65
am: d5c0ef9467

Change-Id: Iec82102d862097ef3242da9103996afe94f0909c
2017-06-20 00:11:45 +00:00
Siarhei Vishniakou
305fe47d65 Merge "Revive DeadZone" into oc-dev
am: b278424fa6

Change-Id: I5a06302eaad1e955aaea6ae8d2785c0b12e53cc4
2017-06-19 23:59:46 +00:00
Siarhei Vishniakou
6ad0e39f33 Revive DeadZone
Override dispatchTouchEvent for the root FrameLayout
of NavigationBar to process ACTION_OUTSIDE MotionEvents
and dispatch directly to DeadZone to keep track of the
most recent outside tap.
Clarified documentation of ACTION_OUTSIDE behaviour.

Bug: 37552674
Test: open IME, tap any key, then quickly tap on top half
of the home button. The home button tap is ignored
and device does not go to homescreen.

Change-Id: Icb5cf6c76959f3514b8b94c09e38cc5434f31b23
2017-06-19 14:06:21 -07:00
Julia Reynolds
b852e56668 Migrate managed services from setting to policy xml
Change-Id: Ie20f91dbdd0ba6b57b5909cbf0152a32754fe02d
Fixes: 62263757
Test: runtest systemui-notification, cts AudioManagerTest,
cts-verifier DND tests, verify bug reports after toggling
access for various types of managed services, verified
default approved services aren't renabled on boot; verified that
they are reenabled after a device reset, verified that
settings are migrated after a restore from OC backup.
2017-06-19 17:43:30 +00:00
Jason Monk
5070e5b4b3 Merge "Add checks against incorrect context use in sysui tests" into oc-dev am: 227e65d818
am: b629460f33

Change-Id: I5695d4b2361bdf4ec9abe054418780572e660d2a
2017-06-01 20:22:03 +00:00
Jason Monk
893f0bdcb7 Add checks against incorrect context use in sysui tests
Fix incorrect usages found by this check.

Test: runtest systemui
Bug: 62251903
Change-Id: I45a762f96838e617833c1cbe003e583087bb8176
2017-06-01 11:21:14 -04:00
Chris Wren
e96b36922f Merge changes from topic 'b/36021111' into oc-dev am: 69ab8e1d56
am: 68c7ccc94d

Change-Id: Iaa6782cb3354c7ac0219ea18b254577ecf0d9733
2017-05-12 08:44:46 +00:00
Chris Wren
629c20c999 extend TestableSettingsProvider to multiuser
Bug: 36021111
Test: runtest -x frameworks/base/tests/testables

Change-Id: I13dc2b33a39a01954034fa3d69ae9645d23c3304
2017-05-11 17:17:15 -04:00
Jason Monk
0c408008f1 Try to add some more documentation to testables
Test: runtest --path frameworks/base/tests/testables/tests
Change-Id: I3dc39f05c3b91929a7d37b28879e31fb699f7334
2017-05-03 15:44:18 -04:00
Jason Monk
77f1b05fb0 Add TestableResources
Makes it easy to add or change values of resources from tests.

Test: runtest --path frameworks/base/tests/testables/tests
Change-Id: Iaedff3d4ce9eaf9f270e7c62bc8c1634bd3519ec
2017-05-03 11:21:03 -04:00
Jason Monk
1660a27b5d Fix flaky test?
- Fix testAttachDetach, process more messages so it actually
   does attach and detach
 - Don't inflate Clocks in QSFragmentTest because they are doing
   something weird...

Test: runtest systemui
Change-Id: I05360630ee8d96158b6ab36660f20588ad158a28
Fixes: 37773362
2017-04-28 15:53:59 -04:00
Jason Monk
2cddbcaa0f Merge "Guard against incorrect context use." into oc-dev 2017-04-27 13:46:54 +00:00
Jason Monk
f06a317039 Guard against incorrect context use.
Instead of just having random tests fail, fail all the tests with a
slightly more useful message.

Also remove all the code around acquiring and contention, now that
we have a test rule in place for TestableContext, we can just use
that for cleanup and have a simple copy-on-write provider.

Test: runtest -x frameworks/base/tests/testables && runtest systemui
Change-Id: I907da23730a4a96cfa2bb112100a06980f01b078
Fixes: 37302051
2017-04-25 21:38:40 +00:00
Jason Monk
745d0a8b77 Revert "Revert "Integrate new looper apis into testables""
This reverts commit fd8f615953.
+ some minor adjustments.

Test: runtest systemui
Change-Id: Ie4349fcfb2aadbbd8826506faa8a6fb1ecd5b589
2017-04-25 13:49:58 -04:00
Jason Monk
64b214ea16 Have QS fragment keep track of some state on recreate
Test: runtest systemui
Change-Id: I1cf84a0943092fcfc5428fcfccb4a887a83b294b
Fixes: 35205198
Fixes: 36592148
(cherry picked from commit 78187249c3)
2017-03-28 18:01:50 +00:00
Jason Monk
fd8f615953 Revert "Integrate new looper apis into testables"
This reverts commit f715f417d2.

Change-Id: I4c0c12d8687426cecccf0f8dad710ea42699727b
2017-03-24 12:44:34 +00:00
Jason Monk
f715f417d2 Integrate new looper apis into testables
Test: runtest --path frameworks/base/tests/testables
Change-Id: Ic12c85ecbd9534a676bd2d7f8643a0c2b4b849b2
2017-03-23 14:52:10 -04:00
Jason Monk
340b0e5216 Move out test utilities to a Testables library
Test: runtest --path frameworks/base/tests/testablets/tests
        && runtest systemui

Change-Id: Ideef4aef5f26136b1741c556b9be5884f38842a0
2017-03-14 17:17:54 -04:00