Commit Graph

159 Commits

Author SHA1 Message Date
Liran Binyamin
5eeff8d1e3 Merge "Support expanding the bar while animating" into main 2024-08-08 12:44:42 +00:00
Liran Binyamin
46111b109e Support expanding the bar while animating
Update the BubbleBarAnimator to handle auto expanding bubbles as
well as expand signals that are received while animating the bubble
bar.

The expansion starts after the bar reaches its peak height. If the
hide animation starts before the expansion signal is received, we
ignore it.

Next step is to delay showing the expanded view until the bubble bar
starts expanding.

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 353644484
Fixes: 356415377
Bug: 339683389
Test: atest BubbleBarViewAnimatorTest
Change-Id: I79a63f0b8728abc1ab3345f0116cbfcba2918643
2024-08-08 03:46:07 -04:00
Jagrut Desai
01d04c40dc Merge "Enable TaskbarEduTooltipControllerTests with rule ordering" into main 2024-08-07 17:55:02 +00:00
Jagrut Desai
6b39f2d40e Merge "Ignoring TaskbarEduTooltipControllerTests" into main 2024-08-06 23:15:06 +00:00
Jagrut Desai
5643f48bb8 Enable TaskbarEduTooltipControllerTests with rule ordering
Test: Presubmit
Bug: 356155191
Flag: TEST_ONLY
Change-Id: If4a03033424c07e37f2cb3f792e75a64a55fb67b
2024-08-06 14:11:38 -07:00
Jagrut Desai
3baa8a7f70 Ignoring TaskbarEduTooltipControllerTests
Test: Presubmit
Bug: 356155191
Flag: TEST_ONLY

Change-Id: I2aa0c0822ea4458484d7a04e38004ddc60f7c982
2024-08-06 13:04:47 -07:00
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
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
Mykola Podolian
fcde085beb Merge "Integrated new BubbleStashControllers into the existing code." into main 2024-07-31 16:43:17 +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
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
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
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
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
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
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
Liam Lee Pong Lam
0002e9cfc9 Merge "Add unit tests for SettingsChangeLogger" into main 2024-07-19 01:53:21 +00:00
Charlie Anderson
c22b0ea47b Merge "[Test Week] unit tests for LauncherRestoreEventLoggerImpl" into main 2024-07-18 18:44:15 +00:00
Liran Binyamin
a2aa555faf Merge "Update bubble notification dot drawing" into main 2024-07-18 18:42:01 +00:00
Liam, Lee Pong Lam
c56711c669 Add unit tests for SettingsChangeLogger
Bug: 353584526
Flag: EXEMPT bugfix
Test: Unit tests
Change-Id: Ib1bac2471d9cc467b8b6697ae4d79f561eea75e4
2024-07-18 18:32:36 +00:00
Charlie Anderson
ee3cc97fd3 [Test Week] unit tests for LauncherRestoreEventLoggerImpl
5 public methods tested
No previous testing class

Flag: TEST_ONLY
Test: unit test
Bug: 353303621
Change-Id: I97273e7eebebfa4aac1e7c3db8bf089f3e49f150
2024-07-18 15:38:08 +00:00
Liran Binyamin
5013028596 Update bubble notification dot drawing
The notification dot drawing state depends on changes in the bubble
bar, so the bubble bar now directly requests updates to the dot at
specific states.

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 351904597
Fixes: 350782375
Test: atest BubbleViewTest
Test: manual basically just hammering on it trying to break it
       1. Dot appears for new bubble in all states of the bar
       2. Expand bubble bar
          - Dot is removed for selected and shows for others
            that have a dot
       3. After removing bubble while expanded
          - Dot is removed from newly selected bubble
       4. Collapse bubble bar
          - Dot is hidden for all bubbles
       5. Dot removed after tapping on a bubble when expanded

Change-Id: I4a940d38a8c77bddaf058b7ef882bab06886bcf4
2024-07-18 10:38:29 -04:00
Alex Chau
1d75081a5f Merge "Apply PreviewPositionHelper matrix to TTV and Overlay" into main 2024-07-18 13:56:42 +00:00
Alex Chau
893f4c6a45 Apply PreviewPositionHelper matrix to TTV and Overlay
- Added GetThumbnailMatrixUseCase to retrieve task using taskId and calcualte Matrix using provided canvas size and isRTL
- TTVM and OverlayVM will uses GetThumbnailMatrixUseCaseTest with runBlocking to obtain the matrix from the loaded thumbnail
- TTV and Overlay listen for size change, and call VM to get the latest Matrix and apply to the view

Fix: 343101424
Test: GetThumbnailMatrixUseCaseTest
Test: TaskThumbnailViewModelTest
Test: TaskOverlayViewModelTest
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: If3f37824bed84d5cbaa54d7a4b12f5f1ef4e2c09
2024-07-18 13:07:14 +01:00
Treehugger Robot
2397ffd437 Merge "Disable model loading in Taskbar unit tests." into main 2024-07-17 21:14:10 +00:00
Treehugger Robot
c2a36a6fcd Merge "Add Repository for RecentOrientedState and DeviceProfile" into main 2024-07-17 12:25:09 +00:00
Alex Chau
5837a4628c Add Repository for RecentOrientedState and DeviceProfile
- DeviceProfile have java fields that cannot be mocked, nor can be freely instantiated, so I've to use FakeInvariantDeviceProfileTest to give me some predefined DeviceProfile for testing

Bug: 343101424
Test: RecentsOrientedStateRepositoryTest
Test: RecentsDeviceProfileRepositoryTest
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: Iaa34ef60a418eb336859d260f5808b263de6b4f7
2024-07-17 11:29:20 +01:00
Brian Isganitis
2477f89fd2 Disable model loading in Taskbar unit tests.
We do not need this for now and it is making development more difficult on macs.

Test: Taskbar unit tests
Bug: 230027385
Flag: TEST_ONLY
Change-Id: I2e74e91e21aa650544d8264fab7b336b97b52547
2024-07-16 18:37:28 -04:00