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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20123964

Change-Id: I0696a78491bc4c31995f64e988ec6407b06871d8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Daniel Norman
2022-10-17 20:36:33 +00:00
committed by Automerger Merge Worker

View File

@@ -504,24 +504,26 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
userState.mBindingServices.removeIf(filter); userState.mBindingServices.removeIf(filter);
userState.mCrashedServices.removeIf(filter); userState.mCrashedServices.removeIf(filter);
final Iterator<ComponentName> it = userState.mEnabledServices.iterator(); final Iterator<ComponentName> it = userState.mEnabledServices.iterator();
boolean anyServiceRemoved = false;
while (it.hasNext()) { while (it.hasNext()) {
final ComponentName comp = it.next(); final ComponentName comp = it.next();
final String compPkg = comp.getPackageName(); final String compPkg = comp.getPackageName();
if (compPkg.equals(packageName)) { if (compPkg.equals(packageName)) {
it.remove(); it.remove();
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;
}
} }
} }
} }