Skip to content

Commit

Permalink
Merge pull request #3746 from mcarare/1847141-uplift
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalchevrel committed Oct 2, 2023
2 parents dd3ee32 + 1abb717 commit 8ede68c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions components/feature/downloads/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
<!-- Needed to prompt the user to give permission to install a downloaded apk -->
<uses-permission-sdk-23 android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

<!-- Needed to receive broadcasts from AC code-->
<uses-permission android:name="${applicationId}.permission.RECEIVE_DOWNLOAD_BROADCAST" />

<permission
android:name="${applicationId}.permission.RECEIVE_DOWNLOAD_BROADCAST"
android:protectionLevel="signature" />

<application android:supportsRtl="true">
<provider
android:name="mozilla.components.feature.downloads.provider.FileProvider"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ abstract class AbstractFetchDownloadService : Service() {
intent.putExtra(EXTRA_DOWNLOAD_STATUS, getDownloadJobStatus(downloadState))
intent.putExtra(EXTRA_DOWNLOAD_ID, downloadState.state.id)

context.sendBroadcast(intent)
context.sendBroadcast(intent, "${context.packageName}.permission.RECEIVE_DOWNLOAD_BROADCAST")
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package mozilla.components.support.utils.ext

import android.annotation.SuppressLint
import android.content.ActivityNotFoundException
import android.content.BroadcastReceiver
import android.content.Context
Expand Down Expand Up @@ -61,6 +62,7 @@ fun Context.navigateToDefaultBrowserAppsSettings() {
* @return The first sticky intent found that matches [filter],
* or null if there are none.
*/
@SuppressLint("UnspecifiedRegisterReceiverFlag")
fun Context.registerReceiverCompat(
broadcastReceiver: BroadcastReceiver?,
filter: IntentFilter,
Expand Down

0 comments on commit 8ede68c

Please sign in to comment.