Skip to content
GitLab
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
Tor Browser
Commits
3c5aa7f8
Commit
3c5aa7f8
authored
Sep 14, 2020
by
Matthew Finkel
Browse files
Bug 40125: Expose Security Level pref in GeckoView
parent
47895669
Changes
2
Hide whitespace changes
Inline
Side-by-side
mobile/android/geckoview/api.txt
View file @
3c5aa7f8
...
...
@@ -641,6 +641,7 @@ package org.mozilla.geckoview {
method @Nullable public GeckoRuntime getRuntime();
method @Nullable public Rect getScreenSizeOverride();
method @Nullable public RuntimeTelemetry.Delegate getTelemetryDelegate();
method public int getTorSecurityLevel();
method public boolean getUseMaxScreenDepth();
method public boolean getWebFontsEnabled();
method public boolean getWebManifestEnabled();
...
...
@@ -659,6 +660,7 @@ package org.mozilla.geckoview {
method @NonNull public GeckoRuntimeSettings setLoginAutofillEnabled(boolean);
method @NonNull public GeckoRuntimeSettings setPreferredColorScheme(int);
method @NonNull public GeckoRuntimeSettings setRemoteDebuggingEnabled(boolean);
method @NonNull public GeckoRuntimeSettings setTorSecurityLevel(int);
method @NonNull public GeckoRuntimeSettings setWebFontsEnabled(boolean);
method @NonNull public GeckoRuntimeSettings setWebManifestEnabled(boolean);
field public static final int ALLOW_ALL = 0;
...
...
@@ -698,6 +700,7 @@ package org.mozilla.geckoview {
method @NonNull public GeckoRuntimeSettings.Builder remoteDebuggingEnabled(boolean);
method @NonNull public GeckoRuntimeSettings.Builder screenSizeOverride(int, int);
method @NonNull public GeckoRuntimeSettings.Builder telemetryDelegate(@NonNull RuntimeTelemetry.Delegate);
method @NonNull public GeckoRuntimeSettings.Builder torSecurityLevel(int);
method @NonNull public GeckoRuntimeSettings.Builder useMaxScreenDepth(boolean);
method @NonNull public GeckoRuntimeSettings.Builder webFontsEnabled(boolean);
method @NonNull public GeckoRuntimeSettings.Builder webManifest(boolean);
...
...
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
View file @
3c5aa7f8
...
...
@@ -458,6 +458,17 @@ public final class GeckoRuntimeSettings extends RuntimeSettings {
getSettings
().
setAllowInsecureConnections
(
level
);
return
this
;
}
/**
* Set security level.
*
* @param level A value determining the security level. Default is 0.
* @return This Builder instance.
*/
public
@NonNull
Builder
torSecurityLevel
(
final
int
level
)
{
getSettings
().
mTorSecurityLevel
.
set
(
level
);
return
this
;
}
}
private
GeckoRuntime
mRuntime
;
...
...
@@ -510,6 +521,8 @@ public final class GeckoRuntimeSettings extends RuntimeSettings {
"dom.security.https_only_mode"
,
false
);
/* package */
final
Pref
<
Boolean
>
mHttpsOnlyPrivateMode
=
new
Pref
<
Boolean
>(
"dom.security.https_only_mode_pbm"
,
false
);
/* package */
final
Pref
<
Integer
>
mTorSecurityLevel
=
new
Pref
<>(
"extensions.torbutton.security_slider"
,
4
);
/* package */
int
mPreferredColorScheme
=
COLOR_SCHEME_SYSTEM
;
...
...
@@ -1208,6 +1221,26 @@ public final class GeckoRuntimeSettings extends RuntimeSettings {
return
this
;
}
/**
* Gets the current security level.
*
* @return current security protection level
*/
public
int
getTorSecurityLevel
()
{
return
mTorSecurityLevel
.
get
();
}
/**
* Sets the Tor Security Level.
*
* @param level security protection level
* @return This GeckoRuntimeSettings instance.
*/
public
@NonNull
GeckoRuntimeSettings
setTorSecurityLevel
(
final
int
level
)
{
mTorSecurityLevel
.
commit
(
level
);
return
this
;
}
@Override
// Parcelable
public
void
writeToParcel
(
final
Parcel
out
,
final
int
flags
)
{
super
.
writeToParcel
(
out
,
flags
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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