Fix incorrect persistent + annoying notification to update F-Droid.
There is a persistent shared preference which dictates whether apps
have been successfully downloaded and are ready to install. When
the InstallManagerService
used to receive an ACTION_INSTALL_COMPLETE
broadcast, it would update this preference to no longer be installing.
However, this never got received in the case of F-Droid updating itself.
In that case, we need to instead wait for the system to broadcast an
Intent.ACTION_PACKAGE_ADDED
intent. This change waits until that
point before removing the preference.
NOTE: This is a little tricky to test with the F-Droid package, so I've done testing with other packages that are not F-Droid and it works quite well. Specifically, if I comment out this line then it indeed does replicate the but in #1027 (closed) for all apps. That is, they all continue to show the "App is ready to install" notification repeatedly. Then reverting to this change fixes the bug for those apps.
Fixes #1027 (closed), #776 (closed).