diff options
author | Jun Mukai <mukai@google.com> | 2015-11-24 11:25:52 -0800 |
---|---|---|
committer | Jun Mukai <mukai@google.com> | 2015-11-30 14:42:53 -0800 |
commit | 19a560197950425f7e1856d5bd1216fbc680bf70 (patch) | |
tree | c5eed0b4dab09ad562f41a13d61743b4a7a7be18 /libs/input/PointerController.cpp | |
parent | 28860b7570d2b3e7bc6a136a7bb7312e5aaf6e61 (diff) |
Introduce accessibility large pointer icons.
This patch does the following things:
- add new graphic assets of large icons for accessibility needs
(imported from ChromeOS data)
- add the logic to choose the set of normal icons or accessibility icons
- make InputManagerService to observe the settings change, so that
it can reload the new resources
This patch misses non-1x graphic though, because ChromeOS doesn't
have such data.
Bug: 25778857
Change-Id: Ia5f95d47f50b3f6eea555c3af8069bc6bae0b400
Diffstat (limited to 'libs/input/PointerController.cpp')
-rw-r--r-- | libs/input/PointerController.cpp | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp index bd6af788bcf7..6a1167a02c0b 100644 --- a/libs/input/PointerController.cpp +++ b/libs/input/PointerController.cpp @@ -91,7 +91,14 @@ PointerController::PointerController(const sp<PointerControllerPolicyInterface>& mLocked.buttonState = 0; + mPolicy->loadPointerIcon(&mLocked.pointerIcon); + loadResources(); + + if (mLocked.pointerIcon.isValid()) { + mLocked.pointerIconChanged = true; + updatePointerLocked(); + } } PointerController::~PointerController() { @@ -325,6 +332,23 @@ void PointerController::setInactivityTimeout(InactivityTimeout inactivityTimeout } } +void PointerController::reloadPointerResources() { + AutoMutex _l(mLock); + + loadResources(); + + if (mLocked.presentation == PRESENTATION_POINTER) { + mLocked.additionalMouseResources.clear(); + mLocked.animationResources.clear(); + mPolicy->loadPointerIcon(&mLocked.pointerIcon); + mPolicy->loadAdditionalMouseResources(&mLocked.additionalMouseResources, + &mLocked.animationResources); + } + + mLocked.presentationChanged = true; + updatePointerLocked(); +} + void PointerController::setDisplayViewport(int32_t width, int32_t height, int32_t orientation) { AutoMutex _l(mLock); @@ -415,15 +439,6 @@ void PointerController::updatePointerShape(int32_t iconId) { } } -void PointerController::setPointerIcon(const SpriteIcon& icon) { - AutoMutex _l(mLock); - - mLocked.pointerIcon = icon.copy(); - mLocked.pointerIconChanged = true; - - updatePointerLocked(); -} - void PointerController::handleMessage(const Message& message) { switch (message.what) { case MSG_INACTIVITY_TIMEOUT: |