Unverified Commit 86094a92 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 06e3626e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ internal const val DEFAULT_READ_TIMEOUT_IN_SECONDS = 20L
 * cache is being used by default.
 * @property client A reference of [Client] for interacting with the AMO HTTP api.
 */
class AddonCollectionProvider(
open class AddonCollectionProvider(
    private val context: Context,
    private val client: Client,
    private val serverURL: String = DEFAULT_SERVER_URL,
@@ -143,7 +143,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(
@@ -161,7 +161,7 @@ class AddonCollectionProvider(
    }

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