Skip to content

Commit

Permalink
DownloadManager: process intents from external apps
Browse files Browse the repository at this point in the history
That's required in Pico4Ultra to receive intents from the Android's
DownloadManager. Without that, things like downloading environments
don't work because we don't get notified when the download is
finished.

Fixes #1740
  • Loading branch information
svillar committed Feb 3, 2025
1 parent 1e871dd commit 1f09ca8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ private void removeDownloadOnDiskIO(long id) {

public void init() {
IntentFilter filter = new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
mContext.registerReceiver(mDownloadReceiver, filter, null, mMainHandler, Context.RECEIVER_NOT_EXPORTED);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
mContext.registerReceiver(mDownloadReceiver, filter, null, mMainHandler, Context.RECEIVER_EXPORTED);
} else {
mContext.registerReceiver(mDownloadReceiver, filter, null, mMainHandler);
}
Expand Down

0 comments on commit 1f09ca8

Please sign in to comment.