Commit Graph

375 Commits

Author SHA1 Message Date
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
Jagrut Desai
c9174e17a2 Merge "Add support for different container and space calculation logic." into main 2024-07-16 20:16:10 +00:00
Brian Isganitis
984d782024 Merge changes from topic "taskbar-pinning-preference-rule-fixes" into main
* changes:
  Add subrule for controlling an individual Taskbar preference.
  Taskbar Pinning Preference Rule fixes.
2024-07-16 18:05:33 +00:00
Jagrut Desai
84151055b7 Add support for different container and space calculation logic.
This CL includes
	- Taskbar container enum class and interface for container to calculate their space needed.
        - Inits and getter of util classes in taksbar activity context.
        - Taskbar Icons specs not have default margins and minimum touch target specs
	- Updates to the test
        - Logic for calculating the space needed for taskbar container

Test: Presubmit
Bug: 341146605
Flag: com.android.launcher3.enable_taskbar_customization
Change-Id: I89e9d521476902a9027f6fd0cebdc2690b2e5f31
2024-07-16 10:48:51 -07:00
Brian Isganitis
d52e15b35a Add subrule for controlling an individual Taskbar preference.
Test: TaskbarPreferenceRuleTest, TaskbarPinningPreferenceRuleTest
Bug: 230027385
Flag: TEST_ONLY
Change-Id: I382c7e17a5739823c25fc8d64c981405af56e3e4
2024-07-15 22:39:27 -04:00
Brian Isganitis
e3d3d653d1 Taskbar Pinning Preference Rule fixes.
- Actually evaluate statement in tests.
- Enable aconfig flag for taskbar pinning.
- Allow DisplayController Taskbar mode to change in test harness.
- Make DisplayController think it's in desktop mode when needed.

Flag: TEST_ONLY
Bug: 230027385
Test: TaskbarPinningPreferenceRuleTest

Change-Id: I1c55f73cb5a4bb903cd2d628fa47fbd5e8b1bb86
2024-07-15 22:34:01 -04:00
Cosmin Băieș
1a0406e1be Merge "Add IME switch button long click support" into main 2024-07-15 18:06:02 +00:00
Brian Isganitis
fd1cc12054 Merge changes I2b87ab88,I939d8202,Ibedd8cae into main
* changes:
  Introduce rule for changing taskbar pinning preferences.
  Reinject controllers when Taskbar recreates itself.
  Inline showTaskbarFromBroadcast.
2024-07-13 19:01:33 +00:00
Brian Isganitis
803c85ac21 Introduce rule for changing taskbar pinning preferences.
Test: TaskbarPinningPreferenceRuleTest
Bug: 230027385
Flag: TEST_ONLY
Change-Id: I2b87ab8823b17c364b3797a325c8b0d569a1d39a
2024-07-12 18:04:17 -04:00
Brian Isganitis
c79c2fd28d Reinject controllers when Taskbar recreates itself.
Test: TaskbarUnitTestRuleTest
Bug: 230027385
Flag: TEST_ONLY
Change-Id: I939d820271ba7e5426303ac4662d1d621d86c08b
2024-07-12 18:04:17 -04:00
Treehugger Robot
1d73fdd4ac Merge "Add icon loading to TasksRepository" into main 2024-07-11 11:26:23 +00:00
Cosmin Băieș
33f8bfbadf Add IME switch button long click support
This adds support for handling long clicking on the IME switch button.
Initially it will behave exactly like short clicking, i.e. show the IME
switcher menu.

Flag: android.view.inputmethod.ime_switcher_revamp
Test: atest
  TaskbarNavButtonControllerTest#testPressImeSwitcher
  TaskbarNavButtonControllerTest#testLongPressImeSwitcher
Bug: 311791923
Change-Id: Ibd0d6bce2bab11511bc082f46731ec86038c8cf8
2024-07-11 11:42:16 +02:00
Uwais Ashraf
b59d86112c Add icon loading to TasksRepository
Bug: 334826842
Test: TasksRepositoryTest
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: I75f2e0e9aae4663993ca54742f653f4c7c04fdfe
2024-07-11 09:40:57 +00:00
Alex Chau
0ac34a3388 Add use case for split animation to retrieve thumbnail
Fix: 349120849
Test: TaskSplitAnimationHelperTest
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: I7d4bcbdbeacd56356c71eb18c73ceef8446011d1
2024-07-10 09:37:33 +00:00
Vinit Nayak
71c9a887c9 Merge "Add divider bg placeholder to app pair icon launch" into main 2024-07-09 04:18:56 +00:00
Shamali P
012ad2fc07 Align the launch location passed to prediction session
Matches the prediction helper (the prediction service ignores added
widgets if launch location doesn't match the pattern. The size / pos
details however aren't used, so we pass defaults.

With this, prediction service may be able to predict widgets that
aren't already added, hence providing more suggestions.

Bug: N/A
Test: Unit test
Flag: EXEMPT BUGFIX
Change-Id: Ieaba4c9a8354dc96ea2bc70cafa106978037c572
2024-07-08 19:56:47 +00:00
Alex Chau
3fde467b41 Make DeskopTaskView use latest TTV
- Made TaskThumbnailViewDeprecated nullable in TaskContainer, with non-null getter that requires feature flag to be on/off
- Removed TaskThumbnailViewDeprecated.setTaskOverlay, as it'll now be null with feature flag on
- Removed TaskThumbnailViewDeprecated from DesktopTaskView xml
- Simplifed DesktopTaskView binding logic, to always get thumbnailViews from viewPool, removeView and recycle all thumbnailViews in onRecycle
- Didn't implement view pooling of TaskThumbnailView due to difficulty with TaskContainer not being recycled togetehr with TaskThumbnailView

Bug: 338360089
Test: TaskThumbnailViewModelTest
Test: manual testing for DesktopTaskView for both enable_refactor_task_thumbnail on and off
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Flag: com.android.window.flags.enable_desktop_windowing_mode
Change-Id: I38a6dfc6bc561689578d1660794f91d30bad4a68
2024-07-05 18:39:56 +01:00
Treehugger Robot
a00c81c173 Merge "Change thumbnail/icon to get the image rather than updating it" into main 2024-07-04 17:13:37 +00:00
Uwais Ashraf
551927c6d3 Change thumbnail/icon to get the image rather than updating it
Flag: EXEMPT no-op refactor
Bug: 334826842
Test: existing screenshot tests
Test: Manual - checked icon loading
Change-Id: Ie1da708f911ba569d6464f338dc4efac92420268
2024-07-04 12:18:56 +00:00
Brian Isganitis
f7ca8d60be Merge changes I6e7c349d,If6c74b3b,Ib276e9dc,Ida0f7cc0 into main
* changes:
  Override DisplayController on main thread.
  Add annotations for manipulating secure settings.
  Don't use UiThreadTest for Taskbar Unit tests.
  Suspend Launcher taskbar while removed for tests.
2024-07-04 02:26:46 +00:00
Vinit Nayak
afdd0d3b31 Add divider bg placeholder to app pair icon launch
* Extract out both the top level split root leash
as well as the left and right split root leashes
* Set windowCorner radius on the left/right roots

Test: No more flicker near divider when launching app
pair (see comment for video in CL)
Flag: EXEMPT bugfix
Bug: 349387413

Change-Id: I6fce290d1e7766e55c2f11cc8c365f0c29087c0f
2024-07-03 11:27:41 -07:00
Treehugger Robot
ff4f1624a9 Merge "Support TaskOverlay with new TaskThumbnailView" into main 2024-07-03 15:01:51 +00:00
Alex Chau
58e8109d6e Support TaskOverlay with new TaskThumbnailView
- Also migrated getScaledInsets method into TaksOverlay

Bug: 335606129
Test: TaskOverlayViewModelTest
Test: TaskOverlayHelper is not tested because it should be a view-based screenshot test for TaskOverlay, which is currently impossible until we refactor TaskOverlay to MVVM
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: I07a8657ff0fe925d8021875310e3ed12a712ba7a
2024-07-03 14:15:09 +01:00
Brian Isganitis
bfa3b7c80e Override DisplayController on main thread.
Bug: 230027385
Flag: TEST_ONLY
Test: TaskbarModeRuleTest
Change-Id: I6e7c349d50c8372ed0d4e1e8d5bfe7f108b2c2e2
2024-07-02 21:46:07 -04:00
Brian Isganitis
160ed1d31a Add annotations for manipulating secure settings.
By default, tests will run with user setup complete and kids mode
disabled.

Test: TaskbarUnitTestRuleTest
Flag: TEST_ONLY
Bug: 230027385
Change-Id: If6c74b3b2c07aa0eac5b6bda933b565351d65188
2024-07-02 21:46:05 -04:00
Brian Isganitis
8e5de6577b Don't use UiThreadTest for Taskbar Unit tests.
This annotation also runs the rule on the main thread, which can lead to
deadlocks with other threads (e.g. loading the model synchronously).

Change-Id: Ib276e9dc322f6f65bd32658e774d6076efb94f2e
Flag: TEST_ONLY
Test: Taskbar Unit Tests
Bug: 230027385
2024-07-02 21:45:23 -04:00
Brian Isganitis
8f1a1c4b6a Suspend Launcher taskbar while removed for tests.
This approach is less destructive than completely destroying Taskbar
while still ensuring it will not try to recreate itself.

Test: Taskbar Unit Tests
Bug: 230027385
Flag: TEST_ONLY
Change-Id: Ida0f7cc0b9c5b1d53bbadc2bb9fd81689c7f3940
2024-07-02 21:42:23 -04:00
Brian Isganitis
3ad18b451a Merge "Revert "Completely destroy Launcher's Taskbar."" into main 2024-07-02 23:20:58 +00:00
Brian Isganitis
e1a2b67f2b Revert "Completely destroy Launcher's Taskbar."
Revert submission 28102205

Reason for revert: Potential test breakage.

Reverted changes: ag/28102205

Change-Id: If7fa1ff192a240e753e5c245d591d46e594e5a6f
Flag: TEST_ONLY
Bug: 230027385
Test: Presubmit
2024-07-02 17:00:11 -04:00
Treehugger Robot
6bf444c3c9 Merge "Only commitRunningAppsToUI if shownTasks changed" into main 2024-07-02 09:07:41 +00:00
Brian Isganitis
035a25c9a7 Merge changes I18245c22,I4c7a6085,I1c17b7f0,I663e5ad7,I9199fd92 into main
* changes:
  Completely destroy Launcher's Taskbar.
  Add context for sandboxing Taskbar window contexts.
  Add tests for TaskbarUnitTestRule.
  Have recreateTaskbar perform recreate on UiThread.
  Move test rules to subpackage.
2024-07-01 16:41:17 +00:00
Brian Isganitis
326ae5e3d1 Completely destroy Launcher's Taskbar.
Just removing it temporarily from the window manager is insufficient.
Taskbar can attempt to recreate itself due to many callbacks being
invoked during tests such as the settings changing. After the tests
finish, the launcher process will restart anyways so taskbar will come
back automatically.

Flag: TEST_ONLY
Test: TaskbarUnitTestRule tests
Bug: 230027385
Change-Id: I18245c224f6d2ffc78d8bf80d30275429074f9b5
2024-06-28 18:38:23 -04:00
Tony Wickham
7829a1ced2 Only commitRunningAppsToUI if shownTasks changed
- Add GroupTask and DesktopTask equals() (with tests)
- Add tests to verify multiple onRecentTasksChanged
  doesn't commitRunningAppsToUI if there's no change
- Add tests to verify commitRunningAppsToUI is still
  called if minimized or running apps set changes

Bug: 348802109
Bug: 348787176
Test: TaskbarRecentAppsControllerTest
Test: GroupTaskTest
Test: log TaskbarView#onMeasure() locally, ensure it is called
much less despite noisy onRecentTasksChanged callbacks
Flag: com.android.window.flags.enable_desktop_windowing_taskbar_running_apps

Change-Id: I3efff7f4492272f88aa2bdbd7cc45bd2bf8156f6
2024-06-28 21:54:37 +00:00
Alex Chau
50293c5227 Merge "Extract TaskContainer to its own class" into main 2024-06-28 12:16:17 +00:00
Brian Isganitis
cc44113e57 Add context for sandboxing Taskbar window contexts.
Otherwise, the contexts leave the sandbox, which blocks testing.

Test: TaskbarWindowSandboxContextTest
Bug: 230027385
Flag: TEST_ONLY
Change-Id: I4c7a60858821c8959be2c82dc61a83b7e2f4d1ed
2024-06-27 18:32:26 -04:00