@@ -1008,6 +1008,34 @@ TEST_F(PointerChoreographerTest, ShowTouchesOverridesUnspecifiedStylusIcon) {
10081008 pc->assertPointerIconSet (PointerIconStyle::TYPE_SPOT_HOVER);
10091009}
10101010
1011+ TEST_F (PointerChoreographerTest, StylusHoverEnterFadesMouseOnDisplay) {
1012+ // Make sure there are PointerControllers for a mouse and a stylus.
1013+ mChoreographer .setStylusPointerIconEnabled (true );
1014+ mChoreographer .setDefaultMouseDisplayId (DISPLAY_ID);
1015+ mChoreographer .notifyInputDevicesChanged (
1016+ {/* id=*/ 0 ,
1017+ {generateTestDeviceInfo (DEVICE_ID, AINPUT_SOURCE_MOUSE, ui::LogicalDisplayId::INVALID),
1018+ generateTestDeviceInfo (SECOND_DEVICE_ID, AINPUT_SOURCE_STYLUS, DISPLAY_ID)}});
1019+ mChoreographer .setDisplayViewports (createViewports ({DISPLAY_ID}));
1020+ mChoreographer .notifyMotion (
1021+ MotionArgsBuilder (AMOTION_EVENT_ACTION_HOVER_MOVE, AINPUT_SOURCE_MOUSE)
1022+ .pointer (MOUSE_POINTER)
1023+ .deviceId (DEVICE_ID)
1024+ .displayId (ui::LogicalDisplayId::INVALID)
1025+ .build ());
1026+ auto mousePc = assertPointerControllerCreated (ControllerType::MOUSE);
1027+ ASSERT_TRUE (mousePc->isPointerShown ());
1028+
1029+ // Start hovering with a stylus. This should fade the mouse cursor.
1030+ mChoreographer .notifyMotion (
1031+ MotionArgsBuilder (AMOTION_EVENT_ACTION_HOVER_ENTER, AINPUT_SOURCE_STYLUS)
1032+ .pointer (STYLUS_POINTER)
1033+ .deviceId (SECOND_DEVICE_ID)
1034+ .displayId (DISPLAY_ID)
1035+ .build ());
1036+ ASSERT_FALSE (mousePc->isPointerShown ());
1037+ }
1038+
10111039using StylusFixtureParam =
10121040 std::tuple</* name*/ std::string_view, /* source*/ uint32_t , ControllerType>;
10131041
0 commit comments