Loading services/inputflinger/reader/mapper/gestures/GestureConverter.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,11 @@ std::list<NotifyArgs> GestureConverter::handleButtonsChange(nsecs_t when, nsecs_ out.push_back(makeMotionArgs(when, readTime, AMOTION_EVENT_ACTION_UP, /* actionButton= */ 0, newButtonState, /* pointerCount= */ 1, mFingerProps.data(), &coords, xCursorPosition, yCursorPosition)); // Send a HOVER_MOVE to tell the application that the mouse is hovering again. out.push_back(makeMotionArgs(when, readTime, AMOTION_EVENT_ACTION_HOVER_MOVE, /*actionButton=*/0, newButtonState, /*pointerCount=*/1, mFingerProps.data(), &coords, xCursorPosition, yCursorPosition)); } mButtonState = newButtonState; return out; Loading services/inputflinger/tests/GestureConverter_test.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ TEST_F(GestureConverterTest, ButtonsChange) { /* down= */ GESTURES_BUTTON_NONE, /* up= */ GESTURES_BUTTON_RIGHT, /* is_tap= */ false); args = converter.handleGesture(ARBITRARY_TIME, READ_TIME, rightUpGesture); ASSERT_EQ(2u, args.size()); ASSERT_EQ(3u, args.size()); ASSERT_THAT(std::get<NotifyMotionArgs>(args.front()), AllOf(WithMotionAction(AMOTION_EVENT_ACTION_BUTTON_RELEASE), Loading @@ -181,6 +181,10 @@ TEST_F(GestureConverterTest, ButtonsChange) { AllOf(WithMotionAction(AMOTION_EVENT_ACTION_UP), WithButtonState(0), WithCoords(POINTER_X, POINTER_Y), WithToolType(ToolType::FINGER))); args.pop_front(); ASSERT_THAT(std::get<NotifyMotionArgs>(args.front()), AllOf(WithMotionAction(AMOTION_EVENT_ACTION_HOVER_MOVE), WithButtonState(0), WithCoords(POINTER_X, POINTER_Y), WithToolType(ToolType::FINGER))); } TEST_F(GestureConverterTest, DragWithButton) { Loading Loading @@ -225,7 +229,7 @@ TEST_F(GestureConverterTest, DragWithButton) { /* down= */ GESTURES_BUTTON_NONE, /* up= */ GESTURES_BUTTON_LEFT, /* is_tap= */ false); args = converter.handleGesture(ARBITRARY_TIME, READ_TIME, upGesture); ASSERT_EQ(2u, args.size()); ASSERT_EQ(3u, args.size()); ASSERT_THAT(std::get<NotifyMotionArgs>(args.front()), AllOf(WithMotionAction(AMOTION_EVENT_ACTION_BUTTON_RELEASE), Loading @@ -237,6 +241,10 @@ TEST_F(GestureConverterTest, DragWithButton) { AllOf(WithMotionAction(AMOTION_EVENT_ACTION_UP), WithButtonState(0), WithCoords(POINTER_X - 5, POINTER_Y + 10), WithToolType(ToolType::FINGER))); args.pop_front(); ASSERT_THAT(std::get<NotifyMotionArgs>(args.front()), AllOf(WithMotionAction(AMOTION_EVENT_ACTION_HOVER_MOVE), WithButtonState(0), WithCoords(POINTER_X - 5, POINTER_Y + 10), WithToolType(ToolType::FINGER))); } TEST_F(GestureConverterTest, Scroll) { Loading services/inputflinger/tests/TouchpadInputMapper_test.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -139,7 +139,8 @@ TEST_F(TouchpadInputMapperTest, HoverAndLeftButtonPress) { VariantWith<NotifyMotionArgs>(WithMotionAction(ACTION_DOWN)), VariantWith<NotifyMotionArgs>(WithMotionAction(BUTTON_PRESS)), VariantWith<NotifyMotionArgs>(WithMotionAction(BUTTON_RELEASE)), VariantWith<NotifyMotionArgs>(WithMotionAction(ACTION_UP)))); VariantWith<NotifyMotionArgs>(WithMotionAction(ACTION_UP)), VariantWith<NotifyMotionArgs>(WithMotionAction(HOVER_MOVE)))); // Liftoff args.clear(); Loading Loading
services/inputflinger/reader/mapper/gestures/GestureConverter.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,11 @@ std::list<NotifyArgs> GestureConverter::handleButtonsChange(nsecs_t when, nsecs_ out.push_back(makeMotionArgs(when, readTime, AMOTION_EVENT_ACTION_UP, /* actionButton= */ 0, newButtonState, /* pointerCount= */ 1, mFingerProps.data(), &coords, xCursorPosition, yCursorPosition)); // Send a HOVER_MOVE to tell the application that the mouse is hovering again. out.push_back(makeMotionArgs(when, readTime, AMOTION_EVENT_ACTION_HOVER_MOVE, /*actionButton=*/0, newButtonState, /*pointerCount=*/1, mFingerProps.data(), &coords, xCursorPosition, yCursorPosition)); } mButtonState = newButtonState; return out; Loading
services/inputflinger/tests/GestureConverter_test.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ TEST_F(GestureConverterTest, ButtonsChange) { /* down= */ GESTURES_BUTTON_NONE, /* up= */ GESTURES_BUTTON_RIGHT, /* is_tap= */ false); args = converter.handleGesture(ARBITRARY_TIME, READ_TIME, rightUpGesture); ASSERT_EQ(2u, args.size()); ASSERT_EQ(3u, args.size()); ASSERT_THAT(std::get<NotifyMotionArgs>(args.front()), AllOf(WithMotionAction(AMOTION_EVENT_ACTION_BUTTON_RELEASE), Loading @@ -181,6 +181,10 @@ TEST_F(GestureConverterTest, ButtonsChange) { AllOf(WithMotionAction(AMOTION_EVENT_ACTION_UP), WithButtonState(0), WithCoords(POINTER_X, POINTER_Y), WithToolType(ToolType::FINGER))); args.pop_front(); ASSERT_THAT(std::get<NotifyMotionArgs>(args.front()), AllOf(WithMotionAction(AMOTION_EVENT_ACTION_HOVER_MOVE), WithButtonState(0), WithCoords(POINTER_X, POINTER_Y), WithToolType(ToolType::FINGER))); } TEST_F(GestureConverterTest, DragWithButton) { Loading Loading @@ -225,7 +229,7 @@ TEST_F(GestureConverterTest, DragWithButton) { /* down= */ GESTURES_BUTTON_NONE, /* up= */ GESTURES_BUTTON_LEFT, /* is_tap= */ false); args = converter.handleGesture(ARBITRARY_TIME, READ_TIME, upGesture); ASSERT_EQ(2u, args.size()); ASSERT_EQ(3u, args.size()); ASSERT_THAT(std::get<NotifyMotionArgs>(args.front()), AllOf(WithMotionAction(AMOTION_EVENT_ACTION_BUTTON_RELEASE), Loading @@ -237,6 +241,10 @@ TEST_F(GestureConverterTest, DragWithButton) { AllOf(WithMotionAction(AMOTION_EVENT_ACTION_UP), WithButtonState(0), WithCoords(POINTER_X - 5, POINTER_Y + 10), WithToolType(ToolType::FINGER))); args.pop_front(); ASSERT_THAT(std::get<NotifyMotionArgs>(args.front()), AllOf(WithMotionAction(AMOTION_EVENT_ACTION_HOVER_MOVE), WithButtonState(0), WithCoords(POINTER_X - 5, POINTER_Y + 10), WithToolType(ToolType::FINGER))); } TEST_F(GestureConverterTest, Scroll) { Loading
services/inputflinger/tests/TouchpadInputMapper_test.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -139,7 +139,8 @@ TEST_F(TouchpadInputMapperTest, HoverAndLeftButtonPress) { VariantWith<NotifyMotionArgs>(WithMotionAction(ACTION_DOWN)), VariantWith<NotifyMotionArgs>(WithMotionAction(BUTTON_PRESS)), VariantWith<NotifyMotionArgs>(WithMotionAction(BUTTON_RELEASE)), VariantWith<NotifyMotionArgs>(WithMotionAction(ACTION_UP)))); VariantWith<NotifyMotionArgs>(WithMotionAction(ACTION_UP)), VariantWith<NotifyMotionArgs>(WithMotionAction(HOVER_MOVE)))); // Liftoff args.clear(); Loading