Loading services/inputflinger/PointerChoreographer.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,7 @@ void PointerChoreographer::processStylusHoverEventLocked(const NotifyMotionArgs& pc.setPosition(x, y); if (args.action == AMOTION_EVENT_ACTION_HOVER_EXIT) { pc.fade(PointerControllerInterface::Transition::IMMEDIATE); pc.updatePointerIcon(PointerIconStyle::TYPE_NOT_SPECIFIED); } else { pc.unfade(PointerControllerInterface::Transition::IMMEDIATE); } Loading services/inputflinger/tests/PointerChoreographer_test.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -1447,6 +1447,15 @@ TEST_F(PointerChoreographerTest, SetsPointerIconForStylus) { ASSERT_FALSE(mChoreographer.setPointerIcon(PointerIconStyle::TYPE_TEXT, DISPLAY_ID, SECOND_DEVICE_ID)); pc->assertPointerIconNotSet(); // The stylus stops hovering. This should cause the icon to be reset. mChoreographer.notifyMotion( MotionArgsBuilder(AMOTION_EVENT_ACTION_HOVER_EXIT, AINPUT_SOURCE_STYLUS) .pointer(STYLUS_POINTER) .deviceId(DEVICE_ID) .displayId(DISPLAY_ID) .build()); pc->assertPointerIconSet(PointerIconStyle::TYPE_NOT_SPECIFIED); } TEST_F(PointerChoreographerTest, SetsCustomPointerIconForStylus) { Loading Loading
services/inputflinger/PointerChoreographer.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,7 @@ void PointerChoreographer::processStylusHoverEventLocked(const NotifyMotionArgs& pc.setPosition(x, y); if (args.action == AMOTION_EVENT_ACTION_HOVER_EXIT) { pc.fade(PointerControllerInterface::Transition::IMMEDIATE); pc.updatePointerIcon(PointerIconStyle::TYPE_NOT_SPECIFIED); } else { pc.unfade(PointerControllerInterface::Transition::IMMEDIATE); } Loading
services/inputflinger/tests/PointerChoreographer_test.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -1447,6 +1447,15 @@ TEST_F(PointerChoreographerTest, SetsPointerIconForStylus) { ASSERT_FALSE(mChoreographer.setPointerIcon(PointerIconStyle::TYPE_TEXT, DISPLAY_ID, SECOND_DEVICE_ID)); pc->assertPointerIconNotSet(); // The stylus stops hovering. This should cause the icon to be reset. mChoreographer.notifyMotion( MotionArgsBuilder(AMOTION_EVENT_ACTION_HOVER_EXIT, AINPUT_SOURCE_STYLUS) .pointer(STYLUS_POINTER) .deviceId(DEVICE_ID) .displayId(DISPLAY_ID) .build()); pc->assertPointerIconSet(PointerIconStyle::TYPE_NOT_SPECIFIED); } TEST_F(PointerChoreographerTest, SetsCustomPointerIconForStylus) { Loading