Delete staged APK whenever DeleteStagedFileOnResult finishes.
The DeleteStagedFileOnResult activity commonly doesn't receive a result,
because the user either immediately opens the newly installed app or
navigates away. When the task containing this activity is either trimmed
by the system or explicitly removed by the user, the activity will be
finished. We can take this opportunity to delete the staged APK.
There is still no guarantee that the staged APK will be deleted; for
example, this activity may already have been destroyed (temporarily) in
low memory situations while the user was completing the install.
Bug: 183940755
Test: Manual, observing when staged APKs are deleted via adb shell ls.
Change-Id: Iaabecffe8131333b2eefee1edec8b4641868b2e7
1 file changed