parent
9729fd494e
commit
c8af16bd47
|
@ -55,4 +55,9 @@ object FeatureFlags {
|
||||||
* Gives option in Settings to Delete Browsing Data on new menu option Quit
|
* Gives option in Settings to Delete Browsing Data on new menu option Quit
|
||||||
*/
|
*/
|
||||||
val deleteDataOnQuit = nightly or debug
|
val deleteDataOnQuit = nightly or debug
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gives option in Settings to disable auto play media
|
||||||
|
*/
|
||||||
|
val autoPlayMedia = nightly or debug
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import androidx.navigation.Navigation
|
||||||
import androidx.preference.Preference
|
import androidx.preference.Preference
|
||||||
import androidx.preference.Preference.OnPreferenceClickListener
|
import androidx.preference.Preference.OnPreferenceClickListener
|
||||||
import androidx.preference.PreferenceFragmentCompat
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
|
import org.mozilla.fenix.FeatureFlags
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.ext.getPreferenceKey
|
import org.mozilla.fenix.ext.getPreferenceKey
|
||||||
import org.mozilla.fenix.ext.settings
|
import org.mozilla.fenix.ext.settings
|
||||||
|
@ -36,6 +37,18 @@ class SitePermissionsFragment : PreferenceFragmentCompat() {
|
||||||
private fun setupPreferences() {
|
private fun setupPreferences() {
|
||||||
bindCategoryPhoneFeatures()
|
bindCategoryPhoneFeatures()
|
||||||
bindExceptions()
|
bindExceptions()
|
||||||
|
|
||||||
|
if (FeatureFlags.autoPlayMedia) {
|
||||||
|
displayAutoplayPreference()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun displayAutoplayPreference() {
|
||||||
|
findPreference<Preference>(
|
||||||
|
getPreferenceKey(R.string.pref_key_browser_feature_autoplay)
|
||||||
|
)?.apply {
|
||||||
|
isVisible = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun bindExceptions() {
|
private fun bindExceptions() {
|
||||||
|
|
|
@ -20,6 +20,7 @@ import mozilla.components.support.ktx.android.content.longPreference
|
||||||
import mozilla.components.support.ktx.android.content.stringPreference
|
import mozilla.components.support.ktx.android.content.stringPreference
|
||||||
import org.mozilla.fenix.BuildConfig
|
import org.mozilla.fenix.BuildConfig
|
||||||
import org.mozilla.fenix.Config
|
import org.mozilla.fenix.Config
|
||||||
|
import org.mozilla.fenix.FeatureFlags
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.components.metrics.MozillaProductDetector
|
import org.mozilla.fenix.components.metrics.MozillaProductDetector
|
||||||
import org.mozilla.fenix.ext.getPreferenceKey
|
import org.mozilla.fenix.ext.getPreferenceKey
|
||||||
|
@ -118,9 +119,10 @@ class Settings private constructor(
|
||||||
default = true
|
default = true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// If autoPlayMedia is flagged OFF, default to true here
|
||||||
val isAutoPlayEnabled = getSitePermissionsPhoneFeatureAction(
|
val isAutoPlayEnabled = getSitePermissionsPhoneFeatureAction(
|
||||||
PhoneFeature.AUTOPLAY, Action.BLOCKED
|
PhoneFeature.AUTOPLAY, Action.BLOCKED
|
||||||
) != Action.BLOCKED
|
) != Action.BLOCKED || !FeatureFlags.autoPlayMedia
|
||||||
|
|
||||||
private var trackingProtectionOnboardingShownThisSession = false
|
private var trackingProtectionOnboardingShownThisSession = false
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
android:icon="@drawable/ic_autoplay_enabled"
|
android:icon="@drawable/ic_autoplay_enabled"
|
||||||
android:key="@string/pref_key_browser_feature_autoplay"
|
android:key="@string/pref_key_browser_feature_autoplay"
|
||||||
android:title="@string/preference_browser_feature_autoplay"
|
android:title="@string/preference_browser_feature_autoplay"
|
||||||
android:summary="@string/preference_option_autoplay_blocked"/>
|
android:summary="@string/preference_option_autoplay_blocked"
|
||||||
|
app:isPreferenceVisible="false"/>
|
||||||
|
|
||||||
<androidx.preference.Preference
|
<androidx.preference.Preference
|
||||||
android:icon="@drawable/ic_camera_enabled"
|
android:icon="@drawable/ic_camera_enabled"
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue