Move app installation logic to onSuccess method in worker under a NonCancellable
context and convert the receiver class to be a generic status handler for anything
except success which should be handled in PackageManagerReceiver.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
Sometimes when download gets completed, the progress hasn't been updated which
results in no notification data and downloads showing status as completed with
a progress less than 100%.
Set progress manually to 100% and avoid checking progress in notificationUtil if
download has succeded. Also avoid calling onProgress again if download has finished.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
Path is only available since Android 8.0+ and it makes no sense to
add a dependency upon desugaring lib for it.
Switch to File class instead which is available on all Android versions
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
On old android versions, work manager runs expedited jobs using FGS which
seem to require a work notification as soon as the service starts by automatically
calling getForegroundInfo method.
This causes an exception as we haven't parsed the data yet. Use a generic
download notification for such cases.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
* Make BaseFragment an abstract class, no reason to keep this open
* This also fixes memory leak that happens after onboarding is finished
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
Considering we will be having a room database instance soon for downloads
and already have tons of other instances everywhere, feels right time to
use Hilt to manage them to avoid more memory leaks.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This allows us to keep all the modifications related to DownloadWorker in a
single place.
Also, drop the 3seconds delay and do the cleanup instead of delegating it to
worker if last job was failed. This is better and more error-proof.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
* Keep results for 7 days atleast
* Cancel download using tag & remove app from download queue
* Tag downloads and updates. This will allow a user to query & cancel all updates or downloads in one click
* Default to cancel all downloads & updates
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
display language seems to be more or less always empty/blank. Let's just
use localized display language instead. This will ensure both lines don't show
same values unless same locale is applied.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
Don't filter out packages without launch intent. Some packages provides updates while
not providing a launch intent for users.
Test: Check if "com.google.android.euicc" is visible in blacklist and has updates.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>