Merge "Adding debug tracing for a lab-only issue" into ub-launcher3-qt-dev

This commit is contained in:
Vadim Tryshev 2019-05-30 17:58:04 +00:00 committed by Android (Google) Code Review
commit 5f642bf783
3 changed files with 21 additions and 3 deletions

View File

@ -52,6 +52,7 @@ import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.logging.UserEventDispatcher;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
@ -182,6 +183,9 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
super(context, attrs, defStyleAttr);
mActivity = BaseDraggingActivity.fromContext(context);
setOnClickListener((view) -> {
if (com.android.launcher3.testing.TestProtocol.sDebugTracing) {
android.util.Log.d(TestProtocol.NO_START_TASK_TAG, "TaskView onClick");
}
if (getTask() == null) {
return;
}
@ -285,6 +289,9 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
public void launchTask(boolean animate, boolean freezeTaskList, Consumer<Boolean> resultCallback,
Handler resultCallbackHandler) {
if (com.android.launcher3.testing.TestProtocol.sDebugTracing) {
android.util.Log.d(TestProtocol.NO_START_TASK_TAG, "launchTask");
}
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
if (isRunningTask()) {
getRecentsView().finishRecentsAnimation(false /* toRecents */,
@ -299,6 +306,9 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
private void launchTaskInternal(boolean animate, boolean freezeTaskList,
Consumer<Boolean> resultCallback, Handler resultCallbackHandler) {
if (com.android.launcher3.testing.TestProtocol.sDebugTracing) {
android.util.Log.d(TestProtocol.NO_START_TASK_TAG, "launchTaskInternal");
}
if (mTask != null) {
final ActivityOptions opts;
if (animate) {

View File

@ -71,4 +71,5 @@ public final class TestProtocol {
public static final String NO_ALLAPPS_EVENT_TAG = "b/133867119";
public static final String NO_DRAG_TAG = "b/133009122";
public static final String NO_START_TAG = "b/132900132";
public static final String NO_START_TASK_TAG = "b/133765434";
}

View File

@ -20,6 +20,8 @@ import androidx.test.uiautomator.Direction;
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;
import com.android.launcher3.testing.TestProtocol;
/**
* A recent task in the overview panel carousel.
*/
@ -59,9 +61,14 @@ public final class OverviewTask {
*/
public Background open() {
verifyActiveContainer();
mLauncher.assertTrue("Launching task didn't open a new window: " +
mTask.getParent().getContentDescription(),
mTask.clickAndWait(Until.newWindow(), WAIT_TIME_MS));
mLauncher.getTestInfo(TestProtocol.REQUEST_ENABLE_DEBUG_TRACING);
try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
"clicking an overview task")) {
mLauncher.assertTrue("Launching task didn't open a new window: " +
mTask.getParent().getContentDescription(),
mTask.clickAndWait(Until.newWindow(), WAIT_TIME_MS));
}
mLauncher.getTestInfo(TestProtocol.REQUEST_DISABLE_DEBUG_TRACING);
return new Background(mLauncher);
}
}