TouchInputMapper: Only use SOURCE_BLUETOOTH_STYLUS when fusion possible

TouchInputMapper can fuse touch pointers with pressure reported by an
external stylus using bluetooth. The pointer fusion can only happen when
the external styus can report pressure. If the external stylus does not
report pressure, there will be no stylus fusion, so do not add
SOURCE_BLUETOOTH_STYLUS to the touchscreen's InputDevice in this case.

Bug: 346797989
Test: atest inputflinger_tests
Flag: EXEMPT bugfix
Change-Id: Idd84cdb77fb3b59cbe314aeedca9d6a0da4affc3
diff --git a/services/inputflinger/reader/mapper/TouchInputMapper.h b/services/inputflinger/reader/mapper/TouchInputMapper.h
index 87b72af..ef0e02f 100644
--- a/services/inputflinger/reader/mapper/TouchInputMapper.h
+++ b/services/inputflinger/reader/mapper/TouchInputMapper.h
@@ -365,6 +365,16 @@
     RawState mLastRawState;
     CookedState mLastCookedState;
 
+    enum class ExternalStylusPresence {
+        // No external stylus connected.
+        NONE,
+        // An external stylus that can report touch/pressure that can be fused with the touchscreen.
+        TOUCH_FUSION,
+        // An external stylus that can only report buttons.
+        BUTTON_FUSION,
+        ftl_last = BUTTON_FUSION,
+    };
+    ExternalStylusPresence mExternalStylusPresence{ExternalStylusPresence::NONE};
     // State provided by an external stylus
     StylusState mExternalStylusState;
     // If an external stylus is capable of reporting pointer-specific data like pressure, we will
@@ -460,8 +470,6 @@
     float mTiltYCenter;
     float mTiltYScale;
 
-    bool mExternalStylusConnected;
-
     // Oriented motion ranges for input device info.
     struct OrientedRanges {
         InputDeviceInfo::MotionRange x;