diff options
| author | 2023-07-17 15:18:01 -0700 | |
|---|---|---|
| committer | 2023-07-17 15:18:04 -0700 | |
| commit | 0ed20c5891f51b54c4284661b2b10c1ce5bc008a (patch) | |
| tree | 5cca063a49d297346ba3965a6f7af3915a993fd9 /api/api_test.go | |
| parent | c3415b9f2ff755cde0403eb121e99de924007edd (diff) | |
[pm] fix loading progress race condition during incremental app migration
When an incremental app is migrated to non-incremental through an app
update, there is a small chance of race conditioning on the loading
progress update. The loading progress is stored in PackageSetting. The
new app's PackageSetting is created before the old package's loading
progress callback is destroyed, which happens when the old directory is
deleted. So there's a small chance that the old package's loading
progress callback updates the new package's package setting with an
outdated loading progress.
As a result, as observed in the test, the new package setting should
have a loading progress of 1, but there is a 3% chance that it is set to
the old loading progress which is 0.3.
To prevent this, we add a restriction on the value of loading progress
so that it will never go down.
BUG: 288323351
Test: atest com.android.tests.loadingprogress.host.IncrementalLoadingProgressTest#testGetLoadingProgressDuringMigration --iterations 100
Change-Id: Ie5a5a56ba4eb211b83db8d1d5dbcb179610eb1d9
Diffstat (limited to 'api/api_test.go')
0 files changed, 0 insertions, 0 deletions