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

Commit b0cccbb7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "PointerChoreographer: Reset stylus icon on HOVER_EXIT" into main

parents 2732ec13 4b36db91
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);
    }
+9 −0
Original line number Diff line number Diff line
@@ -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) {