Commit Graph

1369 Commits

Author SHA1 Message Date
Hongwei Wang
298da246f0 Do not skip onMovementBoundsChanged if already in PiP
If the Task is already in PiP mode and fixed rotation is happening, we
still need the onMovementBoundsChanged callback to go through in
PipTaskOrganizer.

Note that there seems to be an existing bug that Launcher shelf height
is ignored with the following steps
- Enter PiP and open another app to fullscreen
- Rotate screen and swipe the other app to home

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/gs08EEyHyNcn86lsIcbIRe
Bug: 191143521
Test: follow the reproduce steps in bug, see the video
Change-Id: I601c7493794316883445e9c69e5cdd6a808e8933
2021-06-18 15:24:19 -07:00
Ben Lin
22607bc065 Merge "PiP: Update menu bounds before showing the menu." into sc-dev am: 9b8c01844b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15001386

Change-Id: I05a7a4616b0860c7728aa73c5e7bf30129e9fec9
2021-06-17 23:31:16 +00:00
Ben Lin
9b8c01844b Merge "PiP: Update menu bounds before showing the menu." into sc-dev 2021-06-17 23:27:24 +00:00
Ben Lin
5643e20db3 Merge "PiP: Move enter-PiP on-pause logic." into sc-v2-dev 2021-06-17 21:50:11 +00:00
Bill Lin
d3b7eb8dd1 Merge "Allow one-handed mode shortcut expand notification" into sc-dev am: 789f014c04
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14957128

Change-Id: I24b1fb1055403dd684bc0b1f96739fcdd8d6e809
2021-06-17 00:30:48 +00:00
Bill Lin
789f014c04 Merge "Allow one-handed mode shortcut expand notification" into sc-dev 2021-06-16 23:59:28 +00:00
Jorge Gil
2c8878f17b Merge "Start pinchResize only if pointers are inside PIP" into sc-dev am: c6e212c5b2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14948317

Change-Id: Iea52c31ae93d32087599e5b7d8f03b29ebb0e5af
2021-06-16 22:04:50 +00:00
Jorge Gil
c6e212c5b2 Merge "Start pinchResize only if pointers are inside PIP" into sc-dev 2021-06-16 21:59:53 +00:00
Ben Lin
6a55435011 PiP: Move enter-PiP on-pause logic.
Previously, we rely on #makeInvisible in other situations as the last
place to enter PIP before activity gets put to stopped (e.g. ARC++).
However with Shell transitions, #makeInvisible is now immediately called
as user starts the transition into Recents, which would cause app to
enter PIP right away. Thus, removing this part of the code, and instead
we will wait until the Recents transition is finished and try to pause
the app with userLeaveHint before visibility is committed.

Also, when shell transition is enabled, make an explicit transition when
dmissing PIP to properly commit the necessary window container changes
to WM. The tranition will just have no animation.

Bug: 165793917
Test: Enable Shell transition, enter PIP via gesture (non-auto enter
case)
Test: Enable Shell transition, dismiss PIP via dismiss bubble

Change-Id: Ic2c8691f5a1f359b822b1874b16a327bc689f34d
2021-06-16 13:32:28 -07:00
Ben Lin
524bc0a22c PiP: Update menu bounds before showing the menu.
It is possible that sometimes when PiP menu is not showing, it is not
updated correctly.

Bug: 190210447
Test: Enter PiP
Change-Id: I87639a6d568e96e26d4b79ba68a6349ec0ae29e1
2021-06-16 19:51:07 +00:00
Bill Lin
ca75e7e466 Allow one-handed mode shortcut expand notification
1) Add OneHandedEventCallback for WMShell to register
   callback, and if one handed mode settings set show
   notifications, when user tap one handed mode shortcut
   notify WMShell send KEYCODE_SYSTEM_NAVIGATION_DOWN
   through OneHandedEventCallback with SysUIMainExecutor.

2) Add isReady() flag in OneHandedDisplayAreaOrganizer
   and Simplify the flow of onActivatedActionChanged()
   to prevent potential race problem while auto-enable
   One-handed and immeditately startOneHanded(), however,
   DisplayAreaOrganizer#onDisplayAreaAppeared() may not
   ready for transtion yet, and result mState keep in
   unfinsihed STATE_ENTERING.

3) Adjust the transiton duration from 800ms to 600ms
   800ms is a little bit long to affect timing of
   apply runtime overlay package.

4) DelayExecute setEnabledGesturalOverlay() until
   transition finised and at most delay once.
   - onSwipeToNotificationEnabledChanged() : DelayExecute
   - onEnabledSettingChanged() : DelayExecute
   - Ctor setupGesturalOverlay() : No DelayExecute
   - mState.isTransitioning() : DelayExecute

Test: WMShellUnitTests
Bug: 182425480
Change-Id: I2615c3b30ad95a858510b4bcc73d8f343843fc96
2021-06-17 01:12:32 +08:00
Vadim Caen
ab9a4b9a5a Merge "Release the SurfacePackageViewHost on splash screen removed" into sc-dev am: dc07d29bd0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14775423

Change-Id: I41c53ecabb544054bbe522baf5ffddaac211975b
2021-06-16 12:31:00 +00:00
Vadim Caen
dc07d29bd0 Merge "Release the SurfacePackageViewHost on splash screen removed" into sc-dev 2021-06-16 12:27:47 +00:00
jorgegil@google.com
c73eb5d3f7 Start pinchResize only if pointers are inside PIP
The PipResizeGestureHandler was previusly signaling a start
of the pinch resize without checking that both pointers were
within the PIP bounds region. This caused the TouchState to
be reset with a single tap outside the PIP window while
drag-moving it with another finger, which led to PIP becoming
stuck without snapping to the edges.
With this CL, we make sure that both fingers are inside PIP
before starting resetting the touch state and allowing the
pinch resize to start.

Bug: 188640607
Bug: 186607893
Test: move the PIP with one finger and while still holding it
tap anywhere outside of PIP with another finger - verify you
can still keep moving the PIP with the first finger normally.

Change-Id: I2137180ea1f333fe2e0b67e52d57da5ff9a2d094
2021-06-15 17:33:09 -07:00
Ben Lin
6b146e8407 Merge "PiP: Divide up the magnetic percent by 2." into sc-dev am: dd44345c6a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14940431

Change-Id: Ie623a72084cf67d169696bc38ffaa2ea34b243fb
2021-06-15 19:13:35 +00:00
Ben Lin
dd44345c6a Merge "PiP: Divide up the magnetic percent by 2." into sc-dev 2021-06-15 19:06:17 +00:00
Mady Mellor
a652e22417 Merge "Fix dismiss ciricle being behind expanded view" into sc-dev am: 563e1b4856
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14970151

Change-Id: Id5efca28bb74c11167094143ca0a1a7c286fe54d
2021-06-15 16:12:28 +00:00
Mady Mellor
563e1b4856 Merge "Fix dismiss ciricle being behind expanded view" into sc-dev 2021-06-15 16:09:56 +00:00
Mady Mellor
116a6e0493 Merge "Fix launching bubbles from widgets" into sc-dev am: faee2e6b03
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14940550

Change-Id: Ib0a1d09296d050e400e0f61f14f08f0724e908e3
2021-06-15 16:09:04 +00:00
Mady Mellor
faee2e6b03 Merge "Fix launching bubbles from widgets" into sc-dev 2021-06-15 16:08:52 +00:00
Vadim Caen
a46ff113be Release the SurfacePackageViewHost on splash screen removed
The SurfacePackageViewHost was never release, leading to a leak of its
surfaces.

This CL ensure it is released:
  - Directly in the shell if the SplashScreenView was not copied
  - From the client, through the window manger and then to the shell if
  the splash screen was copied in the client process

Test: Manually tested with app setting by checking if the surfaces
are actually removed (winscope + logs) in the following scenarios:
    - When the application registers an OnExitAnimationListener
      and calls remove(),
    - When the application registers an OnExitAnimationListener
      and dies without calling remove()
    - When the applicaiton does not register an OnExitAnimationListener
    and the shell removes the splash screen
Bug: 189759180

Change-Id: Ib68bfffad6720911368739d7dd87d8a03034c589
2021-06-15 15:39:09 +02:00
Tony Huang
ab4130735c Merge "Using rotate split layout while split active" into sc-dev am: e59e08b8f2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14909655

Change-Id: If2ac1372047684bd0b6be3af3e2789ce2cd3879b
2021-06-15 06:59:05 +00:00
Tony Huang
e59e08b8f2 Merge "Using rotate split layout while split active" into sc-dev 2021-06-15 06:50:54 +00:00
TreeHugger Robot
4403e96123 Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-dev 2021-06-15 04:39:23 +00:00
TreeHugger Robot
38e2f0e24a Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-v2-dev 2021-06-15 04:19:43 +00:00
Bill Yi
6e42108257 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I766baecdbecccd89b0a1b0b0dfc5ad71aee83736
2021-06-15 02:39:50 +00:00
Bill Yi
1729ea4c88 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Iab4b9ceaa274a0914f294e71d8fc56f99bd6c87d
2021-06-15 02:38:26 +00:00
TreeHugger Robot
fe162aa552 Merge "Settings Switch animation jank while enabled One-handed mode" into sc-dev am: e796dc88bd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14947950

Change-Id: Ic86a5baf33d7e029bb837e73a21deb9059b11321
2021-06-15 01:54:46 +00:00
TreeHugger Robot
e796dc88bd Merge "Settings Switch animation jank while enabled One-handed mode" into sc-dev 2021-06-15 01:37:34 +00:00
Mady Mellor
e57920820e Fix launching bubbles from widgets
There were a couple of issues:
1) onActivityRestart wasn't checking for bubbles in the overflow
   so there were cases where we could open a bubble but weren't
2) delay opening the bubble until after the transitions have
   happened when launching from a widget, the transition could
   alter the placement of the bubble's surface resulting in
   weird UI.

Test: atest LaunchConversationActivityTest
Test: manual 1) have a bubble & convo widget for it
             2) tap on the widget => bubble opens normally, close
                the bubble & repeat that a bunch

             1) have an unopened bubble & convo widget for it
             2) get enough bubbles to push it out of the stack &
                out of the overflow
             3) tap on the widget => bubble opens

             1) have a bubble & convo widget for it, dismiss bubble
             2) tap on the widget => bubble opens normally
Bug: 188306336

Change-Id: Id68ccbfbfc6fc6949cfc257df4706b470fb78569
2021-06-14 18:25:25 -07:00
Mady Mellor
be613e6a98 Fix dismiss ciricle being behind expanded view
- Need to give it an elevation
- Need to make sure to bring the bubble container
  in front of it so that they appear on top

Test: manual - have at least 2 bubbles, expand the stack, drag
               the bubble that is not expanded to the dismiss view
             => observe that the dismiss view is above the expanded
                view & below the bubble
Bug: 190478161
Change-Id: Ifbce49211b2342c3e197168af38f4c2ca9a1904b
2021-06-14 15:18:12 -07:00
Bill Lin
61766a732c Settings Switch animation jank while enabled One-handed mode
Switch is CompoundButton(View) and animating position when user
tap on it. Unfortunatly when set overlay pakcage enabled, Switch
componet will invoke onLayout() and cancelPositionAnimator(),
that result the UX feel jank.

We add a delay(250ms) before execute runtime resouce overlay
to ensure the widget animation finished first.

Test: Manual Settings > Gesture > One Handed Mode > Tap Switch
Bug: 190584055
Change-Id: Ia42fdf3ed699afd51c154cb0a53581ef67959c71
2021-06-15 05:15:44 +08:00
Jorge Gil
b1d7465e29 Merge "Remove duplicate call to update PIP bounds on PIP expand" into sc-dev am: d3cc960edf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14681779

Change-Id: I15d962b0c0c292cc72ec4ba3cf8dce79893ee3be
2021-06-14 15:10:29 +00:00
Jorge Gil
d3cc960edf Merge "Remove duplicate call to update PIP bounds on PIP expand" into sc-dev 2021-06-14 14:58:33 +00:00
Selim Cinek
b77c0a3d8a Merge "Always do the app reveal animation when dismissing the splash screen" into sc-dev am: bfa0487b7a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14934416

Change-Id: Id5d4519dd0c96ee044a31c5ecac97cfd644d5cc5
2021-06-14 08:19:26 +00:00
Selim Cinek
bfa0487b7a Merge "Always do the app reveal animation when dismissing the splash screen" into sc-dev 2021-06-14 08:02:08 +00:00
TreeHugger Robot
ba69e6175a Merge "Skip onMovementBoundsChanged when waiting for fixed rotation" into sc-dev am: fe8d6de401
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14939513

Change-Id: I4e0179afae3cee599f69e5d9c122bbe4223ebb9e
2021-06-12 18:34:45 +00:00
TreeHugger Robot
fe8d6de401 Merge "Skip onMovementBoundsChanged when waiting for fixed rotation" into sc-dev 2021-06-12 18:13:50 +00:00
Cyrus Boadway
378e1f28d4 Merge "Include splashscreen background color in new starting window listener" into sc-dev am: 7deb3ba4d4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14881305

Change-Id: I0cb2815e926a55032637caf585a63c634d868ee5
2021-06-12 17:27:27 +00:00
Cyrus Boadway
7deb3ba4d4 Merge "Include splashscreen background color in new starting window listener" into sc-dev 2021-06-12 17:14:49 +00:00
TreeHugger Robot
969f8d5ad1 Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-v2-dev 2021-06-11 17:08:26 +00:00
jorgegil@google.com
e5f4c32ce8 Remove duplicate call to update PIP bounds on PIP expand
Remove the callback to update bounds in
resizeAndAnimatePipUnchecked because:
1. animateResizePip already attaches a callback to update the
bounds state in onAnimationEnd
2. it updates the bounds too early before finishResize() is
called, which causes finishResize() to not know the pre-resize
bounds needed to perform the crossfade animation

Bug: 188829986
Test: enter PIP with seamless resize turned on, double-tap to
expand and unexpand, crossfade animation looks right

Change-Id: Id64222fe762b4db0d9ea739db434e8e6acb0b31a
2021-06-11 09:45:39 -07:00
Cyrus Boadway
e830abcc75 Include splashscreen background color in new starting window listener
Pass the starting window background color to starting window listeners.

Bug: 187706750
Test: Manual
Change-Id: I729df4afbf75540a60c6f2e288de80fc0b6d97dd
2021-06-11 10:07:15 +00:00
Bill Yi
16c7313b76 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I466f05e4a637e2b0a8e283e391d6aefaac9d6223
2021-06-11 09:53:59 +00:00
Bill Yi
4162039d32 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I984dc4628334c519511ea9bad6b63006cebf4e40
2021-06-11 09:52:41 +00:00
wilsonshih
192aef77d7 Always do the app reveal animation when dismissing the splash screen
Let empty-style splash screen do reveal animation.
Also remove the extra animation duration if the icon is empty.

Bug: 190695897
Bug: 190695665
Test: manual
Test: atest SplashscreenTests
Change-Id: I8b3b52369c12fbddc32af8c40f37650cc84a88dd
2021-06-11 11:34:33 +08:00
Jerry Chang
7b8f6bf5b2 Merge "Keep the task in main stage at top after dismissed split due to fold" into sc-v2-dev 2021-06-11 03:29:00 +00:00
Jerry Chang
11a26a5665 Merge "Fix not updating split bounds after devices unfolded" into sc-v2-dev 2021-06-11 03:26:28 +00:00
Ben Lin
8a8b1f632a PiP: Divide up the magnetic percent by 2.
At max size, doing a brute percentage calculation using width / minWidth
ends up with a magnetic distance that's too big. Divide by 2 again to
make it more natural.

Bug: 190657668
Test: Pinch to max size, drag down - doesn't immediate snap to it
anymore

Change-Id: Ib5de742b753239a151686c1a85b27a6fe553a577
2021-06-10 14:47:15 -07:00
Ben Lin
e9d456b056 Merge "PiP: Introduce PipTransitionState." into sc-v2-dev 2021-06-10 21:45:25 +00:00