Commit Graph

72 Commits

Author SHA1 Message Date
Vinit Nayak
69ee1b9caf Handle fullscreen app launchs in split init flow for SplitSelectDataHolder
* SystemUi split APIs are overloaded to launch fullscreen tasks
as well, break that out into a separate method for clarity
* Have SplitSelectDataHolder also special case fullscreen launches

Bug: 283045822
Test: Launched various combinations of split tasks,
also tapped on initial view to see fullscreen launch with tasks
and intents
Flag: none

Change-Id: If3de9784b72e0f5f27f1b6d97cbf835b8f5391de
2023-05-22 16:30:04 -07:00
Vinit Nayak
6ab2786d16 Separate code paths to launch split from existing pair vs new pair
* Launching existing pair doesn't rely on any existing
data/state in SplitSelectStateController or SplitSelectDataHolder
* Consolidate launchTask*() methods in GroupedTaskView

Test: TaskThumbnailViews measured correctly, animation
correct on small+large screen, initiating split
still working
Fixes: 274540670
Flag: none needed

Change-Id: Id359f53ac5f2bba19948d4ae3231092fb90cc7c5
2023-05-18 10:43:17 -07:00
Jeremy Sim
92e1eeb5f0 Allows splitscreen with work & personal version of the same app
This patch makes changes in various splitscreen controllers to pass userId to the new shell API, to allow same-app splitting with different users.

Fixes: 274973415
Test: Manual
Change-Id: I810b5353aad738c7c275856586b9c521f1554022
2023-05-11 22:10:51 -07:00
Vinit Nayak
2a014d4c0d Refactor handling data launching split screen to separate class
* SplitSelectDataHolder contains logic for knowing how
to launch split, separate from the actual API calls to launch split

Flag: ENABLE_SPLIT_LAUNCH_DATA_REFACTOR
Bug: 279494325
Test: Tested w/ all 6 types of launches noted in
SplitSelectDataHolder#@SplitLaunchType.
Also checked to make sure most-recent running tasks are
still being used where applicable.

Change-Id: I8114f87e9956b100622c80f578e291937ed4eeac
2023-04-28 18:00:22 -07:00
Robin Lee
52b4c77770 Merge "Remove keyguard state from onAnimationCancelled" into udc-dev 2023-04-25 17:35:59 +00:00
Vinit Nayak
955555a314 Merge "Support splitting from workspace with Widgets" into udc-dev 2023-04-22 03:55:23 +00:00
Jeremy Sim
6e0f34cc0a Merge "App Pairs (behind flag): Add new ItemInfo types and DB save functionality" into udc-dev 2023-04-22 03:21:17 +00:00
Jeremy Sim
7cf0dd9e03 App Pairs (behind flag): Add new ItemInfo types and DB save functionality
This is the second of several patches implementing the App Pairs feature behind a flag.

This patch includes:
- AppPairsController, a new controller that will handle creation, launching, and deletion of app pairs
- ITEM_TYPE_APP_PAIR is a new type of FolderInfo (FolderInfo now can be either a folder or an app pair, and should probably be renamed to CollectionInfo or something more generic in future)
- Necessary plumbing for these new types
- Database code that handles saving a new app pair to the database with the correct schema

Flag: ENABLE_APP_PAIRS (set to false)
Bug: 274189428
Test: Not included in this CL, but will follow
Change-Id: Ie3aefd4eb9171f471789f54876de742849d3013b
2023-04-21 14:23:54 -07:00
Vinit Nayak
fd46900b96 Support splitting from workspace with Widgets
* Need to insert widget's icon in animation
* Launching w/ same package app + widget is
broken

Test: Launched apps from predicted apps + widget,
hotseat apps + widget
Flag: ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE
Bug: 276361926

Change-Id: I3e30189e56536371ebd0acfbdd2c073a882cc731
2023-04-21 14:05:12 -07:00
Robin Lee
7e5594928c Remove keyguard state from onAnimationCancelled
Reason for revert: b/276433230

Test: atest CtsWindowManagerDeviceTestCases:KeyguardTests
Test: atest PowerKeyGestureTests
Bug: 276433230
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:11e6fdd982ab7e6df951dcfe97948f81a8f36d75)
Merged-In: I62d760206dfd13ba4de7a77d2906b0f90bd2c343
Change-Id: I62d760206dfd13ba4de7a77d2906b0f90bd2c343
2023-04-21 09:06:02 +00:00
Tony Huang
26b426aa89 [Re-land] Implement two intents or shortcuts to active split
Implement two intents or shortcuts to active split with shell
transition.

Fix: 259368992
Test: manual
Test: pass existing tests
Change-Id: If65ddbe6486a8bb1766019c6e05ac2cc5cbe08fc
2023-04-10 13:04:30 +08: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
Evan Rosky
8869bb5f40 Improve transition logging
Adding debug-names to remote transitions so that
they can be identified across processes

Bug: 276349701
Test: existing tests since this doesn't change logic
Change-Id: I41400feeb2dd91971f8c750613085c80af309aea
2023-03-30 15:28:43 -07:00
Vinit Nayak
392b20c0ad Merge "Add initial split from GroupedTaskView animation" into tm-qpr-dev am: 4b0a5ed8fa am: 4eb50abbc3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21613692

Change-Id: I1794100f231254037be49f4204fc142270543b94
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-09 22:03:03 +00:00
Vinit Nayak
aa7bf8b394 Add initial split from GroupedTaskView animation
* Created SplitAnimationController to prevent more
RecentsView bloat
* Extract SplitSelectSource attributes into separate class
* http://recall/-/cMb5xTTxhmZtFt04eYnmQj/eACJq1un8Ef91LgmQblpAw

Bug: 267370106
Change-Id: I5d430c091ac84bbbc30319e7b78711b610a21252
2023-03-08 15:17:57 -08:00
Jeremy Sim
86e4f02035 Merge "Fix bug with Taskbar not differentiating between user profiles" into tm-qpr-dev am: 24b1890c4b am: 0027186ea2
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21566360

Change-Id: Ic90db4ff687565109c3644cede0f7c50f9f66f4a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-02 04:10:00 +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
26016622c1 Merge "Refactor SplitSelectStateController to add testing" into tm-qpr-dev am: c9120521ff am: 2fea4c6f1b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21487925

Change-Id: I418fa47df9af8c94a31d3c30124c96cc78e6d758
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-23 00:53:05 +00:00
Vinit Nayak
4e3636e8d0 Refactor SplitSelectStateController to add testing
Bug: 266482558
Change-Id: I2d62a3a310043710d66a26bc533df2309084b81e
2023-02-22 10:51:49 -08:00
Vinit Nayak
8e17afacdd Merge "Move split functions from RecentsView to SplitSelectStateController" into tm-qpr-dev am: 54c262cd67 am: 06ed4db282
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21468212

Change-Id: I4f8fab35c7c4c1de91927fc01a3b8a90d8d4aacd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-22 03:51:29 +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
Jerry Chang
5fa52483de Merge "Support entering split screen with a shortcut and an intent" into tm-qpr-dev am: ab314be1e4 am: a7fb317875
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21276377

Change-Id: I0752a358e3f14d01a237fc22a8351b02ada2083d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-08 08:49:35 +00:00
Jerry Chang
7c59ccac02 Support entering split screen with a shortcut and an intent
Starting a split pair by indicating (shortcut|shortcut) or
(shortcut|intent) was not properly supported, update to leverage
startIntens flow to handle shortcut info when starting a split pair.

Fix: 265919000
Test: repro steps of the bug
Change-Id: I9afcd6f3cdfb5530c1b440a9c0ade8c9952a5fff
2023-02-08 03:27:41 +00:00
Vinit Nayak
7ffc338a42 Merge "Launch initial split from taskbar in overview app menu" into tm-qpr-dev am: d710773889 am: fd185e6402
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20956773

Change-Id: I78f6b8fee567230a59d533ca17bebc3c578e9040
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-28 07:08:17 +00: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
Azhara Assanova
bf0e65a6e9 Add a no-op flag to mutable implicit PendingIntents
Starting from target SDK U, we will block creation of mutable
PendingIntents with implicit Intents because attackers can mutate the
Intent object within and launch altered behavior on behalf of victim
apps. For more details on the vulnerability, see go/pendingintent-rca.

From a quick analysis, we concluded that the intents passed into
getPendingIntent() can be both explicit and implicit, so we added
a no-op FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT to bypass the above block of
mutable implicit PendingIntents.

The flag is introduced in ag/21018466.

Bug: 236704164
Bug: 229362273
Test: TH passes
Change-Id: Ia26c8f92d1b4b50e04bc6b487619f54efc7d5a1d
2023-01-25 15:39:35 +00: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
Tracy Zhou
7e0f5d8a57 Implement split from workspace to workspace
Fixes: 239824922
Test: https://recall.googleplex.com/projects/f46cfe9c-8076-4efe-bf8a-b1cc4f1f5e1b/sessions/b745433d-cba7-4f7a-a28d-4223d9950c0b
Change-Id: I9bfd5844bb9ccb6e65e77fedb7fbccb37692f812
2022-11-15 22:11:28 -08:00
Jerry Chang
e444ffb124 Make multi-instances split opt-in based
Remove appending MULTIPLE_TASK flag when starting an intent and a task
into split screen and leave it to wm-shell to decide whether to append
the flag or not.

Bug: 255224696
Test: atest WMShellFlickerTests
Test: manual check the start intent and task flow
Change-Id: I3d887f8dcea67b12a7e94cef55850d52a79a8d2d
2022-11-08 08:59:35 +00:00
Sunny Goyal
1319de88b4 Removing RemoteTransitionCompat and related wrappers
Bug: 221961069
Test: Presubmit
Change-Id: Ib93640d27a9eb0401882574e37b466163dafa5b3
Merged-In: Ib93640d27a9eb0401882574e37b466163dafa5b3
2022-11-02 23:40:48 +00:00
Tracy Zhou
ba0b5952c8 Support split from fullscreen with shortcuts
Recording: https://recall.googleplex.com/projects/f46cfe9c-8076-4efe-bf8a-b1cc4f1f5e1b/sessions/978a3a55-2982-4026-9726-2a73cb694258

TODO: improve transition animation

Bug: 246661484
Test: manual
Change-Id: Id0d1aec0685bc18f4b273f8e466996efc1d9a3d8
Merged-In: Id0d1aec0685bc18f4b273f8e466996efc1d9a3d8
2022-11-01 04:30:39 +00:00
Sunny Goyal
8a11443333 Removing unnecessary RemoteAnimationTargetCompat
Merged-In: I12a4c29eaf9bd7d97d3c02074b4cc1ca452fc88a
Bug: 221961069
Test: Presubmit
Change-Id: I12a4c29eaf9bd7d97d3c02074b4cc1ca452fc88a
2022-10-24 17:17:36 +00:00
Jerry Chang
3d39bfcda7 Support starts a pair of intent/shortcut and task to split
Add startIntentAndTask and startShortcutAndTask APIs to support starts a
pair of intent/shortcut and task to split with shell-transition.

Fix: 250875492
Test: atest WMShellFlickerTests
Test: manual check start tasks or start intent/shortcut with task flow
      with shell-transition enabled
Change-Id: Ibce60f3a10e2bbc99ef17185f45680dc23ef5f48
2022-10-05 06:44:25 +00:00
Jerry Chang
e3f95693ef Remove stage concept from split screen APIs
Since split screen has transferred from stage-based model to app-pair
model. Update to remove the stage concept from split screen APIs, so the
caller won't need to deal with stage concept.

Bug: 250875492
Test: atest WMShellFlickerTests
Test: manual check start tasks or start intent/shortcut with task flow
Change-Id: I36bfb54f3f690cfafd18ba31ab23f5745ead6d97
2022-10-05 03:27:02 +00:00
Vinit Nayak
7fb4f997c4 Add metrics sources for split invocation
* See design doc in bug description for
usage/details

Bug: 231369744
Change-Id: I0c0ec11e924e387c523b5ac5feb7cabf78eaa748
2022-09-14 11:58:03 -07:00
Jerry Chang
bf9ce9c096 Support launching a shortcut and a task to split screen
Fix: 243101552
Test: long press on a shortcut to enter split screen works
Change-Id: Icaabf2e1c8be086bd1b79e0a2cf05878767caa15
2022-09-02 06:58:08 +00:00
Jeff Chang
9f27fa3687 Launch split task with correct UserHandle
PendingIntent#getActivity gets the owner UserHandle from the app
context. That makes the activity launch fail since the app only exists
in the work profile environment(secondary user).

This CL gets the correct Userhandle from Launcher and use
PendingIntent#getActivityAsUser to launch split task.

Bug: 242039471
Test: Launch Google chat by shortcut to enter split (work-profile)
Change-Id: Ie1db8a858bf9cee700cb3ff3a9e607a5d1dbad30
2022-08-24 10:39:04 +08:00
Jerry Chang
4322190a24 Merge "Integrate split pair cold launch transition with shell transition" into tm-qpr-dev 2022-08-11 07:05:18 +00:00
Jerry Chang
40ff08495b Integrate split pair cold launch transition with shell transition
Fix: 222163803
Test: enabled shell transition, cold launch a split pair from overview
      has proper transition.
Change-Id: Ia5398d24baa64bc98a04e839f6d1247c7c7aabeb
2022-07-29 16:53:02 +00:00
vadimt
f6ef879cf4 Moving all sources that are shared between Launcher and TAPL in one directory
This will help SysUI test team (who uses TAPL) to set up Gradle build for their tests.

Bug: 202567877, 234414088
Test: presubmit
Change-Id: I3d923ea4b54d1a4c3d2b345be09692727d30433e
2022-07-27 20:18:46 +00:00
Tracy Zhou
86a844c976 Add splitFromOverviewForTablet test
Design doc: go/split_tapl

Bug: 238553914
Test: run this test

Change-Id: Ibb385d852f73dee10470d14c4962cf482740105d
2022-07-19 01:57:35 +00:00
Jeremy Sim
c94f4b779b Allows Launcher to recover gracefully into OverviewSplitSelect state
When Launcher restarts (as the result of a UiModeChange or something else), it attempts to recover its previous state. However, the OverviewSplitSelect state is unique because it requires some additional information to recover properly (the taskId of the staged task and so on). This change makes it so that the relevant information is passed forward in the recovery bundle. Launcher will now restart in the base Overview state, and then immediately apply the saved data to recover the OverviewSplitSelect state.

Fixes: 233019928
Test: Manual
Change-Id: Ie6123ef9c374be000268f82857b696c49213c541
Merged-In: Ie6123ef9c374be000268f82857b696c49213c541
2022-07-01 00:07:54 +00:00
Vinit Nayak
a4e5a9eebe Prevent double selection of second split app
* Also fix small other bug where we were
checking only for LauncherState
OVERVIEW_SPLIT_SELECT and not for equivalent
3P RecentsState

Fixes: 227419997
Test: Repro steps don't cause bug. Yay.
Change-Id: Ibb8238185b959d22d8455b6812d29b2e268d9739
2022-04-14 11:06:47 -07:00
Tracy Zhou
53ad207008 Use topComponent to get package name
task.topActivity can be null

Fixes: 226232720
Test: manual
Change-Id: I7d0c928871d01402bf41bc96514aae7854045baf
2022-03-22 17:13:52 -07:00
wilsonshih
7315e33630 [Shell Transition]Release floating task view after second task select.
Register animation start callback to RemoteSplitLaunchTransitionRunner,
so there can clear up the floating task view when entering recents.

Bug: 223397364
Test: verify no floating task view remaining on RecentsActivity.
Change-Id: Idedc7950b8954d1376960d5e74aa4c60fefa9c86
2022-03-16 11:30:46 +08:00
Tracy Zhou
d9cb8cfa0d Support launching an intent and a task from the same app as multi-instance
Similar to ag/16820166, add FLAG_ACTIVITY_MULTIPLE_TASK to the fillInIntent

Fixes: 222583964
Fixes: 217965464
Fixes: 221415250
Test: https://recall.googleplex.com/projects/f46cfe9c-8076-4efe-bf8a-b1cc4f1f5e1b/sessions/7606236a-3350-49d6-bfad-9e6a609413d1
Change-Id: I676358ef1cbff8317995430de961a0a3242c0cbf
2022-03-09 15:21:45 -08:00
Tony Huang
3a2d621429 Refactor startIntentAndTaskWithLegacyTransition
Param intentFirst is not necessary because we could use stagePosition
to ensure intent side is left or right.
Remove it and ensure start task on main stage at split side.

Bug: 218613028
Test: pass existing tests
Test: manual
Change-Id: I3b8fc74b18c4d48fe73b501be696c3d59677183b
2022-02-15 15:57:02 +08:00
Tracy Zhou
a0d4720815 Initial implementation of split from workspace and all apps
Bug: 216829535
Test: https://recall.googleplex.com/projects/f46cfe9c-8076-4efe-bf8a-b1cc4f1f5e1b/sessions/feb5db9c-9429-42c2-a124-777e66fd5f0b
Change-Id: I34118975d0d7e15eb46b483f5a05447f5391e6fd
2022-02-02 13:37:47 -08:00
Vinit Nayak
1465a5af7b Handle split selection when animation is disabled
* Consolidate setState() and setStateWithAnimation()
to be handled in the same manner
* If no animation, we run the created
PendingAnimation right away

Fixes: 209935590
Test: Tested w/ and w/o animation
Change-Id: I1d6fdba21761b6721e6bd52234016178547cd437
2022-01-05 12:19:11 -08:00
Jerry Chang
279c3b7fa2 Support to launch app pair from overview with recorded split ratio.
Bug: 207479945
Test: Quickswitch back to app pair keep split ratio
Change-Id: Id24195c15fe59053cc51515a942f72c3b8e87ba7
2021-11-25 11:38:14 +08:00