Commit Graph

443 Commits

Author SHA1 Message Date
Schneider Victor-tulias 1834581bc0 Fix null-pointer in AbsSwipeUpHandler.buildAnimationController
Flag: not needed
Fixes: 271248485
Test: ran launcher
Change-Id: Ia9e0e68b9ee9273d82ed791b421a10ccb1fcdef2
2023-06-07 10:39:25 -07:00
Vinit Nayak 52ac882e9b Merge "Resize mRemoteTargetHandles when RecentsAnimationStarts" into udc-dev 2023-05-30 22:10:28 +00:00
Winson Chung 98fbe25da9 Try to handle side-task launches even if not fully transitioned to overview
- The launcher state does not transition from Background -> Overview
  until the overview animation finishes, and if a side task is launched
  before that happens, then we receive onTaskAppeared() but
  isInLiveTileMode() is false, which results in a state where no
  animation of the side task surface is run, and the recents animation
  is not finished.  In these cases, if we've already calculated the
  end target is RECENTS, then we can still animate the side task
- Adding some more gesture logs to indicate side task launched (or didn't)

Bug: 279114961
Test: Go to overview and launch next task

Change-Id: I23eac8721da801f14cc95fc6781a0ef9f0355cc0
2023-05-25 06:14:53 +00:00
Vinit Nayak 57de6565a0 Resize mRemoteTargetHandles when RecentsAnimationStarts
* TopTaskTracker gets updated too late after we've exited
split screen so we can't use that to determine how many
RemoteTargetHandles to use
* We default to 2, and then scale it down to 1. Because we
modify the array holding the handles directly, it should
also get updated in AbsSwipeUpHandler
* Temporary solution to stop setting up RecentsView if we detect that
TopTaskTracker has incorrect data and re-setup when we get
onRecentsAnimationStart()

Test: Tested quickswitch in gestural and recents button
double tap in button nav.
Bug: 236226779
Flag: none

Change-Id: I1bae7aed1f8712ddd1bf496acfcb851c0e32a115
2023-05-24 16:26:33 -07:00
Hongwei Wang 45b8d39ab8 Notify WMShell on aborting auto-enter-pip
Note that this change does not fix the bug listed here. This is to
callback WMShell when the transition is aborted and WMShell can choose
how to handle this.

Bug: 283177443
Test: adb shell dumpsys activity service SystemUIService WMShell
Test: go/winscope and check the SF/WM dump
Change-Id: I8abfc2db47d1f0bfc3d400066936bed354743420
2023-05-18 13:15:57 -07:00
Jerry Chang 2792271688 Defer intercepting touch events to actually start shifting tasks
Fix: 278740578
Test: http://recall/-/fLARJNt42LVxc3tt86SneW/d9A443iE2UQVktVc2YqwT2
Change-Id: I81efc87f19775dba96bab581a1c443d6070f6ebc
2023-05-11 05:44:16 +00:00
Sunny Goyal 63cf4d07a8 Updating SurfaceTransactionApplier to handle view not being attached
Bug: 278833389
Test: Presubmit
Flag: N/A
Change-Id: I88c240a1a7bdfe2e68c858c30e91cc5d06bc7bcf
2023-05-05 15:57:42 -07:00
Schneider Victor-tulias f77d2086c4 Add null checks for mRecentsView
Fixed a NPE and added some null checks for mRecentsView. These NPEs can happen if the launcher is destroyed unexpectedly.

Flag: not needed
Fixes: 279738827
Test: ran launcher and tested some gestures
Change-Id: I9c32e22a13d950346ce705ba3a6f11dd3f1da87f
2023-05-01 13:51:02 -07:00
Andy Wickham 830e4b7ce0 Add long swipe from app to overview gesture (with flag).
High level:
 - As you swipe up from an app (OtherActivityInputConsumer),
   a state transition animation to All Apps is created in
   AnimatorControllerWithResistance. The animation is played
   alongside the Recents resistance animation (i.e. past the
   settling point of Overview, which is at mCurrentShift 1).
 - The actual state transition to All Apps only happens if you
   release your finger in the "all apps region." This is set to
   mCurrentShift 2, so double the distance that Overview rests.
 - A haptic plays whenever you enter or exit this region, and
   the all apps animation is set to 0 until the region is
   active. This is so it's clear that something different is
   happening.
 - The panel that was previously used for tablets is now used
   for phones during this transition. It comes in at full
   opacity when you enter the region, and the contents (apps
   and search suggestions) fade in as you continue swiping.
 - The only gesture that is recognized in the all apps region
   is a fling downwards, which will return you to the previous
   app. Otherwise a left/right/up fling or slow release will
   finish the all apps transition.
 - The threshold is ignored if the flag is disabled (default)
   or if FallbackActivityInterface is active.

Flag:
The threshold is ignored if ENABLE_ALL_APPS_FROM_OVERVIEW is
disabled (default).

Bug: 259619990
Bug: 275132633
Test: Manual with and without the flag enabled
Change-Id: Ie311b77252416d97677b2c56fad61dfd392b6fe8
2023-04-26 10:52:04 -07:00
Tracy Zhou eb55f83d88 Merge "Support 4-finger gesture to quick switch" into udc-dev 2023-04-25 18:21:37 +00:00
Andreas Agvard 43327eb082 Merge "Rename notifyGestureStartedAsync to notifyGestureStarted" into udc-dev 2023-04-21 06:36:09 +00:00
Tracy Zhou 7dc9e3a088 Support 4-finger gesture to quick switch
Fixes: 270610237
Test: 4-finger horizontal swipe -> quick switch
Change-Id: I981a7e93ecd07357c7a9cda075f476b397c448cc
2023-04-20 22:34:19 +00:00
Andreas Agvard 167a7ba13b Rename notifyGestureStartedAsync to notifyGestureStarted
Since there is nothing async about it's implementation.

Test: Since it's a name change compilation is the only test needed.
Bug: 278976890
Change-Id: I0057be3c25c3ec80054d3830fe706ec8f9995ea7
2023-04-20 09:52:06 +02:00
wilsonshih 146e81b8c2 Polish reveal animation after onTasksAppeared.
Showing the animation leash of appearedTaskTargets if there need to
play the reveal animation behind splash screen view.
Pausing applyDepthAndBlur while playing splash screen exit animation
from launcher side, otherwise the app window would be blurred.

Bug: 277704255
Test: manual, do quickswitch to start the app behind splash screen
view, verify no flicker or blur happen when playing reveal animation.

Change-Id: I83604ceeaeb54ab2100fdabf45a1624644b85e37
2023-04-20 14:47:51 +08:00
Winson Chung b24efa4494 Cancel recents animation to app when new task is launched while gesturing
- A bit of a degenerate case, but if a new task is received while
  the user is swiping up (but not yet released), none of the usual
  signals will finish the recents animation (it's not considered
  being in overview so we don't launch it, it's not a quickswitch
  since we haven't launched any new tasks ourselves).  As a result,
  nothing happens (we don't finish the animation, and the new task
  is never shown to the user as a result).

Bug: 271188120
Test: Start a gesture, in parallel run:
      adb shell am start -n com.android.settings/.Settings

Change-Id: I5215ee87f761c837db9f764bd5d8135e55fa0a21
2023-04-12 19:06:13 +00:00
Tracy Zhou 5a56d022cb Log the input type for gesture nav gestures
Test: N/A
Bug: 276152142
Change-Id: I84a7a9470aa3151d4c6b9dbfc61d8f158987ea47
2023-04-06 09:49:28 -07:00
Jerry Chang 1dcf99f961 Merge "Consolidate split divider show/hide behavior" into tm-qpr-dev am: 064d88d8b8 am: 8ab17926ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22099682

Change-Id: I66e1a08ccfbfac1eb314d0a30fc1d9b8d3ffa73c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-23 07:45:53 +00:00
Jerry Chang 064d88d8b8 Merge "Consolidate split divider show/hide behavior" into tm-qpr-dev 2023-03-23 06:25:43 +00:00
Jerry Chang 99696bcaf7 Consolidate split divider show/hide behavior
Consolidate split divider show/hide behavior by hiding the divider bar
at a single point where the tasks actually start moving. So it won't
need to deal with hiding the divider before the animation targets ready.
Also prevents to hide the divider too early when users were just
unstashing the taskbar.

Fix: 261376202
Test: http://recall/-/fLARJNt42LVxc3tt86SneW/colHl9bXqOzppYV5o2Hmjh
Change-Id: I2b7b37c2b20cc379581b34c0104fa45246c27e8f
2023-03-22 05:48:49 +00:00
Hongwei Wang 48844c89cb Merge "VisD update for the PipAppIconOverlay 2/N" into tm-qpr-dev am: 452e014caa am: e83a3e29d4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22107736

Change-Id: I6782e9913b91972135cc07e610e703af96547595
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-17 17:16:03 +00:00
Hongwei Wang 0d22befcb8 VisD update for the PipAppIconOverlay 2/N
- Pass the up-to-dated app icon size from Launcher to WMShell
    this is for non-auto-enter-pip cases
- For auto-enter-pip, use the DeviceProfile#allAppsIconSizePx directly

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/ha3ebrRk0hAEyU8GSWBrYE
Bug: Bug: 271912318
Test: manual with 4x4 and 5x5 grid, see the video
Change-Id: Iaad26758a25c6cb3832a2da10e15c53e72de0ce5
2023-03-15 15:55:26 -07:00
Vinit Nayak 9f70b5b74d Merge "Fix quick switch in between two split pairs crash" into tm-qpr-dev am: 750009face am: fc155dd5b0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21460191

Change-Id: I5fcafaf72bd12d1001f9c61b58f96aa9a351fd66
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-07 00:07:13 +00:00
Vinit Nayak 750009face Merge "Fix quick switch in between two split pairs crash" into tm-qpr-dev 2023-03-03 19:37:04 +00:00
Alex Chau 4d95ac8c7e Merge "Remove focus task" into tm-qpr-dev am: 019f8a640a am: 110007f68e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20980936

Change-Id: I8132ad04086f5704bb54ec4bc6c8e1b60c163fd0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-25 12:30:30 +00:00
Alex Chau aec9d3136f Remove focus task
- Focus task is only removed under ENABLE_GRID_ONLY_OVERVIEW, but many fixes/refactoring are generic and apply with the flag off
- Keep moving running task to front if go to overvied after quick switch, so live tile is always on top right

Grid calculation:
- Fixed some top/bottom calculation assumption that assume focus task is always present

Size calculation:
- With ENABLE_GRID_ONLY_OVERVIEW, taskSize == gridTaskSize, and task is aligned to top-right of gridRect (instead of focusTaskRect)

Bug: 257952455
Test: Enter overview from home
Test: Enter overview from app, with variations that quick switch and enter
Test: Dismiss task from different position
Test: Split select task from different position
Test: Repeat with/without GRID_ONLY_OVERVIEW flag
Test: Repeat with handheld
Change-Id: I6580a8ac6c2c2059c33c4daca05b7d0354513e74
2023-02-24 18:43:30 +00:00
Tracy Zhou d248ee7507 [Gesture Library Integration] Update the check for motion events on
trackpad

The gesture library is ported and enabled, thus we are updating our
check for motion events on trackpad.

Bug: 254783214
Test: Swipe up and hold to go to overview; swipe up to go home
Change-Id: I4b74e88c7f8b6ef86c779391b0f8064ea828ed8f
2023-02-23 20:58:22 +00:00
Jerry Chang f4f2a953bd Fix quick switch in between two split pairs crash
Launcher always receive recent animatino start callback before
onStageTaskChanged callback, which result to not able to identify the
correct animate targets to animate. Update to fetch animate target from
wrapped remote animation target directly.

Fix: 236226779
Test: quick in between two split pairs won't crash
Change-Id: Ic10db086256b4a1ed53e5a3becb6fa9114df74ec
2023-02-18 09:46:11 +00:00
Ats Jenk 0571d30706 Merge "Disable quickswitch for desktop windowing" into tm-qpr-dev am: 5e74542570 am: c6d31fa3d8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21423028

Change-Id: Icf3b48826a83b41828546f771bf92b8469970955
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-15 19:37:42 +00:00
Ats Jenk ce6cebd392 Disable quickswitch for desktop windowing
When desktop windowing prototypes are enabled, disable quickswitch for
now.
Quickswitch causes issues with how tasks are moved between desktop and
fullscreen in prototype 2. We are currently doing it based on shell
transitions. And whether there are desktop tasks visible or not.
Directly switching from a fullscreen task to desktop tasks does not fit
well into this model. And supporting this is not trivial.
As quickswitch is not a core user journey right now, will disable
quickswitch for the time being.
We can revisit this at a later date, when building out the production
version.

Bug: 268075592
Test: enable proto 1, try to quickswitch from home screen and from apps
Test: enable proto 2, try to quickswitch from home screen, from
  fullscreen app to desktop, fullscreen app to another fullscreen app,
  from desktop to fullscreen app
Change-Id: I06b3461f0134819cfa7c9e5f61df8ed84cc90eb8
2023-02-14 10:47:37 -08:00
Schneider Victor-tulias 0fc4446318 Merge "Reorganize ActiveGestureLogs for ease-of-use" into tm-qpr-dev am: 301433c11a am: c57c762816
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21120284

Change-Id: Ide588750e5ac5ce772c595d2b88420a289d9a9ae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-10 23:19:59 +00:00
Schneider Victor-tulias 301433c11a Merge "Reorganize ActiveGestureLogs for ease-of-use" into tm-qpr-dev 2023-02-10 22:01:57 +00:00
Schneider Victor-tulias 0a184a9981 Reorganize ActiveGestureLogs for ease-of-use
Fixes: 268382209
Test: completed several gestures and checked the logs
Change-Id: Ic08bfc553a39bda7401f6565ce5553933dbc0689
2023-02-08 13:37:49 -08:00
TreeHugger Robot d41e222150 Merge "Remove ENABLE_TASKBAR_REVISED_THRESHOLDS feature flag." into tm-qpr-dev am: 96328e98d1 am: e6ab0e44b3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21320084

Change-Id: I62502ea9c3082a45efc58b6dbb28948a6e981f45
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-07 22:22:31 +00:00
TreeHugger Robot 96328e98d1 Merge "Remove ENABLE_TASKBAR_REVISED_THRESHOLDS feature flag." into tm-qpr-dev 2023-02-07 21:03:18 +00:00
Jon Miranda 24bd17f23d Remove ENABLE_TASKBAR_REVISED_THRESHOLDS feature flag.
Test: manual
Fixes: 268056334
Change-Id: Iab0eb1ca76b49f0acb96f50274cb2c81d9f213a5
2023-02-07 09:09:52 -08:00
Hongwei Wang f1a14496b8 Merge "Implement app icon overlay for entering PiP" into tm-qpr-dev am: bfcdd23597 am: 81628c047c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21186942

Change-Id: Icc07c7e09db1bb495036f496281dc0e62e375042
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-04 04:07:57 +00:00
Hongwei Wang bfcdd23597 Merge "Implement app icon overlay for entering PiP" into tm-qpr-dev 2023-02-04 03:11:00 +00:00
Hongwei Wang f8f5486acb Implement app icon overlay for entering PiP
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/cyuEoL0G1HOS8hjfRmlyPt
Bug: 265998256
Test: turn on the flag and enter PiP, see video
Change-Id: Ia7d007ad49574a926a1e25351adf7194210729bf
2023-02-01 16:34:51 -08:00
Tony Huang eb8c32e009 Merge "Fix divider hidden delay if quick swipe to home" into tm-qpr-dev am: c3cb117b01 am: 8d3e1dbed9
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21152801

Change-Id: I2c36ceb9bdca9c463014ac645d92af4578d7e0d8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-01 05:23:22 +00:00
Tony Huang 36baf82028 Fix divider hidden delay if quick swipe to home
We didn't handle such case if transient bar enable and divider is
hidden by split side so it will have a delay.
Catch up it on handleNormalGestureEnd if end target is home.

Fix: 265755388
Test: manual
Test: pass existing tests
Change-Id: I09ac2a3a57c51473daf2b6887cd23bca505378f7
2023-01-31 09:03:09 +00:00
Schneider Victor-tulias 360f6d0130 Merge "Revert "Revert^2 "Cancel gestures on launcher destroy""" into tm-qpr-dev am: 7d346bf90b am: 030ba11d8c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21100567

Change-Id: Ib3d7981a93d9647a3599df12e8093d31941550fa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-30 22:45:51 +00:00
Tracy Zhou 6692653328 Disable quickswitch for trackpad gestures
Bug: 261815244
Test: make sure (1) if user starts by swiping up, disable quickswitch (they will land either in overview, home, or the current app) (2) if user starts by quick switching, cancel the gesture

Change-Id: I6b59cec0089d5e6f22eee3241c6336345dd15dce
2023-01-29 23:56:00 -08:00
Schneider Victor-tulias ece659d11a Revert "Revert^2 "Cancel gestures on launcher destroy""
This reverts commit 377eb40985.

Reason for revert: failing tests
Fixes: 266606727
Fixes: 266621449

Change-Id: I61094be02fb73c5ad65ee65be5ed93a3364f37ef
2023-01-27 14:38:19 -08:00
Schneider Victor-tulias cd09b276c5 Merge "Revert^2 "Cancel gestures on launcher destroy"" into tm-qpr-dev am: 74484f4a99 am: 86fbe3c7ea
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20680308

Change-Id: I8c6e5b7431631ce5577dc6ba8435d607fc3bc883
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-24 19:32:52 +00:00
Schneider Victor-tulias 74484f4a99 Merge "Revert^2 "Cancel gestures on launcher destroy"" into tm-qpr-dev 2023-01-24 17:55:54 +00:00
Ats Jenk 7fd8899e54 Merge "Support desktop tasks in recents animation" into tm-qpr-dev am: de85ee9d23 am: e451c8fe9b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20929666

Change-Id: I70411aa4ae3a933fa8ca2f7e97aa5e799bdaf5e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-23 19:30:53 +00:00
Ats Jenk de85ee9d23 Merge "Support desktop tasks in recents animation" into tm-qpr-dev 2023-01-23 18:14:53 +00:00
Ats Jenk 9db95e89b2 Support desktop tasks in recents animation
Desktop tasks are using freeform windowing mode. Update recents
animation to support freeform tasks when desktop mode feature flag is
enabled.

Changes:
- set initial size for freeform tasks to be the size of the thumbnail
  instead of size of the screen
- support multiple individual remote animation targets when starting the
  recents animation

TODO:
- there are flickers when starting and ending the recents animation

Bug: 263264985
Test: swipe up when more than 1 desktop task is visible
Change-Id: I27ee02774281b3a433d779c0bb8825cdb6ea5457
2023-01-20 14:09:32 -08:00
Tony Wickham ccd389dbdf Merge "Fix launcher crash by set divider hidden" into tm-qpr-dev am: f8176700d3 am: 763a9f2059
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20955885

Change-Id: I919e1cb8cb739cab0d0ce79a8c5a434683f7ca53
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-17 23:04:16 +00:00
Tony Huang 3f5d510b38 Fix launcher crash by set divider hidden
We will hide divider when isLikelyToStartNewTask become true, but
this call sometime earlier than onRecentsAnimationStart then cause
crash because mRecentsAnimationTargets is still null.

Fix this by checking mRecentsAnimationTargets before set divider
visibility. And also add new condition to hide divider to ensure
it hidden if such case happened.

Fix: 265238266
Test: manaul
Test: pass existing tests
Change-Id: I80b1294e69a52e7ac5255cd8e55e7c5e6a3dcbcb
2023-01-16 14:29:19 +08:00