Merge "[automerger skipped] Merge "Check for NLS bind permission when rebinding services" into sc-dev am: 73a43831b1 am: d806b6ec65 am: 6b6f85830a -s ours am: 4c519493f6 -s ours am: 7b4f7a2250 -s ours am: e25a1fa4b1 -s ours am: 5b3f8e7f1d -s ours am: b1b9b90a2e -s ours" into main
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index 3e7682a..880a687 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -2703,13 +2703,11 @@
         Map<ComponentName, AccessibilityServiceConnection> componentNameToServiceMap =
                 userState.mComponentNameToServiceMap;
         boolean isUnlockingOrUnlocked = mUmi.isUserUnlockingOrUnlocked(userState.mUserId);
-        Set<ComponentName> installedComponentNames = new HashSet<>();
 
         for (int i = 0, count = userState.mInstalledServices.size(); i < count; i++) {
             AccessibilityServiceInfo installedService = userState.mInstalledServices.get(i);
             ComponentName componentName = ComponentName.unflattenFromString(
                     installedService.getId());
-            installedComponentNames.add(componentName);
 
             AccessibilityServiceConnection service = componentNameToServiceMap.get(componentName);
 
@@ -2769,28 +2767,6 @@
             audioManager.setAccessibilityServiceUids(mTempIntArray);
         }
         mActivityTaskManagerService.setAccessibilityServiceUids(mTempIntArray);
-        final Iterator<ComponentName> it = userState.mEnabledServices.iterator();
-        boolean anyServiceRemoved = false;
-        while (it.hasNext()) {
-            final ComponentName comp = it.next();
-            if (!installedComponentNames.contains(comp)) {
-                it.remove();
-                userState.mTouchExplorationGrantedServices.remove(comp);
-                anyServiceRemoved = true;
-            }
-        }
-        if (anyServiceRemoved) {
-            // Update the enabled services setting.
-            persistComponentNamesToSettingLocked(
-                    Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
-                    userState.mEnabledServices,
-                    userState.mUserId);
-            // Update the touch exploration granted services setting.
-            persistComponentNamesToSettingLocked(
-                    Settings.Secure.TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
-                    userState.mTouchExplorationGrantedServices,
-                    userState.mUserId);
-        }
         updateAccessibilityEnabledSettingLocked(userState);
     }