Defer post-install resource clean up for 5 seconds
There is an inherent problem with deleting files on disk while an
app is running, since it might still try to access code/resources
in the deleted files.
We cannot instantaneously update all application threads to the
new paths without blocking the world, so keep the old ones around
for an arbitrary amount of time.
As mentioned in the linked bug, if PackageManager boots with
duplicated app directories, it will automatically clean itself up,
so we are not concerned with the case where the deferred delete
message doesn't get executed in the current device boot cycle.
5 seconds was chosen with no reasoning beyond it feels safe.
Bug: 129291162
Test: manual reboot device with invalid dirs on disk
Test: manual dynamic feature delivery app with --dont-kill split
Merged-In: Id249a185a8556ebf133be3c36b1fec3f14b588ac
Change-Id: Id249a185a8556ebf133be3c36b1fec3f14b588ac
(cherry picked from commit 87380366ecf60f2cb2697cb26e07ccaf666b45e6)
1 file changed