From 0ecfa017decd230051d5e42d9f49129afd58838b Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Thu, 18 Apr 2013 09:35:43 -0700 Subject: Reload accessibility service infos for reisntalled packages. When something that affects the state of accessibility in the sysytem changes, we run a reolve method that reloads all relevant information and if it changed we call a method that makes everyting right. One of the interesting properties we read is the isntalled accessibliity services. We are using equals to figure out whether these services have changed but this is not correct since AccessibilityServiceInfo does not use all internal members for equals and using all memthis is not reasible since some of these internal members do not support equals propertly, for example ResolveInfo. Therefore, when a package is reinstalled we remove all installed services from the list of ones we know about which forces them to be reloaded, thus capturing the current state of a reinstalled package. bug:8621960 Change-Id: Ie1ef4bf1036d8d6e033cd9528ea2292ce24e5320 --- .../android/server/accessibility/AccessibilityManagerService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java index 110c4da..a7a77ce 100644 --- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -237,6 +237,11 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } // We will update when the automation service dies. UserState userState = getCurrentUserStateLocked(); + // We have to reload the installed services since some services may + // have different attributes, resolve info (does not support equals), + // etc. Remove them then to force reload. Do it even if automation is + // running since when it goes away, we will have to reload as well. + userState.mInstalledServices.clear(); if (userState.mUiAutomationService == null) { if (readConfigurationForUserStateLocked(userState)) { onUserStateChangedLocked(userState); -- cgit v1.1