Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 426bcc77 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update TwoButtonNavbarTouchController logs" into sc-dev

parents cdb45050 8559ae32
Loading
Loading
Loading
Loading
+21 −6
Original line number Original line Diff line number Diff line
@@ -98,23 +98,35 @@ public class TwoButtonNavbarTouchController extends AbstractStateChangeTouchCont
        return mLauncher.isInState(NORMAL);
        return mLauncher.isInState(NORMAL);
    }
    }


    @Override
    public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
        boolean intercept = super.onControllerInterceptTouchEvent(ev);
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.TWO_BUTTON_NORMAL_NOT_OVERVIEW,
                    "2 button touch controller intercept touch? " + intercept);
        }
        return intercept;
    }

    @Override
    @Override
    protected LauncherState getTargetState(LauncherState fromState, boolean isDragTowardPositive) {
    protected LauncherState getTargetState(LauncherState fromState, boolean isDragTowardPositive) {
        final LauncherState targetState;
        if (mIsTransposed) {
        if (mIsTransposed) {
            boolean draggingFromNav =
            boolean draggingFromNav =
                    mLauncher.getDeviceProfile().isSeascape() == isDragTowardPositive;
                    mLauncher.getDeviceProfile().isSeascape() == isDragTowardPositive;
            targetState = draggingFromNav ? HINT_STATE_TWO_BUTTON : NORMAL;
            return draggingFromNav ? HINT_STATE_TWO_BUTTON : NORMAL;
        } else {
        } else {
            LauncherState startState = mStartState != null ? mStartState : fromState;
            LauncherState startState = mStartState != null ? mStartState : fromState;
            targetState = isDragTowardPositive ^ (startState == OVERVIEW)
            return isDragTowardPositive ^ (startState == OVERVIEW) ? HINT_STATE_TWO_BUTTON : NORMAL;
                    ? HINT_STATE_TWO_BUTTON : NORMAL;
        }
        }
    }

    @Override
    protected void onReinitToState(LauncherState newToState) {
        super.onReinitToState(newToState);


        if (TestProtocol.sDebugTracing) {
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.TWO_BUTTON_NORMAL_NOT_OVERVIEW, "Target state: " + targetState);
            Log.d(TestProtocol.TWO_BUTTON_NORMAL_NOT_OVERVIEW, "onReinitToState: " + newToState);
        }
        }
        return targetState;
    }
    }


    @Override
    @Override
@@ -163,6 +175,9 @@ public class TwoButtonNavbarTouchController extends AbstractStateChangeTouchCont
    @Override
    @Override
    protected void onSwipeInteractionCompleted(LauncherState targetState) {
    protected void onSwipeInteractionCompleted(LauncherState targetState) {
        super.onSwipeInteractionCompleted(targetState);
        super.onSwipeInteractionCompleted(targetState);
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.TWO_BUTTON_NORMAL_NOT_OVERVIEW, "Reached state: " + targetState);
        }
        if (!mIsTransposed) {
        if (!mIsTransposed) {
            mContinuousTouchCount++;
            mContinuousTouchCount++;
        }
        }
+1 −1
Original line number Original line Diff line number Diff line
@@ -113,5 +113,5 @@ public final class TestProtocol {
    public static final String WORK_PROFILE_REMOVED = "b/159671700";
    public static final String WORK_PROFILE_REMOVED = "b/159671700";
    public static final String TIS_NO_EVENTS = "b/180915942";
    public static final String TIS_NO_EVENTS = "b/180915942";
    public static final String GET_RECENTS_FAILED = "b/177472267";
    public static final String GET_RECENTS_FAILED = "b/177472267";
    public static final String TWO_BUTTON_NORMAL_NOT_OVERVIEW = "b/13714484";
    public static final String TWO_BUTTON_NORMAL_NOT_OVERVIEW = "b/177316094";
}
}