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

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

Change-Id: I81f0c31df2d07a2f1b9a8747bb06640e167871df
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:07:33 +00:00
committed by Automerger Merge Worker

View File

@@ -456,25 +456,27 @@ 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();
// 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,
userState.mTouchExplorationGrantedServices, userId);
onUserStateChangedLocked(userState);
return;
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.
persistComponentNamesToSettingLocked(
Settings.Secure.TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
userState.mTouchExplorationGrantedServices, userId);
onUserStateChangedLocked(userState);
}
}
}