Commit 310da6c1 authored by Arturo Mejia's avatar Arturo Mejia Committed by Sawyer Blatz
Browse files

No Issue: Add support for deleting individual tracking protection

exceptions on nightly.
parent f726b037
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -58,4 +58,9 @@ object FeatureFlags {
     * Enables the new language picker
     */
    val fenixLanguagePicker = Config.channel.isNightlyOrDebug

    /**
     * Enables deleting individual tracking protection exceptions.
     */
    val deleteIndividualTrackingProtectionExceptions = Config.channel.isNightlyOrDebug
}
+5 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ import mozilla.components.concept.engine.content.blocking.TrackingProtectionExce
import mozilla.components.feature.session.TrackingProtectionUseCases
import mozilla.components.lib.state.ext.consumeFrom
import org.mozilla.fenix.BrowserDirection
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.components.StoreProvider
@@ -76,8 +77,10 @@ class ExceptionsFragment : Fragment() {
    }

    private fun deleteOneItem(item: TrackingProtectionException) {
        // We can't currently delete one item in this Exceptions list with a URL with the GV API
        // See https://github.com/mozilla-mobile/android-components/issues/4699
        // This feature hasn't been uplifted yet.
        if (FeatureFlags.deleteIndividualTrackingProtectionExceptions) {
            trackingProtectionUseCases.removeAllExceptions()
        }
        Log.e("Remove one exception", "$item")
        reloadExceptions()
    }
+3 −0
Original line number Diff line number Diff line
@@ -5,9 +5,11 @@
package org.mozilla.fenix.exceptions.viewholders

import android.view.View
import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.exception_item.view.*
import mozilla.components.concept.engine.content.blocking.TrackingProtectionException
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.R
import org.mozilla.fenix.exceptions.ExceptionsInteractor
import org.mozilla.fenix.ext.components
@@ -38,6 +40,7 @@ class ExceptionsListItemViewHolder(
    fun bind(item: TrackingProtectionException) {
        this.item = item
        url.text = item.url
        deleteButton.isVisible = FeatureFlags.deleteIndividualTrackingProtectionExceptions
        updateFavIcon(item.url)
    }