Commit a93e2fdc authored by Alex Catarineu's avatar Alex Catarineu Committed by Matthew Finkel
Browse files

Bug 40016: Allow inheriting from AddonCollectionProvider

This will allow implementing our own AddonsProvider in fenix.
parent 78be53f6
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ internal const val PAGE_SIZE = 50
 * cache is being used by default
 */
@Suppress("LongParameterList")
class AddonCollectionProvider(
open class AddonCollectionProvider(
    private val context: Context,
    private val client: Client,
    private val serverURL: String = DEFAULT_SERVER_URL,
@@ -156,7 +156,7 @@ class AddonCollectionProvider(
     * a connectivity problem or a timeout.
     */
    @Throws(IOException::class)
    suspend fun getAddonIconBitmap(addon: Addon): Bitmap? {
    open suspend fun getAddonIconBitmap(addon: Addon): Bitmap? {
        var bitmap: Bitmap? = null
        if (addon.iconUrl != "") {
            client.fetch(
@@ -174,7 +174,7 @@ class AddonCollectionProvider(
    }

    @VisibleForTesting
    internal fun writeToDiskCache(collectionResponse: String) {
    protected fun writeToDiskCache(collectionResponse: String) {
        synchronized(diskCacheLock) {
            getCacheFile(context).writeString { collectionResponse }
        }