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

Commit 982d9a38 authored by Riley Jones's avatar Riley Jones Committed by Android (Google) Code Review
Browse files

Merge "Cleanup of disableContinuousShortcutOnForceStop" into main

parents d36d6a1c 06d6f46c
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);