Separate default pointer for mouse and stylus (native part)

Let PointerController (MouseCursorController) know the source of
the current event, either mouse or stylus.
MouseCursorController will show the proper default pointer for
the active source, if the requested pointer type is TYPE_NOT_SPECIFIED.

Test: Manual Test
Bug: b/215436642
Change-Id: I91f702db661846fc7ad857f71656903c8aa4334a
diff --git a/services/inputflinger/include/PointerControllerInterface.h b/services/inputflinger/include/PointerControllerInterface.h
index 7e0c1c7..9dbdd5a 100644
--- a/services/inputflinger/include/PointerControllerInterface.h
+++ b/services/inputflinger/include/PointerControllerInterface.h
@@ -79,8 +79,10 @@
         POINTER,
         // Show spots and a spot anchor in place of the mouse pointer.
         SPOT,
+        // Show the stylus hover pointer.
+        STYLUS_HOVER,
 
-        ftl_last = SPOT,
+        ftl_last = STYLUS_HOVER,
     };
 
     /* Sets the mode of the pointer controller. */
diff --git a/services/inputflinger/reader/mapper/TouchInputMapper.cpp b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
index 9003e58..dc27622 100644
--- a/services/inputflinger/reader/mapper/TouchInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
@@ -3699,13 +3699,14 @@
             ALOG_ASSERT(false);
         }
     }
-    const bool isStylus = isStylusEvent(source, action, pointerProperties);
-    if (isStylus) {
+    const bool isDirectStylus =
+            mDeviceMode == DeviceMode::DIRECT && isStylusEvent(source, action, pointerProperties);
+    if (isDirectStylus) {
         switch (action & AMOTION_EVENT_ACTION_MASK) {
             case AMOTION_EVENT_ACTION_HOVER_ENTER:
             case AMOTION_EVENT_ACTION_HOVER_MOVE:
                 mPointerController->setPresentation(
-                        PointerControllerInterface::Presentation::POINTER);
+                        PointerControllerInterface::Presentation::STYLUS_HOVER);
                 mPointerController
                         ->setPosition(mCurrentCookedState.cookedPointerData.pointerCoords[0].getX(),
                                       mCurrentCookedState.cookedPointerData.pointerCoords[0]