Loading services/inputflinger/reader/mapper/gestures/GestureConverter.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -420,8 +420,8 @@ std::list<NotifyArgs> GestureConverter::handleFling(nsecs_t when, nsecs_t readTi std::list<NotifyArgs> out; mDownTime = when; mCurrentClassification = MotionClassification::TWO_FINGER_SWIPE; out += exitHover(when, readTime, xCursorPosition, yCursorPosition); // TODO(b/281106755): add a MotionClassification value for fling stops. out.push_back(makeMotionArgs(when, readTime, AMOTION_EVENT_ACTION_DOWN, /*actionButton=*/0, /*buttonState=*/0, /*pointerCount=*/1, &coords, xCursorPosition, Loading @@ -431,6 +431,7 @@ std::list<NotifyArgs> GestureConverter::handleFling(nsecs_t when, nsecs_t readTi /*pointerCount=*/1, &coords, xCursorPosition, yCursorPosition)); out += enterHover(when, readTime, xCursorPosition, yCursorPosition); mCurrentClassification = MotionClassification::NONE; return out; } else { // Use the tap down state of a fling gesture as an indicator that a contact Loading services/inputflinger/tests/GestureConverter_test.cpp +10 −10 Original line number Diff line number Diff line Loading @@ -1192,12 +1192,12 @@ TEST_F(GestureConverterTest, FlingTapDownAfterScrollStopsFling) { VariantWith<NotifyMotionArgs>( WithMotionAction(AMOTION_EVENT_ACTION_CANCEL)), VariantWith<NotifyMotionArgs>( AllOf(WithMotionAction(AMOTION_EVENT_ACTION_HOVER_ENTER), WithMotionClassification(MotionClassification::NONE))))); WithMotionAction(AMOTION_EVENT_ACTION_HOVER_ENTER)))); ASSERT_THAT(args, Each(VariantWith<NotifyMotionArgs>(AllOf(WithCoords(POINTER_X, POINTER_Y), WithToolType(ToolType::FINGER), WithDisplayId(ADISPLAY_ID_DEFAULT))))); Each(VariantWith<NotifyMotionArgs>( AllOf(WithCoords(POINTER_X, POINTER_Y), WithToolType(ToolType::FINGER), WithDisplayId(ADISPLAY_ID_DEFAULT), WithMotionClassification(MotionClassification::TWO_FINGER_SWIPE))))); } TEST_F(GestureConverterTest, Tap) { Loading Loading @@ -2613,12 +2613,12 @@ TEST_F(GestureConverterTestWithChoreographer, FlingTapDownAfterScrollStopsFling) VariantWith<NotifyMotionArgs>( WithMotionAction(AMOTION_EVENT_ACTION_CANCEL)), VariantWith<NotifyMotionArgs>( AllOf(WithMotionAction(AMOTION_EVENT_ACTION_HOVER_ENTER), WithMotionClassification(MotionClassification::NONE))))); WithMotionAction(AMOTION_EVENT_ACTION_HOVER_ENTER)))); ASSERT_THAT(args, Each(VariantWith<NotifyMotionArgs>(AllOf(WithCoords(0, 0), WithToolType(ToolType::FINGER), WithDisplayId(ADISPLAY_ID_DEFAULT))))); Each(VariantWith<NotifyMotionArgs>( AllOf(WithCoords(0, 0), WithToolType(ToolType::FINGER), WithDisplayId(ADISPLAY_ID_DEFAULT), WithMotionClassification(MotionClassification::TWO_FINGER_SWIPE))))); } TEST_F(GestureConverterTestWithChoreographer, Tap) { Loading Loading
services/inputflinger/reader/mapper/gestures/GestureConverter.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -420,8 +420,8 @@ std::list<NotifyArgs> GestureConverter::handleFling(nsecs_t when, nsecs_t readTi std::list<NotifyArgs> out; mDownTime = when; mCurrentClassification = MotionClassification::TWO_FINGER_SWIPE; out += exitHover(when, readTime, xCursorPosition, yCursorPosition); // TODO(b/281106755): add a MotionClassification value for fling stops. out.push_back(makeMotionArgs(when, readTime, AMOTION_EVENT_ACTION_DOWN, /*actionButton=*/0, /*buttonState=*/0, /*pointerCount=*/1, &coords, xCursorPosition, Loading @@ -431,6 +431,7 @@ std::list<NotifyArgs> GestureConverter::handleFling(nsecs_t when, nsecs_t readTi /*pointerCount=*/1, &coords, xCursorPosition, yCursorPosition)); out += enterHover(when, readTime, xCursorPosition, yCursorPosition); mCurrentClassification = MotionClassification::NONE; return out; } else { // Use the tap down state of a fling gesture as an indicator that a contact Loading
services/inputflinger/tests/GestureConverter_test.cpp +10 −10 Original line number Diff line number Diff line Loading @@ -1192,12 +1192,12 @@ TEST_F(GestureConverterTest, FlingTapDownAfterScrollStopsFling) { VariantWith<NotifyMotionArgs>( WithMotionAction(AMOTION_EVENT_ACTION_CANCEL)), VariantWith<NotifyMotionArgs>( AllOf(WithMotionAction(AMOTION_EVENT_ACTION_HOVER_ENTER), WithMotionClassification(MotionClassification::NONE))))); WithMotionAction(AMOTION_EVENT_ACTION_HOVER_ENTER)))); ASSERT_THAT(args, Each(VariantWith<NotifyMotionArgs>(AllOf(WithCoords(POINTER_X, POINTER_Y), WithToolType(ToolType::FINGER), WithDisplayId(ADISPLAY_ID_DEFAULT))))); Each(VariantWith<NotifyMotionArgs>( AllOf(WithCoords(POINTER_X, POINTER_Y), WithToolType(ToolType::FINGER), WithDisplayId(ADISPLAY_ID_DEFAULT), WithMotionClassification(MotionClassification::TWO_FINGER_SWIPE))))); } TEST_F(GestureConverterTest, Tap) { Loading Loading @@ -2613,12 +2613,12 @@ TEST_F(GestureConverterTestWithChoreographer, FlingTapDownAfterScrollStopsFling) VariantWith<NotifyMotionArgs>( WithMotionAction(AMOTION_EVENT_ACTION_CANCEL)), VariantWith<NotifyMotionArgs>( AllOf(WithMotionAction(AMOTION_EVENT_ACTION_HOVER_ENTER), WithMotionClassification(MotionClassification::NONE))))); WithMotionAction(AMOTION_EVENT_ACTION_HOVER_ENTER)))); ASSERT_THAT(args, Each(VariantWith<NotifyMotionArgs>(AllOf(WithCoords(0, 0), WithToolType(ToolType::FINGER), WithDisplayId(ADISPLAY_ID_DEFAULT))))); Each(VariantWith<NotifyMotionArgs>( AllOf(WithCoords(0, 0), WithToolType(ToolType::FINGER), WithDisplayId(ADISPLAY_ID_DEFAULT), WithMotionClassification(MotionClassification::TWO_FINGER_SWIPE))))); } TEST_F(GestureConverterTestWithChoreographer, Tap) { Loading