summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Prabir Pradhan <prabirmsp@google.com> 2023-11-08 21:09:34 +0000
committer Prabir Pradhan <prabirmsp@google.com> 2023-11-08 21:09:34 +0000
commitb0e280722c6e876c1d23dd8d0140e33a4e846cd9 (patch)
treec8ef5d369aaac87d500420edc101a888102ebf9b
parent49f94b5919de0db0ada4e81f93219e8d4ffa95c6 (diff)
Address additional comments: Pointer icon refactor for touch/stylus
Bug: 293587049 Test: atest inputflinger_tests Change-Id: I831feaf0921dfdc389e79a88690f75fa51c43720
-rw-r--r--libs/input/PointerController.cpp12
-rw-r--r--libs/input/PointerController.h6
2 files changed, 18 insertions, 0 deletions
diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp
index 2e7452d780eb..65e16056c106 100644
--- a/libs/input/PointerController.cpp
+++ b/libs/input/PointerController.cpp
@@ -404,6 +404,10 @@ MousePointerController::MousePointerController(const sp<PointerControllerPolicyI
PointerController::setPresentation(Presentation::POINTER);
}
+MousePointerController::~MousePointerController() {
+ MousePointerController::fade(Transition::IMMEDIATE);
+}
+
// --- TouchPointerController ---
TouchPointerController::TouchPointerController(const sp<PointerControllerPolicyInterface>& policy,
@@ -413,6 +417,10 @@ TouchPointerController::TouchPointerController(const sp<PointerControllerPolicyI
PointerController::setPresentation(Presentation::SPOT);
}
+TouchPointerController::~TouchPointerController() {
+ TouchPointerController::clearSpots();
+}
+
// --- StylusPointerController ---
StylusPointerController::StylusPointerController(const sp<PointerControllerPolicyInterface>& policy,
@@ -422,4 +430,8 @@ StylusPointerController::StylusPointerController(const sp<PointerControllerPolic
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 6461abf754e3..fa07c3989720 100644
--- a/libs/input/PointerController.h
+++ b/libs/input/PointerController.h
@@ -143,6 +143,8 @@ public:
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 @@ public:
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 @@ public:
const sp<Looper>& looper, SpriteController& spriteController,
bool enabled);
+ ~StylusPointerController() override;
+
void setPresentation(Presentation) override {
LOG_ALWAYS_FATAL("Should not be called");
}