Commit Graph

9 Commits

Author SHA1 Message Date
Riddle Hsu
d490c57905 Send fixed rotation adjustments to the associated client
So the real information of display can be adjusted according
to the adjustments for the application started with fixed
rotation transform.

The enabling adjustments may be sent in different ways:
- Launch activity
  The information is bundled with LaunchActivityItem.
- Resume activity or update non-activity window
  Send a standalone FixedRotationAdjustmentsItem.

The disabling adjustments (null) are always sent by
FixedRotationAdjustmentsItem.

Bug: 147213487
Test: AppConfigurationTests#testRotatedInfoWithFixedRotationTransform
      TransactionParcelTests#testFixedRotationAdjustments

Change-Id: I5238888a5c8352db83fc12749f4de2bfabf46026
2020-05-11 22:17:03 +08:00
Winson
0651a24738 Mock sourceDir for ActivityThreadClientTest
This just has to be non-null for the purposes of path
generation. The result is thrown away as the mocked LoadedApk
doesn't actually support updating its info, so this should have
no effect on the test logic.

Bug: 154807103

Test: atest android.app.activity.ActivityThreadClientTest

Change-Id: Id097a0f3be3c8822e679093347c9a0320fdba13e
2020-04-23 09:04:40 -07:00
Andrii Kulian
b9faa03b90 Use START/STOP messages to update visibility
Activity visibility messages simply move the activity to STOPPED or
STARTED state. We can use the lifecycle messages to do the same and
simplify the logic/remove duplicated code.

This CL also removes the option to send STOP message without making
the client invisible and actually calling onStop(). This option
caused a mismatch of the state between server (STOPPED) and client
(PAUSED). Also, in cases when the device was going to sleep, STOP
message was always followed by SLEEP message, which called onStop()
anyway.

Bug: 137329632
Bug: 129750406
Test: AM/WM CTS and unit tests
Change-Id: I487575520ce301bb2f65519f0c0a30b6b9edac0c
2020-01-08 15:29:57 -08:00
Jeff Chang
67335d2307 Remove flaky annotation of ActivityThreadClientTest
Remove flaky annotation on ActivityThreadClientTest since they are
stable from test metrics.

fixes:144675058
Test: atest ActivityThreadClientTest
Change-Id: I67e95f955f2b73721a35ceb7748271977e607f8b
2020-01-03 16:47:56 +08:00
Jeff Chang
6d12c9c940 Attempt to fix the ActivityThreadClientTest test case failed.
ActivityThreadclient test case failed in emulator environment, but they
always work successfully on devices. This CL try to fix the test
case failed by mocking the LoadApk#updateApplicationInfo function
because the purpose of the test focuses on activity client state changes
behavior.

Bug: 144675058
Test: atest FrameworksMockingCoreTests:android.app.activity.ActivityThreadClientTest
Change-Id: I8bec296b65a4e688166fde0f2803bdb06d981a30
2019-12-26 22:02:46 +08:00
Jeff Chang
e52b03f85d Add ActivityThreadClientTest to presubmit
Add tests to presubmit and mark as flaky. We will remove
the flaky annotation if stable.

Bug: 143153552
Test: atest FrameworksMockingCoreTests:android.app.activity.
      ActivityThreadClientTest
Change-Id: Ife07cfc8891184dcb6cf2b8444cd36fbfad7fdc9
2019-10-29 14:24:27 +08:00
Felipe Leme
b769296531 Improved TimingsTraceLog performance by using arrays, instead of Deque of Pairs.
Test: manual verification
Test: atest FrameworksMockingCoreTests:android.util.TimingsTraceLogTest

Fixes: 135754571

Change-Id: I7a3571a422d09cd618f6610d3403a870af1ebafa
2019-06-25 15:34:02 -07:00
Sunny Goyal
70db79ab0f Adding API for defining and invoking DirectActions
DirectActions are abstract actions defined by an Activtiy. The
actual definition of these actions will be available through
the support lib.

This API provides a secure channel for system or assistant to
interact with a running app using these Actions.

Test: atest CtsVoiceInteractionTestCases
Test: added android.voiceinteraction.cts.DirectActionsTest

Bug: 129705716

Exempt-From-Owner-Approval: Resolving merge conflict

Change-Id: I0ce568e0d8f41e0fe46306052016a74c7b394efa
(cherry picked from commit d40c345536)
2019-04-26 00:39:53 +00:00
Andrii Kulian
ca7f710eee Add unit tests for activity client state changes
This also adds new module for tests that require Extended Mockito.

Bug: 127106719
Test: atest FrameworksCoreTests:android.app.activity.ActivityThreadTest
Change-Id: I7ed5de72d35babbbf72c4c823d3a9e4baa50e3c4
2019-04-05 16:07:59 -07:00