Commit Graph

90 Commits

Author SHA1 Message Date
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
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
Brian Isganitis
c0da543553 Add tests for TaskbarUnitTestRule.
Test: TaskbarUnitTestRuleTest
Bug: 230027385
Flag: TEST_ONLY
Change-Id: I1c17b7f04920676cdfbe481b9435ff5d842181d1
2024-06-27 18:32:26 -04:00
Brian Isganitis
c2bb120a87 Have recreateTaskbar perform recreate on UiThread.
Test: Taskbar{AllApps,Overlay}ControllerTest
Bug: 230027385
Flag: TEST_ONLY
Change-Id: I663e5ad7bb37e73381e2ef9d787c80177cfdf7a7
2024-06-27 18:32:26 -04:00
Brian Isganitis
e7e98985f7 Move test rules to subpackage.
Test: Compiles
Flag: EXEMPT refactor
Bug: 230027385
Change-Id: I9199fd92450180fa10673c3072dd6e8312fd24d6
2024-06-27 18:32:26 -04:00
Liran Binyamin
fde4fdc472 Merge "Add a new bubble at limit while expanded" into main 2024-06-27 17:26:34 +00:00
Vinit Nayak
d900d39412 Merge "Add set correct window corner radius on split invocation animation leashes" into main 2024-06-27 16:42:54 +00:00
Liran Binyamin
2e1dd4644b Add a new bubble at limit while expanded
Handles adding a new bubble and removing an old bubble when the bar
is expanded and at the limit.

Demo when bar is on right: http://recall/-/bJtug1HhvXkkeA4MQvIaiP/dxhFKrctdR5I2F6Pvho6u8
Demo when bar is on left: http://recall/-/bJtug1HhvXkkeA4MQvIaiP/er4ZGQfg8OKHZ2aTi9OJ9N

Flag: com.android.wm.shell.enable_bubble_bar
Test: demos
Test: atest BubbleViewAnimatorTest
Fixes: 345795791
Change-Id: I4e75d61c8afdb81340823a1d77e55b15e3fd6bc0
2024-06-27 10:36:16 -04:00
Alex Chau
8474edcf13 Extract TaskContainer to its own class
Bug: 335606129
Test: Manual
Flag: EXEMPT refactor
Change-Id: I0ac924652079c69737cd37a9233080b432ecc16e
2024-06-27 14:26:14 +01:00
Vinit Nayak
093978a6ba Add set correct window corner radius on split invocation animation leashes
Test: Enter split anim from overview on phone is smoother than
Michael Jackson's moonwalk
Bug: 349387413
Flag: EXEMPT bugfix

Change-Id: I01fd1eee6fe111623a22dd6aaf130837ebbdeeb1
2024-06-27 03:58:42 +00:00
Treehugger Robot
2f90296717 Merge "Use snapshotView references in TaskContainer when possible" into main 2024-06-26 18:01:54 +00:00
Alex Chau
c06bc41ee0 Use snapshotView references in TaskContainer when possible
- Moved majority of TaskContainer.thumbnailViewDeprecated usage to TaskContainer.snapshotView, so they'll cover the new TaskThumbnailView as well
- There are afew location left that will be handled as a follow-up
- Removed TaskThumbnailView's splitTranslation and use translation directly as it's the only translation we use

Bug: 336612373
Test: Ensure all Task CUJs still work without refacorting
Test: Ensure major Task CUJs work with refactoring
Flag: EXEMPT refactor
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: Ieb52236bc503ce0d0a511249978c1821a82d406e
2024-06-26 16:07:57 +01:00
Brian Isganitis
1812030be0 Merge "Take in test instance as field." into main 2024-06-25 23:02:32 +00:00
Brian Isganitis
a07a7c2f91 Take in test instance as field.
This refactor makes it simpler for the rule to keep track of the test
instance (immutable). Having the rule be a TestRule instead of a
MethodRule also simplifies nesting TestRules within this implementation
(future CLs).

Test: Taskbar{AllApps,Overlay}ControllerTest
Flag: EXEMPT refactor
Bug: 230027385
Change-Id: Icf587202242fcb4526946d9c7619e5be4f59154e
2024-06-25 17:16:35 -04:00
Brian Isganitis
5ee679dbb8 Merge "Introduce TestRule for setting Taskbar mode." into main 2024-06-24 20:17:24 +00:00
Brian Isganitis
cbc07b4282 Introduce TestRule for setting Taskbar mode.
This rule is separate from TaskbarUnitTestRule, because mode isn't
relevant to all Taskbar controllers.

To keep MainThreadInitializedObject behavior consistent across
Robolectric and Instrumented environments, context needs to be a SandboxContext.

Test: TaskbarModeRuleTest
Bug: 230027385
Flag: TEST_ONLY
Change-Id: Iae2e3627b9002e13ee6da135113e7b8bcc4e7d47
2024-06-24 14:34:45 -04:00
Treehugger Robot
c1391754ff Merge "Enable currently functional multivalent tests" into main 2024-06-24 01:17:40 +00:00
Uwais Ashraf
c902df4e41 Enable currently functional multivalent tests
Flag: EXEMPT test-only
Bug: 325088619
Bug: 325088638
Bug: 325088328
Test: Presubmit
Test: Gradle robolectric run
Change-Id: I20e77a401ed98c97168bf9c752eacc93c3c545dd
2024-06-22 22:14:30 +00:00
Treehugger Robot
0abbc4af14 Merge "Add scrim to TaskThumbnailView" into main 2024-06-22 01:22:31 +00:00
Treehugger Robot
f4934108bb Merge "Fix bubble bar bounce animation issue" into main 2024-06-21 20:44:10 +00:00
Uwais Ashraf
0d9b547471 Add scrim to TaskThumbnailView
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Fix: 334832108
Fix: 348195366
Test: Manual - checked scrim in un/folded
Change-Id: I758a26e9b4498dac509b75afbe059784557b3f8c
2024-06-21 16:27:01 +00:00
Liran Binyamin
cdc3e4d8b4 Fix bubble bar bounce animation issue
The bubble bar bounce animation was assuming that the initial translation
of the bubble bar is also the translation the bubble bar should have at
the end of the animation. This is normally correct except when the
bubble bar is initially hidden. What happens in that case is that the
translation is 0 so the bubble bar gets animated incorrectly.

This change gets the target animation from stash controller.

ABTD 100 runs: https://android-build.corp.google.com/abtd/run/L26900030004638356/

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 347856510
Test: atest BubbleBarTest#selectDifferentBubble
Change-Id: I661bf006c6f23ff871c221f8d9da74d79a2dff11
2024-06-20 18:03:52 -04:00
Liran Binyamin
8af78f19a3 Merge "Animate bubble removal from the bar" into main 2024-06-20 20:57:34 +00:00
Liran Binyamin
7b426af15f Animate bubble removal from the bar
This change creates a BubbleAnimator class that handles animating
both new bubbles in and removed bubbles out.

Demo: http://recall/-/bJtug1HhvXkkeA4MQvIaiP/dMHGANplWjGC5HZT6MXyA4

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 345687290
Test: atest BubbleAnimatorTest
Test: see demo

Change-Id: Ie060495f4b1421d1c8af48a861cd3e12dd0adbe8
2024-06-20 14:57:03 -04:00
Liran Binyamin
ad2f15c5b2 Merge "Implement new bubble animation when collapsed" into main 2024-06-18 00:16:08 +00:00
Liran Binyamin
9e15f07c1c Implement new bubble animation when collapsed
Bounce the bubble bar when a new bubble is received while the bubble
bar is collapsed.

Demo: http://recall/-/bJtug1HhvXkkeA4MQvIaiP/fn7NWNY3htuR6K3wxhfcK2

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 280605790
Test: atest BubbleBarViewAnimatorTest
Change-Id: I4c622454fd99f6bb5a332b3fe4aa2764c8af93af
2024-06-17 16:24:59 -04:00
Brian Isganitis
0e709b9a9d Merge "Add test for toggleSearch." into main 2024-06-17 18:25:17 +00:00
Randy Pfohl
69092b41f6 Merge changes from topic "windowPrototype" into main
* changes:
  Fixing tests related to abstraction
  Abstracting StatefulActivity from StateManager
2024-06-13 22:11:49 +00:00
Brian Isganitis
fa1f4c9f79 Add test for toggleSearch.
Focus is not requested until the open animation finishes, so we need to
emulate the animation completing.

Test: TaskbarAllAppsControllerTest
Flag: TEST_ONLY
Fix: 346394798
Change-Id: I5ba57e9bb1813c159599b31404a28ef10c85e3ee
2024-06-13 20:06:30 +00:00
Brian Isganitis
1535867fa7 Merge "Test TaskbarAllAppsController non-search behavior." into main 2024-06-13 18:04:12 +00:00
randypfohl
4b40965346 Fixing tests related to abstraction
Flag: NONE - fixing tests

Test: built and ran locally, verified test pass in presubmit

Bug: 224595066

Change-Id: Ifefab1e1696853c5bd816a361314082073ba8a20
2024-06-13 10:26:12 -07:00
Brian Isganitis
e2b79a499d Merge "Add more documentation explaining main thread requirements." into main 2024-06-13 00:02:22 +00:00
Brian Isganitis
e54c1462a3 Test TaskbarAllAppsController non-search behavior.
Flag: TEST_ONLY
Bug: 230027385, 346394798
Test: TaskbarAllAppsControllerTest
Change-Id: Id97e1b82cb8fba48687b5e23222e3bba6695ac4c
2024-06-12 23:59:51 +00:00
Brian Isganitis
e16fc827d3 Add more documentation explaining main thread requirements.
Flag: TEST_ONLY
Test: n/a
Bug: 230027385
Change-Id: Iad38f946c2e75a3372253e57abb4df2f52e62ca5
2024-06-12 16:23:14 -04:00
Brian Isganitis
a76fcaf5b4 Add more tests for {request,hide}Window.
Flag: TEST_ONLY
Fix: 346394585
Test: TaskbarOverlayControllerTests
Change-Id: I59ed58d7f3a4d46bccfb34ef6923f1bf4f5bf2c1
2024-06-12 15:53:33 -04:00
Brian Isganitis
9eaae4b6a4 Initial TaskbarUnitTestRule with example overlay controller tests.
Flag: TEST_ONLY
Bug: 230027385
Test: TaskbarOverlayControllerTest
Change-Id: I858906ece7e67677962ec8b4432bfcca5ec30283
2024-06-11 23:48:13 -04:00
Ats Jenk
cd4c9d153d Add content description to bubble bar and bubbles
Set content description on the bubble bar when it is collapsed. Only
allow focus on the bar itself. In collapsed mode, bubbles in the bar
can't be focused.
Content description for the bar matches what we have in floating mode.
We include the text for the first bubble and then how many bubbles are
there more.

Set content description on bubbles in bubble bar. When bubble bar is
expanded, only the bubbles are focusable.
Bubble content description matches the floating bubbles content
description. Includes the notification title and app name.

Bug: 344670947
Flag: com.android.wm.shell.enable_bubble_bar
Test: enable talkback, focus on bubble bar when it is collapsed, check
  that only bubble bar receives focus
Test: enable talkback and expand bubble bar, check that only the bubbles
  receive focus
Change-Id: Id931f0360b9ebadd01dd16b05b75546fcc4df803
2024-06-05 10:13:22 -07:00