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>
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>