Merge "More debug tracing for switching to all apps not sending the final event" into ub-launcher3-qt-dev
am: 719908c84b
Change-Id: Ife320795c1034d0b332a652b44d4f2c6e1a66418
This commit is contained in:
@@ -40,6 +40,7 @@ import android.animation.AnimatorListenerAdapter;
|
|||||||
import android.animation.AnimatorSet;
|
import android.animation.AnimatorSet;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import androidx.annotation.IntDef;
|
import androidx.annotation.IntDef;
|
||||||
|
|
||||||
@@ -474,6 +475,11 @@ public class LauncherStateManager {
|
|||||||
// Only change the stable states after the transitions have finished
|
// Only change the stable states after the transitions have finished
|
||||||
if (state != mCurrentStableState) {
|
if (state != mCurrentStableState) {
|
||||||
mLastStableState = state.getHistoryForState(mCurrentStableState);
|
mLastStableState = state.getHistoryForState(mCurrentStableState);
|
||||||
|
if (TestProtocol.sDebugTracing) {
|
||||||
|
Log.d(TestProtocol.NO_ALLAPPS_EVENT_TAG,
|
||||||
|
"mCurrentStableState = " + state.getClass().getSimpleName() + " @ " +
|
||||||
|
android.util.Log.getStackTraceString(new Throwable()));
|
||||||
|
}
|
||||||
mCurrentStableState = state;
|
mCurrentStableState = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import static com.android.launcher3.util.SystemUiController.UI_STATE_ALL_APPS;
|
|||||||
|
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
import android.animation.AnimatorListenerAdapter;
|
import android.animation.AnimatorListenerAdapter;
|
||||||
|
import android.util.Log;
|
||||||
import android.util.Property;
|
import android.util.Property;
|
||||||
import android.view.animation.Interpolator;
|
import android.view.animation.Interpolator;
|
||||||
|
|
||||||
@@ -29,6 +30,7 @@ import com.android.launcher3.anim.AnimationSuccessListener;
|
|||||||
import com.android.launcher3.anim.AnimatorSetBuilder;
|
import com.android.launcher3.anim.AnimatorSetBuilder;
|
||||||
import com.android.launcher3.anim.SpringObjectAnimator;
|
import com.android.launcher3.anim.SpringObjectAnimator;
|
||||||
import com.android.launcher3.anim.PropertySetter;
|
import com.android.launcher3.anim.PropertySetter;
|
||||||
|
import com.android.launcher3.testing.TestProtocol;
|
||||||
import com.android.launcher3.util.MultiValueAlpha;
|
import com.android.launcher3.util.MultiValueAlpha;
|
||||||
import com.android.launcher3.util.Themes;
|
import com.android.launcher3.util.Themes;
|
||||||
import com.android.launcher3.views.ScrimView;
|
import com.android.launcher3.views.ScrimView;
|
||||||
@@ -162,6 +164,10 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
|
|||||||
@Override
|
@Override
|
||||||
public void setStateWithAnimation(LauncherState toState,
|
public void setStateWithAnimation(LauncherState toState,
|
||||||
AnimatorSetBuilder builder, AnimationConfig config) {
|
AnimatorSetBuilder builder, AnimationConfig config) {
|
||||||
|
if (TestProtocol.sDebugTracing) {
|
||||||
|
Log.d(TestProtocol.NO_ALLAPPS_EVENT_TAG,
|
||||||
|
"setStateWithAnimation " + toState.getClass().getSimpleName());
|
||||||
|
}
|
||||||
float targetProgress = toState.getVerticalProgress(mLauncher);
|
float targetProgress = toState.getVerticalProgress(mLauncher);
|
||||||
if (Float.compare(mProgress, targetProgress) == 0) {
|
if (Float.compare(mProgress, targetProgress) == 0) {
|
||||||
setAlphas(toState, config, builder);
|
setAlphas(toState, config, builder);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import android.animation.AnimatorListenerAdapter;
|
|||||||
import android.animation.AnimatorSet;
|
import android.animation.AnimatorSet;
|
||||||
import android.animation.ValueAnimator;
|
import android.animation.ValueAnimator;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.HapticFeedbackConstants;
|
import android.view.HapticFeedbackConstants;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
|
||||||
@@ -118,6 +119,9 @@ public abstract class AbstractStateChangeTouchController
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final boolean onControllerInterceptTouchEvent(MotionEvent ev) {
|
public final boolean onControllerInterceptTouchEvent(MotionEvent ev) {
|
||||||
|
if (TestProtocol.sDebugTracing) {
|
||||||
|
Log.d(TestProtocol.NO_ALLAPPS_EVENT_TAG, "onControllerInterceptTouchEvent 1 " + ev);
|
||||||
|
}
|
||||||
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
|
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
|
||||||
mNoIntercept = !canInterceptTouch(ev);
|
mNoIntercept = !canInterceptTouch(ev);
|
||||||
if (mNoIntercept) {
|
if (mNoIntercept) {
|
||||||
@@ -147,6 +151,9 @@ public abstract class AbstractStateChangeTouchController
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (TestProtocol.sDebugTracing) {
|
||||||
|
Log.d(TestProtocol.NO_ALLAPPS_EVENT_TAG, "onControllerInterceptTouchEvent 2 ");
|
||||||
|
}
|
||||||
onControllerTouchEvent(ev);
|
onControllerTouchEvent(ev);
|
||||||
return mDetector.isDraggingOrSettling();
|
return mDetector.isDraggingOrSettling();
|
||||||
}
|
}
|
||||||
@@ -234,6 +241,9 @@ public abstract class AbstractStateChangeTouchController
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDragStart(boolean start) {
|
public void onDragStart(boolean start) {
|
||||||
|
if (TestProtocol.sDebugTracing) {
|
||||||
|
Log.d(TestProtocol.NO_ALLAPPS_EVENT_TAG, "onDragStart 1 " + start);
|
||||||
|
}
|
||||||
mStartState = mLauncher.getStateManager().getState();
|
mStartState = mLauncher.getStateManager().getState();
|
||||||
if (mStartState == ALL_APPS) {
|
if (mStartState == ALL_APPS) {
|
||||||
mStartContainerType = LauncherLogProto.ContainerType.ALLAPPS;
|
mStartContainerType = LauncherLogProto.ContainerType.ALLAPPS;
|
||||||
@@ -243,6 +253,9 @@ public abstract class AbstractStateChangeTouchController
|
|||||||
mStartContainerType = LauncherLogProto.ContainerType.TASKSWITCHER;
|
mStartContainerType = LauncherLogProto.ContainerType.TASKSWITCHER;
|
||||||
}
|
}
|
||||||
if (mCurrentAnimation == null) {
|
if (mCurrentAnimation == null) {
|
||||||
|
if (TestProtocol.sDebugTracing) {
|
||||||
|
Log.d(TestProtocol.NO_ALLAPPS_EVENT_TAG, "onDragStart 2");
|
||||||
|
}
|
||||||
mFromState = mStartState;
|
mFromState = mStartState;
|
||||||
mToState = null;
|
mToState = null;
|
||||||
cancelAnimationControllers();
|
cancelAnimationControllers();
|
||||||
@@ -552,6 +565,9 @@ public abstract class AbstractStateChangeTouchController
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void cancelAnimationControllers() {
|
private void cancelAnimationControllers() {
|
||||||
|
if (TestProtocol.sDebugTracing) {
|
||||||
|
Log.d(TestProtocol.NO_ALLAPPS_EVENT_TAG, "cancelAnimationControllers");
|
||||||
|
}
|
||||||
mCurrentAnimation = null;
|
mCurrentAnimation = null;
|
||||||
cancelAtomicComponentsController();
|
cancelAtomicComponentsController();
|
||||||
mDetector.finishedScrolling();
|
mDetector.finishedScrolling();
|
||||||
|
|||||||
@@ -158,6 +158,9 @@ public class SwipeDetector {
|
|||||||
// SETTLING -> (View settled) -> IDLE
|
// SETTLING -> (View settled) -> IDLE
|
||||||
|
|
||||||
private void setState(ScrollState newState) {
|
private void setState(ScrollState newState) {
|
||||||
|
if (TestProtocol.sDebugTracing) {
|
||||||
|
Log.d(TestProtocol.NO_ALLAPPS_EVENT_TAG, "setState -- start: " + newState);
|
||||||
|
}
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
Log.d(TAG, "setState:" + mState + "->" + newState);
|
Log.d(TAG, "setState:" + mState + "->" + newState);
|
||||||
}
|
}
|
||||||
@@ -165,6 +168,9 @@ public class SwipeDetector {
|
|||||||
if (newState == ScrollState.DRAGGING) {
|
if (newState == ScrollState.DRAGGING) {
|
||||||
initializeDragging();
|
initializeDragging();
|
||||||
if (mState == ScrollState.IDLE) {
|
if (mState == ScrollState.IDLE) {
|
||||||
|
if (TestProtocol.sDebugTracing) {
|
||||||
|
Log.d(TestProtocol.NO_ALLAPPS_EVENT_TAG, "setState -- 1: " + newState);
|
||||||
|
}
|
||||||
reportDragStart(false /* recatch */);
|
reportDragStart(false /* recatch */);
|
||||||
} else if (mState == ScrollState.SETTLING) {
|
} else if (mState == ScrollState.SETTLING) {
|
||||||
reportDragStart(true /* recatch */);
|
reportDragStart(true /* recatch */);
|
||||||
@@ -318,9 +324,15 @@ public class SwipeDetector {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mDisplacement = mDir.getDisplacement(ev, pointerIndex, mDownPos, mIsRtl);
|
mDisplacement = mDir.getDisplacement(ev, pointerIndex, mDownPos, mIsRtl);
|
||||||
|
if (TestProtocol.sDebugTracing) {
|
||||||
|
Log.d(TestProtocol.NO_ALLAPPS_EVENT_TAG, "onTouchEvent 1");
|
||||||
|
}
|
||||||
|
|
||||||
// handle state and listener calls.
|
// handle state and listener calls.
|
||||||
if (mState != ScrollState.DRAGGING && shouldScrollStart(ev, pointerIndex)) {
|
if (mState != ScrollState.DRAGGING && shouldScrollStart(ev, pointerIndex)) {
|
||||||
|
if (TestProtocol.sDebugTracing) {
|
||||||
|
Log.d(TestProtocol.NO_ALLAPPS_EVENT_TAG, "onTouchEvent 2");
|
||||||
|
}
|
||||||
setState(ScrollState.DRAGGING);
|
setState(ScrollState.DRAGGING);
|
||||||
}
|
}
|
||||||
if (mState == ScrollState.DRAGGING) {
|
if (mState == ScrollState.DRAGGING) {
|
||||||
|
|||||||
Reference in New Issue
Block a user