Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06d6f46c authored by Riley Jones's avatar Riley Jones
Browse files

Cleanup of disableContinuousShortcutOnForceStop

Test: N/A
Flag: N/A
Bug: 198018180
Change-Id: If4dd32424584ded229cf23adcd38c4a2c9bce470
parent 851604f1
Loading
Loading
Loading
Loading
+4 −27
Original line number Diff line number Diff line
@@ -935,35 +935,12 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
                    }
                    final AccessibilityUserState userState = getUserStateLocked(userId);

                    if (Flags.disableContinuousShortcutOnForceStop()) {
                    if (doit && onPackagesForceStoppedLocked(packages, userState)) {
                        onUserStateChangedLocked(userState);
                        return false;
                    } else {
                        return true;
                    }
                    } else {
                        final Iterator<ComponentName> it = userState.mEnabledServices.iterator();
                        while (it.hasNext()) {
                            final ComponentName comp = it.next();
                            final String compPkg = comp.getPackageName();
                            for (String pkg : packages) {
                                if (compPkg.equals(pkg)) {
                                    if (!doit) {
                                        return true;
                                    }
                                    it.remove();
                                    userState.getBindingServicesLocked().remove(comp);
                                    userState.getCrashedServicesLocked().remove(comp);
                                    persistComponentNamesToSettingLocked(
                                            Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
                                            userState.mEnabledServices, userId);
                                    onUserStateChangedLocked(userState);
                                }
                            }
                        }
                        return false;
                    }
                }
            }
        };
+0 −1
Original line number Diff line number Diff line
@@ -813,7 +813,6 @@ public class AccessibilityManagerServiceTest {
    }

    @Test
    @RequiresFlagsEnabled(Flags.FLAG_DISABLE_CONTINUOUS_SHORTCUT_ON_FORCE_STOP)
    public void testPackagesForceStopped_fromContinuousService_removesButtonTarget() {
        final AccessibilityServiceInfo info_a = new AccessibilityServiceInfo();
        info_a.setComponentName(COMPONENT_NAME);