Pointer icon refactor for touch (base)

When PointerChoreographer is enabled, PointerChoreographer can
create multiple TouchPointerControllers for each touch device
when 'Show taps' is enabled. A TouchPointerController is
reponsible for one touch device and it can show touch spots
on the associated display.

Test: atest libinputservice_test
Bug: 293587049
Change-Id: I1a624a6a50023c530e709cc5fc0704b0b997125b
diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp
index 576ebc1..246db6c 100644
--- a/libs/input/PointerController.cpp
+++ b/libs/input/PointerController.cpp
@@ -74,6 +74,10 @@
             controller = std::shared_ptr<PointerController>(
                     new MousePointerController(policy, looper, spriteController, enabled));
             break;
+        case ControllerType::TOUCH:
+            controller = std::shared_ptr<PointerController>(
+                    new TouchPointerController(policy, looper, spriteController, enabled));
+            break;
         case ControllerType::LEGACY:
         default:
             controller = std::shared_ptr<PointerController>(
@@ -397,4 +401,13 @@
     PointerController::setPresentation(Presentation::POINTER);
 }
 
+// --- TouchPointerController ---
+
+TouchPointerController::TouchPointerController(const sp<PointerControllerPolicyInterface>& policy,
+                                               const sp<Looper>& looper,
+                                               SpriteController& spriteController, bool enabled)
+      : PointerController(policy, looper, spriteController, enabled) {
+    PointerController::setPresentation(Presentation::SPOT);
+}
+
 } // namespace android
diff --git a/libs/input/PointerController.h b/libs/input/PointerController.h
index 08e19a0..1a8e109 100644
--- a/libs/input/PointerController.h
+++ b/libs/input/PointerController.h
@@ -68,7 +68,7 @@
 
     void updatePointerIcon(PointerIconStyle iconId);
     void setCustomPointerIcon(const SpriteIcon& icon);
-    void setInactivityTimeout(InactivityTimeout inactivityTimeout);
+    virtual void setInactivityTimeout(InactivityTimeout inactivityTimeout);
     void doInactivityTimeout();
     void reloadPointerResources();
     void onDisplayViewportsUpdated(const std::vector<DisplayViewport>& viewports);
@@ -154,6 +154,50 @@
     }
 };
 
+class TouchPointerController : public PointerController {
+public:
+    /** A version of PointerController that controls touch spots. */
+    TouchPointerController(const sp<PointerControllerPolicyInterface>& policy,
+                           const sp<Looper>& looper, SpriteController& spriteController,
+                           bool enabled);
+
+    std::optional<FloatRect> getBounds() const override {
+        LOG_ALWAYS_FATAL("Should not be called");
+    }
+    void move(float, float) override {
+        LOG_ALWAYS_FATAL("Should not be called");
+    }
+    void setPosition(float, float) override {
+        LOG_ALWAYS_FATAL("Should not be called");
+    }
+    FloatPoint getPosition() const override {
+        LOG_ALWAYS_FATAL("Should not be called");
+    }
+    int32_t getDisplayId() const override {
+        LOG_ALWAYS_FATAL("Should not be called");
+    }
+    void fade(Transition) override {
+        LOG_ALWAYS_FATAL("Should not be called");
+    }
+    void unfade(Transition) override {
+        LOG_ALWAYS_FATAL("Should not be called");
+    }
+    void setDisplayViewport(const DisplayViewport&) override {
+        LOG_ALWAYS_FATAL("Should not be called");
+    }
+    void setPresentation(Presentation) override {
+        LOG_ALWAYS_FATAL("Should not be called");
+    }
+    void updatePointerIcon(PointerIconStyle) {
+        LOG_ALWAYS_FATAL("Should not be called");
+    }
+    void setCustomPointerIcon(const SpriteIcon&) {
+        LOG_ALWAYS_FATAL("Should not be called");
+    }
+    // fade() should not be called by inactivity timeout. Do nothing.
+    void setInactivityTimeout(InactivityTimeout) override {}
+};
+
 } // namespace android
 
 #endif // _UI_POINTER_CONTROLLER_H