parent
6e2ea0750e
commit
cbd811dcfb
|
@ -108,6 +108,7 @@
|
|||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<service android:name=".downloads.DownloadService" />
|
||||
<receiver
|
||||
android:name=".SearchWidgetProvider">
|
||||
<intent-filter>
|
||||
|
|
|
@ -37,6 +37,7 @@ import mozilla.components.browser.session.SessionManager
|
|||
import mozilla.components.feature.app.links.AppLinksFeature
|
||||
import mozilla.components.feature.contextmenu.ContextMenuFeature
|
||||
import mozilla.components.feature.downloads.DownloadsFeature
|
||||
import mozilla.components.feature.downloads.manager.FetchDownloadManager
|
||||
import mozilla.components.feature.intent.IntentProcessor
|
||||
import mozilla.components.feature.prompts.PromptFeature
|
||||
import mozilla.components.feature.readerview.ReaderViewFeature
|
||||
|
@ -74,6 +75,7 @@ import org.mozilla.fenix.components.toolbar.QuickActionSheetAction
|
|||
import org.mozilla.fenix.components.toolbar.QuickActionSheetState
|
||||
import org.mozilla.fenix.components.toolbar.ToolbarIntegration
|
||||
import org.mozilla.fenix.customtabs.CustomTabsIntegration
|
||||
import org.mozilla.fenix.downloads.DownloadService
|
||||
import org.mozilla.fenix.ext.components
|
||||
import org.mozilla.fenix.ext.enterToImmersiveMode
|
||||
import org.mozilla.fenix.ext.nav
|
||||
|
@ -271,10 +273,11 @@ class BrowserFragment : Fragment(), BackHandler {
|
|||
|
||||
downloadsFeature.set(
|
||||
feature = DownloadsFeature(
|
||||
requireContext(),
|
||||
requireContext().applicationContext,
|
||||
sessionManager = sessionManager,
|
||||
fragmentManager = childFragmentManager,
|
||||
sessionId = customTabSessionId,
|
||||
downloadManager = FetchDownloadManager(requireContext().applicationContext, DownloadService::class),
|
||||
onNeedToRequestPermissions = { permissions ->
|
||||
requestPermissions(permissions, REQUEST_CODE_DOWNLOAD_PERMISSIONS)
|
||||
}),
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package org.mozilla.fenix.downloads
|
||||
|
||||
import mozilla.components.feature.downloads.AbstractFetchDownloadService
|
||||
import org.mozilla.fenix.ext.components
|
||||
|
||||
class DownloadService : AbstractFetchDownloadService() {
|
||||
override val httpClient by lazy { components.core.client }
|
||||
}
|
Loading…
Reference in New Issue