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

Skip to content
Commit 0ed20c58 authored by Songchun Fan's avatar Songchun Fan
Browse files

[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
parent c3415b9f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment