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

Commit dc0095e9 authored by Daniel Norman's avatar Daniel Norman Committed by Android (Google) Code Review
Browse files

Merge "RESTRICT AUTOMERGE Disable all A11yServices from an uninstalled package." into qt-dev

parents 62044e50 37966299
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -427,25 +427,27 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
                    }
                    UserState userState = getUserStateLocked(userId);
                    Iterator<ComponentName> it = userState.mEnabledServices.iterator();
                    boolean anyServiceRemoved = false;
                    while (it.hasNext()) {
                        ComponentName comp = it.next();
                        String compPkg = comp.getPackageName();
                        if (compPkg.equals(packageName)) {
                            it.remove();
                            userState.mBindingServices.remove(comp);
                            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;
                        }
                    }
                }
            }