Unverified Commit 0b4838c1 authored by Alex Catarineu's avatar Alex Catarineu Committed by boklm
Browse files

Modify Addon support

Bug 40011: Hide option for disallowing addons in private mode

Bug 40016: Allow inheriting from AddonCollectionProvider

This will allow implementing our own AddonsProvider in fenix.
parent 1661b6ef
......@@ -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,
......@@ -173,7 +173,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(
......@@ -191,7 +191,7 @@ class AddonCollectionProvider(
}
@VisibleForTesting
internal fun writeToDiskCache(collectionResponse: String, language: String?) {
protected fun writeToDiskCache(collectionResponse: String, language: String?) {
synchronized(diskCacheLock) {
getCacheFile(context, language, useFallbackFile = false).writeString { collectionResponse }
}
......
......@@ -63,6 +63,7 @@
/>
<androidx.appcompat.widget.AppCompatCheckBox
android:visibility="gone"
android:id="@+id/allow_in_private_browsing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
......@@ -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"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment