parent
29522d29ed
commit
0a6881d470
|
@ -24,11 +24,6 @@ object FeatureFlags {
|
||||||
*/
|
*/
|
||||||
const val mediaIntegration = true
|
const val mediaIntegration = true
|
||||||
|
|
||||||
/**
|
|
||||||
* Gives option in Settings to disable auto play media
|
|
||||||
*/
|
|
||||||
val autoPlayMedia = Config.channel.isNightlyOrDebug
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows Progressive Web Apps to be installed to the device home screen.
|
* Allows Progressive Web Apps to be installed to the device home screen.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,7 +9,6 @@ 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,18 +35,6 @@ 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() {
|
||||||
|
|
|
@ -22,7 +22,6 @@ 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.browser.browsingmode.BrowsingMode
|
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
|
||||||
import org.mozilla.fenix.components.metrics.Event
|
import org.mozilla.fenix.components.metrics.Event
|
||||||
|
@ -128,10 +127,9 @@ 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 || !FeatureFlags.autoPlayMedia
|
) != Action.BLOCKED
|
||||||
|
|
||||||
private var trackingProtectionOnboardingShownThisSession = false
|
private var trackingProtectionOnboardingShownThisSession = false
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,7 @@
|
||||||
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"
|
||||||
|
|
Loading…
Reference in New Issue