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

Commit 9e3a6a62 authored by Daniel Norman's avatar Daniel Norman Committed by Automerger Merge Worker
Browse files

Merge "Disable all A11yServices from an uninstalled package." into rvc-dev am: e6d10db5

parents 9d8fcdad e6d10db5
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -456,24 +456,26 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
                    userState.mBindingServices.removeIf(filter);
                    userState.mCrashedServices.removeIf(filter);
                    final Iterator<ComponentName> it = userState.mEnabledServices.iterator();
                    boolean anyServiceRemoved = false;
                    while (it.hasNext()) {
                        final ComponentName comp = it.next();
                        final String compPkg = comp.getPackageName();
                        if (compPkg.equals(packageName)) {
                            it.remove();
                            userState.mTouchExplorationGrantedServices.remove(comp);
                            anyServiceRemoved = true;
                        }
                    }
                    if (anyServiceRemoved) {
                        // Update the enabled services setting.
                        persistComponentNamesToSettingLocked(
                                Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
                                userState.mEnabledServices, userId);
                        // Update the touch exploration granted services setting.
                            userState.mTouchExplorationGrantedServices.remove(comp);
                        persistComponentNamesToSettingLocked(
                                    Settings.Secure.
                                    TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
                                Settings.Secure.TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
                                userState.mTouchExplorationGrantedServices, userId);
                        onUserStateChangedLocked(userState);
                            return;
                        }
                    }
                }
            }