Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
fenix
Commits
be57d067
Unverified
Commit
be57d067
authored
Oct 14, 2020
by
Matthew Finkel
Browse files
fixup! Bug 40026: Integrate Security Level settings
Bug 40082: Use Security Level preference at startup
parent
268e56f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/org/mozilla/fenix/components/Core.kt
View file @
be57d067
...
...
@@ -92,7 +92,8 @@ class Core(private val context: Context, private val crashReporter: CrashReporti
fontInflationEnabled
=
context
.
settings
().
shouldUseAutoSize
,
suspendMediaWhenInactive
=
false
,
forceUserScalableContent
=
context
.
settings
().
forceEnableZoom
,
loginAutofillEnabled
=
context
.
settings
().
shouldAutofillLogins
loginAutofillEnabled
=
context
.
settings
().
shouldAutofillLogins
,
torSecurityLevel
=
context
.
settings
().
torSecurityLevel
().
intRepresentation
)
GeckoEngine
(
...
...
app/src/main/java/org/mozilla/fenix/utils/Settings.kt
View file @
be57d067
...
...
@@ -40,6 +40,7 @@ import org.mozilla.fenix.settings.deletebrowsingdata.DeleteBrowsingDataOnQuitTyp
import
org.mozilla.fenix.settings.logins.SavedLoginsSortingStrategyMenu
import
org.mozilla.fenix.settings.logins.SortingStrategy
import
org.mozilla.fenix.settings.registerOnSharedPreferenceChangeListener
import
org.mozilla.fenix.tor.SecurityLevel
import
java.security.InvalidParameterException
private
const
val
AUTOPLAY_USER_SETTING
=
"AUTOPLAY_USER_SETTING"
...
...
@@ -176,6 +177,33 @@ class Settings(private val appContext: Context) : PreferencesHolder {
true
)
var
standardSecurityLevel
by
booleanPreference
(
appContext
.
getPreferenceKey
(
SecurityLevel
.
STANDARD
.
preferenceKey
),
default
=
true
)
var
saferSecurityLevel
by
booleanPreference
(
appContext
.
getPreferenceKey
(
SecurityLevel
.
SAFER
.
preferenceKey
),
default
=
false
)
var
safestSecurityLevel
by
booleanPreference
(
appContext
.
getPreferenceKey
(
SecurityLevel
.
SAFEST
.
preferenceKey
),
default
=
false
)
// torSecurityLevel is defined as the first |true| preference,
// beginning at the safest level.
// If multiple preferences are true, then that is a bug and the
// highest |true| security level is chosen.
// Standard is the default level.
fun
torSecurityLevel
():
SecurityLevel
=
when
{
safestSecurityLevel
->
SecurityLevel
.
SAFEST
saferSecurityLevel
->
SecurityLevel
.
SAFER
standardSecurityLevel
->
SecurityLevel
.
STANDARD
else
->
SecurityLevel
.
STANDARD
}
// If any of the prefs have been modified, quit displaying the fenix moved tip
fun
shouldDisplayFenixMovingTip
():
Boolean
=
preferences
.
getBoolean
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment