Merge "Fix forgetAllPackageInfos OutOfBoundsException" into sc-dev

This commit is contained in:
Ryan Mitchell
2021-02-17 17:16:42 +00:00
committed by Android (Google) Code Review

View File

@@ -1341,7 +1341,9 @@ public final class OverlayManagerService extends SystemService {
}
public void forgetAllPackageInfos(final int userId) {
for (int i = 0, n = mCache.size(); i < n; i++) {
// Iterate in reverse order since removing the package in all users will remove the
// package from the cache.
for (int i = mCache.size() - 1; i >= 0; i--) {
removePackageUser(mCache.valueAt(i), userId);
}
}