summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/allapps
diff options
context:
space:
mode:
authorvadimt <vadimt@google.com>2019-05-10 19:51:22 -0700
committervadimt <vadimt@google.com>2019-05-14 10:40:22 -0700
commit3d13f303ee23a1ce01e81a450f71bcfe0cde025a (patch)
tree89762299b1b530fad29dd88f718ecc5458ed4f9d /src/com/android/launcher3/allapps
parentfc65c357a1e396d3ee2b9b1a90f34011e12f1f6c (diff)
downloadpackages_apps_Trebuchet-3d13f303ee23a1ce01e81a450f71bcfe0cde025a.tar.gz
packages_apps_Trebuchet-3d13f303ee23a1ce01e81a450f71bcfe0cde025a.tar.bz2
packages_apps_Trebuchet-3d13f303ee23a1ce01e81a450f71bcfe0cde025a.zip
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
Diffstat (limited to 'src/com/android/launcher3/allapps')
-rw-r--r--src/com/android/launcher3/allapps/AllAppsRecyclerView.java12
-rw-r--r--src/com/android/launcher3/allapps/DiscoveryBounce.java6
2 files changed, 14 insertions, 4 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
index 180ca4816..548d5de0e 100644
--- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
@@ -32,7 +32,8 @@ import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.R;
-import com.android.launcher3.graphics.DrawableFactory;
+import com.android.launcher3.Utilities;
+import com.android.launcher3.compat.AccessibilityManagerCompat;
import com.android.launcher3.logging.StatsLogUtils.LogContainerProvider;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
@@ -419,4 +420,13 @@ public class AllAppsRecyclerView extends BaseRecyclerView implements LogContaine
public boolean hasOverlappingRendering() {
return false;
}
+
+ @Override
+ public void onScrollStateChanged(int state) {
+ super.onScrollStateChanged(state);
+
+ if (state == SCROLL_STATE_IDLE && Utilities.IS_RUNNING_IN_TEST_HARNESS) {
+ AccessibilityManagerCompat.sendScrollFinishedEventToTest(getContext());
+ }
+ }
}
diff --git a/src/com/android/launcher3/allapps/DiscoveryBounce.java b/src/com/android/launcher3/allapps/DiscoveryBounce.java
index 7467119b5..1d62b435d 100644
--- a/src/com/android/launcher3/allapps/DiscoveryBounce.java
+++ b/src/com/android/launcher3/allapps/DiscoveryBounce.java
@@ -24,7 +24,6 @@ import static com.android.launcher3.userevent.nano.LauncherLogProto.ContainerTyp
import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.animation.AnimatorListenerAdapter;
-import android.app.ActivityManager;
import android.content.SharedPreferences;
import android.os.Handler;
import android.view.MotionEvent;
@@ -32,6 +31,7 @@ import android.view.MotionEvent;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
import com.android.launcher3.compat.UserManagerCompat;
import com.android.launcher3.states.InternalStateHandler;
@@ -134,7 +134,7 @@ public class DiscoveryBounce extends AbstractFloatingView {
&& !shouldShowForWorkProfile(launcher))
|| AbstractFloatingView.getTopOpenView(launcher) != null
|| UserManagerCompat.getInstance(launcher).isDemoUser()
- || ActivityManager.isRunningInTestHarness()) {
+ || Utilities.IS_RUNNING_IN_TEST_HARNESS) {
return;
}
@@ -159,7 +159,7 @@ public class DiscoveryBounce extends AbstractFloatingView {
|| (launcher.getSharedPrefs().getBoolean(SHELF_BOUNCE_SEEN, false)
&& !shouldShowForWorkProfile(launcher))
|| UserManagerCompat.getInstance(launcher).isDemoUser()
- || ActivityManager.isRunningInTestHarness()) {
+ || Utilities.IS_RUNNING_IN_TEST_HARNESS) {
return;
}