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

Commit cbfebb38 authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

3322879 Device soft reboots on enabling and disabling accessibility settings...

3322879 Device soft reboots on enabling and disabling accessibility settings (caused due to my incorrect fix of 3304011 in change If99ef28c)

Change-Id: I9578655b3b436829f0adb3947c242a19631d74c7
parent 5727b479
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);
            }
        }