Address additional comments: Pointer icon refactor for touch/stylus
Bug: 293587049
Test: atest inputflinger_tests
Change-Id: I831feaf0921dfdc389e79a88690f75fa51c43720
diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp
index 2e7452d..65e1605 100644
--- a/libs/input/PointerController.cpp
+++ b/libs/input/PointerController.cpp
@@ -404,6 +404,10 @@
PointerController::setPresentation(Presentation::POINTER);
}
+MousePointerController::~MousePointerController() {
+ MousePointerController::fade(Transition::IMMEDIATE);
+}
+
// --- TouchPointerController ---
TouchPointerController::TouchPointerController(const sp<PointerControllerPolicyInterface>& policy,
@@ -413,6 +417,10 @@
PointerController::setPresentation(Presentation::SPOT);
}
+TouchPointerController::~TouchPointerController() {
+ TouchPointerController::clearSpots();
+}
+
// --- StylusPointerController ---
StylusPointerController::StylusPointerController(const sp<PointerControllerPolicyInterface>& policy,
@@ -422,4 +430,8 @@
PointerController::setPresentation(Presentation::STYLUS_HOVER);
}
+StylusPointerController::~StylusPointerController() {
+ StylusPointerController::fade(Transition::IMMEDIATE);
+}
+
} // namespace android
diff --git a/libs/input/PointerController.h b/libs/input/PointerController.h
index 6461abf..fa07c39 100644
--- a/libs/input/PointerController.h
+++ b/libs/input/PointerController.h
@@ -143,6 +143,8 @@
const sp<Looper>& looper, SpriteController& spriteController,
bool enabled);
+ ~MousePointerController() override;
+
void setPresentation(Presentation) override {
LOG_ALWAYS_FATAL("Should not be called");
}
@@ -161,6 +163,8 @@
const sp<Looper>& looper, SpriteController& spriteController,
bool enabled);
+ ~TouchPointerController() override;
+
std::optional<FloatRect> getBounds() const override {
LOG_ALWAYS_FATAL("Should not be called");
}
@@ -205,6 +209,8 @@
const sp<Looper>& looper, SpriteController& spriteController,
bool enabled);
+ ~StylusPointerController() override;
+
void setPresentation(Presentation) override {
LOG_ALWAYS_FATAL("Should not be called");
}