Merge "Incorrect unbinding of accessibility services." into jb-mr2-dev

This commit is contained in:
Svetoslav
2013-03-23 00:14:43 +00:00
committed by Android (Google) Code Review

View File

@@ -1070,14 +1070,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
if (userState.mBindingServices.contains(componentName)) { if (userState.mBindingServices.contains(componentName)) {
continue; continue;
} }
// No enabled installed services => disable accessibility to avoid
// sending accessibility events with no recipient across processes.
if (userState.mEnabledServices.isEmpty()) {
userState.mIsAccessibilityEnabled = false;
Settings.Secure.putIntForUser(mContext.getContentResolver(),
Settings.Secure.ACCESSIBILITY_ENABLED, 0, userState.mUserId);
return;
}
if (userState.mEnabledServices.contains(componentName)) { if (userState.mEnabledServices.contains(componentName)) {
if (service == null) { if (service == null) {
service = new Service(userState.mUserId, componentName, installedService); service = new Service(userState.mUserId, componentName, installedService);
@@ -1098,6 +1090,14 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
} }
} }
} }
// No enabled installed services => disable accessibility to avoid
// sending accessibility events with no recipient across processes.
if (isEnabled && userState.mEnabledServices.isEmpty()) {
userState.mIsAccessibilityEnabled = false;
Settings.Secure.putIntForUser(mContext.getContentResolver(),
Settings.Secure.ACCESSIBILITY_ENABLED, 0, userState.mUserId);
}
} }
private void scheduleUpdateClientsIfNeededLocked(UserState userState) { private void scheduleUpdateClientsIfNeededLocked(UserState userState) {