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

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

Merge "IOBE while diabling accessibility with some enabled accessibility services." into honeycomb

parents eafbce55 6ff5f103
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -532,7 +532,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub

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

@@ -575,7 +578,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
            Set<ComponentName> enabledServices) {

        Map<ComponentName, Service> componentNameToServiceMap = mComponentNameToServiceMap;
        List<Service> services = mServices;
        boolean isEnabled = mIsEnabled;

        for (int i = 0, count = installedServices.size(); i < count; i++) {
@@ -665,23 +667,30 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub

        /**
         * Binds to the accessibility service.
         *
         * @return True if binding is successful.
         */
        public void bind() {
        public boolean bind() {
            if (mService == null) {
                mContext.bindService(mIntent, this, Context.BIND_AUTO_CREATE);
                return mContext.bindService(mIntent, this, Context.BIND_AUTO_CREATE);
            }
            return false;
        }

        /**
         * Unbinds form the accessibility service and removes it from the data
         * structures for service management.
         *
         * @return True if unbinding is successful.
         */
        public void unbind() {
        public boolean unbind() {
            if (mService != null) {
                mContext.unbindService(this);
                mComponentNameToServiceMap.remove(mComponentName);
                mServices.remove(this);
                return true;
            }
            return false;
        }

        /**