From d4eaef7f4c5a5d281de4fff272cd33e892e26264 Mon Sep 17 00:00:00 2001 From: Jun Mukai Date: Fri, 30 Oct 2015 15:54:33 -0700 Subject: Make public pointer icon API with custom icons. BUG: 25778347, 23804184 Change-Id: If138b97c750c912e9848412c27b65004899961eb --- libs/input/PointerController.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libs/input/PointerController.cpp') diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp index 6a1167a02c0b..529849e99fb6 100644 --- a/libs/input/PointerController.cpp +++ b/libs/input/PointerController.cpp @@ -439,6 +439,17 @@ void PointerController::updatePointerShape(int32_t iconId) { } } +void PointerController::setCustomPointerIcon(const SpriteIcon& icon) { + AutoMutex _l(mLock); + + const int32_t iconId = mPolicy->getCustomPointerIconId(); + mLocked.additionalMouseResources[iconId] = icon; + mLocked.requestedPointerShape = iconId; + mLocked.presentationChanged = true; + + updatePointerLocked(); +} + void PointerController::handleMessage(const Message& message) { switch (message.what) { case MSG_INACTIVITY_TIMEOUT: -- cgit v1.2.3