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

Commit 8303dccf authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "(cherrypick from master) 3322879 Device soft reboots on enabling and...

Merge "(cherrypick from master) 3322879 Device soft reboots on enabling and disabling accessibility settings" into honeycomb
parents 32846944 563d7840
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -532,11 +532,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub

        for (int i = 0, count = services.size(); i < count; i++) {
            Service service = services.get(i);

            service.unbind();
            mComponentNameToServiceMap.remove(service.mComponentName);
        }
        services.clear();
    }

    /**
@@ -588,15 +585,18 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
            Service service = componentNameToServiceMap.get(componentName);

            if (isEnabled) {
                if (enabledServices.contains(componentName) && service == null) {
                    new Service(componentName).bind();
                } else if (!enabledServices.contains(componentName) && service != null) {
                    // clean up done in Service#onServiceDisconnected
                if (enabledServices.contains(componentName)) {
                    if (service == null) {
                        service = new Service(componentName);
                    }
                    service.bind();
                } else if (!enabledServices.contains(componentName)) {
                    if (service != null) {
                        service.unbind();
                    }
                }
            } else {
                if (service != null) {
                    // clean up done in Service#onServiceDisconnected
                    service.unbind();
                }
            }
@@ -679,6 +679,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
        public void unbind() {
            if (mService != null) {
                mContext.unbindService(this);
                mComponentNameToServiceMap.remove(mComponentName);
                mServices.remove(this);
            }
        }