Merge "Removing tracing for fixed bugs" into ub-launcher3-qt-r1-dev

This commit is contained in:
TreeHugger Robot
2019-07-16 23:15:07 +00:00
committed by Android (Google) Code Review
16 changed files with 0 additions and 105 deletions
@@ -194,9 +194,6 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe
@Override
public AnimationFactory prepareRecentsUI(Launcher activity, boolean activityVisible,
boolean animateActivity, Consumer<AnimatorPlaybackController> callback) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_OVERVIEW_EVENT_TAG, "prepareRecentsUI");
}
final LauncherState startState = activity.getStateManager().getState();
LauncherState resetState = startState;
@@ -349,32 +349,17 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
}
private void onLauncherStart(final T activity) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_OVERVIEW_EVENT_TAG, "onLauncherStart");
}
if (mActivity != activity) {
return;
}
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_OVERVIEW_EVENT_TAG, "onLauncherStart 1");
}
if (mStateCallback.hasStates(STATE_HANDLER_INVALIDATED)) {
return;
}
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_OVERVIEW_EVENT_TAG, "onLauncherStart 2");
}
// If we've already ended the gesture and are going home, don't prepare recents UI,
// as that will set the state as BACKGROUND_APP, overriding the animation to NORMAL.
if (mGestureEndTarget != HOME) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_OVERVIEW_EVENT_TAG, "onLauncherStart 3");
}
Runnable initAnimFactory = () -> {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_OVERVIEW_EVENT_TAG, "onLauncherStart 4");
}
mAnimationFactory = mActivityControlHelper.prepareRecentsUI(mActivity,
mWasLauncherAlreadyVisible, true,
this::onAnimatorPlaybackControllerCreated);
@@ -384,14 +369,8 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
// Launcher is visible, but might be about to stop. Thus, if we prepare recents
// now, it might get overridden by moveToRestState() in onStop(). To avoid this,
// wait until the next gesture (and possibly launcher) starts.
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_OVERVIEW_EVENT_TAG, "onLauncherStart 5");
}
mStateCallback.addCallback(STATE_GESTURE_STARTED, initAnimFactory);
} else {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_OVERVIEW_EVENT_TAG, "onLauncherStart 6");
}
initAnimFactory.run();
}
}
@@ -192,9 +192,6 @@ 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;
}
@@ -291,9 +288,6 @@ 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 */,
@@ -308,9 +302,6 @@ 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) {
-3
View File
@@ -890,9 +890,6 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
@Override
protected void onStart() {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_OVERVIEW_EVENT_TAG, "Launcher.onStart");
}
RaceConditionTracker.onEvent(ON_START_EVT, ENTER);
super.onStart();
if (mLauncherCallbacks != null) {
@@ -403,10 +403,6 @@ public class LauncherStateManager {
}
private void onStateTransitionStart(LauncherState state) {
if (TestProtocol.sDebugTracing) {
android.util.Log.d(TestProtocol.NO_DRAG_TAG,
"onStateTransitionStart");
}
if (mState != state) {
mState.onStateDisabled(mLauncher);
}
@@ -575,10 +571,6 @@ public class LauncherStateManager {
private final AnimatorSet mAnim;
public StartAnimRunnable(AnimatorSet anim) {
if (TestProtocol.sDebugTracing) {
android.util.Log.d(TestProtocol.NO_DRAG_TAG,
"StartAnimRunnable");
}
mAnim = anim;
}
-8
View File
@@ -370,10 +370,6 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
@Override
public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) {
if (TestProtocol.sDebugTracing) {
android.util.Log.d(TestProtocol.NO_DRAG_TAG,
"onDragStart 1");
}
if (ENFORCE_DRAG_EVENT_ORDER) {
enforceDragParity("onDragStart", 0, 0);
}
@@ -424,10 +420,6 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
}
// Always enter the spring loaded mode
if (TestProtocol.sDebugTracing) {
android.util.Log.d(TestProtocol.NO_DRAG_TAG,
"onDragStart 2");
}
mLauncher.getStateManager().goToState(SPRING_LOADED);
}
@@ -137,9 +137,6 @@ public abstract class BaseItemDragListener extends InternalStateHandler implemen
@Override
public boolean shouldStartDrag(double distanceDragged) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_DRAG_TAG, "BIDL.shouldStartDrag");
}
// Stay in pre-drag mode, if workspace is locked.
return !mLauncher.isWorkspaceLocked();
}
@@ -474,10 +474,6 @@ public class DragController implements DragDriver.EventListener, TouchController
}
private void handleMoveEvent(int x, int y) {
if (TestProtocol.sDebugTracing) {
android.util.Log.d(TestProtocol.NO_DRAG_TAG,
"handleMoveEvent 1");
}
mDragObject.dragView.move(x, y);
// Drop on someone?
@@ -492,22 +488,8 @@ public class DragController implements DragDriver.EventListener, TouchController
mLastTouch[0] = x;
mLastTouch[1] = y;
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_DRAG_TAG,
"handleMoveEvent Conditions " +
mIsInPreDrag + ", " +
(mIsInPreDrag && mOptions.preDragCondition != null) + ", " +
(mIsInPreDrag && mOptions.preDragCondition != null
&& mOptions.preDragCondition.shouldStartDrag(
mDistanceSinceScroll)));
}
if (mIsInPreDrag && mOptions.preDragCondition != null
&& mOptions.preDragCondition.shouldStartDrag(mDistanceSinceScroll)) {
if (TestProtocol.sDebugTracing) {
android.util.Log.d(TestProtocol.NO_DRAG_TAG,
"handleMoveEvent 2");
}
callOnDragStart();
}
}
@@ -545,10 +527,6 @@ public class DragController implements DragDriver.EventListener, TouchController
* Call this from a drag source view.
*/
public boolean onControllerTouchEvent(MotionEvent ev) {
if (TestProtocol.sDebugTracing) {
android.util.Log.d(TestProtocol.NO_DRAG_TAG,
"onControllerTouchEvent");
}
if (mDragDriver == null || mOptions == null || mOptions.isAccessibleDrag) {
return false;
}
@@ -449,11 +449,6 @@ public class PopupContainerWithArrow extends ArrowPopup implements DragSource,
@Override
public boolean shouldStartDrag(double distanceDragged) {
if (TestProtocol.sDebugTracing) {
Log.d(TestProtocol.NO_DRAG_TAG,
"createPreDragCondition().shouldStartDrag " + distanceDragged + ", "
+ mStartDragThreshold);
}
return distanceDragged > mStartDragThreshold;
}
@@ -74,7 +74,4 @@ public final class TestProtocol {
public static boolean sDebugTracing = false;
public static final String REQUEST_ENABLE_DEBUG_TRACING = "enable-debug-tracing";
public static final String REQUEST_DISABLE_DEBUG_TRACING = "disable-debug-tracing";
public static final String NO_DRAG_TAG = "b/133009122";
public static final String NO_START_TASK_TAG = "b/133765434";
public static final String NO_OVERVIEW_EVENT_TAG = "b/134532571";
}
@@ -230,10 +230,6 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext>
@Override
public boolean onTouchEvent(MotionEvent ev) {
if (TestProtocol.sDebugTracing) {
android.util.Log.d(TestProtocol.NO_DRAG_TAG,
"onTouchEvent " + ev);
}
int action = ev.getAction();
if (action == ACTION_UP || action == ACTION_CANCEL) {
if (mTouchCompleteListener != null) {
@@ -243,10 +239,6 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext>
}
if (mActiveController != null) {
if (TestProtocol.sDebugTracing) {
android.util.Log.d(TestProtocol.NO_DRAG_TAG,
"onTouchEvent 1");
}
return mActiveController.onControllerTouchEvent(ev);
} else {
// In case no child view handled the touch event, we may not get onIntercept anymore
@@ -181,7 +181,6 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer {
* Flings backward (up) and waits the fling's end.
*/
public void flingBackward() {
mLauncher.getTestInfo(TestProtocol.REQUEST_ENABLE_DEBUG_TRACING);
try (LauncherInstrumentation.Closable c =
mLauncher.addContextLayer("want to fling backward in all apps")) {
final UiObject2 allAppsContainer = verifyActiveContainer();
@@ -190,7 +189,6 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer {
allAppsContainer, Direction.UP, 1, new Rect(0, mHeight / 2, 0, 0), 10);
verifyActiveContainer();
}
mLauncher.getTestInfo(TestProtocol.REQUEST_DISABLE_DEBUG_TRACING);
}
/**
@@ -59,7 +59,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
}
protected void goToOverviewUnchecked(int expectedState) {
mLauncher.getTestInfo(TestProtocol.REQUEST_ENABLE_DEBUG_TRACING);
switch (mLauncher.getNavigationModel()) {
case ZERO_BUTTON: {
final int centerX = mLauncher.getDevice().getDisplayWidth() / 2;
@@ -112,7 +111,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
mLauncher.waitForSystemUiObject("recent_apps").click();
break;
}
mLauncher.getTestInfo(TestProtocol.REQUEST_DISABLE_DEBUG_TRACING);
}
protected String getSwipeHeightRequestName() {
@@ -53,11 +53,9 @@ abstract class Launchable {
private Background launch(BySelector selector) {
LauncherInstrumentation.log("Launchable.launch before click " +
mObject.getVisibleCenter() + " in " + mObject.getVisibleBounds());
mLauncher.getTestInfo(TestProtocol.REQUEST_ENABLE_DEBUG_TRACING);
mLauncher.assertTrue(
"Launching an app didn't open a new window: " + mObject.getText(),
mObject.clickAndWait(Until.newWindow(), WAIT_TIME_MS));
mLauncher.getTestInfo(TestProtocol.REQUEST_DISABLE_DEBUG_TRACING);
mLauncher.assertTrue(
"App didn't start: " + selector,
mLauncher.getDevice().wait(Until.hasObject(selector),
@@ -64,14 +64,12 @@ public final class OverviewTask {
*/
public Background open() {
verifyActiveContainer();
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);
}
}
@@ -67,7 +67,6 @@ public final class Workspace extends Home {
"switchToAllApps: swipeHeight = " + swipeHeight + ", slop = "
+ mLauncher.getTouchSlop());
mLauncher.getTestInfo(TestProtocol.REQUEST_ENABLE_DEBUG_TRACING);
mLauncher.swipeToState(
start.x,
start.y,
@@ -75,7 +74,6 @@ public final class Workspace extends Home {
start.y - swipeHeight - mLauncher.getTouchSlop(),
60,
ALL_APPS_STATE_ORDINAL);
mLauncher.getTestInfo(TestProtocol.REQUEST_DISABLE_DEBUG_TRACING);
try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
"swiped to all apps")) {
@@ -157,7 +155,6 @@ public final class Workspace extends Home {
static void dragIconToWorkspace(
LauncherInstrumentation launcher, Launchable launchable, Point dest,
String longPressIndicator) {
launcher.getTestInfo(TestProtocol.REQUEST_ENABLE_DEBUG_TRACING);
LauncherInstrumentation.log("dragIconToWorkspace: begin");
final Point launchableCenter = launchable.getObject().getVisibleCenter();
final long downTime = SystemClock.uptimeMillis();
@@ -172,7 +169,6 @@ public final class Workspace extends Home {
downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, dest);
LauncherInstrumentation.log("dragIconToWorkspace: end");
launcher.waitUntilGone("drop_target_bar");
launcher.getTestInfo(TestProtocol.REQUEST_DISABLE_DEBUG_TRACING);
}
/**