Merge "Track overview animation as atomic animation." into ub-launcher3-master
diff --git a/src/com/android/launcher3/LauncherRootView.java b/src/com/android/launcher3/LauncherRootView.java
index ce1795a..2b2224a 100644
--- a/src/com/android/launcher3/LauncherRootView.java
+++ b/src/com/android/launcher3/LauncherRootView.java
@@ -8,7 +8,6 @@
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
-import android.graphics.Insets;
import android.graphics.Paint;
import android.graphics.Rect;
import android.os.Build;
diff --git a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
index a7ef9ef..ed869bb 100644
--- a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
+++ b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
@@ -166,13 +166,22 @@
}
public boolean performAction(final View host, final ItemInfo item, int action) {
- if (action == ACTION_LONG_CLICK && ShortcutUtil.isDeepShortcut(item)) {
- CustomActionsPopup popup = new CustomActionsPopup(mLauncher, host);
- if (popup.canShow()) {
- popup.show();
+ if (action == ACTION_LONG_CLICK) {
+ if (ShortcutUtil.isDeepShortcut(item)) {
+ CustomActionsPopup popup = new CustomActionsPopup(mLauncher, host);
+ if (popup.canShow()) {
+ popup.show();
+ return true;
+ }
+ } else if (host instanceof BubbleTextView) {
+ // Long press should be consumed for workspace items, and it should invoke the
+ // Shortcuts / Notifications / Actions pop-up menu, and not start a drag as the
+ // standard long press path does.
+ PopupContainerWithArrow.showForIcon((BubbleTextView) host);
return true;
}
}
+
if (action == MOVE) {
beginAccessibleDrag(host, item);
} else if (action == ADD_TO_WORKSPACE) {
diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java
index 54a44ee..1b7b015 100644
--- a/src/com/android/launcher3/dragndrop/DragController.java
+++ b/src/com/android/launcher3/dragndrop/DragController.java
@@ -565,11 +565,13 @@
/**
* Since accessible drag and drop won't cause the same sequence of touch events, we manually
- * inject the appropriate state.
+ * inject the appropriate state which would have been otherwise initiated via touch events.
*/
public void prepareAccessibleDrag(int x, int y) {
mMotionDownX = x;
mMotionDownY = y;
+ mLastTouch[0] = x;
+ mLastTouch[1] = y;
}
/**
diff --git a/tests/src/com/android/launcher3/util/rule/FailureInvestigator.java b/tests/src/com/android/launcher3/util/rule/FailureInvestigator.java
index be6f865..dcc7b7c 100644
--- a/tests/src/com/android/launcher3/util/rule/FailureInvestigator.java
+++ b/tests/src/com/android/launcher3/util/rule/FailureInvestigator.java
@@ -18,9 +18,13 @@
import static androidx.test.InstrumentationRegistry.getInstrumentation;
+import android.os.SystemClock;
+
import androidx.test.uiautomator.UiDevice;
import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
import java.util.regex.Pattern;
class FailureInvestigator {
@@ -28,17 +32,21 @@
return Pattern.compile(regex).matcher(string).find();
}
- static int getBugForFailure(CharSequence exception, String testsStartTime) {
+ static int getBugForFailure(CharSequence exception) {
if ("com.google.android.setupwizard".equals(
UiDevice.getInstance(getInstrumentation()).getLauncherPackageName())) {
return 145935261;
}
- final String logSinceTestsStart;
+ final String logSinceBoot;
try {
- logSinceTestsStart =
+ final String systemBootTime =
+ new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(
+ new Date(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
+
+ logSinceBoot =
UiDevice.getInstance(getInstrumentation())
- .executeShellCommand("logcat -d -t " + testsStartTime.replace(" ", ""));
+ .executeShellCommand("logcat -d -t " + systemBootTime.replace(" ", ""));
} catch (IOException e) {
return 0;
}
@@ -49,19 +57,24 @@
exception)) {
if (matches(
"BroadcastQueue: Can't deliver broadcast to com.android.systemui.*Crashing it",
- logSinceTestsStart)) {
+ logSinceBoot)) {
return 147845913;
}
if (matches(
"Attempt to invoke virtual method 'boolean android\\.graphics\\.Bitmap\\"
+ ".isRecycled\\(\\)' on a null object reference",
- logSinceTestsStart)) {
+ logSinceBoot)) {
return 148424291;
}
+ if (matches(
+ "java\\.lang\\.IllegalArgumentException\\: Ranking map doesn't contain key",
+ logSinceBoot)) {
+ return 148570537;
+ }
} else if (matches("java.lang.AssertionError: Launcher build match not found", exception)) {
if (matches(
"TestStabilityRule: Launcher package: com.google.android.setupwizard",
- logSinceTestsStart)) {
+ logSinceBoot)) {
return 145935261;
}
} else if (matches("Launcher didn't initialize", exception)) {
@@ -69,7 +82,7 @@
"ActivityManager: Reason: executing service com.google.android.apps"
+ ".nexuslauncher/com.android.launcher3.notification"
+ ".NotificationListener",
- logSinceTestsStart)) {
+ logSinceBoot)) {
return 148238677;
}
}
diff --git a/tests/src/com/android/launcher3/util/rule/FailureRewriterRule.java b/tests/src/com/android/launcher3/util/rule/FailureRewriterRule.java
index 4cb309a..99ddee4 100644
--- a/tests/src/com/android/launcher3/util/rule/FailureRewriterRule.java
+++ b/tests/src/com/android/launcher3/util/rule/FailureRewriterRule.java
@@ -22,15 +22,9 @@
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
public class FailureRewriterRule implements TestRule {
private static final String TAG = "FailureRewriter";
- private static final String testsStartTime =
- new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date());
-
@Override
public Statement apply(Statement base, Description description) {
return new Statement() {
@@ -39,8 +33,7 @@
try {
base.evaluate();
} catch (Throwable e) {
- final int bug =
- FailureInvestigator.getBugForFailure(e.toString(), testsStartTime);
+ final int bug = FailureInvestigator.getBugForFailure(e.toString());
if (bug == 0) throw e;
Log.e(TAG, "Known bug found for the original failure "