Commit Graph

79 Commits

Author SHA1 Message Date
Vinit Nayak
637274ebc9 Launch AppPair live tile when not visible
* End the recents animation and then relaunch as if
from scratch
* We explicitly ignore the anim for end of recents animation
since that will cause the taskbar to quickly show and stash
again, and we know in this case that we'll quickly be launching
right back into an app

Test: Tested w/ live tile + non live,
fullscreen + app pairs
Bug: 316485863

Change-Id: I6ae8cccc01401935bf96fba8a154216e6b1ad701
2024-04-04 15:58:17 -07:00
Gina Ko
5b845d2831 Reapply "Support toggling Taskbar All Apps with 3P Launcher." am: 036a83cd99
The revert was not supposed to be auto-merged.

This reverts commit 5a3bf93d82, reversing
changes made to 84f8002586.

Bug: 331384026
Change-Id: Ieb11a8544db90259aae856c4af805c37ce9e68cc
2024-03-26 15:03:31 -07:00
Liana Kazanova
036a83cd99 Revert "Support toggling Taskbar All Apps with 3P Launcher."
This reverts commit 176f186a6d.

Reason for revert: DroidMonitor: Potential culprit for http://b/331438065 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: Ie375277ad2f65199749f0211ab50037d4b37e664
Merged-In: Ie375277ad2f65199749f0211ab50037d4b37e664
2024-03-26 20:34:09 +00:00
Brian Isganitis
176f186a6d Support toggling Taskbar All Apps with 3P Launcher.
Taskbar All Apps exists regardless of the default launcher. Thus, we can
toggle it on large screen devices. This CL ties registering the system
action to default launcher and taskbar's enablement.

Test: adb shell input keyevent 117
Test: AllAppsActionManagerTest
Flag: LEGACY ENABLE_ALL_APPS_SEARCH_IN_TASKBAR ENABLED
Fix: 317259709
Change-Id: I26f0ed9e921beac762f3f9e6aaceb1002ad4801a
(cherry picked from commit c113b277e6)
2024-03-26 01:16:39 +00:00
Schneider Victor-tulias
bdc846448c Merge "Update KQS launch task callbacks" into main 2024-02-23 19:54:44 +00:00
Vinit Nayak
2b031727f0 Merge "Log split metrics through individual sessions" into main 2024-02-21 00:20:44 +00:00
Schneider Victor-tulias
56aa9ed61b Update KQS launch task callbacks
Updated KQS to allow launching tasks through OverviewCommandHelper to allow launching the overview task without it having focus.

Flag: LEGACY ENABLE_KEYBOARD_QUICK_SWITCH ENABLED
Fixes: 324888738
Fixes: 324904244
Test: used enter and tap to launch tasks in KQS
Change-Id: I6de38ceea22c362a52a420c8ba0165ba23e5c862
2024-02-20 14:54:08 +00:00
Jon Miranda
26447ddc98 Notify home is visible when launching a translucent app.
To fix the taskbar stash delay when launching an app, ag/18875100
sets the state so that the taskbar stashes immediately after
app is launched.

Since we cannot know if the app is translucent at that point,
we have to check after the animation is started so we can update the
launcher visibility state.

Bug: 314792981
Flag: ACONFIG ENABLE_HOME_TRANSITION_LISTENER TRUNKFOOD
Test: HomeObserverTest
Change-Id: Ifc3a6559d7a8c6fda4c08a0fc2d6791da46b38d6
2024-02-15 13:55:42 -08:00
Vinit Nayak
5a9d4af170 Log split metrics through individual sessions
* Now we log the original source of the first selected app
as soon as the user selects it (previously we only did when user
selected second app)
* We log the item info for the second app to determine second
surface.
* Added new metrics to log after user has started a split session
and ended a split session
* We log different cancellation reasons (cancel button,
home gesture, general other app interruptions, etc).
* One KI/Bug: When the second app is selected via taskbar in
overview, the container will say hotseat because we are using
Launcher's logger and not Taskbar's. Taskbar's logger manually
overwrites the container in TaskbarActivityContext, we may be
able to make something hacky that can allow us to overwrite, but
that'll have to be a separate change

Bug: 322551862
Test: Logged metrics manually with event and itemInfo
Change-Id: I177623fd00ce62acf2d4ee983b58561d8c946d59
2024-02-13 17:55:08 -08:00
Jagrut Desai
2fee4eb040 Fixing NullPointerException in TaskbarUIController
Test: Presubmit
Bug: 322617093
Flag: NONE
Change-Id: I648ff17bbc666f30bd43fdab3320d058ac9e1f9f
2024-01-29 08:52:16 -08:00
Schneider Victor-tulias
5bc6a0aa1f Update KQS task launch animation
Updated the KQS app launch animation to match the spec: translate the launching app from the left (right in RTL) and translate the closing app to the right (left in RTL)

Flag: LEGACY ENABLE_KEYBOARD_QUICK_SWITCH ENABLED
Fixes: 313606549
Fixes: 313607264
Test: launched tasks from KQS from home and launched app
Change-Id: I0e903c741e4f930b377607b7eaf42a87177c3eb6
2024-01-08 16:19:17 -05:00
Jeremy Sim
42a44d7984 Fixes two bugs with findLastActiveTasksAndRunCallback()
This CL changes findLastActiveTasksAndRunCallback to return a fixed array rather than an ArrayList.

1) This fixes a (minor) crash with app pairs, where we performed get(0) on an empty array when no running tasks were found.
2) This also fixes a live bug where app pairs would launch apps in the wrong order if app 1 was not found in running tasks, but app 2 was.

The function should be more robust now, preserving the indexing of the input keys.

Fixes: 316053131
Test: Clear all tasks from Overview, launch an app pair, launch succeeds
Flag: ACONFIG com.android.wm.shell.enable_app_pairs DEVELOPMENT
Change-Id: I51d8ba823a2ec57e9ecfeede956e0afce1d653f4
2023-12-18 11:39:33 +09:00
Jon Miranda
20fdc7b508 Move taskbar clean up so that it only gets called when user swipes up to go home.
This fixes the bug where the flag gets set when user taps on nav handle, which
results in the taskbar animation playing.

Flag: N/A
Test: open app
      wait for taskbar to finish stashing*
      tap on nav handle
      nothing happens (desired affect)
      * I will address tapping on taskbar while its animating in a separate change
Bug: 292108880
Change-Id: I75870050225bdd951c69224d272d0bd5a3d6d4ea
2023-12-13 02:51:28 +00:00
Jeremy Sim
2987d95ba4 App Pairs: Implement Taskbar functionality
[App Pairs 8/?]

This CL adds taskbar functionality for app pairs:
- Ability to drag an app pair icon to Taskbar
- App pair launch from Home Taskbar
- App pair launch from Overview Taskbar
- App pair launch from in-app Taskbar

KNOWN ISSUES:
- Bug (b/315190686): if user is inside a running split pair and attempts to launch the same pair from an app pair icon on taskbar, Overview tiles get temporarily messed up (recoverable by leaving Overview)
- User can attempt to split with an app pair icon on the Taskbar. This should result in a "can't split with this" bounce animation on the SplitInstructionsView (to be implemented). Currently does nothing.

Bug: 274835596
Flag: ACONFIG com.android.wm.shell.enable_app_pairs DEVELOPMENT
Test: Manual
Change-Id: I5256547af236fc2deeb192d60bfe1f2b7ddc5647
2023-12-08 15:07:45 -08:00
Schneider Victor-tulias
f67c54b48f Fix Keyboard quick switch screenshots and spliscreen launch
Flag: LEGACY ENABLE_KEYBOARD_QUICK_SWITCH ENABLED
Fixes: 312449590
Fixes: 292182490
Test: TaplTestsKeyboardQuickSwitch, keyboard quick switched with split app pairs
Change-Id: I0faf2f7d58b39270ad6e5a065cf59f48e0dd23f0
2023-11-29 15:59:04 -05:00
Liran Binyamin
d7f1942d4a Let the bubble bar handle gestures over the bubble bar.
This change introduces a motion event flag to signal that the gesture
is being originated over the bubble bar (similar to the nav bar gesture flag). Downstream consumers use this flag to ignore the event in order
to allow the bubble bar to handle it.

The black screen in b/293348900 seemed to be related to the recents
shell transition closing the app that was in the foreground before
swiping on the bubble bar handle. Not sure why it ended up with a black
screen, but this change avoids starting the recents transition entirely.

Demo: http://recall/-/bJtug1HhvXkkeA4MQvIaiP/BSxLROoflr1i2yy0v6Y4G

Fixes: 294421126
Bug: 293348900
Test: Manual:
      - Add bubble to the bubble bar
      - Swipe up over the bubble bar
      - Observe that the bubble bar expands

      - Launch application
      - Swipe up on the bubble bar handle
      - Observe that the bubble bar expands

Change-Id: Iea15829de97edb6bfbfb7007388865230faaf736
2023-09-26 12:02:27 -04:00
Liran Binyamin
a833af316b Adjust the hotseat when the bubble bar becomes visible
When the bubble bar becomes visible the space between icons in the
hotseat is now adjusted. This change only does it when the QSB is
above the icons, but this will be changed in the future to be based
on the amount of space between the hotseat and the edge of the screen.

When the hotseat is adjusted, the new width is smaller by the size of
2 icons. The icons are then translated to be evenly spaced within the
boundaries of the new width.

Since the adjustment is only applied when the QSB is above the icons,
it is resized accordingly to the new width.

All visual updates currently snap to the new position, but will be animated
in a follow up.

Demo: https://recall.googleplex.com/projects/3391fc5c-599d-4827-b6f8-d2deb160aa99/sessions/fad1a5c5-e9cf-4586-92e4-1e92df3b002e

Bug: 280494203
Test: Manual (on tangor)
      - Set device to landscape
      - Make the bubble bar visible by adding a bubble
      - Rotate to portrait mode
      - Observe that the hotseat is adjusted
      - Rotate to landscape
      - Observe that the hotseat adjustment is removed
      - Rotate back to portrait
      - Observe that the hotseat is adjusted again
      - Dismiss the bubble to hide he bubble bar
      - Observe the hotseat adjustment is removed

Change-Id: I5b02a60b6cb301ffa2507a6d825c748a782cca18
2023-09-13 17:08:42 -04:00
Jeremy Sim
94fd07e5da App Pairs: Implement save, inflate, launch, and delete
This is the third of several patches implementing the App Pairs feature behind a flag.

This patch includes:
- AppPairIcon and associated XML. Actual icon asset is placeholder for now
- Ability to launch split pair on click
- Icon can be moved around, incl. to Taskbar
- App pair can be deleted by dragging to "Remove" drop zone
- Icon persists on Launcher reload

Change-Id: I88aec6fbc814be98f9ef048bbc5af889d0797970
Flag: ENABLE_APP_PAIRS (set to false)
Bug: 274835596
Test: Not included in this CL, but will follow
2023-08-02 12:08:41 -07:00
Schneider Victor-tulias
ab51f2110a Add null-check to findLastActiveTaskAndRunCallback
ItemInfo.getTargetComponent is nullable, so we can't always create a ComponentKey. Added a null-check and proper creation of ComponentKeys

Flag: not needed
Fixes: 286053950
Test: started and completed splitscreen selection from home, taskbar and overview
Change-Id: Ifa30f194ae064fab8aad79c5116f8c859dfd8cf1
2023-06-06 11:02:09 -07:00
Jeremy Sim
f4835a8884 Force Taskbar to remain stashed when in 3p launcher or recents
This patch makes it so that the transient Taskbar cannot unstash when in 3P launcher.

Previously, the user was able to unstash Taskbar when in 3P launcher, causing a janky-looking UI (3P launchers may implement their own version of Taskbar on the home screen. This also caused problems with certain Taskbar commands like split screen, which provide an entry portal to Pixel-specific implementations.

Fixed by forcing the Taskbar to stay stashed when a 3P Launcher is displayed. The Taskbar is still usable inside of other non-launcher apps. This was done by using TopTaskTracker to check for ACTIVITY_TYPE_HOME or ACTIVITY_TYPE_RECENTS, and disabling Taskbar when these activities are running.

Fixes: 277963491
Test: Manual
Change-Id: Ifc0f3c07e3b76eb610f93205978fbc596bab6253
2023-05-12 00:32:24 -07:00
Winson Chung
de1b42b957 Only refresh the launcher resume state when the task launch fails
- The previous call from TaskbarLauncherStateController caused a
  regression due to the inability for the code to distinguish
  Normal -> Background -> Normal when tapping on the bar area
  or from failing to launch a task, so both cases were triggering
  the resumed state to cycle and start an animation.  For now we can
  only handle the task-launch fail case.

Bug: 268448123
Fixes: 281966662
Test: Quickswitch to an activity that finishes when resumed
Change-Id: Ie4692dd85252540ff47633978c0e6e4adbb1bdd0
2023-05-11 23:31:14 +00:00
Mike Schneider
593ff77267 Revert ag/22195243 and solve the initialization issue it was supposed to fix differently
The fix caused a flicker tests to fail, but that is specific to the persistent taskbar used in tests only.

Bug: 277470898
Bug: 277003116
Fixed: 277470898
Fixed: 277003116

Test: Flicker tests passes
Test: Manual (http://shortn/_kiAZykhZsp)
Test: Tapl presubmit tests
Change-Id: Ib9daebf3b06af2f1a4a3b7461acf91f204ff281b
2023-04-13 11:37:39 +00:00
Jeremy Sim
0c5262b9e1 Fix bug with split screen not recognizing user differences
This patch fixes a bug where split screen did not fully support launching intents with different users.

The bug arose because SplitSelectStateController only had one place to store user information about the staged intent, mUser, but this disregarded the fact that the secondary app could also be passed in as an intent, and could belong to a different user from that of the initial app and the existing context. We need to support this case now since we now allow second-app selection from Taskbar.

Fixed by splitting the field into mInitialUser and mSecondUser, which will be tightly bound with mInitialTaskIntent and mSecondTaskIntent to make sure that Intents are always launched with the correct UserHandle.

Change-Id: I1ec49c75d562e4309a41d98010f0eff113c81e9d
Fixes: 275410160
Test: Manual
Merged-In: Ic904672769be8fd116180d457b36eb567c5ee304
2023-04-06 03:42:55 +00:00
Mike Schneider
94f46e14f4 Do not play unstash animation when unlocking the device
The unstash is ignored by TaskbarStashController, while the TaskbarLauncherStateController positions the hotseat on the launcher correctly without animation.

Since the TaskbarStashController is used even with 3p launchers, both of these actors keep track of whether the device is locked independently, based on the SysUI flags.

Bug: 270139677, 266890635, 274084408
Test: manually, Tapl
Change-Id: Iae94522b5d57cc89c9a4d219ad1254b150a3400d
2023-03-22 09:10:03 +01:00
Mike Schneider
308b7849db Do not perform invisible transitions while the screen is off.
This change caches whether launcher was active at the time of the screen
off, and assumes this last state when the screen is actually off.

While trying to understand the code, I renamed a couple class-internal
methods and flags, plus added comments. If they are not accurate, its
due to a misunderstanding on my part, and I will gladly revisit and
check whether all the assumptions I made still hold.

Bug: 261418621
Test: manually

Change-Id: I2ad25caf478100781a063c356c5fd2d20d3e1917
Merged-In: I2ad25caf478100781a063c356c5fd2d20d3e1917
2023-03-21 21:02:55 +00:00
Jon Miranda
1671b704b3 Merge "Hide taskbar view for app open/close animation." into tm-qpr-dev 2023-03-09 00:33:27 +00:00
Jon Miranda
acdf07e0b7 Hide taskbar view for app open/close animation.
Bug: 246635237
Test: open app in hotseat
      close app in hotseat
      the 'matching' view in taskbar should be hidden
      tested icon, predicted icon, folders in taskbar/hotseat
Change-Id: I74382480826afafe6ae58e78faf26fe10812e29b
2023-03-08 10:37:25 -08:00
Brian Isganitis
c762ef68d4 Log when taskbar is in task switcher container.
Test: wwdebug & wwlogcat
Bug: 261177876
Change-Id: Id4eda7ee7e4e2c1aa60e07d5b65410b3847d9ac6
2023-03-07 03:29:21 +00:00
Jeremy Sim
e35d112693 Fix bug with Taskbar not differentiating between user profiles
This patch fixes a bug where Taskbar would not differentiate between user profiles when selecting an app to launch from Overview.

The bug occurred because findLastActiveTaskAndRunCallback(), which checks for already-running tasks when launching an app from the Taskbar, only checks for a ComponentName match and not a userId match.

Fixed by making the findLastActiveTaskAndRunCallback() also check for a userId match.

Fixes: 270456926
Test: Manual
Change-Id: I43ff06083a5dce775fdbd0b0ed951beaae34c0ab
2023-03-01 10:57:41 -08:00
Vinit Nayak
54c262cd67 Merge "Move split functions from RecentsView to SplitSelectStateController" into tm-qpr-dev 2023-02-22 02:15:46 +00:00
Schneider Victor-tulias
8129ebfd04 Merge "Keyboard quick switch polish" into tm-qpr-dev 2023-02-21 21:03:30 +00:00
Vinit Nayak
c97bb4600f Move split functions from RecentsView to SplitSelectStateController
* Moving things out of RecentsView to avoid
dependency on a non-testable class
* Also helping prevent bloating RecentsView.java

Bug: 266482558
Test: Single Chrome instance in recents. Initiate split
with Chrome from workspace, tap on Chrome again in Taskbar,
ensure no crash.

Change-Id: I99ec704479ffaa860f4d80c2cb9f54182f31f41a
2023-02-17 17:28:08 -08:00
Schneider Victor-tulias
0bba3d6184 Keyboard quick switch polish
- Added support for escape(backtick on some keyboards) keyboard keys
- Added support for d-pad left and right keyboard keys
- Fixed janky behaviour when quick switching too quickly.
- Removed unused code

Bug: 269618928
Test: Tried quick switch very quickly, tried escape, d-pad left and right keys in RTL and LTR modes
Change-Id: Ie03207cb349891e9c2de18502f3f65b7c8f9c018
2023-02-17 15:44:04 -08:00
Jon Miranda
13e9b9f889 Translate the taskbar icons to match nav handle shape.
- We need to reset icon alignment whenever icon layout bound
  changes. This fixes the issue where we build an icon
  alignment animator before any of the views are laid out.
- Separated animation logic between.
  createTransientAnimToIsStashed and createAnimToIsStashed
* The values still require a bit more tuning but this gets us
  a lot closer to spec for many of the motion polish.

Bug: 267806083
Bug: 246634367
Bug: 246635237
Test: manual
Change-Id: Id122134b22ef4e418ce632e4a8137239dc8bb313
2023-02-17 10:56:59 -08:00
Jagrut Desai
4ffc71262d Merge "Making taskbar to stay stashed if user launches app for split screen view from all apps view" into tm-qpr-dev 2023-02-15 23:03:19 +00:00
Schneider Victor-tulias
de7ceba80b Add the KeyboardQuickSwitchView (2/2)
Adding KeyboardQuickSwitchView and associated flows.

Test: Manually tested alt-tab and alt-shift-tab in and out of overview on a tablet and phone
Bug: 258854035
Change-Id: Ifb48b005067b3a9c66acfd5ecdbae144b359d3be
2023-02-14 13:34:37 -08:00
Schneider Victor-tulias
f908729fa8 Add the KeyboardQuickSwitchView (1/2)
Preparatory change for adding the KeyboardQuickSwitchView and associated flows.

Test: Manually tested alt-tab and alt-shift-tab in and out of overview on a tablet and phone
Bug: 258854035
Change-Id: I468481a023e82d3ef7c7d4d44c5b9435173b49ae
2023-02-13 15:34:39 -08:00
Tony Wickham
ef03a14980 Making taskbar to stay stashed if user launches app for split screen view from all apps view
Test: Visual
Fix: 263058045

Change-Id: Idcbc4ce90e8d4ff1084780bf331f2cea8b9335ca
2023-02-08 21:53:37 +00:00
Jeremy Sim
6c40e8548e Refactor getIndexOfTask() to getTaskAttributesById()
This change is a minor cleanup to make a function more streamlined.

Bug: 265244769
Test: Manual, confirmed no regression
Change-Id: I557246a7633b10701adf75aaba6930f25e1c30aa
2023-02-02 11:27:56 +08:00
Jeremy Sim
0b4b89bdcf Fix bug with selecting a secondary task as second splitscreen app via Taskbar
This patch makes it so that the correct task will be chosen when selecting a second splitscreen app via Taskbar.

Prior to this patch, the Taskbar app selection function -- which attempts to match the tapped icon to a running TaskView -- assumed that the TaskView in question was always a solo (non-grouped) Task. This resulted in the wrong app being selected for split when the desired Task happened to be the secondary app in a pair.

Fixed by checking to see if the desired app is primary or secondary, and returning the correct Task, IconView, and ThumbnailView for the split operation.

Fixes: 265244769
Test: Manual
Change-Id: Ie1122d1b49151d70dec9711fe558fba7752b7d8e
2023-02-01 15:40:06 +08:00
TreeHugger Robot
5107dff0eb Merge "Fix bug with trying to split an app with itself" into tm-qpr-dev 2023-01-31 23:42:29 +00:00
Jeremy Sim
c779ae54ce Fix bug with trying to split an app with itself
This patch fixes the following user flow:
1) App is already running
2) User initiates splitscreen from Home with that app
3) User selects the same app from Taskbar or AllApps

Previously, this caused a crash because the split-from-home initiation removed the corresponding app tile, causing a null pointer exception when the same task ID was used as a split target.

Fixed by adding a null check: if the target TaskView can't be found for any reason, fall back to launching the second app via Intent instead. If the app doesn't support multi-instance, the UI will now show an attempted split, followed by the message "This app can only be opened in 1 window."

Fixes: 263041522
Fixes: 266218404
Test: Manual
Change-Id: I39ed60c9ac758ac215391f0618f44f7fcee4f32c
2023-01-31 17:58:12 +08:00
Vinit Nayak
49dc6d2712 Launch initial split from taskbar in overview app menu
* Consolidated init calls in SplitSelectStateController
* Also add support to launch from taskbar all apps
* Add logic in SplitSelectStateController to know whether
or not we need to dismiss existing TaskView vs relying
on mSplitHiddenTaskView null check
* Default click handling for SplitShortcut is to start
split selection mode

Bug: 251747761
Test: Initiated split from smart actions, thumbnail app
icon, home, taskbar in overview, all apps. Saw it choose
the latest thumbnail

Change-Id: Ib4f64e619c97615af458a19a9c0efd86c92979d9
2023-01-27 16:46:14 -08:00
Jeremy Sim
2842bc72fd Fix bug with Taskbar launches in Overview
This patch fixes a bug where Taskbar launches (tapping an icon on the Taskbar) were not executing correctly in Overview.

Now that Taskbar is always present in Overview, we need to handle cases where the user taps to launch an app, but the app is already visible to the user in Overview. This was breaking in a noticeable way with split apps, where the Taskbar simply wouldn't respond when the tapped app was already visible as a live tile.

Fixed by polling RecentsModel for already-running tasks, checking to see if the associated TaskView is visible to the user or not, and calling launchTasks() on the TaskView if so. If the tile is not visible to the user, the app will launch normally.

Fixes: 261952204
Test: Work in progress
Change-Id: If761546913bde7451a22456a272ba6c31942c5f8
2023-01-17 13:54:47 +08:00
Brian Isganitis
8216a26bfe Merge "Polish all apps taskbar unstash behavior for transient and persistent." into tm-qpr-dev 2022-12-14 18:54:42 +00:00
Brian Isganitis
2a2f1b6cd3 Polish all apps taskbar unstash behavior for transient and persistent.
- During gestures from taskbar all apps, unstash immediately in
  transient.
- Overlay closes sooner if all apps is open (still done later for EDU).
- Taskbar stashes in overview when All Apps is opened.
- Transient app-window threshold is ignored if All Apps is opened.

Test: Manual
Fix: 262076812
Change-Id: I46b2dcdc75ee0cc15c1b47da2139ff8c20cf618a
2022-12-13 16:24:35 -05:00
Jeremy Sim
538281db37 Merge "Use already-running app instances when splitting" into tm-qpr-dev 2022-12-13 18:21:12 +00:00
Brian Isganitis
85ccf120f2 Better support transient and persistent taskbar in taskbar's overlays.
- Transient taskbar nav threshold now works in overlays.
- Delay closing overlay to transient app-window threshold if necessary.
- Persistent taskbar no longer stashes for EDU overlay.
- EDU overlay provides enough bottom padding for transient and
  persistent taskbar.

Test: Manual
Bug: 217261955
Change-Id: I2ae5612ef70a6d09e22f83f8117cdbf2a0a053b8
Fix: 260769010
2022-12-09 11:24:27 -08:00
Jeremy Sim
2cbd7bbfdf Use already-running app instances when splitting
This patch makes it so that when the user initiates a split from Home, a running app instance is used instead of always attempting to spawn a new Intent. If no matching app instance is found, behavior is unchanged.

Previously, splitting from Home always resulted in a new Intent being staged, which ignored the fact that an app of the same type could already be running. This resulted in undesirable situations like being able to attempt splitting an app with itself in Overview.

Fixed by querying the RecentsModel when a split of this type is initiated, checking to see if there is a running task of the desired type, and using that to perform the split operation if one is found. When Overview is loaded, applyLoadPlan() will now check to see if there is a staged task, and remove the associated tile as needed. If the removed task is part of a pair, this involves creating a temporary TaskView to hold the other task.

Also fixes a bug where using the Taskbar to select one's second app would incorrectly choose the oldest instance of a multi-instance app rather than the newest.

Fixes: 257513447
Fixes: 259936298
Test: Manual
Change-Id: I97a62f34c03aa4980f9cd743e35e9fc6ef4c092d
2022-12-08 13:24:43 -08:00
Alex Chau
cd76ac24b6 Fade in/out taskbar when launching apps from or back to AllApps/-1
- Added isHotseatIconTopWhenAligned to control both iconAlignment and stash animation to just fade in if hotseat icon isn't on top of the screen in the aligned state

Fix: 257355864
Fix: 213455090
Test: Launch apps from/back to home, taskbar animate from/to hotseat
Test: Launch apps from/back to AllApps/-1, taskbar fade in/out
Test: Repeat aboth with transient or persistent taskbar
Change-Id: I6bdae615ff9e199d23cbfe2d26c8d46a08fbc436
2022-12-01 18:56:30 +00:00