RESTRICT AUTOMERGE Disable all A11yServices from an uninstalled package. am: 3796629985
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20120242 Change-Id: Ib593fd95127da2dde8fde254fa080d985535aedc Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -430,26 +430,28 @@ 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);
|
||||||
// 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);
|
userState.mTouchExplorationGrantedServices.remove(comp);
|
||||||
persistComponentNamesToSettingLocked(
|
anyServiceRemoved = true;
|
||||||
Settings.Secure.
|
|
||||||
TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
|
|
||||||
userState.mTouchExplorationGrantedServices, userId);
|
|
||||||
onUserStateChangedLocked(userState);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user