summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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");
}