Commit Graph

260 Commits

Author SHA1 Message Date
Shivam Agrawal
2d59448295 Merge "Filter-Diff Screen Layout Changes for Activity Relaunch" into sc-v2-dev 2021-08-14 04:11:56 +00:00
Charles Chen
cc2f80f5a0 Merge "Allow WPS to create windows with multiple type" into sc-v2-dev 2021-08-13 06:24:45 +00:00
Chris Li
a5e7ce9b16 Merge "Invoke keyguard going away when it is collecting for wake" into sc-v2-dev 2021-08-12 18:32:53 +00:00
chaviw
296c6554a0 Add Java and JNI WindowInfosChangedListener hooks to register with SCC
Bug: 188792659
Test: Existing tests pass
Change-Id: I0a6fa58e1c8648bf1d9d30f5e2c59e056a07cb88
2021-08-11 14:09:05 -05:00
Charles Chen
8bae39cab2 Allow WPS to create windows with multiple type
Before WindowProviderService, Service can add windows with several
window types. This is previously not allowed for WindowProviderService
because a context can only associate with a window container.
However, it may cause regressions because Service is used to add
windows with multiple types.
This CL allows WindowProviderService to do so, but WindowProviderService
can only associate with the window type returned by #getWindowType.
This CL also extracts some methods to WindowContext interface so that
WindowContext and WindowProviderService can reuse the same interface.

Test: atest WindowContextPolicyTests StrictModeTest
Test: atest ContextIsUiContextTest ContextGetDisplayTest
Test: atest WindowContextTest WindowContextTests
fixes: 191959013

Change-Id: Ie16916b370a4cbb8a17ccaec9870d47b4b089390
2021-08-11 23:43:01 +08:00
Chris Li
2c0834c5e5 Invoke keyguard going away when it is collecting for wake
Before, when KEYGUARD_GOING_AWAY is called before WAKE starts,it will
not be passed to the keyguard service to dimiss keyguard. Now, we
merge the flags and add check for that.

Bug: 193564917
Test: check with/without sEnableRemoteKeyguardAnimation
Change-Id: I28d40664b4fbdc0ea199baa32ccefba7dea473f8
2021-08-10 11:26:31 -07:00
Ben Lin
a50d29727a Pass AppOps result for PiP to Transition change.
Bug: 194272108
Test: Enable shell transitions, enter PIP
Change-Id: Ic39840615df9c270187f9f810a6755fa22b585b7
2021-08-09 14:32:54 -07:00
Shivam Agrawal
8bec600008 Filter-Diff Screen Layout Changes for Activity Relaunch
Currently, an activity is relaunched from a resize only if
the activity does not handle SCREEN_SIZE config changes and
the new activity size crosses a width, height, or smallest
width resource qualifier. A change in activity size may also
change an activity’s screen layout. However, an activity
is relaunched from a screen layout change if it does not
handle SCREEN_LAYOUT config changes even if the screen layout
did not cross a screen layout resource qualifier.

This CL does three things:
(1) Propogates screen layout qualifiers through the same
path as width, height, and smallest width qualifiers
in the AssetManager to make it available to the
WindowManager.
(2) Prevents an activity relaunch if the screen layout
has been changed but does not cross a screen layout
qualifier.
(3) Adds tests for SizeConfigurationBuckets for the new
screen layout logic as well as for existing logic.

Test: atest FrameworksMockingCoreTests:SizeConfigurationBucketsTest
Bug: b/192369163 b/187529743
Change-Id: I41d28e6492b76c4284c4dca2c1f3f5904fc5e91a
2021-08-06 14:15:23 -04:00
Evan Rosky
bc047eeedd Differentiate seamless rotations in shell transitions
Shell owns the whole display rotation animation now. So, we
can just provide enough information for it to decide when
seamless is requested/appropriate. The default behavior (when
not explicitly animating) is already a jump-cut/seamless, so
just skip the rotation animation if we are doing seamless

Bug: 194693472
Test: atest SeamlessAppRotationTest ShellTransitionTests
Change-Id: I64748f5910c04784fd9818818b029fa5f1339c6c
2021-08-05 10:11:52 -07:00
Chris Li
1a9c49f643 Merge "setAdjacentTaskFragments for paired TaskFragment" into sc-v2-dev 2021-07-30 23:56:11 +00:00
Chris Li
36c3af87dc setAdjacentTaskFragments for paired TaskFragment
Bug: 190433129
Test: Tested with sample app
Change-Id: Ifa4cf3df77f053d2f5806290989329d3a2b47160
2021-07-30 13:39:15 -07:00
Evan Rosky
8ba6a92dbe Add occlude/unocclude support in keyguard shell transitions
Creates and registers remote transitions that deal with situations
where keyguard might be occluded/unoccluded.

Bug: 191799478
Test: atest KeyguardInputTests
Change-Id: I625a810aef915de7a01ded9ddbe3042f0e124b52
2021-07-30 05:15:33 +00:00
Evan Rosky
cc3b202fab Merge "Add some more transition filter properties" into sc-v2-dev 2021-07-30 01:41:51 +00:00
Evan Rosky
adb7e53532 Add some more transition filter properties
These are needed for keyguard transitions. The ones added are:

A NOT requirement which will reject transitions with a matching
change.

The ability to match containers that aren't independent.

Checks for global transition flags as well as individual change
flags.

Match only if container is a task.

Bug: 191799478
Test: atest ShellTransitionTests
Change-Id: I963c6c91cdfc0b71a75ba9656261bb0e237f11f1
2021-07-29 15:05:24 -07:00
Vadim Caen
44823207a4 Merge "Do not draw icon background if it shouldn't be seen" into sc-dev am: ee08a68fd4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15175437

Change-Id: I99c182334636b3c9ce7bdc24b910d1b99bddb93a
2021-07-29 19:02:27 +00:00
Evan Rosky
58fd4834b9 Merge "Enable keyguard remote animation when WMShell is used." into sc-v2-dev 2021-07-28 20:37:38 +00:00
Wei Sheng Shih
8ea3583b8d Merge "Correcting the package name used on splash screen window." into sc-dev am: 0793f65c95
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15358033

Change-Id: I28623c6b9596275536a1e3f979cd9650f8082b3e
2021-07-28 14:49:43 +00:00
Issei Suzuki
142179fbc8 Enable keyguard remote animation when WMShell is used.
This also adds a WAKE transition type to handle situations where
a showWhenLocked activity is made visible during wake.

Bug: 191799478
Bug: 183993924
Test: atest ActivityStarterTests
Change-Id: I18f9f5a0af41766a52efd87855f6a3b074aa98f1
2021-07-27 10:09:45 -07:00
Vadim Caen
ee08a68fd4 Merge "Do not draw icon background if it shouldn't be seen" into sc-dev 2021-07-27 10:05:17 +00:00
Charles Chen
9dfcf46ab9 Promote TaskFragment APIs to TestAPi
... to verify their behaviors in CTS
Also wraps ITaskFragmentOrganizer to TaskFragmentOrganizerToken
because we cannot make .aidl a TestApi.

Test: presubmit
Bug: 192442647

Change-Id: I848a33340449189af7d9d66a6468a9e397a0f53a
2021-07-26 16:13:20 +08:00
Chris Li
99b93b7dfa Add WCT#setAdjacentTaskFragments
Similar to WCT#setAdjacentRoots, but can be called with fragmentTokens
in case the TaskFragments may not be created yet.

Bug: 190433129
Change-Id: I41dd515fb9722ea6e95d0c3fb040cc0d196ad78d
Test: atest WmTests:TaskFragmentOrganizerControllerTest
2021-07-23 14:03:52 -07:00
Vadim Caen
496b4cbb86 Do not draw icon background if it shouldn't be seen
Test: atest CtsWindowManagerDeviceTestCases:SplashscreenTests
Bug: 193608336
Change-Id: I824137e67eaa0133337fcaf55c44fca46bac8010
2021-07-23 13:27:11 +02:00
wilsonshih
7a7722abe0 Correcting the package name used on splash screen window.
The top activity in TaskActivitiesReport can be filter out if the state
of top activity is INITIALIZING, this doesn't make sense for splash
screen, because the state of the top activity do can be INITIALIZING.
Create a filed targetActivityInfo in StartingWindowInfo to specify the
starting activity info.

Bug: 193459277
Test: atest SplashscreenTests StartingSurfaceDrawerTests
Change-Id: Ifec7aff644013a0426e0622162ab24f6b9fb3d8f
2021-07-23 16:50:01 +08:00
Louis Chang
692e92bfde Merge "Providing caller's token when starting activity in TaskFragment" into sc-v2-dev 2021-07-23 08:26:03 +00:00
Charles Chen
7d66f8c082 Merge "Add hasRunningActivity in TaskFragmentInfo" into sc-v2-dev 2021-07-23 03:46:27 +00:00
Louis Chang
ca43bb061b Providing caller's token when starting activity in TaskFragment
NEW_TASK flag was added by ATMS when #startActivityInTaskFragment
is called because the activity was started without source record.

Bug: 193846941
Test: starting CCT in sample app
Change-Id: Ida26034324f7ff761f1e688403d78959a01f010d
2021-07-23 11:14:35 +08:00
Evan Rosky
317e669870 Merge "Fix some shell transitions bugs breaking splashscreen cts" into sc-v2-dev 2021-07-21 18:01:08 +00:00
Charles Chen
9dd4bc8bf4 Add hasRunningActivity in TaskFragmentInfo
... for TaskFragmentOrganizer to finish adjacent Activities
altogether.

Test: presubmit
Bug: 189386466
Change-Id: I1fddd9c6708bc9eabec3186433f5ccb34a1e6c2c
2021-07-21 15:13:40 +08:00
Evan Rosky
00d3ad743e Fix some shell transitions bugs breaking splashscreen cts
Splashscreen CTS uses its own HOME activity that gets placed
on top of the normal launcher. Prevent the launcher's remote
transition from responding in that case by adding a component
filter to the TransitionFilter class.

Bug: 194112093
Test: atest SplashscreenTests
Change-Id: Iaf4572279b84953ca20abd7e34c64d7e19700b09
2021-07-20 16:08:26 -07:00
Chris Li
964d297792 Add default implementation of TaskFragmentOrganizer
Bug: 190433398
Test: N/A
Change-Id: I84fdba974ef308aebe19348fa76f565311e06f2e
2021-07-19 19:32:30 -07:00
Evan Rosky
6139cf51b2 Create a LegacyTransitions to manage combined WCT + remoteanimation
Use this to implement Drag-to-split transition

BYPASS_INCLUSIVE_LANGUAGE_REASON=using existing API.

Bug: 192291727
Test: drag from taskbar into split and observe. Also,
      drag same-app into split and observe no-op.
Change-Id: I710805c85c7d57ae8eebe18e5df7fca899f1b882
2021-07-16 19:06:14 -07:00
Chris Li
5849a2b5e3 Merge "Allow TaskFragmentOrganizer to apply WCT without permission" into sc-v2-dev 2021-07-16 06:50:53 +00:00
Chris Li
d5555da37a Allow TaskFragmentOrganizer to apply WCT without permission
TaskFragmentOrganizer will be used by regular apps without the
permission to manage Task. We are allow it to apply transactions if it
is operating on TaskFragment that is organized by itself.

Bug: 193191599
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Change-Id: I82e5d49260680bd496ff184c6795ec817c65d858
2021-07-15 13:07:14 -07:00
Tony Huang
b9559a6f80 Migrate rotation animation to shell transition
Migrate rotation animation in wm core to wm shell and used in
shell transition.

Bug: 190002115
Test: manual rotation the device
Change-Id: Ib3404eeb7ac647774ea3be2707c9515371ab0976
2021-07-15 10:33:49 +08:00
Chris Li
6accbd24e2 Merge "Add unit test for TaskFragmentOrganizer" into sc-v2-dev 2021-07-13 05:25:34 +00:00
Chris Li
457b3348c8 Include the list of child Activities in TaskFragmentInfo
When we get a call to start activity to side, we can check the list to
know which TaskFragment it belongs to.

Bug: 190433129
Test: N/A
Change-Id: I7fc5772769bf9971c3e21723f9d4c09a183bac31
2021-07-12 14:51:04 -07:00
Chris Li
7f5c891325 Add unit test for TaskFragmentOrganizer
Bug: 190433129
Test: atest WmTests:TaskFragmentOrganizerTest
Change-Id: I1665921c4ec27fa3e08f250fc639e290977298c2
2021-07-10 19:31:15 +00:00
Charles Chen
427a66fa71 Merge "Send DA's config directly when attaching to DA" into sc-v2-dev 2021-07-10 05:02:32 +00:00
Chris Li
fec7d6ec1e Merge "Add onErrorCallback for TaskFragmentOrganizer" into sc-v2-dev 2021-07-10 03:43:08 +00:00
Chris Li
e7ed99bfc2 Merge "Remove TaskInfo#topActivityToken usage in size compat for security" into sc-dev 2021-07-08 18:05:40 +00:00
Jeff Chang
ad40d06f0e Merge "Embedded Activities in TaskFragments" into sc-v2-dev 2021-07-08 10:23:33 +00:00
Jeff Chang
397b1509bb Embedded Activities in TaskFragments
- Adding TaskFragments into the leaf Task to embed activities when
  activity started to the side.
- Delete TaskFragment
- Reparent TaskFragments

Bug: 189385246
Bug: 190433129
Test: wm presubmit and have test case in updating CL.
Change-Id: I7e7f5109457dd083d3b148d3ce676ad9aa5ad89f
2021-07-08 12:40:28 +08:00
Chris Li
1245aefa49 Remove TaskInfo#topActivityToken usage in size compat for security
Security report shows that this can cause leak token of different app.

Replace the functionality with a callback to the TaskOrganizerController
to restart activity when size compat restart button is clicked.

Bug: 186776724
Test: manually verify the restart button still works
Change-Id: I097b9f02e8435e6765695b9d5a531a4e165bac66
Merged-In: I097b9f02e8435e6765695b9d5a531a4e165bac66
2021-07-07 21:09:24 -07:00
Chris Li
ae54032e9a Remove TaskInfo#topActivityToken usage in size compat for security
Security report shows that this can cause leak token of different app.

Replace the functionality with a callback to the TaskOrganizerController
to restart activity when size compat restart button is clicked.

Bug: 186776724
Test: manually verify the restart button still works
Change-Id: I097b9f02e8435e6765695b9d5a531a4e165bac66
2021-07-07 12:50:53 -07:00
Vadim Caen
c56fa470bd Merge "Implement the legacy splash screen behavior" into sc-dev am: 2be72d030b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14920934

Change-Id: If3cb25fa466589eed613c1b122e638533631a549
2021-07-05 15:46:35 +00:00
Charles Chen
eb07884f01 Send DA's config directly when attaching to DA
WindowContext relies on WindowTokenClient#onConfigurationChanged after
calling WMS#attachWindowContextToDisplayArea.
However, it took some time to wait for onConfigurationChanged callback
from the server side so that we may get a stale value right after
creating WindowContext.
This confuses developers especially when the foreground activity is in
size compat mode or freeform because the process config is overridden
by activity's config.
This CL makes #attachWindowContextToDisplayArea return DA's configuration
and applies to WindowContext direcly.
It also benefits WindowProviderService because it can obtain DA's
 configuration before onCreate() based on [1] and this CL.

Bug: 190019118
Bug: 190745506
Test: manual - 1. launch an Activity in size compat mode
               2. create a WindowContext and verify if WindowMetrics
                  matches DA bounds.
Test: atest WindowContextTest WindowContextTests
Test: atest WindowContextControllerTest ContextGetDisplayTest
[1]: dd4a748af0

Change-Id: I8dd3987b731662502bc01e9d2ed67e718ada5f46
2021-07-05 14:02:02 +08:00
Chris Li
ccff5a6a8b Add onErrorCallback for TaskFragmentOrganizer
When app wants to create activity through sidecar (for example,
startActivityToSide), we need a callback in case it failed to finish the
request.

Allow the caller to set a token for the WCT, which will be passed back
if there is any error, so that the caller can identify the error
callback.

Bug: 190433129
Test: N/A
Change-Id: Icffb7255e75465b90ed822559296f147a7e3418a
2021-07-01 22:06:22 -07:00
Vadim Caen
f08dae3158 Implement the legacy splash screen behavior
For apps opted out of the new splash screen, we show the full background
drawable.
Ensure there has send the splash screen background color to
StartingWindowListener.

Bug: 182880656
Test: manual set useLegacy to true then verify legacy splash screen.
Test: atest WmTests:ActivityRecordTests
Test: atest StartingSurfaceDrawerTests

Change-Id: Icf662f3c5f368f447e718f82f78dc25b909ca9be
2021-07-01 15:05:06 +08:00
Chris Li
3a00e2b213 Merge "Notify TaskFragmentOrganizer onConfigurationChanged" into sc-v2-dev 2021-06-24 21:44:16 +00:00
Chris Li
ad2dc01882 Notify TaskFragmentOrganizer onConfigurationChanged
Bug: 190433129
Bug: 190433500
Test: N/A
Change-Id: I383a434d536ac08f7cf82dfd87cd24bfc53a6d58
2021-06-24 10:58:40 -07:00