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

This commit is contained in:
Daniel Norman
2022-10-17 19:44:36 +00:00
committed by Android (Google) Code Review

View File

@@ -427,25 +427,27 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
} }
UserState userState = getUserStateLocked(userId); UserState userState = getUserStateLocked(userId);
Iterator<ComponentName> it = userState.mEnabledServices.iterator(); Iterator<ComponentName> it = userState.mEnabledServices.iterator();
boolean anyServiceRemoved = false;
while (it.hasNext()) { while (it.hasNext()) {
ComponentName comp = it.next(); ComponentName comp = it.next();
String compPkg = comp.getPackageName(); String compPkg = comp.getPackageName();
if (compPkg.equals(packageName)) { if (compPkg.equals(packageName)) {
it.remove(); it.remove();
userState.mBindingServices.remove(comp); userState.mBindingServices.remove(comp);
userState.mTouchExplorationGrantedServices.remove(comp);
anyServiceRemoved = true;
}
}
if (anyServiceRemoved) {
// Update the enabled services setting. // Update the enabled services setting.
persistComponentNamesToSettingLocked( persistComponentNamesToSettingLocked(
Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
userState.mEnabledServices, userId); userState.mEnabledServices, userId);
// Update the touch exploration granted services setting. // Update the touch exploration granted services setting.
userState.mTouchExplorationGrantedServices.remove(comp);
persistComponentNamesToSettingLocked( persistComponentNamesToSettingLocked(
Settings.Secure. Settings.Secure.TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
userState.mTouchExplorationGrantedServices, userId); userState.mTouchExplorationGrantedServices, userId);
onUserStateChangedLocked(userState); onUserStateChangedLocked(userState);
return;
}
} }
} }
} }