Commit Graph

31 Commits

Author SHA1 Message Date
Rafael de Moura Dev
5e20759cc8 fixed NPEs below q(#5048)
* fixed java.lang.NoSuchMethodError: No interface method toList()

´´´
Ljava/util/List; in class Ljava/util/stream/Stream; or its super classes (declaration of 'java.util.stream.Stream' appears in /system/framework/core-oj.jar)
                                                                                                                            	at com.android.launcher3.model.WidgetsModel.getFilteredWidgetsListForPicker(WidgetsModel.java:99)
                                                                                                                            	at com.android.launcher3.model.WidgetsModel.getWidgetsListForPicker(WidgetsModel.java:122)
                                                                                                                            	at com.android.launcher3.model.BaseLauncherBinder.bindWidgets(BaseLauncherBinder.java:204)
                                                                                                                            	at com.android.launcher3.model.LoaderTask.run(LoaderTask.java:338)
                                                                                                                            	at android.os.Handler.handleCallback(Handler.java:873)
                                                                                                                            	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                                            	at android.os.Looper.loop(Looper.java:193)
                                                                                                                            	at android.os.HandlerThread.run(HandlerThread.java:65)

                                                                                                                            	´´´

* fix crashes when trying to customize from folders

* fix NoClassDefFound attempting to create new folder in lower apis

* fix java.lang.NoSuchMethodError: No static method beginAsyncSection(Ljava/lang/String;I)V in class Landroid/os/Trace; or its super classes (declaration of 'android.os.Trace' appears in /system/framework/framework.jar!classes2.dex) when adding widgets below Q

                                                                                                        	at com.android.launcher3.widget.LauncherAppWidgetHostView.setAppWidget(LauncherAppWidgetHostView.java:126)
                                                                                                        	at android.appwidget.AppWidgetHost.createView(AppWidgetHost.java:382)
                                                                                                        	at com.android.launcher3.widget.LauncherWidgetHolder.createViewInternal(LauncherWidgetHolder.java:447)
                                                                                                        	at com.android.launcher3.widget.LauncherWidgetHolder.createView(LauncherWi

* fix java.lang.NoSuchMethodError: No static method beginAsyncSection(Ljava/lang/String;I)V in class Landroid/os/Trace; or its super classes (declaration of 'android.os.Trace' appears in /system/framework/framework.jar!classes2.dex) when adding widgets below Q

                                                                                                        	at com.android.launcher3.widget.LauncherAppWidgetHostView.setAppWidget(LauncherAppWidgetHostView.java:126)
                                                                                                        	at android.appwidget.AppWidgetHost.createView(AppWidgetHost.java:382)
                                                                                                        	at com.android.launcher3.widget.LauncherWidgetHolder.createViewInternal(LauncherWidgetHolder.java:447)
                                                                                                        	at com.android.launcher3.widget.LauncherWidgetHolder.createView(LauncherWi

* fix                                                                                                     java.lang.NoSuchMethodError: No virtual method setSystemGestureExclusionRects(Ljava/util/List;)V in class Lcom/android/launcher3/AppWidgetResizeFrame; or its super classes (declaration of 'com.android.launcher3.AppWidgetResizeFrame' appears in /data/app/app.lawnchair.play.debug-ewPju7gaDxUbh-ipLPLIoA==/base.apk!classes6.dex)

* fix more NoSuchMethodError

* fix NPE´s

* fix: disable showing addButton widget as it not make sense i think

* fix  java.lang.NoSuchMethodError: No virtual method getInstallerUid()I in class Landroid/content/pm/PackageInstaller$SessionInfo; or its super classes (declaration of 'android.content.pm.PackageInstaller$SessionInfo' appears in /system/framework/framework.jar)
                                                                                                        	at com.android.launcher3.pm.InstallSessionHelper.getUserHandle(InstallSessionHelper.java:265)
                                                                                                        	at com.android.launcher3.pm.InstallSessionHelper.verify(InstallSessionHelper.java:164)

* fix  java.lang.NoSuchMethodError: No virtual method getInstallerUid()I in class Landroid/content/pm/PackageInstaller$SessionInfo; or its super classes (declaration of 'android.content.pm.PackageInstaller$SessionInfo' appears in /system/framework/framework.jar)
                                                                                                        	at com.android.launcher3.pm.InstallSessionHelper.getUserHandle(InstallSessionHelper.java:265)
                                                                                                        	at com.android.launcher3.pm.InstallSessionHelper.verify(InstallSessionHelper.java:164)

* Update InstallSessionHelper

* revert changes in BaseWidgetSheet

* apply changes from code review
2024-12-11 05:47:26 +08:00
Andy Wickham
b922dccbf5 Cleanup API checks for P, Q, and R.
Test: Build with gradle
Flag: NA
Change-Id: I3ef17090741d14bebd76cf09cf3dc5ac4f11e686
2024-01-24 14:58:08 -08:00
Jagrut Desai
311d519292 Fix TaplTestsNexus#testSearchForApp
This cl is 1/2 part change

We are currently getting StaleObjectException when running this test.
We want to implment a synchoronized event beetween test and launcher,
so we know that search result adapter is done updating and page will
get no more updates of search results.

Test: Presubmit
Bug: 232008758
Flag: not needed
Change-Id: I40cf9b83d231a2487220aabc8f8e8c3ca71f255c
2023-09-13 11:09:05 -07:00
Brian Isganitis
fdd044e16e Expose IS_RUNNING_IN_TEST_HARNESS as static method.
This variable is now mutable, making the uppercase format misleading.
For instance, users might assume they can use this value in other
immutable properties, when they really should be accessing the latest
value every time they need it.

Context: https://source.android.com/docs/setup/contribute/code-style#follow-field-naming-conventions

Test: Manual
Bug: 271160958
Change-Id: Iaaa51d9153cb8a7d686c72e1210b1948029dcfd5
2023-03-03 00:17:33 +00: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
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
Alex Chau
97cba26a20 Wait for dismiss animation to finish before checking task count
- See http://b/193440212#comment5, TaskView takes time after swipe gesture to finish dismiss animation, so wait for the animation to finish before checking task count

Bug: 193440212
Test: TaplTestsQuickstep#testOverview
Change-Id: I21397e68f384e956a7c9f2ee8a8161ac784b4d2e
2021-07-19 17:34:57 +01:00
Alex Chau
46b9a41686 Enable logs on swipe detection in tests
- Enable BaseSwipeDetector log in tests
- Add log for scroll finish and motion pause event

Bug: 193440212
Test: TaplTestsQuickstep#testSwitchToOverview
Change-Id: Idab566bc615050f73d898459897b66f8b95951b3
2021-07-15 20:45:51 +01:00
vadimt
f8ceabbcc1 Misc test improvements
Ignoring state events from NexusLauncher in Launcher3 tests.
Improving diags for failed app launch.

Change-Id: I3ffb49c598edef7b6698b48ba7b63e6163ef25b4
2020-07-24 17:59:50 -07:00
vadimt
665232be61 Removing diags for a fixed flake
Bug: 160238801
Change-Id: Ia166eb1f154ddeeb70da5a141c9e985a265ba49a
2020-07-20 12:24:50 -07:00
vadimt
ae76bebfed More diags for non-receiving scroll end
Bug: 160238801
Change-Id: I2e19d16e49e84e93bdf135eb97d5f033475305e8
2020-07-08 10:09:46 -07:00
vadimt
1af70f2729 Add logging for non-sending "end scrolled" event for Widgets
Bug: 160238801
Change-Id: I60a1cb689110c5b22b0a145b3cca7d47d867005e
2020-06-30 12:36:09 -07:00
vadimt
822efc9e82 Remove tracing for widgets scroll bug
Bug: 152354290
Change-Id: Iff56460f3f673f7089d647d08bb621c3965c7444
2020-04-17 19:04:41 -07:00
vadimt
ac752e39f5 Debug tracing to repro a flake
Bug: 152354290
Change-Id: I06c9ad131ab125226dfdd548121d0aa3f26c7bc7
2020-03-24 17:58:03 -07:00
Tony Wickham
6382b39ff4 Add null check to sendCustomAccessibilityEvent()
ag/10273975 caused a regression where launcher crashes if RecentsView is
empty.

Change-Id: I1607627be0a9748fd552adc757296d7b6bbfd1e2
2020-02-24 17:44:38 -08:00
Tony Wickham
619daaf82a Give current TaskView accessibility focus
Send TYPE_VIEW_FOCUSED in the following places:
- When page transition ends on a task
- When finishing state transition to overview
- When un-hiding the current running task view

Bug: 145647019
Change-Id: I7bb357ea60e1dea79daf2ad50efa51071e064da8
2020-02-07 12:38:34 -08:00
vadimt
5995e60d90 Logging state change events when in test to simplify diagnosing
Change-Id: I48f741802696f7ef1764a5745ae6243c407a19cc
2019-12-11 17:53:03 -08:00
Sunny Goyal
3d56046ff8 Fixing some tests for 2-button mode
Bug: 141315387
Change-Id: I66db3e790f5fbe6bc30999ed599cce03874509be
2019-09-20 10:40:14 -07:00
vadimt
2af71dd058 Removing tracing for a fixed bug.
Bug: 133867119
Change-Id: I796118f5ff0c27db002bb0e3369e651c95b06bbe
2019-07-11 20:18:32 +00:00
vadimt
17f9d57ac7 Add debug tracing for a lab-only flake
This time, Launcher doesn't send a completion event upon switching from
Home to all apps.

Bug: 133867119
Change-Id: I3738cf10a14ea288df2dfda387aafda022beb349
2019-05-29 14:10:28 -07:00
vadimt
2d6cd80bc9 Launcher reports whe 0-button swipe-up gesture pause is detected.
This eliminates an unreliable timeout.

Also removing an unnecessary check for harness that is done by the
called method.

Change-Id: If954580060415cbb2952532c16ea0ae4dc7b9469
2019-05-24 19:28:40 -07:00
Sunny Goyal
ab3963ddcf Moving TestInformationProvider to Launcher3 so that it can be used for
testing Launcher3 without quickstep

Also keeping the provider as disabled until needed

Change-Id: Ib5f459e02ae551724b390f3b74f43d601568d749
2019-05-23 14:02:33 -07:00
vadimt
3d13f303ee Using model-time scrolling in all apps
This should solve flakes when the test thread wakes up too rarely to
inject enough touch events.

Change-Id: I461583d35eb4bfe0192b81c242aacf8d20e353d1
2019-05-14 10:40:22 -07:00
Tony Wickham
5519a0f6a8 Use AccessibilityManager#getRecommendedTimeoutMillis for Snackbar
Bug: 129806241
Change-Id: I4aabc3ee33560960f3117d82f9873fce60f1278a
2019-04-25 11:47:22 -07:00
vadimt
42a88b9681 Sending state ordinals from Launcher to TAPL
This improves diagnostics.

Test: TAPL tests
Change-Id: I0ebb533513405372ea7c58a36910160cfb6d8368
2019-02-14 13:08:01 -08:00
Sunny Goyal
8c48d8bea6 Changing min sdk to 25
Change-Id: I0d28069967854357ca755bf25dec19d4979bdecf
2019-01-29 11:29:52 -08:00
Vadim Tryshev
b6398a1eb8 Sharing protocol constants between Launcher and TAPL
Bug: 110103162
Test: TaplTests
Change-Id: I5b2a2b8576a7a6ea4a156f00858711496d6b5bba
2018-08-14 19:53:43 -07:00
Vadim Tryshev
30ac987c56 Removing requirement for no enabled accessibility services
Now Launcher will talk to TAPL even if there are enabled accessibility
services.

This should fix some lab tests that presumably run with some
accessibility services enabled.

Bug: 110103162
Test: will check on lab tests
Change-Id: Ie11896441c2b2b7c16150cd3f2df28a5a5095d88
2018-08-08 11:46:19 -07:00
Vadim Tryshev
ff3fa34a7a Fixing scrolling up in App Apps.
Done by scrolling only when scroll position is not zero. This way, the
scroll gesture can't close All Apps.

Bug: 110103162
Test: TaplTests suite
Change-Id: Icfe47d2bcc0210ae221df169d6c35cd1be10ff86
2018-08-02 14:15:05 -07:00
Vadim Tryshev
2ce6a13f60 Tapl library
The public API of the library has finalized; flakiness has been removed;
code polished.

Bug: 110103162
Test: TaplTests suite
Change-Id: Ic156bbfeedb1cb9c4a48ef907f97e396e8e81936
2018-07-20 14:43:05 -07:00
Sunny Goyal
d0030b05f5 Adding placeholder method for compat implementations for Accessibility manager
> Moving some utility methods to the compat class

Bug: 69611105
Change-Id: Ide0cab0b926d7bc03617fc568d2a2b429ee00cd9
2017-12-08 16:09:45 -08:00