Skip to content
Snippets Groups Projects
Commit 57746147 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 4a0b3ca3
Branches
Tags
1 merge request!1500TB 43415: Rebased onto 134.0a1
......@@ -495,6 +495,7 @@ class AddonManager(
val installedAddon = Addon.newFromWebExtension(ext, installedState)
addonUpdater.registerForFutureUpdates(installedAddon.id)
setAddonAllowedInPrivateBrowsing(installedAddon, true)
completePendingAddonAction(pendingAction)
onSuccess(installedAddon)
}
......
......@@ -63,7 +63,7 @@ internal const val PAGE_SIZE = 50
* should remain valid before a refresh is attempted. Defaults to -1, meaning no cache
* is being used by default
*/
class AMOAddonsProvider(
open class AMOAddonsProvider(
private val context: Context,
private val client: Client,
private val serverURL: String = DEFAULT_SERVER_URL,
......@@ -237,7 +237,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