Commit Graph

1851 Commits

Author SHA1 Message Date
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
Becky Qiu
6183c4dd74 [Toast] Create one search tapl tests for opening qsb and calculator app.
Test design doc: https://docs.google.com/document/d/1aPtMvegzn4hdwC0CNuIkfkalqG7v0FNCfyoO7qIOfN4/edit?usp=sharing&resourcekey=0-71oNHp1KKOdDKxr7Vd4dGQ

Bug: 225935921
Bug: 225935929
Test: ran test in android studio
Change-Id: I74197a9d81fc75a44269ab3bc1bba910de5e17fe
2022-05-05 18:47:34 -07:00
Nicolò Mazzucato
21ea6828d8 Merge "Allow workspace to provide icon positions in tests" into tm-dev 2022-05-05 08:17:54 +00:00
TreeHugger Robot
4bd36a37a7 Merge "Implementing support for item diffing instead of creating out the complete UI on every update" into tm-dev 2022-05-04 23:11:04 +00:00
Nicolo' Mazzucato
f67536e1eb Allow workspace to provide icon positions in tests
This is needed in order to implement a test for the unfold animation.
getWorkspaceAndHotseatIconsPositions returns map that associate icon name with its center on the screen

Test: atest TaplTestsLauncher3
Bug: 220087235
Change-Id: I254aa0c146edf4cae1c2bf5c09dec000993eb4d8
2022-05-04 20:27:11 +00:00
Pat Manning
f4bd9b6304 Merge "Update workspace, cell layout, shortcut and widget, and cell size calculations." into tm-dev 2022-05-04 18:19:02 +00:00
Pat Manning
b45d6c421d Update workspace, cell layout, shortcut and widget, and cell size calculations.
Test: DeviceProfileGridDimensionsTest.kt
Fix: 230862148
Change-Id: Ib1d577bf21beb45b2f8b3d4bd57e72c188e0f71b
2022-05-04 15:39:03 +01:00
Sunny Goyal
3c5a08ada1 Implementing support for item diffing instead of creating out the
complete UI on every update

Bug: 229860311
Test: Verified locally
Change-Id: I5712b5d76878a0ed72cc1392ede59b3778b7a1dc
2022-05-03 16:24:46 -07:00
Sunny Goyal
7bf8730634 Fixing wrong window insets estimation
Launcher was estimating the landscape insets incorrectly
causing the UI to get reloaded if device is rotated. This also
caused widgets to be refetched as a result of grid size change

Bug: 218067434
Test: Verified locally that the window bounds do not change
Change-Id: Ia7228296c78ea3056f4859e43696d4bfd9522d3c
2022-05-02 13:18:45 -07:00
Thales Lima
828875cd12 Fix hotseat width to span a number of columns
Bug: 227344807
Test: manual
Change-Id: Ice4e37929bcbb8c9cf3af340e67b6bec002578bd
2022-04-29 14:56:30 +00:00
TreeHugger Robot
0716b0c104 Merge "Tracing the cause for saving bugreports" into tm-dev 2022-04-28 18:20:06 +00:00
TreeHugger Robot
fd64b4f2b3 Merge "Cleanup tapl test workaround" into tm-dev 2022-04-28 12:51:48 +00:00
Anushree Ganjam
fa693be19f Merge "Revert "Refactors Search results into separate RV for Toast."" into tm-dev 2022-04-28 04:52:01 +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
Sebastián Franco
84051cd8bf Merge "Give the tests the ability to emulate other devices screens" into tm-dev 2022-04-27 17:25:55 +00:00
Andras Kloczl
015d44aee3 Cleanup tapl test workaround
There was a bug in the framework (b/219711163) so
we needed a workaround to make the tapl test pass.

Test: Run TAPL tests
Bug: 219919285
Change-Id: I3eb4ca8c5b1d24f38330ad41b58c31c81eb01501
2022-04-27 12:24:43 +01:00
vadimt
6df9aa3086 Tracing the cause for saving bugreports
Bug: 229115383
Test: presubmit
Change-Id: I8ce42c67b4679e23b2e7ea68ee27ee9738a8b4b5
2022-04-26 13:18:19 -07:00
Sebastian Franco
00aff95ac0 Give the tests the ability to emulate other devices screens
This code contains utility clases that can change the display
of a device and make it look like another device.
The function DisplayEmulator#emulate receives a DeviceEmulationData
a certain grid to emulate and a callback, everyting that happens
inside of the callback will happen when the device is being emulated
and can be used by other tests.

Example test:
package com.android.launcher3.deviceemulator;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import com.android.launcher3.deviceemulator.models.DeviceEmulationData;
import com.android.launcher3.ui.AbstractLauncherUiTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.concurrent.TimeUnit;

@MediumTest
@RunWith(AndroidJUnit4.class)
public class TestTest extends AbstractLauncherUiTest {
    @Test
    public void testEmulation() throws Exception {
        String deviceCode = "pixel6pro";
        DeviceEmulationData deviceData = DeviceEmulationData.getDevice(deviceCode);
        String grid = "normal";
        DisplayEmulator displayEmulator = new DisplayEmulator(mTargetContext);

        displayEmulator.emulate(deviceData, grid, () ->{
            TimeUnit.SECONDS.sleep(10);
            return true;
        });
    }
}

Test: You could use the test above to make your device look like a
Pixel6 pro for 10 secons.
Fix: 229028257

Change-Id: Icd79be405a2e14dda0bc5f555b0e46149e16f912
2022-04-25 11:57:58 -05: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
Alex Chau
e3b806366a Update pull back animation for tablet AllApps
- This is a follow-up of http://ag/17636490
- Introduced animation property specifically for pullback translation and alpha, which will invoke getRecyclerViewContainer directly on tablet, and invoke aggregate setter of appsView on phones
- Delay reset of pullback animation to after dismiss animation to avoid jump in value during state transition animation
- Introduced property factory for addictive properties similar to MultiScalePropertyFactory

Fix: 220345008
Test: manual on small and large screen
Change-Id: I7b5c0019c1d4d36c3c7ca4ec79e38e4eb09c32ca
2022-04-22 16:27:25 +01:00
Vadim Tryshev
70dffbe896 Merge "Sampling too long Launcher tests" into tm-dev 2022-04-20 17:09:26 +00:00
vadimt
25fbd5b0bb Sampling too long Launcher tests
A test that takes > 3 min will generate an artifact file containing stacks of all threads of the test process taken every 3 sec. This artifact will be also generated if the test process is killed, for example, by timeout.

This artifact should help EngProd's effort to speed up presubmits.

Bug: 225186335
Test: local runs
Change-Id: I721779bfbe5bc6289315998ed2660f5f46165611
2022-04-19 18:02:56 -07:00
Sunny Goyal
df472f8db7 Merge "Updating target SDK for Launcher" into tm-dev 2022-04-19 03:32:27 +00:00
vadimt
3a60866b70 Trying to remove waiting for broadcasts
Way back we suspected that this would prevent Launcher restarts while the test runs, but later we seem to have found another solution.

Now the tests can sit for, like, 90 sec in this call.

So let's remove it and see what happens.

Test: presubmit
Bug: 187761685
Change-Id: I4baa174b48151151d657e833f121b2e6daa27453
2022-04-18 14:42:36 -07:00
Sunny Goyal
cd2ac0f3e9 Updating target SDK for Launcher
Bug: 229173942
Bug: 226461147
Test: Presubmit
Change-Id: Id9e303f113cba87adf26442f1417ed2814555c54
2022-04-18 13:55:01 -07:00
Benno Lin
edb576fba8 Merge "Enable pressback tests" into tm-dev 2022-04-07 23:39:20 +00:00
Alex Chau
bfa953b230 Merge "Allow 5 hotseat icons in tablet 3 button" into tm-dev 2022-04-01 10:11:59 +00:00
Vadim Tryshev
2c52c31571 Merge "Moving away from obsolete Display#getRealSize()." into tm-dev 2022-03-31 21:01:58 +00:00
vadimt
bda5f6b3e5 Moving away from obsolete Display#getRealSize().
Step 2 (final): stopping using old API

Bug: 202567877, 227307209
Test: presubmit
Change-Id: Ic32740723a517b28f92dbdd32fc53e27831441cc
2022-03-31 10:56:03 -07:00
Alex Chau
72c4de8c13 Use Chrome instead of Camera for TwoPanelWorkspaceTest
Fix: 227540753
Test: atest -c NexusLauncherTests:com.android.launcher3.ui.workspace.TwoPanelWorkspaceTest#testEmptyPagesGetRemovedIfBothPagesAreEmpty
Change-Id: Ia00e243ef9d56e094da0e23511cc8d62fa606df6
2022-03-31 14:40:20 +00:00
Alex Chau
8a7451a565 Allow 5 hotseat icons in tablet 3 button
Fix: 223756731
Test: manual
Change-Id: Iacde8b9506c09a20d6b2b917da8f6589009aadc7
2022-03-31 15:27:35 +01:00
Thales Lima
c1ea50a43d Merge "Make inline qsb part of grid attrs" into tm-dev 2022-03-31 08:30:10 +00:00
Thales Lima
12d0eff037 Make inline qsb part of grid attrs
This should make it more configurable, and be independent of the screen size set by the user.

Fix: 223726518
Test: atest Launcher3Tests:HotseatSizeTest
Test: atest Launcher3Tests:InlineQsbTest
Change-Id: If04f3fb0f556103f60b580c757a9fc06da561516
2022-03-30 20:57:57 +01:00
TreeHugger Robot
dc4dad8ec4 Merge "Moving away from obsolete Display#getRealSize()." into tm-dev 2022-03-30 17:44:44 +00:00
András Klöczl
aa35c39167 Merge "Separate workspace item finding logic" into tm-dev 2022-03-30 16:43:32 +00:00
Benno Lin
264d9a67de Enable pressback tests
Bug: 205027405
Test: Manual
Change-Id: I5bb41fc27db17e95d7a7c91cec2bbf85f33d6dad
(cherry picked from commit b5b70930e9)
2022-03-30 10:36:38 +00:00
vadimt
c8aada4433 Moving away from obsolete Display#getRealSize().
Step 1: use both new and old APIs and make sure they return the same values.

Bug: 202567877, 227307209
Test: presubmit
Change-Id: I86fbb0ca089a88b5ff787a5c353664a192fb7e79
2022-03-29 16:58:25 +00:00
Andras Kloczl
68e1af2bc2 Separate workspace item finding logic
Extract the item finding logic from AddWorkspaceItemsTask
to a separate class and write tests.

Test: AddWorkspaceItemsTaskTest.kt , WorkspaceItemSpaceFinderTest.kt
Bug: 199160559
Change-Id: Ie1bc4fcd4f94cd7cb0601c21bbdf273452b9dd1f
2022-03-29 13:31:31 +01:00
Thales Lima
b7ef569591 Change size of All Apps bottom sheet
This brings the size of the bottom sheet closer to the spec provided by UX. For that type of flexibility to be possible, more attributes are introduced and some calculations had to be changed.

This shouldn't affect phones.

Bug: 218638090
Test: visual, with dumpsys and HSV
Change-Id: Ieee7580d80d8e100837b1cdd7a1455c4d65612dc
2022-03-22 12:19:46 +00:00
Alex Chau
d5859e80d7 Change grid migration to start from top to bottom
Fix: 222236363
Test: GridSizeMigrationTaskV2Test
Test: 4x4 -> 4x5/5x5 migration, 5x5 -> 4x5/4x4 migration
Change-Id: Id5d87b5d0bf9d7cc9154de81dd5edfb0ca9fa633
2022-03-15 17:21:24 +00:00
TreeHugger Robot
deae9343be Merge "Pass in dbFile from idpGridState for grid migration" into tm-dev 2022-03-14 21:33:16 +00:00
TreeHugger Robot
8cb2364c1a Merge "Renaming LauncherInstrumentation.pressHome to goHome" into tm-dev 2022-03-14 20:37:06 +00:00
vadimt
41c0b52cd9 Renaming LauncherInstrumentation.pressHome to goHome
This is a better name now that we have gestural nav.

Renaming will happen in stages, the first one being having 2 names side-by-side.

Test: presubmit
Bug: 187761685
Change-Id: Ifb15c838cc0e161d852cf6df025687e3f92d6124
2022-03-14 18:13:47 +00:00
Hyunyoung Song
234b1e0655 Merge "Revert "Add entry and cursor location in GetSuggestionRequest"" into tm-dev 2022-03-11 06:26:04 +00:00
Schneider Victor-tulias
fb252e7ce1 Add taskbar TAPL tests
- Added TAPL objects to support TAPL tests for taskbar features
- Added tests for major taskbar features: hiding/showing the taskbar, opening all apps, lauching apps and app deep shortcuts from the taskbar/all apps page, launching apps and app deep shortcuts in splitscreen
- These tests should only run for large devices

Design: go/taskbar-tapl-tests
Test: ran tests locally with invalid configurations and remotely
Bug: 215218813
Change-Id: I3c28c339707467414aa47fa633f87fa0c1fdee57
2022-03-10 13:02:35 -08:00
Sam Gilbert
355bd482c8 Revert "Add entry and cursor location in GetSuggestionRequest"
Revert submission 17128079-suggestionentry

Reason for revert: test monitor determined it broke tests: b/223859070
Reverted Changes:
I838896e2f:Add entry and cursor location in GetSuggestionRequ...
Ic9f5dd35b:Add cursorLocation and entry to GetSuggestRequest

Change-Id: I8a15f61c5ddb37b26d3e06de25f0d5b5b5c89abc
2022-03-10 19:48:31 +00:00
Hyunyoung Song
e395453bd9 Add entry and cursor location in GetSuggestionRequest
Bug: 223728521
Test: manual
Change-Id: I838896e2fad2d37c22e665473d59cc1b2c9a14d7
2022-03-09 22:21:50 -08:00
Sunny Goyal
187b16cb91 Updating window manager estimation logic:
> Moving the code from ApiWrapper to Resource overlays for better maintainability
> Accounting for display cutouts in insets estimation
> Using same logic in display controller and view inset dispatching

Test: Verified on device
Bug: 221961069
Change-Id: I78466353563692ce3f7512b0146ef8b61ef14bc0
2022-03-09 11:15:58 -08:00
Alex Chau
fe9a07bb96 Pass in dbFile from idpGridState for grid migration
- IDP can get re-initializeed during grid migration task, causing src/dest dbFile to be the same when prepareForMigration, which fails the migration and causes a wipe
- The fix is to cache IDP state as DeviceGridState, and use DeviceGridState to determine migration, trigger migration and save configuration after migration
- This should avoid migration failure in b/198965093 that causes homescreen wipe. Homescreen icon may still be messed up by the migration, but won't completely disappear

Bug: 198965093
Fix: 223579388
Test: manually trigger grid migration
Change-Id: I9890a6d5d530ff87aed8f601ec7d35a672b7cd46
2022-03-09 14:52:17 +00:00
Alex Chau
d8a37c2e12 Merge "Use less icons in hotseat when in 3 button nav for tablet" into tm-dev 2022-03-08 11:58:55 +00:00