Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b32c58fd authored by Svetoslav's avatar Svetoslav Committed by Android Git Automerger
Browse files

am 8d023d80: am 320a31c6: Merge "Incorrect unbinding of accessibility services." into jb-mr2-dev

* commit '8d023d80':
  Incorrect unbinding of accessibility services.
parents e9e9aa65 8d023d80
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -1070,14 +1070,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
                if (userState.mBindingServices.contains(componentName)) {
                    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 (service == null) {
                        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) {