WorkManager downloads can fail due to n number of reason. Regardless of the reason
there might be not enough time to mark the download as failed within the worker
causing the download to keep the status as downloading on next startup, thus blocking
the queue.
Always check for downloads with downloading status on init and cancel them if work
manager cannot find atleast one ongoing work for it.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
We don't want to cancel all downloads when user requests to cancel only updates.
Also, update the download's status to cancelled atomically.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This is useful when an active download is stuck which could happen if the app
was force stopped by user or killed by Android.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
* Check for fdroid basic as install source as well
* Check for fdroid.org as organization name in signing certificate attribute
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
If a user has incompatible updates turned on, show them updates which fails
certificate verification as well.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
The new setRequestUpdateOwnership() method allows us to indicate to the system that we intend to be responsible for future updates to an app it is installing.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
Not used anywhere nor working with rework. Needs to be implemented properly
before adding again.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
Session, Shizuku and Root Installer are supported for now. Native and Aurora Services
have been deprecated and won't be supported. App Manager might support it or it will
be deprecated as well (if it doesn't).
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
Switch from args to arguments as the current one caches the old
value and returns it again on creation.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This requests user's confirmation before uninstallation every time which
is what we want to happen as well.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This would be useful for self-updates when they get downloaded but user
isn't automatically installed.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This results in their state never being updated when passed to menu fragment.
Store the ongoing downloads in a list and find it when required using the
package name instead.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
Switch to LinearProgressIndicator where possible and show an indeterminate
progress bar while download progress is below 1%
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
Don't show failure notification if download was cancelled by the user
on Android 12+ devices. Sadly the method is not backwards compt nor I
want to spend time on it.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
* Only show updates for devices that has atleast one matching certificate
* On Android 9.0+ devices, purchase apps with latest certificate's hash while updating
to support key rotations
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
Old android versions get binder transaction errors otherwise. Also move out the
logic to fetch icon into the Worker to avoid fetching it 100 times. Keep the install
logic in place as that method is only called once after installation.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>