Commit a4f1fa1a authored by Alex Catarineu's avatar Alex Catarineu Committed by Pier Angelo Vendrame
Browse files

[android] Modify Addon support

android-components#40011: Hide option for disallowing addons in private mode

android-components#40016: Allow inheriting from AddonCollectionProvider

This will allow implementing our own AddonsProvider in fenix.
parent b2a5bfce
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -542,6 +542,7 @@ class AddonManager(
        val installedAddon = Addon.newFromWebExtension(ext, installedState)

        addonUpdater.registerForFutureUpdates(installedAddon.id)
        setAddonAllowedInPrivateBrowsing(installedAddon, true)
        completePendingAddonAction(pendingAction)
        onSuccess(installedAddon)
    }
+2 −2
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ internal const val PAGE_SIZE = 50
 * is being used by default
 * @property ioDispatcher Coroutine dispatcher for IO operations.
 */
class AMOAddonsProvider(
open class AMOAddonsProvider(
    private val context: Context,
    private val client: Client,
    private val serverURL: String = DEFAULT_SERVER_URL,
@@ -244,7 +244,7 @@ class AMOAddonsProvider(
    }

    @VisibleForTesting
    internal fun writeToDiskCache(collectionResponse: String, language: String?) {
    open fun writeToDiskCache(collectionResponse: String, language: String?) {
        synchronized(diskCacheLock) {
            getCacheFile(context, language, useFallbackFile = false).writeString { collectionResponse }
        }
+1 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@
                app:drawableStartCompat="@drawable/mozac_ic_permissions" />

        <androidx.appcompat.widget.SwitchCompat
            android:visibility="gone"
            android:id="@+id/allow_in_private_browsing_switch"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"