Skip to content
Snippets Groups Projects
Verified Commit d0a76a97 authored by Alex Catarineu's avatar Alex Catarineu Committed by Pier Angelo Vendrame
Browse files

[android] 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 fe81c7e6
Branches
Tags
1 merge request!1222Bug 43166: Rebased alpha onto 128.3.0esr
......@@ -494,6 +494,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 }
}
......
......
......@@ -53,6 +53,7 @@
tools:text="@string/mozac_feature_addons_installed_dialog_description_2" />
<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"
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment