Skip to content
Snippets Groups Projects
Commit b4a01eec 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 0fbd0e0f
Branches
Tags
1 merge request!1505BB/TB 43416: Rebased onto 135.0a1
......@@ -500,6 +500,7 @@ class AddonManager(
val installedAddon = Addon.newFromWebExtension(ext, installedState)
addonUpdater.registerForFutureUpdates(installedAddon.id)
setAddonAllowedInPrivateBrowsing(installedAddon, true)
completePendingAddonAction(pendingAction)
onSuccess(installedAddon)
}
......
......@@ -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 }
}
......
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment