Commit Graph

1508 Commits

Author SHA1 Message Date
Alex Chau 67a1006f56 Use onTaskThumbnailChanged as sourced of truth for thumnbail override
- Both RecentsView.screenshotTask and RecentsView.updateThumbnail uses thumbnail that comes from recentsAnimationController.screenshotTask. recentsAnimationController.screenshotTask always results in TaskVisualsChangeListener.onTaskThumbnailChanged, which is a better source of truth to rely on rather than having 3 entry points for thumbnail override
- As a thumbnail objects from onTaskThumbnailChanged has the same snapshotId but are different instances, updated RecentsViewModel.waitForThumbnailsToUpdate to reflect that

Bug: 342560598
Test: RecentsViewModelTest
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: I79b6e32224df4192e8df6930d87b222ed93bf8d8
2024-08-05 12:55:16 +01:00
Treehugger Robot 0e179ddc67 Merge "Fixes SettingsChangeLoggerTest failures" into main 2024-08-02 00:01:34 +00:00
Achim Thesmann f7961d5f0d Merge "Replace get/setPendingIntentBackgroundActivityLaunchAllowedByPermission" into main 2024-08-01 16:53:29 +00:00
Treehugger Robot dae3f1d6ca Merge "Increase number of triggers for taskData reloading in TasksRepository" into main 2024-08-01 13:41:26 +00:00
Alex Chau 4c7dcc4b02 Increase number of triggers for taskData reloading in TasksRepository
- Simplified AbsSwipeUpHandler.switchToScreenshot to remove the unused refreshView=false parameter, so we RecentsView.updateThumbnail don't need to return a TaskView
- Changed TasksRepository.setThumbnailOverride to addThumbnailOverride, that'll accumulate overrides being sent to it
- Handled RecentsView.updateThumbnail to add an override to TasksRepository
- visibleTaskIds being sent to TasksRepository now take acccount of fileering out mTmpRunningTasks
- Updated a few TODOs around thumbnail/icon reloading

Bug: 342560598
Test: TasksRepositoryTest
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: Ia892819c45f20e82fbda275fd0e39081d6362cb6
2024-08-01 12:42:00 +01:00
Liran Binyamin ea5e8f1049 Merge "Revert^2 "Initial view screenshot tests for BubbleView"" into main 2024-08-01 07:36:50 +00:00
Achim Thesmann 6ae0fc94f4 Replace get/setPendingIntentBackgroundActivityLaunchAllowedByPermission
Replace usages of the old get/setPendingIntentBackgroundActivityLaunchAllowedByPermission
API with the new replacement (passing in mode = ALWAYS).

Test: atest TaskAnimationManagerTest
Flag: EXEMPT refactor
Bug: 352182359
Change-Id: I76998b2bfa9d76ab3659ddd4d4c42d74872f5b2f
2024-07-31 23:00:14 +00:00
Liran Binyamin ccb57d8330 Revert^2 "Initial view screenshot tests for BubbleView"
3795d3782b

Flag: Exempt test only
Bug: 355454021
Test: atest NexusLauncherViewScreenshotTest

Change-Id: Ib51491dd2a6910df8953ad972c1a04fd5d79be9f
2024-07-31 16:31:49 -04:00
Mykola Podolian fcde085beb Merge "Integrated new BubbleStashControllers into the existing code." into main 2024-07-31 16:43:17 +00:00
Luca Zuccarini 3cdabb8864 Move some Shell utils to the Shared package.
Bug: 322791067
Flag: EXEMPT move only
Test: NA
Change-Id: I8a827a200340fd1ee0168ed16c4f5223150a1795
2024-07-31 14:10:54 +00:00
Alina Zaidi 00614eae0e Use DesktopModeStatus#canEnterDesktopMode instead of just Flag check.
Test: Existing tests pass
Bug: 349544589
Flag: EXEMPT minor refactoring
Change-Id: Idf572d48d35b8eeedd7fd1b8c608834d27a818e7
2024-07-31 10:47:16 +00:00
mpodolian 484ff0fe9c Integrated new BubbleStashControllers into the existing code.
Integrated the PersistentTaskbarStashController and the
TransientTaskbarStashController into the launcher code. Made changes to
the TaskbarInsetsController to set appropriate touchable zones. Updated
the TaskbarUIController to not start the overview transition on clicks
for the collapsed bubble bar.

Bug: 346391377
Fixes: 350065038
Fixes: 355664783
Flag: com.android.wm.shell.enable_bubble_bar_in_persistent_task_bar
Test: com.android.launcher3.taskbar package tests

persistent taskbar and transient taskbar manual testing:
- on launcher home screen expand bubble bar, switch between bubbles,
remove bubble via bubble menu, add bubble, remove bubble with the drug
gesture, add bubble, collapse bubble bar
- repeat previous test on launcher overview screen and inside any
application
- after last test drag expanded bubble view to the opposite side of the
screen

Change-Id: I50f2c510854c4895fdfc9bd453a261c2103286fd
2024-07-30 18:36:05 -07:00
Treehugger Robot afc2f976e3 Merge "Revert "Initial view screenshot tests for BubbleView"" into main 2024-07-30 16:55:41 +00:00
Liran Binyamin 3795d3782b Revert "Initial view screenshot tests for BubbleView"
Revert submission 28447963-launcher-view-screenshot-tests

Reason for revert: breaks the build -- conflicts with another cl

Reverted changes: /q/submissionid:28447963-launcher-view-screenshot-tests

Change-Id: If40903403d72e8b1bf776feccaa34dbc3e3e8ae2
2024-07-30 15:04:21 +00:00
Liran Binyamin 419b917e74 Merge "Initial view screenshot tests for BubbleView" into main 2024-07-30 14:38:15 +00:00
Alex Chau e7a87f3fa8 Merge "Don't show splash when thumbnail is null in SplashAlphaUseCaseTest" into main 2024-07-30 10:44:50 +00:00
Alex Chau 2a640c61a7 Don't show splash when thumbnail is null in SplashAlphaUseCaseTest
- thumbnail is always null to begin with, and we don't want the splash icon to ever shown in Overview, so it should default to hidden

Fix: 356079562
Test: SplashAlphaUseCaseTestTest
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: I2a010f911814fda2bbcf0ca7ebc7192580772076
2024-07-29 11:28:19 +01:00
Liran Binyamin 4b4122d02e Initial view screenshot tests for BubbleView
Flag: EXEMPT test only
Bug: 355454021
Test: atest NexusLauncherViewScreenshotTests

Change-Id: I32c2a190333143c1ec2fe977efef43b4c04fd469
2024-07-29 04:39:28 -04:00
Treehugger Robot 453734f09e Merge "Support switch to screenshot for TTV" into main 2024-07-27 00:14:26 +00:00
Jagrut Desai 65b5eb472e Merge "Unit Testing for TaskbarEduTooltipController" into main 2024-07-26 22:44:16 +00:00
Alex Chau 378622c907 Support switch to screenshot for TTV
- Moved live tile decision to TaskThumbnailViewModel, and added RecentsViewData for runningTask information
- Implemented a ThumbnailData override mechanism to override screenshot from TaskThunmbnailCache, the override will be added during switchToScreenshot and cleared when user exit recents (RecentsView.reset)
- During the thumbnail override, we wait until the new ThumbnailData propagates, before finsihing Recents animation to avoid a frame of flash

Bug: 343364498
Test: TaskThumbnailViewModelTest, TaskRepositoryTest, RecentsViewModelTest
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: I776943ecdfa0d65d94b054692297b42686f59f8a
2024-07-26 21:25:58 +01:00
Andy Wickham 369a5e749b Merge "Add 2 stage LPNH tests." into main 2024-07-26 19:38:27 +00:00
Jagrut Desai 5af1bfbf52 Unit Testing for TaskbarEduTooltipController
This CL includes
	- TaskbarEduTooltipController Unit Test for all edu logic and hide tooltip
	- Test util class for taskbar controller test to run the test on main thread.
	- Refactored other controller test to use the new util function to run test on main thread.
	- Ability to disable running test in test harness mode.

Test: Presubmit
Bug: 346394824
Flag: TEST_ONLY
Change-Id: Ic623df8e7a58ac48d260e592ffab61d1f0658aef
2024-07-26 12:14:50 -07:00
Mykola Podolian 550927be44 Merge "Added TransientTaskbarStashController implementation." into main 2024-07-26 16:59:46 +00:00
mpodolian a5cd1a0dbb Added TransientTaskbarStashController implementation.
Added TransientTaskbarStashController implementation of
BubbleStashController interface. Added tests for the implementation.

Bug: 346391377
Flag: com.android.wm.shell.enable_bubble_bar
Test: TransientTaskbarStashController
Change-Id: Ie302086d6b4aac48a948473908b68c2c436e4b30
2024-07-26 02:19:00 +01:00
Andy Wickham e935438787 Add 2 stage LPNH tests.
Fix: 353613649
Test: NavHandleLongPressInputConsumerTest
Flag: TEST_ONLY

Change-Id: I99f4eb5f999d2769cc2d9e1eb1d04ae6c5ff27db
2024-07-25 23:21:16 +00:00
Treehugger Robot 4a6c90d552 Merge "Add unit tests for MultiStateCallback" into main 2024-07-25 17:43:24 +00:00
Liam, Lee Pong Lam 85f3476943 Fixes SettingsChangeLoggerTest failures
The mLoggablePrefs was created on constructor, so move the system under test out of setup because the preference change needs to be made before it.
For details: https://source.corp.google.com/h/googleplex-android/platform/superproject/main/+/main:packages/apps/Launcher3/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java;drc=c56711c6691e7957ed98a9de6b3acb79103abb66;l=95

Bug: 354157494
Test: Unit tests
Flag: EXEMPT bugfix

Change-Id: I2fd5eec5b10d7463c663df03cfefefb11bcefecc
2024-07-25 17:18:15 +00:00
Uwais Ashraf 06dd94c66a Add splash state to new TTV
Bug: 334826842
Test: test classes added in CL
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: Ia7c2de18b5ff932430946df6b4c27929d715e79c
2024-07-25 14:35:00 +00:00
Schneider Victor-tulias dfeb22f7ab Add unit tests for MultiStateCallback
Flag: EXEMPT adding tests
Fixes: 355003429
Test: MultiStateCallbackTest
Change-Id: Id617ca79c44dcfa6226e47d574b9e3bfe6cfb140
2024-07-25 10:11:17 -04:00
Vinay Joglekar fe7878c144 Merge "Dim TaskThumbnailView on Foreground scrim" into main 2024-07-25 13:03:49 +00:00
vinayjoglekar 36ef7bf6e7 Dim TaskThumbnailView on Foreground scrim
Bug: 349601769
Test: TaskThumbnailViewModelTest
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: I3a9fa21d8a4c28ffe40279243030f0e47c957513
2024-07-25 11:18:20 +01:00
Treehugger Robot de1a7e067f Merge "Move TestExtensions.kt to quickstep for DeviceConfig overrides." into main 2024-07-24 22:42:00 +00:00
Treehugger Robot 5ace16c7b8 Merge "Only register RecentTasksChangedListener if flag is enabled" into main 2024-07-24 01:17:35 +00:00
Andy Wickham 75ce1a2cd6 Move TestExtensions.kt to quickstep for DeviceConfig overrides.
Fix: 353740808
Test: Run existing tests using this class
Flag: TEST_ONLY
Change-Id: Ie72fb86ea4d451e90a6629554dc717126db0b24c
2024-07-24 00:15:05 +00:00
Tony Wickham bbfa9fc181 Only register RecentTasksChangedListener if flag is enabled
Also unregister it if the feature becomes disabled (currently
this is only done in tests but in the future there will be a
user setting as well).

Added tests to verify getTasks() is not called while both
canShowRunningApps and canShowRecentApps are false.

Bug: 354087794
Test: TaskbarRecentAppsControllerTest
Flag: com.android.launcher3.enable_recents_in_taskbar
Flag: com.android.window.flags.enable_desktop_windowing_taskbar_running_apps
Change-Id: I3123501e7584ad7f877e13294454556501d2dbc8
2024-07-23 23:24:10 +00:00
Treehugger Robot ea4373c060 Merge "Add NavHandleLongPressInputConsumerTest." into main 2024-07-23 23:20:47 +00:00
Treehugger Robot e3078707a0 Merge "Move more tests to deviceless" into main 2024-07-23 23:16:08 +00:00
Mykola Podolian 126be5629b Merge "Added BubbleStashController interface" into main 2024-07-23 21:37:31 +00:00
Liam Lee Pong Lam c1d3fa453f Merge "Fixes SettingsChangeLoggerTest failures" into main 2024-07-23 21:35:41 +00:00
Anushree Ganjam 7c32ae9acf Move more tests to deviceless
Bug: 353339741
Test: Manual
Flag: TEST_ONLY
Change-Id: Ib43d5a17feb812b08d9749b1bf6dcacabf205d47
2024-07-23 13:57:28 -07:00
Liam, Lee Pong Lam 80ffa83957 Fixes SettingsChangeLoggerTest failures
To revert the preference change on PreviewItemManagerTest for on-device
test.

Bug: 354157494
Test: Unit tests
Flag: EXEMPT bugfix
Change-Id: I966cbd7bf85b0336e131c6e9e4bb306b3700a928
2024-07-23 19:33:27 +00:00
mpodolian 08e98a2c3e Added BubbleStashController interface
Added common BubbleStashController interface and implementation for the
PersistentTaskBarStashController. Added tests for the implementation.

Bug: 346391377
Flag: com.android.wm.shell.enable_bubble_bar
Test: PersistentTaskBarStashControllerTest
Change-Id: I353e5a2cfa2d39e83b0e94980938aee8a1002fd9
2024-07-23 19:32:08 +01:00
Andy Wickham 8e4faffd0e Add NavHandleLongPressInputConsumerTest.
Tests LPNH for the standard conditions (no flags or AGA configs).

Specifically tests:
 - Delegate stealing focus
 - Long press triggers with steady hold or slight slop
 - Up, cancel, or excessive slop cancels the long press
 - Touch ignored if outside the nav handle (not centered)

Things behind flags / AGA config which are not yet tested:
 - 2 stage detection (double timeout after small slop)
 - Deep press
 - Custom timeout from AGA

Fix: 353613291
Test: NavHandleLongPressInputConsumerTest
Flag: TEST_ONLY
Change-Id: I5ada3a07ccec9062ac22fa21b00d5a030f6d134a
2024-07-23 01:23:45 +00:00
Alina Zaidi 3835f93237 [Dev options][DW flag] Update all usage of enable_desktop_windowing_mode flag to use DesktopModeFlags
Test: Current tests pass
Bug: 348193756
Flag: com.android.window.flags.show_desktop_windowing_dev_option
Change-Id: I96107f7c2964ee8261ad0a161163491d6f7d4d39
2024-07-22 20:33:02 +00:00
vinayjoglekar 82bb770738 Support sysUiStatusNavFlags for refactored TTV
Bug: 350743460
Test: SysUiStatusNavFlagsUseCaseTest
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: Id7576cb2eda14e6c72f34fe3fea3323a104a5164
2024-07-22 12:44:52 +01:00
Jordan Silva 426f74369a Introducing Manual DI for Overview
This CL adds the RecentsDependencyContainer to maintain singletons and dependencies related to RecentsView. RecentsDependencies is a singleton that requires the application context to be initialized. Unlike regular singletons, this class has an initialize function where it gets initialized and can be retrieved with getInstance without providing the appContext each time.

- We've updated the refactored classes behind the -enable_refactor_task_thumbnail flag to use this DI solution rather than relying on .parent or recreating dependencies.

- To inject dependencies, you can use RecentsDependencies.inject for lazy initialization or RecentsDependencies.get for eager initialization.

- At the moment, we don't have a singleton or factory definition. All dependencies created by RecentsDependencies will be stored in a specific scope, making the instance a singleton within that scope.

- You can create or retrieve a dependency in a particular scope by calling RecentsDependencies.inject(scopeId).

- If you don't need the dependency to be stored in RecentsDependencies, you can create it manually in your code and inject the necessary parameters from RecentsDependencies (see the viewModel in TaskOverlayHelper).

- Handling the cleaning/resetting of dependencies will be addressed in b/353917593. RecentsView lifecycle is more complex and doesn't get recreated every time. We need to determine which dependencies or scopes can be destroyed and recreated.

Fix: 349055024
Test: NONE
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: I27b92e3038f1cce0fd53b637dba5054c05b40283
2024-07-19 11:54:20 +00:00
Treehugger Robot 2495e980ed Merge "Throw exception from SystemUiProxy.getRecentTasks for invalid result" into main 2024-07-19 11:01:40 +00:00
Alex Chau 3210f73125 Throw exception from SystemUiProxy.getRecentTasks for invalid result
- The reason Recents is empty after a force-stop is when RecentsTasksList.getTasks is called first time after restart, the result is always invalid but we cached the invalid result with a chagneId(=1). The next time we call getTasks again, we think the cached result is valid, and returend an empty list.
- The fix is to mark such result as invalid to avoid caching the wrong result

Fix: 353926204
Test: RecentTasksListTest
Flag: EXEMPT bugfix
Change-Id: If15ab8fd7454db8a08c22b17eaac73f0c78aa75f
2024-07-19 09:21:40 +00:00
Liam Lee Pong Lam 0002e9cfc9 Merge "Add unit tests for SettingsChangeLogger" into main 2024-07-19 01:53:21 +00:00