[tbb-commits] [Git][tpo/applications/android-components][android-components-60.0.3-10.0-1] Bug 40016: Allow inheriting from AddonCollectionProvider

Matthew Finkel gitlab at torproject.org
Sat Oct 10 14:12:25 UTC 2020



Matthew Finkel pushed to branch android-components-60.0.3-10.0-1 at The Tor Project / Applications / android-components


Commits:
86094a92 by Alex Catarineu at 2020-10-10T14:11:59+00:00
Bug 40016: Allow inheriting from AddonCollectionProvider

This will allow implementing our own AddonsProvider in fenix.

- - - - -


1 changed file:

- components/feature/addons/src/main/java/mozilla/components/feature/addons/amo/AddonCollectionProvider.kt


Changes:

=====================================
components/feature/addons/src/main/java/mozilla/components/feature/addons/amo/AddonCollectionProvider.kt
=====================================
@@ -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 }
         }



View it on GitLab: https://gitlab.torproject.org/tpo/applications/android-components/-/commit/86094a926a304ddd76690f4263b1d7ee8b41e7be

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/android-components/-/commit/86094a926a304ddd76690f4263b1d7ee8b41e7be
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20201010/c096b31e/attachment-0001.htm>


More information about the tbb-commits mailing list