Commit Graph

21576 Commits

Author SHA1 Message Date
vadimt 29d8b54957 Disabling events checks for successful gestures by default
Launcher tests will still perform checks upon every gesture completion.

All tests using tapl will still use events for diagnostics if the
gesture fails.

The benefit is that system health and other platform tests won't have to
use expensive logcat, and moreover, wait seconds for the events to
appear in logcat because of buffering in logcat.

Change-Id: I3b5a0965d9432144d0c4a8b40ebe2fa89b19a689
2020-01-22 19:16:32 -08:00
TreeHugger Robot 51ee9cf03e Merge "TAPL: verify input events" into ub-launcher3-master 2020-01-22 22:45:51 +00:00
vadimt 9af34a7b13 TAPL: verify input events
This will catch cases, for example, when the platform stops delivering
injected events to Launcher, or injects unexpected events, like Back
Button.

Also optimizing and fixing incorrect behavior of calculating the start
time for the event collection.

Change-Id: I2ba0108e6bfa112f2905a05bcb327b148ec08f77
2020-01-22 14:10:53 -08:00
vadimt f51cbd8e69 Use wrapped launcher animation runner for app launch
- Prevents a lingering reference to the icon view

Bug: 139137636
Change-Id: I576dd4f55609dbe75ef37a5f264eb808e571863d
2020-01-22 11:24:28 -08:00
Hyunyoung Song a85f3c2f2d Disable FOLDER_NAME_SUGGEST flag
Bug: 147913781

Change-Id: I12ec71e1fef735f41bb67b155df40335f88d95c9
2020-01-22 09:26:29 -08:00
Hyunyoung Song dc2c128b20 Merge "Updating feature flags subclassing" into ub-launcher3-master 2020-01-22 07:16:54 +00:00
vadimt 2c6316be46 Adding auto-investigation of one more flake
Reshuffling the tests to make the investigator the outmost rule and run
the code that throws the original exception inside the investigator.

Change-Id: I714717a9b616862db5ce59116138ba7ea6ceb971
2020-01-21 19:06:59 -08:00
TreeHugger Robot 8c786b2e5c Merge "Adds Launcher flag to enable Universal Smartspace." into ub-launcher3-master 2020-01-22 01:53:36 +00:00
TreeHugger Robot 1348e44378 Merge "TAPL: Optimization: avoid getting actual events twice" into ub-launcher3-master 2020-01-22 01:15:44 +00:00
TreeHugger Robot d44326c2e7 Merge "Automatically diagnosing known flakes" into ub-launcher3-master 2020-01-21 22:56:35 +00:00
Sunny Goyal 94fa76fbeb Updating feature flags subclassing
> Preventing debug flags to get change listener on release device

Bug: 147913781
Change-Id: I2bd0456918c5d3224c714b153c4565b1ef41d7c0
2020-01-21 14:22:58 -08:00
vadimt cffe99f0bb Automatically diagnosing known flakes
It often takes a long time to fix a flake; meanwhile it takes a lot of
time for sheriffs to identify whether to register a new flake for a
failure.

This CL adds automatic identifies identification of one know flake type.
Once identified, it rewrites the error so that:
1. Flakes clustering tool that has only rudimentary clustering, places
all flakes of this kind in the same cluster (not multiple ones like
now). This is a step towards using clustering tool for monitoring
flakes;
2. Sheriff immediately sees that the issue is known.

Change-Id: I86a0762665cb21434289e1be00b60bd76fec4142
2020-01-21 13:29:37 -08:00
TreeHugger Robot 745aff4294 Merge "Fix regression where ShortcutRequest returns no results" into ub-launcher3-master 2020-01-18 00:46:44 +00:00
Tony Wickham d11fa28df9 Fix regression where ShortcutRequest returns no results
There was a subtle bug introduced by ag/9898176 where we now accept
String... shortcutIds. There are a couple calls that don't pass any
id's, which means the shortcut query is doomed to return an empty list.
Instead, we should pass null to match all shortcuts for that package.

Bug: 147831521
Change-Id: I928b6ed23b7e0ad01d95749cabf88ada053bcdd3
2020-01-17 16:14:13 -08:00
Andy Wickham ff13792b83 Adds Launcher flag to enable Universal Smartspace.
Test: Used the flag
Bug: 141701658
Change-Id: Id06016e313b05ae70b693c39e2e1cde2576cfbb1
2020-01-17 23:03:03 +00:00
Winson Chung 442d5e5bcd Merge "Move remote animation definition runner to wrapped class" into ub-launcher3-master 2020-01-17 22:59:20 +00:00
TreeHugger Robot 9311785daf Merge "Better diags and a small correction for scrolling in AllApps" into ub-launcher3-master 2020-01-17 21:48:52 +00:00
Winson Chung 24ab40cebe Move remote animation definition runner to wrapped class
- Add call to unregister for remote animations from the system
  when the launcher activity is destroyed to prevent a lingering
  reference from the system to the old activity. But separately,
  to not have to wait for the system to GC before clearing the
  binder ref, we also wrap all runner implementations so that
  they can be cleaned up after a GC in our process only.

Bug: 139137636

Change-Id: Ib6276cac80b446440ec101fe00eae6ca41fdf32c
2020-01-17 21:34:54 +00:00
TreeHugger Robot 163d4d0184 Merge "TAPL: performing event verification for all gestures" into ub-launcher3-master 2020-01-17 21:16:24 +00:00
vadimt 299aaf3a8a TAPL: performing event verification for all gestures
+ missed comments from earlier CLs

Change-Id: Iec84de66a3ff9c2aa59a11566560fa6f169190d0
2020-01-17 12:25:40 -08:00
Amos Bianchi dda7490c34 Fix gradle build of Launcher3
Test: build, run

Change-Id: I121fe3174bdb2292ae8f08ab610da2bac01251b3
2020-01-17 11:24:43 -08:00
TreeHugger Robot bb150db0cd Merge "Removing flake when 2 long-press events happened on single long press" into ub-launcher3-master 2020-01-17 17:48:06 +00:00
TreeHugger Robot b616ee02f5 Merge "Verifying that Launcher didn't crash in TaplTestsQuickstep" into ub-launcher3-master 2020-01-17 16:27:25 +00:00
TreeHugger Robot f3b71bb230 Merge "hook database restore with restore session" into ub-launcher3-master 2020-01-17 01:37:07 +00:00
vadimt d8827bad12 Verifying that Launcher didn't crash in TaplTestsQuickstep
TaplTestsLauncher3 already do this

Change-Id: I17fe638b81cbef4cf5230a6bd49b165e4f9e7855
2020-01-16 17:28:43 -08:00
vadimt 2ea348ff87 Removing flake when 2 long-press events happened on single long press
There is some unknown to me logic in Launcher that sometimes duplicates
the long-press event . This causes flakes whenTAPL expects one long
press, but the actual sequence is 2 events.

That duplication logic seems to be related to race conditions is is hard
to repro. For now, just removing long-press verification. I'll start
with more deterministic events.

Bug: 147806932
Change-Id: I03841131bf8cae88011824f660f2c7b1906592f4
2020-01-16 17:10:55 -08:00
Pinyao Ting ad5f24072c hook database restore with restore session
1. Create feature flag for new backup & restore flow.
2. For each restore session (install reason is restore),
   if its creation time is newer than the one we have in
   SharedPreference, we update the entry and restores
   favorite table from backup.
3. The restore operation is debounced so that when
   multiple restore session is created within a small
   amount of time, only the last invocation will get
   executed.

Bug: 141472083
Change-Id: I7b5b63ec28741ba2b02ccfd13f591c961362ba36
Test:
1. apply on master, build & flash on physical device.
2. factory reset the device.
3. go through SuW, perform restore, exit without
   adding work profile.
4. settings -> account -> add work profile account.
5. finish work profile setup, verify work profiles
   is restored as well.
2020-01-16 16:01:54 -08:00
Sunny Goyal c0e9df6dd6 Removing some unnecessary LauncherProvider overrides
Change-Id: Ia07919309bd4fe942af152881642fe24de9b00ee
2020-01-16 14:57:39 -08:00
vadimt f6c1a167d9 TAPL: Optimization: avoid getting actual events twice
Getting events is an expensive operation involving reading logcat. We
did this al least twice even if the number of events was already
sufficient. Fixing this.

Change-Id: I5bfb57e3b573c4fc3f0327512327750dbb35af2f
2020-01-16 14:44:51 -08:00
Pinyao Ting 9be1cfde79 include roboelectric test to verify db backup is created when
initializing the db for the very first time.

Bug: 141472083
Change-Id: I84d3487bb296bf445323906e8a2d3734b1aa8594
2020-01-16 12:30:48 -08:00
Pinyao Ting ba9c557108 Initial support for restore workspace from last stable db entry.
(see go/play-launcher-plan-launcher-implementation)

1. When Launcher launches for the first time, creates a backup
   of the workspace before sanitizing db entries.
2. Creates a new path in LauncherProvider that triggers workspace
   restore using last stable db entry of the same grid size.
3. When restore from backup created this way, the table will be
   sanitized afterward.

Test:
1. apply on master, build & refresh on physical device
2. factory reset, go through SuW and perform restore
3. exit SuW without signing into Work Profile
4. run following commands in console
adb root
adb remount
adb pull
/data/data/com.google.android.apps.nexuslauncher/databases/launcher.db
sqlite3 ./launcher.db
.tables
SELECT * FROM favorites_bakup;

Bug: 141472083
Change-Id: I8032866a97eb333946d4f62352595d180364126b
2020-01-16 12:23:45 -08:00
Pinyao Ting 71e53bba16 Fix the issue malformed SQL statement was provided during db
sanitization.

Bug: 147114476
Change-Id: I34459267cfacb168ec520856e90e5da0b83728f0
Test:
1. follow the verification step in ag/9891836
2. add the following line in Launcher#onResume
LauncherSettings.Settings.call(getContentResolver(),
        LauncherSettings.Settings.METHOD_RESTORE_BACKUP_TABLE);
3. build & flash on the device
4. verify sanitizeDb success without error message
2020-01-16 10:02:23 -08:00
Tony Wickham 0e4cc09738 Merge "If RecentsView is empty when starting quickswitch, listen for tasks to load" into ub-launcher3-master 2020-01-16 00:18:19 +00:00
TreeHugger Robot a97958a22a Merge "Swipe up from nav bar in fallback recents to go home" into ub-launcher3-master 2020-01-15 22:56:41 +00:00
Vadim Tryshev f7b2d40347 Merge "TAPL: Verifying some interactions with system" into ub-launcher3-master 2020-01-15 22:32:13 +00:00
TreeHugger Robot 2abd13a80b Merge "Fix BaseSwipeDetector#setState() called inside another setState()" into ub-launcher3-master 2020-01-15 22:03:01 +00:00
vadimt 252d012ed0 TAPL: Verifying some interactions with system
Investigation of TAPL failures, especially flakes is complex, partially
because it’s hard to tell whether it’s Launcher who is wrong or the
system.

We need to introduce a framework that looks at Launcher interaction with
the system and reports when interactions deviate from the expected
course, and who made the first wrong step.

This is first, proof-of-concept CL.

It analyzes long-press events. We had multiple cases when long-presses
didn’t happen or happened unexpectedly.

Launcher registers the events, TAPL retrieves and compares against the
sequence of expected regular expressions. This diagnostic is used when
something fails and at the end of public methods.

Change-Id: I07aa3a027267c03422c99c73ccd8808445c55fe8
2020-01-15 13:31:18 -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
TreeHugger Robot e16a2ba379 Merge "Add null check before updating NotificationItemView" into ub-launcher3-master 2020-01-15 02:44:08 +00:00
TreeHugger Robot 14bd192275 Merge "Track bottom of the app window when ENABLE_OVERVIEW_ACTIONS is true" into ub-launcher3-master 2020-01-14 23:33:02 +00:00
Tony Wickham 011439e353 If RecentsView is empty when starting quickswitch, listen for tasks to load
When first doing quick switch, RecentsView might be empty but tasks subsequently
load. In that case, we can update our animators to have the correct scale etc.

Test: From home, toggle dark theme or RTL from quick setting tiles,
then quick switch; ensure RecentsView comes in scaled up.

Bug: 126596417
Change-Id: I28d79455431b1da634372d6f31182406aa24cd06
2020-01-14 21:27:59 +00:00
TreeHugger Robot 8b0e50fecf Merge "Tracing launcher package name" into ub-launcher3-master 2020-01-14 18:41:53 +00:00
vadimt cef8008bfa Tracing launcher package name
I suspect that when the test starts, launcher package may be
com.google.android.setupwizard

Bug: 145935261
Change-Id: Ibf5e9785cd73762cbf2cdc8569482d77db782897
2020-01-13 17:10:12 -08:00
TreeHugger Robot 3d76dadcd6 Merge "Recognizing running "prebuilt" launcher and manually built platform" into ub-launcher3-master 2020-01-14 00:45:46 +00:00
Hyunyoung Song bab1101b87 Merge "Show suggestion when user taps on folder's edit text" into ub-launcher3-master 2020-01-13 23:18:21 +00:00
TreeHugger Robot d4ec31a51a Merge "TAPL: Tracing only changed part of the context for diags" into ub-launcher3-master 2020-01-13 22:39:20 +00:00
Hyunyoung Song 54d1f88ae6 Show suggestion when user taps on folder's edit text
Also, enabled preloading of the folder name db
Bug: 147523650
Bug: 147359653

Change-Id: Ia77e12d2b2bc428263c2b2821a96894a6004d82e
2020-01-11 23:39:02 -08:00
Tony Wickham 107dd8dd66 Track bottom of the app window when ENABLE_OVERVIEW_ACTIONS is true
- Fix the shelf tracking distance since there's no shelf.
- Pullback against a swipe up from an app later

Bug: 143361609
Change-Id: I296fb9bcb20d7d45931006f20512f0dc4a54212b
2020-01-10 14:44:29 -08:00
Sunny Goyal 2000228dc0 Merge "Adding support for multiple Model clients" into ub-launcher3-master 2020-01-10 22:21:20 +00:00
Sunny Goyal a7a5bf3101 Adding support for multiple Model clients
Bug: 137568159
Change-Id: Ia4db800b19cc80c695fcb9ea28e07709dfd08c6a
2020-01-10 12:23:27 -08:00