Commit Graph

59 Commits

Author SHA1 Message Date
Tony Wickham
6b32ce07b1 Merge "Decrease TAPL All Apps scrolling flakiness" into tm-qpr-dev 2022-11-02 15:39:45 +00:00
Sunny Goyal
f34811d3a3 Revert "Revert "Updating the scroll calculation from recyclerView to avoid view inflation""
Test: ABTD
https://android-build.googleplex.com/builds/abtd/run/L52600000956969786

This reverts commit cee6ddf3de.

Reason for revert: Fixed in ag/20239136

Change-Id: I0e8446e66d9a86a94b40fcbd6de14da07abe8e5c
2022-10-22 15:37:47 +00:00
Schneider Victor-tulias
ee0bc03d58 Decrease TAPL All Apps scrolling flakiness
scrolling in all apps did not factor in additional top padding in the all apps list recycler. This made it so that apps could occasionally scroll and be obcured by that top padding, making them un-tappable. Added this padding to the scrolling logic to make scrolling less flaky.

Test: TaplTestsTaskbar, TaplTestsLauncher3 and presubmit
Fixes: 248064856
Change-Id: Id76b92b4bc354917f3688ac53673d0ed7a905f02
2022-10-21 12:12:38 -07:00
Hui Kang
cee6ddf3de Revert "Updating the scroll calculation from recyclerView to avoid view inflation"
This reverts commit 20bbe95ddb.

Reason for revert: Causing flake in Ironwood test: b/248295569

Test: ABTD
Before: Flaky, 14/50 PASSED
https://android-build.googleplex.com/builds/abtd/run/L33900000956890639

Revert: 50/50 PASSED
https://android-build.googleplex.com/builds/abtd/run/L49200000956887317

Change-Id: I41f4428c74e581323f90c716a7852b5e553ae27d
2022-10-17 20:37:49 +00:00
Sunny Goyal
20bbe95ddb Updating the scroll calculation from recyclerView to avoid view inflation
> Updating the LayoutManager's scroll calculation instead of a separate
  implementation to better support recyclerView's calculations
> Caching the view sizes during layout to avoid view-inflation for
  unknown types
> Fixing scrollbar jump during scroll when widget list is expanded
> Fixing scrollbar never reaching end when onboarding card is displayed
  in work tab

Bug: 240343082
Test: Verified on device that new views are not inflated
Change-Id: Ied11ccf65b053691c5c126c4bf8de306ec24786d
2022-09-12 12:24:34 -07:00
vadimt
f6ef879cf4 Moving all sources that are shared between Launcher and TAPL in one directory
This will help SysUI test team (who uses TAPL) to set up Gradle build for their tests.

Bug: 202567877, 234414088
Test: presubmit
Change-Id: I3d923ea4b54d1a4c3d2b345be09692727d30433e
2022-07-27 20:18:46 +00:00
Chilun Huang
ac57ddeb4c Workaround to return 1/3 of the position
Some devices in portrait mode have the same symptoms as b/234322284.
Simply return 1/3 of the position like the X axis to solve the problem.

Bug: 238202110
Test: atest Launcher3Tests:TaplTestsLauncher3#testAddDeleteShortcutOnHotseat
Change-Id: Ic7d3756cfbda6673a62b266c6093745b8311e6ac
2022-07-11 15:19:16 +08:00
Tony Wickham
0c8ceda6e7 Merge "Move TEST_HARNESS_TRIGGER_TIMEOUT to MotionPauseDetector directly" into tm-qpr-dev 2022-07-06 16:25:03 +00:00
Tony Wickham
539c2703ea Move TEST_HARNESS_TRIGGER_TIMEOUT to MotionPauseDetector directly
- Removed TestProtocol.sForcePauseTimeout and
  TestProtocol.REQUEST_SET_FORCE_PAUSE_TIMEOUT
- Instead, add MotionPauseDetector.TEST_HARNESS_TRIGGER_TIMEOUT, which
  is used when Utilities.IS_RUNNING_IN_TEST_HARNESS.

Test: unbundled/launcher/launcher3_test_platform
Fixes: 232548865
Change-Id: I224e99042b41375cab6bffd555434217518958c5
2022-06-30 12:16:08 -07:00
Chilun Huang
7662dae663 Add TAPL API for adding app icon to hotseat
Please refer to go/tapl-add-icon-to-hotseat for more details.

Bug: 231400119
Test: atest NexusLauncherTests:TaplTestsQuickstep#testAddDeleteShortcutOnHotseat
Change-Id: I8cadecbe742413e3ce35ff269c0f78057331532c
Merged-In: I8cadecbe742413e3ce35ff269c0f78057331532c
2022-06-27 11:10:21 +08:00
Abhilasha Chahal
997a757661 Check if launcher has touch interaction service when registering touch events
Bug: 228014625
Test: Refactoring change

Change-Id: I3b94f4f7fabf7cb2964eefd5cf1e099d2bb80ca6
2022-05-06 16:21:48 +00:00
Anushree Ganjam
5cc7ff0990 Revert "Refactors Search results into separate RV for Toast."
This reverts commit 6729f0b950.

Reason for revert: This change caused b/230648542.

Please see https://b.corp.google.com/issues/230648542#comment5 for the video after reverting this change.

Bug: 206905515
Bug: 230648542

Change-Id: I85f063c56cad137c05b810204244bba7e8f94ee7
2022-04-28 01:37:49 +00:00
Andy Wickham
6729f0b950 Refactors Search results into separate RV for Toast.
This will help enable transitions between A-Z apps lists and
search results because both can be seen simultaneously and
manipulated independently.

Some high level items of the refactor:
 - SearchRecyclerView is added; logic that populated the main
   (personal) tab with search results was simply redirected to
   this RV instead.
 - BaseAllAppsContainerView added isSearching() method. Returns
   false, and ActivityAllAppsContainerView overrides (as search
   is handled there).
 - Renamed BaseRecyclerView to FastScrollRecyclerView to better
   describe what it does. SearchRecyclerView extends this, but
   returns false for supportsFastScrolling().
 - AlphabeticalAppsList#mAllAppsStore is now optional, so the
   Search RV doesn't need to store/listen to apps. Note this
   doesn't affect the predicted app row which is still updated
   if one of the predicted apps is uninstalled (I tested this).

Future work:
 - Determine why dispatchRestoreInstanceState is not called for
   BaseAllAppsContainerView. Save is called, e.g. on rotation.
   Effect of restore not called: rotating while searching goes
   back to A-Z list.
 - Keep suggested apps in Header while searching. Currently they
   are rendered in the SearchRV above search results, as before.
 - Potentially extract Personal/Work tabs to move independently of
   header.
 - AlphabeticalAppsList is a misleading name because it can also
   contains search results. However, things are pretty intertwined
   between that and BaseAllAppsAdapter (effectively a circular
   dependency), so I figured cleaning all that up was out of the
   immediate scope of this refactor, which is mainly meant to
   unblock transition work.

Bug: 206905515
Test: Manually checked for regressions, ran tests.
Change-Id: I4d3757c8a8f9b774956ca6be541dd4fcdad1de13
2022-04-24 17:36:48 -07:00
Shikha Malhotra
f78da1bae3 Review comments followup
These are review comments followup from ag/17399997

Bug: b/218187058
Test: manually test thet Launcher3 features work correctly
Change-Id: I9865a37c1ed663370dc28e7678994f3d961e3cd1
2022-04-12 14:33:07 +00:00
Benno Lin
7738cac424 Implemnet methods to drag a icon to given Workspace cell
The CL implements public methods to drag an Icon from AllApps to a
given cell in the workspace.

Bug: 199120092
Test: Launcher3Tests:com.android.launcher3.ui.TaplTestsLauncher3#testDragAppIconToWorkspaceCell
Test: https://android-build.googleplex.com/builds/abtd/run/L89300000953052361
Test: https://android-build.googleplex.com/builds/abtd/run/L44500000953013792
Change-Id: Ife16d1f1b55b809763dd40f5afee6711049a4729
2022-02-15 01:48:45 +00:00
vadimt
462fe7c007 Allowing OOP tests to enable home screen rotation.
Bug: 202567877
Test: local runs
Change-Id: Ifb711a3071a26e2d8e690e0378b6e74146ac722c
2021-11-03 18:39:01 -07:00
Benno Lin
5261776d3a Update TAPL to operate on folder icons.
The change updates features listed as follow:

1. Create a new class for folder icon.
2. Implement function to drag a icon to the other.
   (create a folder)
3. Find folders in a workspace.

Bug: 199120092
Test: Launcher3Tests:com.android.launcher3.ui.TaplTestsLauncher3#testDragToFolder
Change-Id: I3044025f8297f6e442446d70238f4b56f38a798a
2021-10-25 11:08:44 +00:00
Tony Wickham
21970ccd29 Remove nonOverlappingTaskarInsets
- Override our insets in LauncherRootView to explicitly only care about nav bar size, ignoring any insets due to taskbar.
- Previously we used nonOverlappingTaskbarInsets to belatedly subtract from measurements in e.g. DeviceProfile, but now we can revert most of those calculations since we effectively subtract taskbar insets at the root.

Test: visual in different orientations and navigation modes, and testPressHomeOnAllAppsContextMenu to ensure REQUEST_WINDOW_INSETS still works for automated tests
Fixes: 200607741
Change-Id: I8de5a268c686a1354b4beaa30e101bab6bed5af9
2021-09-21 13:52:43 -07:00
Alex Chau
e9dbb0d952 Use windowInsets for bottomGestureSize instead of gestureInsets
- getTargetInsets will be reverted to its behavior before ag/15431427
- getBottomGestureSize will use the new getWindowInset call uses windowInsets instead of the max of windowInsets/gestureInsets, with the taskbar inset calibration

Bug: 195263971
Test: com.android.launcher3.ui.widget.AddWidgetTest#testDragCustomShortcut
Change-Id: I89368edee5252a404ef490db6540734ec4806f2b
2021-08-09 18:49:29 +01:00
vadimt
6b534ee54f Diagnose when lab device sends fake touch screen events to test
Bug: 189874683
Test: local
Change-Id: I8ac569ab049bafaa0a6263598f2b43a99386e6d9
2021-08-06 15:49:02 -07:00
Alex Chau
0dfe56cff1 Increase motion pause timeout for tests
- In cuttlefish occasionally MOTION_MOVE and MOTION_UP takes more than 300ms due to lag, increasing the motion pause timeout to avoid getting false signals in tests

Bug: 194114179
Test: atest NexusLauncherOutOfProcTests:com.android.launcher3.memory.MemoryTests#testAppLaunchFromWorkspace
Change-Id: I0a33f34b5bf96f4f7ae56020c5a27f4ef9a0ff64
2021-08-04 20:09:06 +01:00
Alex Chau
6951aef060 Fix Launcher3 tests for tablets
- Consider taskbar size for bottom gesture size, by using TargetInsets
- TargetInsets should substract overlapping taskbar size when it's present
- For pressHome, use the same gesture scope when context menu is present as well.
- For pressHome, GestureScope.INSIDE_TO_OUTSIDE should only be used when it's already at home screen on launcher3 tablet.

Bug: 193539246
Test: NexusLauncherTest and Launcher3Test
Change-Id: I4a20522f3b38ef326acae4b189df11a125990411
2021-07-30 20:39:05 +01:00
Alex Chau
0686931b68 Use DeviceProfile.isTwoPanels for two panels expectation in tests
Fix: 193810767
Test: TaplTestsLauncher3.testWorkspace
Change-Id: Ifec5506415b79f3effa84fe0163eb1bb2bc7cc8d
2021-07-16 15:14:34 +00:00
Vinit Nayak
b974a86c8f Add IDs to buttons in 3 button nav for Taskbar
Bug: 191449914
Test: testSwitchToOverview passes
See bug for more details

Change-Id: I108bbe7607181680bca7cb5fad5e7289191edde6
2021-06-18 18:20:44 -07:00
Steven Ng
2f5648a911 Refactoring before adding a new view type in the WidgetsListAdapter
Changes made:
1. Model: added an abstract class for storing common information for
   entries shown in the full page widgets picker.
2. Introduced a ViewHolderBinder interface to split the logic of binding
   data to ViewHolder into separate classes.
3. Move the view holder binding of WidgetsListRow from WidgetListAdapter
   to its new class.
4. Move some widgets picker classes into a new picker package.

Test: Auto: Run WidgetsListAdapterTest, WidgetsListRowEntryTest and
      WidgetsListRowViewHolderBinderTest.
      Manual: open the all apps widgets tray and navigate the list.

Bug: 179797520
Change-Id: Iab29557842bb79156cad84d00a4c5d0db0c5aa06
2021-02-10 21:23:40 +00:00
vadimt
fb099c7fe1 Improving diagnostics when can't find a widget
Instead of "exceeded number of attempts" now printing that can't scroll
to widget.

Change-Id: Ia6f582e038d68fc35f152d94e592f60ef0bc2cf4
2020-06-24 21:54:16 +00:00
vadimt
45564c831b Removing debug requests from non-debug test info handlers
Bug: 152629799
Bug: 153670015
Change-Id: I02776be811d1d3325b35880d19d25a6638f904ef
2020-06-10 18:48:37 -07:00
Vinit Nayak
6b7cc3fdc2 Re-enable orientation sensor for Overview animation
Slight revert of ag/10668129 with adjustment
of disabling it for tests.

Fixes: 151456795
Test: Ran the labtest command for OOP
tests for crosshatch (where this issue
was first detected)

Change-Id: I315d138c2e4a6d4068304e9b5fb2e1b7feb34e63
2020-04-02 11:07:10 -07:00
vadimt
2e1e0d6bff Removing tracing for "Launcher didn't initialize" flake
The flake had disappeared, perhaps because of this logging, or,
hopefully, for some other reason.

Bug: 148313079
Change-Id: I636783d5fc71474dd443c143289c3ff74651835e
2020-02-10 12:47:42 -08:00
Sunny Goyal
5fffa47cac Fixing race condition on test information provider
Activity tracker is accessed on a non-UI thread, which can cause a non-initialized
Launcher to be treated as initialized

Bug: 149022794
Change-Id: I6634a6aff891592369c16469bbe95a9ea611819c
2020-02-07 12:37:44 -08:00
vadimt
c8b09709ff Tracing for another "Launcher didn't initialize" failure
This simply restored logging used for one of earlier investigations

Bug: 148313079
Change-Id: Idafed13208dc5610d577986fc487d1d44bc0ef5e
2020-01-27 17:48:49 -08:00
vadimt
9675452c2f Better diags and a small correction for scrolling in AllApps
Change-Id: I48dbba26139f42350831fb707bea847b7c76129f
2020-01-14 19:39:35 -08:00
Pinyao Ting
654adf657e integration test for open settings menu from workspace.
compare pid of launcher process after test execution to verify launcher isn't crashed when running in oop test.

Bug: 147235759
Change-Id: Id13c47f5c4e388cc8e95b19d099e94a2e540bf3f
Test: fun flake locally
2020-01-08 17:01:39 -08:00
vadimt
480083490f Tapl: AllApps: ensuring a minimal vertical size of an icon
Clicking an icon within its padding area is ignored by Launcher. Hence,
ensuring that the whole icon is visible.

Bug: 141770616
Change-Id: I19e3ba7cfa25de75a47202845d0838bea46af92c
2019-11-13 20:20:57 +00:00
vadimt
56b800bfea Reducing chances for the object with finalizer to be reffed by register
As suggested in b/143155020#comment27

Bug: 143155020
Change-Id: I4ed87a003fcd7afde213014fc1ba8b004500e71a
2019-10-25 18:12:25 -07:00
vadimt
23c8341096 Removing tracing and @Stability for a fixed bug
Bug: 142514365
Change-Id: I147850db274c465fb964eca30b97b3ebaaa2ccf6
2019-10-25 11:21:33 -07:00
vadimt
ce25a2bf68 Adding tracing for a lab-only flake
Bug: 142514365
Change-Id: I9c93ecabbcbad6d4683d595587831d8465e62ee8
2019-10-14 11:34:38 -07:00
Winson Chung
c062580b5a Wait for the task to be in recents before validation
- There are two issues:
  1) Currently the system does not add the task to the task list until
     the activity starting the task has been resumed (to be fixed in a
     follow up platform CL). When the three activities are started in
     sequence, it's possible for one of the activities to not reach the
     resumed state leading to an unexpected number of recent tasks the
     next time it's fetched.
  2) When swiping up, it may take time for getTasks to return and call
     applyLoadPlan, so try and wait until the task views have had a
     chance to be applied before continuing.
  3) Use the launcher activity tracker instead of activity rule since it
     will return the same activity even after the activity is destroyed
- Move the margin handling to the caller instead of the scroll method

Bug: 141580748
Change-Id: I2b7634f5ac6869ba4b369b3bd60e0f63747c0f0b
2019-10-11 17:10:38 -07:00
vadimt
4b5c1ef71b Adding support for intentionally leaking views.
Bug: 139137636
Change-Id: I923d1781daee9ae47eb306ee8fa3c44790c6993f
2019-10-08 17:04:26 +00:00
TreeHugger Robot
86017c9611 Merge "Removing access to LauncherModel.getCallbacks" into ub-launcher3-master 2019-10-08 16:26:12 +00:00
vadimt
1b92f6d964 Reduce risk of flakes in memory leak detection tests.
Now performing jreck@-style garbage collection prior to getting Launcher
PSS. The reduces PSS noise from ~700KB to ~250KB (std dev).

The tests (MemoryTests) run outside of Launcher process and
communicate with Launcher via RPC.

The change is in the RPC handler that lives in Launcher and returns
Launcher PSS to the test.

Bug: 139137636
Change-Id: I457e590b005dac53345f4223d972c7961754938c
2019-10-08 01:05:41 +00:00
Sunny Goyal
b0adac23e0 Removing access to LauncherModel.getCallbacks
Bug: 137568159
Change-Id: Ic074dec6a8981a4b9aabf028cf3b878b532abb11
2019-10-02 14:27:40 -07:00
Sunny Goyal
e84c5b82be Unifying activity tracker callback
> Using a common class for both Launcher and RecentsActivity
> Removing static refenrece to LauncherModel and using a common pattern for
  tracking activities

Bug: 141376165
Bug: 137568159
Change-Id: Ic1897abe6913ec78e25725118eedf5b468d5ec70
2019-10-01 13:54:26 -07:00
Vadim Tryshev
f7a2971530 Merge "Waiting for Launcher model load in out-of-proc tests." into ub-launcher3-master 2019-10-01 18:43:24 +00:00
vadimt
542b7df7fd Waiting for Launcher model load in out-of-proc tests.
Not doing this seems to have caused flakes.

Bug: 141770616
Change-Id: Ia9caf20e4a2d93298adf4249ca815ad79bced802
2019-10-01 17:46:35 +00:00
Pinyao Ting
d843673434 Merge "removed extra test protocol for unit test" into ub-launcher3-qt-future-dev
am: d8aef47393

Change-Id: I0d69c2ec0e3d693d4556314fd1b74dabd0a8cbd2
2019-09-30 13:54:36 -07:00
Pinyao Ting
ea38c25854 removed extra test protocol for unit test
Bug: 140406263
Test: run TaplTestsLauncher3
Change-Id: I73b3098bd3aa92fed41d22a94cb58fd07263d26a
2019-09-30 18:34:49 +00:00
Pinyao Ting
30414c5699 Merge changes from topic "a11y-minus-one" into ub-launcher3-qt-future-dev
am: ff4977d42d

Change-Id: I5c565a2d67274240dcd06e41ad03564526d486ce
2019-09-24 14:58:53 -07:00
Pinyao Ting
7752023c08 fix test for a11y change in supporting -1 page
Bug: 140406263
Change-Id: I0a39db135a5e5b0fe570ace55a368a7f4b6cb453
Test: run TaplTestLauncher3 locally
2019-09-23 13:06:36 -07:00
Sunny Goyal
3d56046ff8 Fixing some tests for 2-button mode
Bug: 141315387
Change-Id: I66db3e790f5fbe6bc30999ed599cce03874509be
2019-09-20 10:40:14 -07:00