|
|
|
@ -44,6 +44,7 @@ import org.mozilla.fenix.settings.logins.SavedLoginsSortingStrategyMenu
|
|
|
|
|
import org.mozilla.fenix.settings.logins.SortingStrategy
|
|
|
|
|
import org.mozilla.fenix.settings.registerOnSharedPreferenceChangeListener
|
|
|
|
|
import org.mozilla.fenix.settings.sitepermissions.AUTOPLAY_BLOCK_ALL
|
|
|
|
|
import org.mozilla.fenix.settings.sitepermissions.AUTOPLAY_BLOCK_AUDIBLE
|
|
|
|
|
import java.security.InvalidParameterException
|
|
|
|
|
|
|
|
|
|
private const val AUTOPLAY_USER_SETTING = "AUTOPLAY_USER_SETTING"
|
|
|
|
@ -814,7 +815,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
|
|
|
|
|
* either [AUTOPLAY_ALLOW_ALL] or [AUTOPLAY_BLOCK_ALL]. Because of this, we are forced to save
|
|
|
|
|
* the user selected setting as well.
|
|
|
|
|
*/
|
|
|
|
|
fun getAutoplayUserSetting() = preferences.getInt(AUTOPLAY_USER_SETTING, AUTOPLAY_BLOCK_ALL)
|
|
|
|
|
fun getAutoplayUserSetting() = preferences.getInt(AUTOPLAY_USER_SETTING, AUTOPLAY_BLOCK_AUDIBLE)
|
|
|
|
|
|
|
|
|
|
private fun getSitePermissionsPhoneFeatureAutoplayAction(
|
|
|
|
|
feature: PhoneFeature,
|
|
|
|
@ -834,8 +835,14 @@ class Settings(private val appContext: Context) : PreferencesHolder {
|
|
|
|
|
microphone = getSitePermissionsPhoneFeatureAction(PhoneFeature.MICROPHONE),
|
|
|
|
|
location = getSitePermissionsPhoneFeatureAction(PhoneFeature.LOCATION),
|
|
|
|
|
camera = getSitePermissionsPhoneFeatureAction(PhoneFeature.CAMERA),
|
|
|
|
|
autoplayAudible = getSitePermissionsPhoneFeatureAutoplayAction(PhoneFeature.AUTOPLAY_AUDIBLE),
|
|
|
|
|
autoplayInaudible = getSitePermissionsPhoneFeatureAutoplayAction(PhoneFeature.AUTOPLAY_INAUDIBLE),
|
|
|
|
|
autoplayAudible = getSitePermissionsPhoneFeatureAutoplayAction(
|
|
|
|
|
feature = PhoneFeature.AUTOPLAY_AUDIBLE,
|
|
|
|
|
default = AutoplayAction.ALLOWED
|
|
|
|
|
),
|
|
|
|
|
autoplayInaudible = getSitePermissionsPhoneFeatureAutoplayAction(
|
|
|
|
|
feature = PhoneFeature.AUTOPLAY_INAUDIBLE,
|
|
|
|
|
default = AutoplayAction.BLOCKED
|
|
|
|
|
),
|
|
|
|
|
persistentStorage = getSitePermissionsPhoneFeatureAction(PhoneFeature.PERSISTENT_STORAGE),
|
|
|
|
|
mediaKeySystemAccess = getSitePermissionsPhoneFeatureAction(PhoneFeature.MEDIA_KEY_SYSTEM_ACCESS)
|
|
|
|
|
)
|
|
|
|
|