Commit Graph

13217 Commits

Author SHA1 Message Date
Schneider Victor-tulias a4c8c7fafb Merge changes Iceb7c9cf,I1e802e67 into main
* changes:
  Fix NPE in LauncherSwipeHandlerV2Test.setup
  Update recents states sent to tests by RecentsWindowManager
2025-01-07 07:46:03 -08:00
Schneider Victor-Tulias 878b2af8ea Update recents states sent to tests by RecentsWindowManager
Flag: com.android.launcher3.enable_fallback_overview_in_window
Bug: 382527932
Test: Tapl tests
Change-Id: I1e802e6787570e781d59e61cf03ce62c8a1edb47
2025-01-07 10:41:17 -05:00
Treehugger Robot 1165fb5a71 Merge "Adding ThemeManager as a centralized place for controlling icon theming" into main 2025-01-07 07:02:43 -08:00
Wei Sheng Shih a6ee3810c8 Merge "Reduce extra binder call for take task snapshot.(2/2)" into main 2025-01-07 03:04:35 -08:00
Vinay Joglekar 09be152da2 Merge "Add instrumentation for adding overview task to desktop window using overivew task's menu." into main 2025-01-07 00:08:15 -08:00
Sunny Goyal c369d1e4af Adding ThemeManager as a centralized place for controlling icon theming
Bug: 381897614
Flag: EXEMPT refactor
Test: atest ThemeManagerTest

Change-Id: Ib1dafdcc303f05f78cf586741c3d35243ab06e69
2025-01-06 21:53:22 -08:00
Treehugger Robot eb453571d9 Merge "Converting DesktopVisibilityController to a singleton" into main 2025-01-06 12:05:48 -08:00
vinayjoglekar 9d31790a7b Add instrumentation for adding overview task to desktop window using overivew task's menu.
Test needed to be updated since there is null check for the view and the context here.

https://source.corp.google.com/h/googleplex-android/platform/superproject/main-al-dev/+/main-al-dev:frameworks/base/core/java/com/android/internal/jank/InteractionJankMonitor.java;l=846

Bug: 339585622
Test: DesktopSystemShortcutTest
Flag: NONE new perfetto instrumentation
Change-Id: I33b7e83f548e8364ac09ffa7ba2cac7a52bbbf77
2025-01-06 11:20:24 -08:00
Treehugger Robot 9594716850 Merge "Use Dispatchers.Main.immediate to run code quickly that runs on main." into main 2025-01-06 09:57:58 -08:00
Hyunyoung Song d783b429c0 Merge "Prevent CtS invocation in fake landscape mode" into main 2025-01-06 09:33:58 -08:00
Uwais Ashraf b1f28aa75e Use Dispatchers.Main.immediate to run code quickly that runs on main.
immediate dispatcher schedules code on main (post{...}) if the current coroutine context is not main. However, if the coroutine context is main it will run synchronously without scheduling the work.

This removes all the continuations that come from initialisation of flow collectors.

Bug: 387511656
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: Checking perfetto traces shows that this reduces the number of continuations on main by ~120 for 30 apps
Change-Id: I6c5ffba893e470c25d81f044f83cf43cb80588b8
2025-01-06 16:06:26 +00:00
Treehugger Robot 06a0f61573 Merge "Recycle tasks that are split when split select anim complete for reuse" into main 2025-01-06 07:34:10 -08:00
Jordan Silva 28b3bd608b Recycle tasks that are split when split select anim complete for reuse
Re-land this CL after memory leak and performance regression for time were fixed.

Change-Id: I726a5d7e970869e54e9ece736f97802b8d01b02e
Fix: 376428479
Fix: 383033231
Bug: 381352866
Flag: EXEMPT bugfix
Test: Manual verification of heap dumps
2025-01-06 05:36:58 -08:00
Johannes Gallmann 389d70bff6 Merge "Fix flicker in predictive back to home animation" into main 2025-01-06 02:33:47 -08:00
wilsonshih f6995393fb Reduce extra binder call for take task snapshot.(2/2)
It is not necessary to take the task snapshot from the Shell because
it is usually executed in the SystemUI process. The Launcher can perform
the same operation through ActivityManagerWrapper. Which can also help
release the memory since it won't referened by 3 processes.

Flag: EXEMPT bugfix
Bug: 238206323
Test: close task from recents, verify SystemUI won't hold the
snapshot memory

Change-Id: Ia3ac4487af348f926327bcfe3cbe869b8a96cbcd
2025-01-06 04:55:40 +00:00
Mykola Podolian 8b3f1e1c3f Merge "Fix bubble added from the overflow background arrow animation." into main 2025-01-04 10:24:15 -08:00
Hyunyoung Song 299576a777 Prevent CtS invocation in fake landscape mode
Bug: 383421642
Test: manual, atest ContextualSearchInvokerTest
Flag: EXEMPT bugfix

Change-Id: I71ff453c54ade4583494ae9a6b44560d59b010d8
2025-01-04 06:41:06 +00:00
mpodolian 7f88d9fc83 Fix bubble added from the overflow background arrow animation.
The new bubble animation now uses a "selected location" argument to
position the pointing arrow.

Test: BubbleAnimatorTest
Test: Manual. Create a bubble bar with overflow. Open the overflow menu
and click an overflow bubble icon. Observe that a new bubble is added
and immediately expands. Observe that the arrow animates to the new
bubble's position.
Test: Manual. Create a bubble bar with overflow. Open any bubble.
Trigger a new bubble notification. Observe that a new bubble is added
but does not expand, so the arrow remains at the currently open bubble.
Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 359952121

Change-Id: I47f5b6c2aad775f2dd3e70f8c544a3711f192342
2025-01-03 16:22:27 -08:00
Uwais Ashraf bdc352f645 Remove TaskViews and Clear All button from RecentsView.
This means that when Overview is being opened it doesn't have to do this work. Also many cancelled pieces of work are received on main because tasks and images are loaded before the TaskViews are removed. Removing TaskViews in onReset avoids this as CoroutineScopes for Views are already cancelled.

Bug: 387511656
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: Checking perfetto traces shows that this reduces the number of continuations on main significantly
Test: Manual - opening Overview (from home, app)
Test: Manual - splitting an app
Test: Manual - overlay presence
Test: Manual - splash icon
Test: Presubmit (TAPL/image tests etc)
Change-Id: I871f3c3931bba733d579583d69bc197ccbcad132
2025-01-03 23:55:51 +00:00
Sunny Goyal 6d6529cff9 Merge "Converting LauncherPrefs to dagger" into main 2025-01-03 14:18:19 -08:00
Sunny Goyal e79d453bc8 Converting LauncherPrefs to dagger
Fixing ENABLE_TWOLINE_ALLAPPS_TOGGLE not properly tied to IDP:
http://recall/-/ep7WJ8pKwCEklUN5J1mAkM

Bug: 361850561
Flag: EXEMPT dagger-migration
Test: atest LauncherPrefsTest FakeLauncherPrefsTest
Change-Id: Iba63d060f4a8c2e31033fca2a4638c559c161338
2025-01-03 13:49:53 -08:00
Treehugger Robot 3ba7d458d4 Merge "Make fetch thumbnails call on bg thread to reduce thread switching" into main 2025-01-03 13:48:01 -08:00
Uwais Ashraf 53c627afa9 Make fetch thumbnails call on bg thread to reduce thread switching
Fix: 369590189
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: Side-by-side checking videos for improvement (b/369590189#comment6)
Test: TasksRepositoryTest
Change-Id: I26dde455b4e864077ec6ee6ce145e7fadc0840a7
2025-01-03 19:56:43 +00:00
Uwais Ashraf 201ae49e99 Make overlay run in background instead of unconfined (main)
This means that when TaskOverlayViewModel.overlayState is combining flows it does it on background. If this combination results in an emission then there is still a message to main but if it does not emit (e.g. no change filtered by distinctUntilChanged()) then it will not result in a continuation on main.

Bug: 387511656
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: Checking perfetto traces shows that this reduces the number of continuations on main significantly
Test: Manual - overlay presence + select functionality
Test: Presubmit (TAPL/image tests etc)
Change-Id: I840cb86e91db5a0626191b5eab145978ef4192e9
2025-01-03 19:38:27 +00:00
Ats Jenk e86c88d29d Merge "Increase bubble bar tap timeout" into main 2025-01-03 09:31:02 -08:00
Johannes Gallmann 0d9caa737f Fix flicker in predictive back to home animation
The predictive back to home animation has a small flicker sometimes with the predictive_back_to_home_polish flag enabled. It is caused by the setLauncherScale call in LauncherBackAnimationController#finishAnimation.

To fix this, we no longer make that call in the case when back is committed, but only when back is cancelled. It's not necessary to make the call in the commit case anyways because the ScalingWorkspaceRevealAnim takes care of the Launcher scale in that case.

The reason for the flicker is that finishAnimation is called BEFORE the ScalingWorkspaceRevealAnim has finished, causing them to interfere. This is expected. We don't want to wait for the ScalingWorkspaceRevealAnim (which has a very soft and slow landing). Instead, we only want to wait for the spring animation that animates the app window into the Launcher icon, which ends earlier.

Bug: 382453424
Test: Manual, i.e. verified that flicker is not reproducible
Flag: com.android.launcher3.predictive_back_to_home_polish
Change-Id: I6bb04cd5b168442f39debb66872c668c5ad58fcd
2025-01-03 08:00:32 -08:00
Treehugger Robot 5aac5dbde1 Merge "Convert TaskIconCache and TaskThumbnailCache to kotlin" into main 2025-01-03 06:19:35 -08:00
Uwais Ashraf b6a733843c Convert TaskIconCache and TaskThumbnailCache to kotlin
Bug: 369590189
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: Presubmits
Change-Id: I1becdcdf2fffd2c1fe548e7f182a7fd851be3c08
2025-01-03 03:43:35 -08:00
Alex Chau e70eda424b Combine RecentsViewStateController with base class
- BaseRecentsViewStateController is only inherited by RecentsViewStateController, remove the base class to simplify code
- Also converted RecentsViewStateController to Kotlin and remove a bunch of warnings

Fix: 387267938
Test: presubmit and manual
Flag: EXEMPT refactor
Change-Id: I18e9c2b186a64a0af39230cb41e3b3f4949107d5
2025-01-03 10:37:57 +00:00
Ats Jenk 048d2e5605 Increase bubble bar tap timeout
We were using only 100ms for bubble bar tap timeout. That made it
difficult to tap to expand the bubble bar.
The constant we were using, per javadoc, is for distinguishing scroll vs
tap.
Updating the timeout constant to long-press timeout value. If the tap is
shorter than the long-press timeout (400ms by default), it is considered
a tap.
This should make it easier to tap the bar.
Also fixing the long-press to drag timeout on the bubble bar. We were
using only half of the long-press timeout constant.

Bug: 385928447
Test: tap on bubble bar to expand it, long-press on bubble bar to move
Flag: com.android.wm.shell.enable_bubble_bar
Change-Id: I2df51a3caaa19ceb5b013d9377ebedd611ef84f3
2025-01-02 18:04:06 -08:00
Treehugger Robot 7482e5cbe2 Merge "Fixing prediction ring color not getting updated if the icon changes while the slot animation is running" into main 2024-12-30 14:27:50 -08:00
Sunny Goyal ad61173ca2 Converting DesktopVisibilityController to a singleton
This avoids a persistant connection to TouchInteractionService from WMProxy,
which keeps the service alive all the time

Bug: 384896306
Test: Presubmit
Flag: EXEMPT bugfix
Change-Id: Id6fe59471c8c3f9874514f71126631f217ab610c
2024-12-30 12:54:19 -08:00
Treehugger Robot bf5e7e867f Merge "Moving trackpad device tracking to a separate class" into main 2024-12-30 09:52:58 -08:00
Treehugger Robot bf7a0cb976 Merge "Flip set subtraction to produce correct list of tasks to remove." into main 2024-12-30 08:36:52 -08:00
Uwais Ashraf 39682e308f Flip set subtraction to produce correct list of tasks to remove.
Fix: 380067701
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: TasksRepositoryTest
Change-Id: I26933614241e622a11a440829e89023822c8041b
2024-12-30 14:45:33 +00:00
Uwais Ashraf 7b2c441d45 Store scopeToCancel.
Without this the scope that gets cancelled can be the new one after re-attaching. This results in no flows working - hence blank thumbnails.

Fix: 369590189
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: Manual - visually verified
Change-Id: Ie930d890095c30c4be8e87c795a06383ac06ea9e
2024-12-30 08:34:07 +00:00
Treehugger Robot 70e443cde8 Merge "Removing unnecessary baseContext usage in InputConsumerUtils" into main 2024-12-27 12:04:39 -08:00
Sunny Goyal 5bf0742fc5 Fixing prediction ring color not getting updated if the icon changes
while the slot animation is running

Slot animation is only trigerred through prediction update and it sets
final ring color at that point as part of the animation. If the icon
and the color change due to some other reason (like high-res icon or
a package-update), that color is overriden by the ongoing slot animation.

Bug: 381897614
Test: Verified manually by slowing down animation
Flag: EXEMPT bugfix
Change-Id: Ia3b86330afdb91ba6ff3366e3c8057bd7ec34e5d
2024-12-27 02:54:21 -08:00
Sunny Goyal dff42e04b7 Removing unnecessary baseContext usage in InputConsumerUtils
Bug: 386288280
Test: Presubmit
Flag: EXEMPT refactor
Change-Id: Ie1ceb513205028e12acefc6bcf8dbf628ce15bc4
2024-12-26 20:43:56 -08:00
Sunny Goyal 4d3683fbfe Moving trackpad device tracking to a separate class
This would eventually lead to breaking apart TIS into smaller classes,
which can be injected using dagger.
This is needed to migrate DisplayController to dagger

Bug: 361850561
Test: Presubmit
Flag: EXEMPT dagger refactor
Change-Id: Ic15386136bf1705e76c08536cc0790f51e19ab73
2024-12-26 20:32:30 -08:00
Sunny Goyal c2639e464f Replacing some fixed lookup flags with specific constant flag
This would make it easier to customize flags used on desktop icons

Bug: 366237794
Flag: EXEMPT refactor
Test: atest CacheLookupFlagTest
Change-Id: I0f3f04ddbe73abea207a5b58a65714ff172b2726
2024-12-26 20:19:02 -08:00
Treehugger Robot a2cc47aaf5 Merge "Migrate to TaskViewsIterable & TaskViewsIterator - [n/n]" into main 2024-12-23 14:21:46 -08:00
Mykola Podolian dca789d97d Merge "Fix hotseat QSB squished issue" into main 2024-12-23 14:10:49 -08:00
minch 263bc2d3e8 Migrate to TaskViewsIterable & TaskViewsIterator - [n/n]
Use TaskViewsIterable to iterate all the current TaskViews
inside `RecentsView.updateGridProperties`. Remove all the indices
usage inside this function as well.

Flag: EXEMPT as no functionality changes
Bug: 379942019
Test: Verified that the TaskViews layout is correct in below scenarios:
      1. Swipe up from an fullscreen app or from home
      2. Dismiss the large tile, a TaskView in the middle either in the
         top row or the bottom row, dismiss the last TaskView.
      3. Clear all TaskViews
      4. Swipe up to the right side of the edge to have a normal
         TaskView as the snapped TaskView
      5. Alt+Tab with more than 6 apps to enter Overview, with a
         hidden TaskView from the alt+tab list as the snapped TaskView.
Change-Id: Ic01534ed03bcc654d5799f43f0cf659d2c86ca31
2024-12-23 15:55:05 +00:00
Uwais Ashraf 4a87b48d44 Merge "Move TaskThumbnailViewData initialisation to init." into main 2024-12-23 04:15:41 -08:00
Alex Chau 9af2ef3ef0 Merge "Implement TaskViewsIterable using Kotlin Sequence" into main 2024-12-23 03:26:48 -08:00
Mykola Podolian 2a36384351 Merge "Fixes issue with missing overflow bubble" into main 2024-12-21 11:15:40 -08:00
mpodolian 91cf7b3fc4 Fix hotseat QSB squished issue
Added logic to do not adjust hotseat and QSB if the bubble bar is not
visible.

Test: Manual. Unfold foldable device, open bubbles test application,
trigger bubble via adb, wait until bubble bar is stashed, unfold the
device, go back to the home screen. Observe hotseat and QSB are not
squished.
Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 384903202

Change-Id: Ib03e02d977de6357069470171952afb20c681f20
2024-12-20 15:40:11 -08:00
mpodolian 609e9642bc Fixes issue with missing overflow bubble
The problem had two parts:
1 When BubbleBarViewController removed all views, including the overflow
bubble, it did not update the value of the mOverflowAdded field
2 BubbleBarController removed all views upon receiving an initial update
This CL addresses both issues.

Test: Manual. Ensure the overflow bubble is present in the bubble bar.
Rotate the device and verify that the overflow bubble remains visible.
Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 380281090

Change-Id: I1810671e6bfc5b8b402433697b07f3de2e612ed7
2024-12-20 15:34:04 -08:00
Uwais Ashraf 84ce6e9e80 Merge "Fix blank recent tasks thumbnails." into main 2024-12-20 12:20:02 -08:00