diff --git a/android/gradle.properties b/android/gradle.properties index ae798c7d..cedd8d06 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -14,9 +14,9 @@ BlobCourier_testExtVersion = 1.1.+ BlobCourier_testLoggerVersion = 2.1.1 BlobCourier_buildToolsVersion = 30.0.2 -BlobCourier_compileSdkVersion = 31 +BlobCourier_compileSdkVersion = 34 BlobCourier_minSdkVersion = 24 -BlobCourier_targetSdkVersion = 30 +BlobCourier_targetSdkVersion = 34 ADB_COMMAND_TIMEOUT_MILLISECONDS = 10000L PROMISE_TIMEOUT_MILLISECONDS = 60000L diff --git a/android/src/main/java/io/deckers/blob_courier/fetch/ManagedDownloader.kt b/android/src/main/java/io/deckers/blob_courier/fetch/ManagedDownloader.kt index b5d613d8..0f24caa1 100644 --- a/android/src/main/java/io/deckers/blob_courier/fetch/ManagedDownloader.kt +++ b/android/src/main/java/io/deckers/blob_courier/fetch/ManagedDownloader.kt @@ -11,6 +11,7 @@ import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.content.IntentFilter +import android.os.Build import androidx.localbroadcastmanager.content.LocalBroadcastManager import io.deckers.blob_courier.common.ACTION_CANCEL_REQUEST import io.deckers.blob_courier.common.BlobCourierError @@ -162,10 +163,19 @@ class ManagedDownloader( private fun registerDownloadCompletionHandler(downloadReceiver: ManagedDownloadReceiver) { lv("Registering ${DownloadManager.ACTION_DOWNLOAD_COMPLETE} receiver") - context.registerReceiver( - downloadReceiver, - IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE) - ) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + context.registerReceiver( + downloadReceiver, + IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE), + Context.RECEIVER_EXPORTED + ) + } else { + @Suppress("UnspecifiedRegisterReceiverFlag") + context.registerReceiver( + downloadReceiver, + IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE) + ) + } lv("Registered ${DownloadManager.ACTION_DOWNLOAD_COMPLETE} receiver") }