Restart accessibility services after they update. am: 1e6695bbd4

am: fff4a144de

Change-Id: Ife63344494f27a68511c702536d373350e2b4b46
This commit is contained in:
Phil Weaver
2016-08-17 21:02:30 +00:00
committed by android-build-merger

View File

@@ -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) {