Commit 40b71286 authored by Dan Ballard's avatar Dan Ballard
Browse files

fixup! TB 40002: [android] Ensure system download manager is not used

TB 44054: Remove "open" button from download snackbar; second line defense for shouldShowAppDownloaderDialog
parent c222060e
Loading
Loading
Loading
Loading
Loading
+4 −1
Changes for mobile/android/android-components/components/feature/downloads/src/main/java/mozilla/components/feature/downloads/DownloadsFeature.kt: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ class DownloadsFeature(
    private val promptsStyling: PromptsStyling? = null,
    private val onDownloadStartedListener: ((String) -> Unit) = {},
    private val dismissCustomFirstPartyDownloadDialog: () -> Unit = {},
    private val shouldForwardToThirdParties: () -> Boolean = { false },
    private var shouldForwardToThirdParties: () -> Boolean = { false },
    private val customFirstPartyDownloadDialog: (
        (
        CurrentDownloadState,
@@ -173,6 +173,9 @@ class DownloadsFeature(

    init {
        this.onDownloadStopped = onDownloadStopped
        // TB#44054 adding second override along with tb#40002 adding `&& false` to caught instantiations
        // of this class, so that we still disable this when new instantiations are added
        this.shouldForwardToThirdParties = { false }
    }

    private var scope: CoroutineScope? = null
+1 −1
Changes for mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/AddonPopupBaseFragment.kt: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ abstract class AddonPopupBaseFragment :
                    PreferenceManager.getDefaultSharedPreferences(requireContext()).getBoolean(
                        requireContext().getPreferenceKey(R.string.pref_key_external_download_manager),
                        false,
                    )
                    ) && false
                },
                promptsStyling = DownloadsFeature.PromptsStyling(
                    gravity = Gravity.BOTTOM,
+1 −1
Changes for mobile/android/fenix/app/src/main/java/org/mozilla/fenix/snackbar/SnackbarBinding.kt: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -328,7 +328,7 @@ class SnackbarBinding(
                            subText = state.downloadState.fileName,
                            subTextOverflow = TextOverflow.MiddleEllipsis,
                            duration = context.components.settings.getSnackbarTimeout(hasAction = true).value.toInt(),
                            action = context.getString(R.string.download_completed_snackbar_action_open),
                            action = if (state.downloadState.isPdf) context.getString(R.string.download_completed_snackbar_action_open) else null,
                        ) {
                            val fileWasOpened = downloadFileUtils.openFile(
                                fileName = state.downloadState.fileName,