Commit Graph

4351 Commits

Author SHA1 Message Date
Hongwei Wang
500043a457 Merge "Implement PiP custom close action on phone" into tm-dev 2022-04-20 17:37:44 +00:00
Shawn Lin
88ed5ca17a Merge "Support scaled cutout & roundedcorners when resolution is overridden" into tm-dev 2022-04-20 16:56:28 +00:00
Chris Li
701b3f759c Merge "Fix crash in getParentContainerBounds" into tm-dev 2022-04-20 13:04:17 +00:00
Chilun Huang
dc7c91de99 Merge "Use the icon size of starting surface for split decor" into tm-dev 2022-04-20 08:44:33 +00:00
Chris Li
e382326e3d Fix crash in getParentContainerBounds
Before, before TaskFragment appeared, the getTopNonFinishingActivity may
be null, and throw exception for no bounds found.
Now, make sure we always have Task bounds stored.

Bug: 228885031
Test: atest WMJetpackUnitTests:SplitControllerTest
Test: atest WMJetpackUnitTests:TaskContainerTest
Change-Id: I3744813a85f24941563c8ff8f284b2e45396f906
2022-04-20 15:45:09 +08:00
Hongwei Wang
dd51f86fd4 Implement PiP custom close action on phone
To use this new custom close action on Phone
- We expect app providing actions via
  PictureInPictureParams.Builder#setActions as they normally do
- We also expect app providing a custom close action via
  PictureInPictureParams.Builder#setCloseAction
- The custom close action is used on Phone only if it matches one of the
  actions listed in setActions (by comparing the PendingIntent)

SysUI will render the custom close action with a highlighted background
and ensures the PiP dismisses after certain timeout if the app fails to
respond in time.

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/fR0hxeorlYrxXyzfZ02btK
Bug: 223896879
Test: see video
Change-Id: I65c585ae3224061311e476753bc4c72f00c4fa33
2022-04-19 23:55:06 -07:00
shawnlin
bcea9fd89e Support scaled cutout & roundedcorners when resolution is overridden
In current desgin, the confgis for cutout and rounded corner are based
on the original display size. If the display resolution is overridden,
cutous and rounded corners will be drawn in incorrect places with
incorrect size.

We should load the cutout & rounded corners with the orignal display
size and then scale the results with the display ratio which is
calculated by dividing current size with original size.

Bug: 209592558
Test: manual:
      1. Go Settings-> Display-> Screen Resolution
      2. Switch between FHD+ and QHD+
      3. Check if the cutout and rounded corner looks the same as they
	 are in the original display size.
Test: manual:
      1. adb shell wm size 1080x2340
      2. Check if the cutout and rounded corner looks the same as they
         are in the original display size.
Test: atest DisplayCutoutTest LocalDisplayAdapterTest
          ScreenDecorationsTest RoundedCornerResDelegateTest
Change-Id: Iea42b73c0276b82983c1ddbce9455355afdc164d
2022-04-20 10:03:19 +08:00
Hongwei Wang
a6cf936798 Validate target view surface in PipDismissTargetHandler
Bug: 228969163
Test: N/A, will monitor the crash dashboard
Change-Id: I255c53c67b5e2df22a5049b43933aeb824b6fd45
2022-04-19 11:35:02 -07:00
Mady Mellor
ef1cc8850f Merge "Collapse bubbles when drag and drop is initiated" into tm-dev 2022-04-19 17:08:36 +00:00
Wei Sheng Shih
a944a2c1ad Merge "Do not show task snapshot window if task bounds has changed." into tm-dev 2022-04-19 02:07:46 +00:00
Mady Mellor
528db439de Collapse bubbles when drag and drop is initiated
Dragging a notification into split screen would fail if bubbles
were expanded while performing this action. I think it makes sense
to collapse the stack if its open when drag and drop for an app
starts.

Bug: 223909931
Test: atest DragAndDropControllerTest
Test: manual - have bubbles expanded
             - swipe down the shade, long press on a notification
               and drag it
             => bubbles are collapsed and the notif is able to be
                put into split screen.
Change-Id: Ib5160b3d772452f1cdd704926887bd38a5fd1ef1
2022-04-18 22:52:59 +00:00
Mady Mellor
1970f8ddd2 Merge "Fix drag to split in RTL" into tm-dev 2022-04-18 17:11:23 +00:00
Chris Li
d41df35243 Merge "Allow delete empty TaskFragment in PiP" into tm-dev 2022-04-18 15:26:56 +00:00
Chris Li
720ae87d6b Allow delete empty TaskFragment in PiP
We ignore WCT for TaskFragment in PiP, but in case the empty
TaskFragment is not removed before the Task enters PiP, we should allow
organizer to remove it.

Also make sure we have all requests in one WCT during
onTaskFragmentInfoChanged.

Bug: 225371112
Test: atest WmTests:TaskFragmentOrganizerControllerTest
Test: atest WMJetpackUnitTests:SplitControllerTest
Test: atest WMJetpackUnitTests:TaskFragmentContainerTest
Change-Id: I718bbb7f6c18c35048c671ed3c131eaf536cf265
2022-04-18 18:12:05 +08:00
Tony Huang
0b87da7195 Merge "Fix recents thumbnail wrong while swipe up" into tm-dev 2022-04-18 03:44:15 +00:00
Shawn Lin
8b8de88b3e Merge "Update to use NAV_BAR_KIDS_MODE settings key for kids mode organizer" into tm-dev 2022-04-18 03:41:27 +00:00
TreeHugger Robot
e16244c3cd Merge "Make BackEvent#getTouchX and BackEvent#getTouchY floats." into tm-dev 2022-04-16 01:51:10 +00:00
Hongwei Wang
e4f4f107f3 Reset PiP shadow radius in onTaskVanished
This is a follow-up of ag/17527240 in which we do not cover the case
that a Task in pinned mode is directly removed via Task#moveTaskToBack

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/cMG5Uh1kLC7EyAs2EbDVkM
Bug: 228793904
Test: follow the reproduce step in bug, see video
Test: atest WMShellUnitTests:PipTaskOrganizerTest
Change-Id: Ib7472908a81d56d34216ca272afbd9f1a2668b89
2022-04-15 13:51:30 -07:00
Mady Mellor
4008e21f0a Merge "Skip onTaskMovedToFront if the bubble selection is animating" into tm-dev 2022-04-15 16:25:02 +00:00
Tony Huang
9220937682 Fix recents thumbnail wrong while swipe up
This bug occured when it has multiple visible app targets need to
show. If surface didn't have specific layer, their display order
will be determined by create timing. By such rule, we should create
their animation leash by down to top rather than top to down.

This patch also fix wrong logic to create RecentsAnimationSplitTasks,
we should only do that when split is active.

Fix: 223396876
Fix: 207390696
Test: manual
Test: pass existing tests
Change-Id: I74a33cdc28d370f1db3910ebda8577c72416bc97
2022-04-15 15:15:44 +08:00
TreeHugger Robot
3d69ea8e74 Merge "Fix bubble expanded view jumping to the left when switching bubbles" into tm-dev 2022-04-15 04:41:57 +00:00
Wei Sheng Shih
2aac68104f Merge "Clear the system bars color when removing the splash screen window." into tm-dev 2022-04-15 02:18:23 +00:00
Mady Mellor
6827e13a2d Skip onTaskMovedToFront if the bubble selection is animating
When a bubble gets dismissed while the stack is expanded, we should
select the next available bubble. Instead, we are collapsing.
This is because we get an onTaskMovedToFront event for the app
behind bubbles moving to the front, which causes the stack to
collapse. To fix this I add a check to see if the switch animation
is running, and if so we skip the collapse in onTaskMovedToFront.

Bug: 208648025
Test: manual - have multiple bubbles, expand the stack, visit each
               bubble
             - dismiss each bubble by dragging to dismiss target
             => observe that after dismissing each bubble, the next
                bubble is selected (if available)
Change-Id: If82c004ecd1ec8920e934dbae2107b4c37853cb5
2022-04-14 23:54:28 +00:00
Mady Mellor
81bd659c44 Fix bubble expanded view jumping to the left when switching bubbles
When the bubbles are shown vertically on the left side of the screen
and you tapped between them, the view would be misaligned for a bit
during the animation.

This was happening because the padding being applied to the view
didn't account for the space the pointer triangle took up.

The fix is to add the size of the pointer to the padding when
showing vertically on the left side.

Bug: 196444014
Test: manual - expand a bubble on a large screen on the left side
             - tap between the bubble and the overflow or other
               bubbles
            => observe that the expanded view doesn't jump a bit to
               the left
      manual - test switching between bubbles on phone, phone
               landscape (left & right sides), and tablet on the
               right side
            => observe that the animation looks correct
Change-Id: Icb3cd87843504ab31da8005fb72f36daae387d39
2022-04-14 21:42:11 +00:00
Shan Huang
316179540e Make BackEvent#getTouchX and BackEvent#getTouchY floats.
Bug: 228533817
Test: Try swipe back to home on Flag Flipper (with Predictive Back
Animation toggle enabled in Flipper) and make sure animation looks good.
Try in both landscape and portrait mode.

Change-Id: If2165827a0f66f8e0bd8f78483577c3ac4c9f213
2022-04-14 19:34:26 +00:00
Chilun Huang
2384beb3fa Use the icon size of starting surface for split decor
Use a fixed icon size and fit to centor scale for split decor to avoid
unexpected icon size. Also sync the same icon size to drop zone area.

Bug: 228928242
Test: Manual resize the split and check the icon size.
      Manual drag to split and check the icon size.
Change-Id: Idaf523810e3913a22787925817b6013464818147
2022-04-14 20:32:06 +08:00
Chris Li
88671a050f Merge "Notify organizer when the last activity in TaskFragment enter PiP" into tm-dev 2022-04-14 10:22:10 +00:00
Tony Huang
96770f2561 Merge "Add error handling for start task and intent" into tm-dev 2022-04-14 09:11:21 +00:00
Tony Huang
4ae839860f Add error handling for start task and intent
If user start task and intent with same app but not support
multi-instance, in this case it will only start one side split and
the other one show as black screen.
We should avoid such status and do some error handling, this patch
prevent it by exiting split immediately and expand the that app as
full screen.

Fix: 224888879
Test: manual
Test: pass existing tests
Change-Id: I827debb01f3a2fc8f04f4b1931084f2fa475f8a6
2022-04-14 14:40:13 +08:00
shawnlin
7439e38646 Update to use NAV_BAR_KIDS_MODE settings key for kids mode organizer
Bug: 228912892
Test: make
Change-Id: I14593e959487dae5c3dd3bf0dba95c4109eb0c67
2022-04-14 12:18:14 +08:00
Ryan Lin
565d2b1b85 Merge changes from topic "nodebounds" into tm-dev
* changes:
  remove embeddedMatrix usage for PIP menu
  Change node bounds procedure based on SufaceFlinger Callback
2022-04-14 01:55:04 +00:00
Hongwei Wang
d34728c264 Merge "Do not allow PiP stash over DisplayCutout" into tm-dev 2022-04-14 01:08:28 +00:00
Mady Mellor
669a1c2657 Merge "Fix bubble overflow position after rotating on larger screen" into tm-dev 2022-04-13 23:07:49 +00:00
Hongwei Wang
b7a13624a5 Do not allow PiP stash over DisplayCutout
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/dHnahAkfvVeHelqxMMiWGg
Bug: 222223451
Bug: 229047277
Bug: 229064630
Test: follow the reproduce steps in bug, see video
Change-Id: Ie1006dae08294300a92e713b239217e57d79c2e0
2022-04-13 13:30:59 -07:00
Mady Mellor
a74ed727df Fix bubble overflow position after rotating on larger screen
The code was passing the index of the bubble rather than the
actual position onscreen so the resulting translation was incorrect.

Test: manual - be on a large screen / tablet
             - expand bubbles, select the overflow
             - rotate the device
             => observe that the overflow container remains with
                the rest of the bubbles and doesn't jump around
Bug: 223911182
Change-Id: I95403f57e40e8c428ea9694e6fb93b0b0478c530
2022-04-13 18:29:36 +00:00
TreeHugger Robot
49afccb1af Merge "Remove references to old FaaS test rule" into tm-dev 2022-04-13 17:39:58 +00:00
Hongwei Wang
634396baaf Merge "Use sourceRectHint to calculate scale when enter PiP" into tm-dev 2022-04-13 17:38:34 +00:00
Chris Li
63ece2d2e5 Notify organizer when the last activity in TaskFragment enter PiP
When the Task contains multiple activities, activity entering PiP will
be reparented to a new PiP Task. In this case, we should notify the
organizer about the behavior, and prevent the dependents from closing as
a result of an empty TaskFragment.

Bug: 225371112
Test: atest WmTests:TaskFragmentTest
Change-Id: I6f0138c0532d2d0249de38fd84d1a4690f266c07
2022-04-13 21:31:30 +08:00
Charles Chen
64d4564747 Merge "Promote WMJetpackUnitTests to presubmit" into tm-dev 2022-04-13 09:48:11 +00:00
wilsonshih
8764073976 Do not show task snapshot window if task bounds has changed.
Add a condition in ActivityRecord#isSnapshotCompatible that skip to
add task snapshot window if the current task bounds does not match the
tasksnapshot size.

Bug: 216079545
Test: atest ActivityRecordTests
Test: start activity from recents after modify wm size, verify there
should use splash screen starting window.

Change-Id: I62e390e74d8de42211499c47fc282bacdd95aa6f
2022-04-13 17:40:10 +08:00
Pablo Gamito
521dfd5acf Remove references to old FaaS test rule
Test: atest FlickerTests
Change-Id: Iabab1c67166933be74244abcb8e9d883ce2e8dad
2022-04-13 09:38:26 +00:00
Mady Mellor
76bbf7a731 Fix drag to split in RTL
The code assumes that the views are in LTR order, so when the device
is in RTL, the wrong view gets highlighted. The code thinks dropzone1
is on the left side, but in RTL it'd be on the right.

Fix for this is to just always layout the views in LTR.

Bug: 228530510
Test: manual - put the device in RTL and drag an app into split
             => verify that the highlight is on the correct side
Change-Id: I05e548143ed7042c4151252b46fa1b96d8ac7409
2022-04-12 22:06:16 +00:00
Sergey Serokurov
3ad3650181 Merge "Do stack collapse after stack reorder" into tm-dev 2022-04-12 15:49:27 +00:00
ryanlwlin
e0c8caf15b remove embeddedMatrix usage for PIP menu
We used to use the embedded matrix to correct the node bounds.
It is not necessary anymore because we now use the transform from
InputWindowHandle to comput the node bounds.

Test: manual test the pip menu buttons when talkback is enabled.
Bug: 200797785
Change-Id: Ie3be64b48735577139e66d34f0db367e16c26b88
2022-04-12 22:24:51 +08:00
ryanlwlin
7bdc82af7c Change node bounds procedure based on SufaceFlinger Callback
The attachInfo from ViewRootImpl is not reliable
for DisplayArea manipulation or windowless window.

To fix this problem, we use the transform matrix of
InputWindowHandle, which could transform the bounds
from window coorindate to screen coordinate. We also
transfrom the bounds to logical display coordinates
with the associated display matrix.

Besides, we also record the magnification spec of the window,
which could get the bounds before magnification. We use
this value to decide the property 'visibleToUser'.

Bug: 200797785
Test: atest android.accessibilityservice.cts WindowInfoTest
      atest com.android.server.accessibility
Change-Id: I0917b04fe8b027fb2bd932a6f0604ba1449ebc66
2022-04-12 22:24:21 +08:00
Jacqueline Bronger
6cc02e8d74 Merge "Fix gravity after re-enabling expanded PiP" into tm-dev 2022-04-12 08:48:52 +00:00
Galia Peycheva
427189714d Merge "Fix strange pip size in horizontal expanded mode" into tm-dev 2022-04-12 08:29:43 +00:00
Riddle Hsu
dc19fc3bd0 Merge "Do not show animation background with wallpaper transition" into tm-dev 2022-04-12 05:45:11 +00:00
Chris Li
a6b968f887 Merge "No embed activity when Task is in PIP" into tm-dev 2022-04-12 03:29:37 +00:00
Sergey Serokurov
2c480f88e2 Do stack collapse after stack reorder
Bug: 223912200
Test: atest SystemUITests
Change-Id: I10818e9c38c48c60686c16b492f4d0792474037b
2022-04-11 17:47:41 -07:00