Merge "[pm] fix loading progress race condition during incremental app migration" into main

This commit is contained in:
Song Chun Fan
2023-07-18 20:22:02 +00:00
committed by Android (Google) Code Review

View File

@@ -1195,8 +1195,11 @@ public class PackageSetting extends SettingBase implements PackageStateInternal
}
public PackageSetting setLoadingProgress(float progress) {
mLoadingProgress = progress;
onChanged();
// To prevent race conditions, we don't allow progress to ever go down
if (mLoadingProgress < progress) {
mLoadingProgress = progress;
onChanged();
}
return this;
}