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
16d3112e
Commit
16d3112e
authored
Oct 18, 2020
by
Alex Catarineu
Committed by
Matthew Finkel
May 04, 2021
Browse files
Bug 40198: Expose privacy.spoof_english pref in GeckoView
parent
45bb9d2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
mobile/android/geckoview/api.txt
View file @
16d3112e
...
...
@@ -644,6 +644,7 @@ package org.mozilla.geckoview {
method public boolean getRemoteDebuggingEnabled();
method @Nullable public GeckoRuntime getRuntime();
method @Nullable public Rect getScreenSizeOverride();
method public boolean getSpoofEnglish();
method @Nullable public RuntimeTelemetry.Delegate getTelemetryDelegate();
method public int getTorSecurityLevel();
method public boolean getUseMaxScreenDepth();
...
...
@@ -664,6 +665,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 setSpoofEnglish(boolean);
method @NonNull public GeckoRuntimeSettings setTorSecurityLevel(int);
method @NonNull public GeckoRuntimeSettings setWebFontsEnabled(boolean);
method @NonNull public GeckoRuntimeSettings setWebManifestEnabled(boolean);
...
...
@@ -703,6 +705,7 @@ package org.mozilla.geckoview {
method @NonNull public GeckoRuntimeSettings.Builder preferredColorScheme(int);
method @NonNull public GeckoRuntimeSettings.Builder remoteDebuggingEnabled(boolean);
method @NonNull public GeckoRuntimeSettings.Builder screenSizeOverride(int, int);
method @NonNull public GeckoRuntimeSettings.Builder spoofEnglish(boolean);
method @NonNull public GeckoRuntimeSettings.Builder telemetryDelegate(@NonNull RuntimeTelemetry.Delegate);
method @NonNull public GeckoRuntimeSettings.Builder torSecurityLevel(int);
method @NonNull public GeckoRuntimeSettings.Builder useMaxScreenDepth(boolean);
...
...
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
View file @
16d3112e
...
...
@@ -469,6 +469,17 @@ public final class GeckoRuntimeSettings extends RuntimeSettings {
getSettings
().
mTorSecurityLevel
.
set
(
level
);
return
this
;
}
/**
* Sets whether we should spoof locale to English for webpages.
*
* @param flag True if we should spoof locale to English for webpages, false otherwise.
* @return This Builder instance.
*/
public
@NonNull
Builder
spoofEnglish
(
final
boolean
flag
)
{
getSettings
().
mSpoofEnglish
.
set
(
flag
?
2
:
1
);
return
this
;
}
}
private
GeckoRuntime
mRuntime
;
...
...
@@ -523,6 +534,8 @@ public final class GeckoRuntimeSettings extends RuntimeSettings {
"dom.security.https_only_mode_pbm"
,
false
);
/* package */
final
Pref
<
Integer
>
mTorSecurityLevel
=
new
Pref
<>(
"extensions.torbutton.security_slider"
,
4
);
/* package */
final
Pref
<
Integer
>
mSpoofEnglish
=
new
Pref
<>(
"privacy.spoof_english"
,
0
);
/* package */
int
mPreferredColorScheme
=
COLOR_SCHEME_SYSTEM
;
...
...
@@ -1247,6 +1260,26 @@ public final class GeckoRuntimeSettings extends RuntimeSettings {
return
this
;
}
/**
* Get whether we should spoof locale to English for webpages.
*
* @return Whether we should spoof locale to English for webpages.
*/
public
boolean
getSpoofEnglish
()
{
return
mSpoofEnglish
.
get
()
==
2
;
}
/**
* Set whether we should spoof locale to English for webpages.
*
* @param flag A flag determining whether we should locale to English for webpages.
* @return This GeckoRuntimeSettings instance.
*/
public
@NonNull
GeckoRuntimeSettings
setSpoofEnglish
(
final
boolean
flag
)
{
mSpoofEnglish
.
commit
(
flag
?
2
:
1
);
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