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

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

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

parents 57963a33 e1f343ac
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;
                        }
                    }
                }
            }