Commit Graph

62 Commits

Author SHA1 Message Date
Alex Chau
2d9692f63d Destroy taskbar if it's not present in DeviceProfile
Bug: 254119092
Test: manual
Change-Id: I9eb95cc90c92bf93d9220b05406d4589b2cb196f
2023-01-20 20:57:58 +00:00
Nicolo' Mazzucato
696238e086 Provide single threaded executor to UnfoldUnfoldTransitionFactory
This fixes a concurrency issue where HingeSensorAngleProvider was being stopped and started at the same time in a thread-pool after a fast fold/unfold, despite not providing concurrency guarantees.

In sysui, the background executor provided was already single threaded, so no issue arisen. From Launcher, THREAD_POOL_EXECUTOR was provided.

In a follow up cl, I'll add a @SingleThreadBackground annotation to the executor used in the unfold lib.

Bug: 261320823
Test: manually stress tested fold/unfold.
Change-Id: Iccf1f1f7246d8592d4d80a032479aa75f0050655
2023-01-12 09:19:48 +00:00
Vinit Nayak
0d784ee7fb Toggle taskbar button nav assistant availability
* New signals coming in from Sysui reflect the toggle
in Settings for long pressing on home button to
invoke assistant.

Fixes: 255909545
Test: Manual + added unit test for TaskbarNavButtonController
Change-Id: Ic65a80b0b9697990931b7e89756773fb086cc3bd
2023-01-03 20:07:27 -08:00
Nicolo' Mazzucato
1ee66e943a Add logs to aid missing unfold animation on launcher investigation
Bug: 261320823
Test: Manual
Change-Id: If714750c85ee49e66e21462ab9d2675ab0be8b55
2022-12-06 13:06:01 +00:00
Alex Chau
e818bcb997 Use real IDP in DeviceProfileTest
- Mock WindowManagerProxy instead of IDP in DeviceProfileTest
- Extracted NavigationMode to standalone class
- Moved parseNavigationMode to WindowManagerProxy so it can be mocked
- Moved DeviceProfileTest to internal repo

Bug: 242086027
Test: DeviceProfileTest
Change-Id: Ia5a43293b1380f04d786d2adf8503cfd10f7674a
2022-09-07 10:35:21 +01:00
Tony Wickham
c8e824dbdb Add support to Tapl to recreateTaskbar
Also moved references of "tasbkar_view" to share TASKBAR_RES_ID constant

Test: compiles; see follow up CLs
Bug: 235986838
Change-Id: I69bcfa975550e567f3daa35af8a810546297d79c
2022-08-30 13:40:45 -07:00
Sunny Goyal
d6801af69a Inlining BaseQuickstepLauncher to QuickstepLauncher
Bug: 243022799
Test: Presubmit
Change-Id: I3706fc1f10d88ea73bd873c7e94c3e78795791eb
2022-08-24 12:51:21 -07:00
Vinit Nayak
8a3d05587e Show 3 button nav on phone in Taskbar (1/2)
* TODO: Landscape/seascape support,
        Separate nav spacing out into
        separate class/add tests

Bug: 219035565
Change-Id: I8f5c007f04ea4d6df15962772806356181d764ff
2022-08-09 13:25:50 -07:00
Vinit Nayak
7db37b3d94 Use Taskbar window for phones (only works on gesture nav) with flag
* Try to avoid re-creating TaskbarActivityContext to
avoid re-inflating taskbar views
* Toggle via Flipper App (key 1101)
OR adb shell setprop persist.wm.debug.hide_navbar_window 1 && adb reboot
TODOs
* Only works for gesture nav, not 3 button
* Sampling on phone doesn't always work.

Bug: 219035565
Change-Id: I2a015f99d5f1fe86d7261eec9fd898bd4480ff9f
2022-08-01 17:48:09 -07:00
Brian Isganitis
a9a78117c7 Have separate DeviceProfile instances for taskbar and all apps windows.
We want to scale down the DeviceProfile for taskbar, but the all apps
window should rely on the original DeviceProfile.

Test: Manual
Fix: 232907361
Change-Id: Ia09f674ada9e445c1d7278fa94c536ea9de13ef9
Merged-In: Ia09f674ada9e445c1d7278fa94c536ea9de13ef9
2022-05-25 18:11:51 +00:00
Schneider Victor-tulias
766f2fc346 Coordinate the SUW All Set page first reveal with the taskbar unstash to hotseat animation.
Bug: 220096988
Test: manual
Change-Id: I1f517b322e5c18f825be8b51ebb560a4a195b666
2022-05-13 11:17:10 -07:00
Schneider Victor-tulias
9b6babf839 Translate the 3 navigation buttons to/from their in-app position when animating to/from the -1 screen, all apps and widgets.
Bug: 221455508
Test: opened all apps, widgets, -1 screen, notifications shade and keyboard in various combinations and orders; locked screen, launched app, returned home with the back/home buttons, opened overview
Change-Id: Ia0b406aacf72b34bd6b7ff1c01278ab6895a7da4
Merged-In: Ia0b406aacf72b34bd6b7ff1c01278ab6895a7da4
(cherry picked from commit 9c1a452a1d)
2022-05-02 18:45:01 +00:00
Vinit Nayak
188ae14220 Listen for density changes through DisplayController callbacks
* Make display controller callbacks member variable for
clarity.
* Created follow-up refactor (b/227669780)

Fix: 227329641
Test: Repro steps in bug no longer make taskbar appear
when it shouldn't

Change-Id: I83702c0b817749943d2a9c4c5f0e44342a475e75
2022-03-31 16:20:23 -07:00
Tony Wickham
3b7a391c2b Don't recreate taskbar on rotation
This was a regression due to ag/17241303, since technically the size changes when rotating (width and height swap). Now we detect that case and don't recreate, but instead propagate the new DeviceProfile via TaskbarActivityContext#updateDeviceProfile()

Test: Open an app, rotate device, ensure taskbar isn't recreated. Changing properties such as dark theme does still recreate taskbar.
Bug: 219981733
Change-Id: Ic827c8e697a284a085609ea8653d77900686306a
2022-03-24 10:35:10 -07:00
Vinit Nayak
bacd5e1d21 Use ComponentCallbacks to recreate on fold/unfold
* DisplayController callbacks were sometimes being
called too soon and providing stale window bounds,
which led to the incorrect DeviceProfile being used.
Switched to ComponentCallbacks on the window to get
the most up-to-date callbacks.
* Sadly, for navigation mode changes, ComponentCallbacks
get fired too soon and have a stale navigation mode
so we continue to rely on DisplayController for that
change for now.

Fixes: 219958843
Test: Tested folding/unfolding, no taskbar appears when
it shouldn't.
Tested with changing display/font size as well as
nav mode changes

Change-Id: I1b398934c0ea49f69bad19b13977b7b0906f3190
2022-03-17 12:03:14 -07:00
Nick Chameyev
41b7f53805 Merge "Do not run unfold taskbar animation when in portrait" into tm-dev 2022-03-09 10:26:21 +00:00
Nick Chameyev
fe9ec740cc Do not run unfold taskbar animation when in portrait
Limits taskbar icons translation animation
only when the display is in natural orientation.

Bug: 219958588
Test: fold/unfold in portrait and landscape
Change-Id: I33e26829ae37f1df39e8c7234f98d20eb7993b93
2022-03-08 12:03:32 +00:00
Sunny Goyal
4403d078a6 Moving NavigationMode to display controller
Navigation mode affects display properties like bounds and
most listeners already had a similar display listener. This
will remove race conditions when managing the two events.

Bug: 221961069
Test: Presubmit
Change-Id: If7a22e006e6b969ecddf075001066809aa72995c
2022-03-04 18:11:33 -08:00
Vinit Nayak
58c27cce73 Remove Taskbar and Taskbar EDU flags.
Bug: 219035565
Change-Id: I643b5d006b5759723418901ffeb463fa04a82cbc
(cherry picked from commit ec4adc1d5a)
2022-02-23 18:14:28 +00:00
Schneider Victor-tulias
bce63e06ed Merge "Fix taskbar icon dragging issues" 2022-01-25 19:03:06 +00:00
Schneider Victor-tulias
312b68fde4 Fix taskbar icon dragging issues
- Fixed icons disappearing when initiating dragging
- Fixed incorrect icon location when initiating dragging after rotating the screen to an orientation other than what launcher started in

Fixes: 215418478
Fixes: 214025075
Test: dragged icons from the workspace and taskbar
Change-Id: I848138af28802f7d806708c77c25b8de307c70d8
2022-01-20 14:56:01 -08:00
Schneider Victor-tulias
fa0bfee97a Add log dumps for taskbar state
Test: created bugreport and checked logs
Bug: -
Change-Id: Ic0c2330b18c8daf181ae5b236e0c4b212d630fa3
2022-01-20 14:41:25 -08:00
Pat Manning
2c4a1d8f7a Create taskbar for kids mode.
Test: manual
Bug: 203749295
Change-Id: I52c05cf8685e6e921bb717e9714d1cb2e5f4a351
2022-01-07 11:25:04 +00:00
Vinit Nayak
1144fa8c3d Merge "Add task unpinning support for 3 button taskbar" into sc-v2-dev am: f198f6e492 am: b3f069e06c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16339859

Change-Id: Ifb1a086f3a93f14ee7a8889c110b991c7b7701d9
2021-12-01 05:06:34 +00:00
Vinit Nayak
570653346f Add task unpinning support for 3 button taskbar
Bug: 199544447
Test: Tested on small and large screen
Change-Id: Ib7785992ef11825cd07a929e2cb623d02ef246f1
2021-11-30 17:18:09 -08:00
TreeHugger Robot
3057559690 Merge "Handle configuration changes in floating rotation button" into sc-v2-dev am: ed05712f04 am: 6b45ff77e8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16343605

Change-Id: I412679a314a4eab71a035c62884df44ca55e62f9
2021-11-29 20:19:02 +00:00
TreeHugger Robot
ed05712f04 Merge "Handle configuration changes in floating rotation button" into sc-v2-dev 2021-11-29 19:41:26 +00:00
Nick Chameyev
71eed5ca35 Handle configuration changes in floating rotation button
Update resources in floating rotation button
when configurations such as screen density, screen size,
current locale have changed.

Bug: 200103245
Test: change display size, locale, fold/unfold
 -> check that floating rotation button resources
    are updated
Change-Id: Ia69f4f8b393a686012e286a1e39822650c562d52
2021-11-26 11:38:28 +00:00
Winson Chung
cc60ff2fff Merge "Removing logs" into sc-v2-dev am: c1afaa4042 am: c0098a8628
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16248600

Change-Id: Id59fc54915e3f0c54d38904dff7c62d3c937e028
2021-11-23 22:23:39 +00:00
Winson Chung
c1afaa4042 Merge "Removing logs" into sc-v2-dev 2021-11-23 21:58:14 +00:00
Tony Wickham
329d07d91d Merge "Add support for dark tint on taskbar nav buttons" into sc-v2-dev am: 426b021e22 am: 7a957e914e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16250063

Change-Id: I15f08a40e4414b410a1571b97284ada43d610747
2021-11-22 22:30:14 +00:00
Tony Wickham
9ceae57095 Add support for dark tint on taskbar nav buttons
Tint the buttons when taskbar isn't drawing a background (either due to alpha or offset).

Test: Dark icons on a light wallpaper on home screen, dark icons when light IME is showing
Bug: 204256643
Change-Id: Iae634a1b604f50edc102905abd0d812a43c5346e
2021-11-17 16:28:21 -08:00
Merissa Tan
5f2516c03a Create new TaskbarUIController class for Kingyo.
This CL creates a new TaskbarUIController sub-class to allow for taskbar
UI customization on Kingyo.

Recall: http://recall/clips/598d7fc8-fa06-426b-8851-c5d5c1a91eb2

Bug: 202450677
Test: Manual
Change-Id: I9e06fe7556bd9a29d126e29c0277139b2f218069
2021-11-12 12:05:50 -08:00
Winson Chung
21d129de28 Removing logs
Bug: 201305599
Test: Builds
Change-Id: Ic480136ee6b158dc614d43beaed1dfce91b9ca8a
2021-11-12 17:18:11 +00:00
Winson Chung
cc4a1925a6 Remove debug tracing checks to get logs beteween tests
Bug: 201305599
Test: Presubmit
Change-Id: Iab4430f88a2cac97a056486edd97895bc30a03b1
2021-11-05 09:45:13 -07:00
Winson Chung
067faf3bbe Add some logging for taskbar recreation
Bug: 201305599
Test: Manual
Change-Id: I437fe3226657ebe7b5507146fbe5e7f32e2e2fce
2021-11-03 11:17:44 -07:00
Nick Chameyev
0288d2e8bb Move floating rotation button handling to Launcher
Moves handling of floating rotation button when navigation
bar is not created to the launcher. This button was not
showing when taskbar is visible as it was initialized in
navigation bar (which is not created for large screens).

Bug: 200103245
Test: rotate phone when autorotate disabled on inner screen
Test: showing rotate suggestion when gesture nav enabled/disabled
Change-Id: I13dd555bcd811f1524be7ab9ad51b2b012b3b749
2021-11-01 10:36:34 +00:00
Tony Wickham
5a5a926945 Recreate taskbar when dark mode changes
Also dispatch sysui flags to all controllers upon recreate, not just NavbarButtonsViewController. Additionally, tell the controllers to skip the animation due to the flag changes if it's fromInit.

Test: Enable themed icons, switch dark theme in quick settings, ensure taskbar updates
Fixes: 204403933
Change-Id: Ic43a50cf0456175f9beba5c29360440f051cbd2d
2021-10-28 17:49:03 -07:00
Tony Wickham
8791e7de11 Add FallbackTaskbarUIController
- Refactor TaskbarManager to accept StatefulActivity instead of BaseQuickstepLauncher
- Update the new StatefulActivity in onOverviewTargetChange()
- Cleanup LauncherTaskbarUIController a bit to avoid initializing TaskbarActivityContext, TaskbarDragLayer, and TaskbarViewController in the constructor, and instead get these from mControllers after init()

Test: No change in behavior
Bug: 188790554
Change-Id: Ic4d69d73deb6dada416876eb265db57803c3adfd
2021-10-21 10:53:46 -07:00
Nick Chameyev
8523412470 Merge "Do not animate statusbar unfold when in portrait orientation" into sc-v2-dev 2021-10-21 10:02:00 +00:00
Sunny Goyal
2a528a43c1 Delaying taskbar loading until user setup completed
> Also keeping it stashed while all-set activity is visible
> Creating a shared state (simiar to saved instance state) for taskbar
> Keeping taskbar stashed while all-set activity is visible

Bug: 194786060
Bug: 201782272
Test: Manual
Change-Id: Iab5e082243a206772266aece62d3028f5acb6400
2021-10-19 12:38:02 -07:00
Nick Chameyev
ae818dfe42 Do not animate statusbar unfold when in portrait orientation
Disables unfold animation for statusbar when it is
perpendicular to the screen fold.
Moves ScopedUnfoldTransitionProgressProvider from launcher
to shared SysUI/Launcher code

Bug: 201518277
Test: manual
Test: atest com.android.systemui.unfold.util.NaturalRotationUnfoldProgressProviderTest
Change-Id: I1417ee89b132b541d5a3ed0e5ddcbc56d827da96
2021-10-15 14:06:42 +01:00
Vinit Nayak
a08e806e25 Move back to end of screen on keyguard
* Animate it back into position after user unlocks
* Re-create taskbar on layout direction change so
PropertyHolders are recreated to take into account
new values

Fixes: 199852418
Test: Tested w/ password + pin for gesture + 3 button
Change-Id: Ie7f16f737a8fc12328c05d7628d0e3ae09fc08ca
2021-10-06 18:09:15 -07:00
Tony Wickham
4db4ec118b Destroy taskbar when device is shutting down
Test: Shutdown/restart device, ensure taskbar isn't showing
Fixes: 194633599
Change-Id: I8061e515e122c446438975b98527aeda6c59996a
2021-09-10 16:18:20 -07:00
Tony Wickham
abaa481bfb Update taskbar color in onConfigurationChanged()
Test: Change wallpaper, ensure taskbar updates to match
Fixes: 199045474
Change-Id: I7ec8bbec8e31d2d03c09bf487ab55c86b95917e7
2021-09-07 15:39:53 -07:00
Nick Chameyev
4dd4159fdc Add taskbar icons unfold animation
Adds 'move from center' animation for taskbar icons when
unfolding foldable devices.

Moves unfold transition progress provider from quickstep
launcher activity to TouchInteractionService to widen
the scope when this provider is available to cover
both launcher activity and taskbar.

Launcher activity and taskbar get their own instances
of unfold transition progress provider using
ScopedUnfoldTransitionProgressProvider wrapper.
This wrapper allows to get transition progress provider
that emits events only when clients are ready to handle them.

Bug: 193794563
Test: manual
Change-Id: I27581bd4e145a74f526bf60f2a545e56ded322f9
2021-09-03 10:25:52 +01:00
Tony Wickham
14cba5e009 Show back button in SUW
- Listen for USER_SETUP_COMPLETE
- Recreate taskbar, forcing nav buttons to be visible

Test: Run setup wizard and ensure back button is present, then is replaced with taskbar when setup is complete
adb shell am start -a android.intent.action.MAIN -n com.google.android.setupwizard/.SetupWizardTestActivity

Fixes: 191846922
Change-Id: I789186dcc23a2db7cc4637b1cb0486f0d2add784
2021-08-26 17:34:54 -07:00
Tony Wickham
8a2c1cbc5a Add taskbar stashing feedforward, i.e. hint at upcoming stash/unstash
Also fix unstashing not working in 3P launchers by moving the unstash call from LauncherTaskbarUIController to TaskbarActivityContext

Test: long press taskbar background and stashed handle, watch it hint towards the new stashed/unstashed state respectively and then complete the animation when the long press is triggered
Fixes: 193926311
Fixes: 192926350
Change-Id: I0e538be9129bf5c600d07f360b8106d7077862ad
2021-07-19 14:09:33 -10:00
Alex Chau
60cacdf373 Notify System UI about taskbar state
We want to move the rotation suggestion button to the middle
of the taskbar when it is visible and not stashed.
To do this we need to update System UI about the current
state of the taskbar.

Test: manual
Fixes: 187410455
Change-Id: Id918e10a44631362f7c3a8a8bb624ee80bdd3c8b
2021-07-02 10:48:04 +01:00
Sunny Goyal
6e1ce8ccb8 Fixing out of order taskbar callbacks
OnCreate can come before onDestroy for a previous activity which can
cause the callbacks for taskbar to get cleared

Bug: 190170303
Test: Presubmit
Change-Id: I48334605384d4604043a50ffc3d137f84575148a
2021-06-18 12:44:38 -07:00