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
This commit is contained in:
Jun Mukai
2015-11-24 11:25:52 -08:00
parent 28860b7570
commit 19a5601979
50 changed files with 240 additions and 44 deletions

View File

@@ -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: