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

Commit 7f7588d3 authored by Phil Weaver's avatar Phil Weaver Committed by android-build-merger
Browse files

Restart accessibility services after they update. am: 1e6695bb am: fff4a144

am: f49d1bab

Change-Id: I27d86acb98d9cf19f89af036202af9b0a911eea6
parents d1f8be5f f49d1bab
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -278,6 +278,31 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
                }
            }

            @Override
            public void onPackageUpdateFinished(String packageName, int uid) {
                // Unbind all services from this package, and then update the user state to
                // re-bind new versions of them.
                synchronized (mLock) {
                    final int userId = getChangingUserId();
                    if (userId != mCurrentUserId) {
                        return;
                    }
                    UserState userState = getUserStateLocked(userId);
                    boolean unboundAService = false;
                    for (int i = userState.mBoundServices.size() - 1; i >= 0; i--) {
                        Service boundService = userState.mBoundServices.get(i);
                        String servicePkg = boundService.mComponentName.getPackageName();
                        if (servicePkg.equals(packageName)) {
                            boundService.unbindLocked();
                            unboundAService = true;
                        }
                    }
                    if (unboundAService) {
                        onUserStateChangedLocked(userState);
                    }
                }
            }

            @Override
            public void onPackageRemoved(String packageName, int uid) {
                synchronized (mLock) {