Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Tor Browser
Commits
c2340f2c
Commit
c2340f2c
authored
6 months ago
by
clairehurst
Committed by
Pier Angelo Vendrame
4 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fixup! TB 42247: Android helpers for the TorProvider
parent
76faa024
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1500
TB 43415: Rebased onto 134.0a1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/TorAndroidIntegration.java
+8
-12
8 additions, 12 deletions
...ain/java/org/mozilla/geckoview/TorAndroidIntegration.java
with
8 additions
and
12 deletions
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/TorAndroidIntegration.java
+
8
−
12
View file @
c2340f2c
...
...
@@ -10,6 +10,8 @@ import android.content.Context;
import
android.os.AsyncTask
;
import
android.util.Log
;
import
androidx.annotation.NonNull
;
import
androidx.lifecycle.LiveData
;
import
androidx.lifecycle.MutableLiveData
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.FileOutputStream
;
...
...
@@ -84,6 +86,9 @@ public class TorAndroidIntegration implements BundleEventListener {
private
int
mMeekCounter
;
private
final
MutableLiveData
<
TorConnectStage
>
_lastKnownStage
=
new
MutableLiveData
<>(
null
);
public
LiveData
<
TorConnectStage
>
lastKnowStage
=
_lastKnownStage
;
/**
* mSettings is a Java-side copy of the authoritative settings in the JS code. It's useful to
* maintain as the UI may be fetching these options often and we don't watch each fetch to be a
...
...
@@ -156,6 +161,7 @@ public class TorAndroidIntegration implements BundleEventListener {
}
}
else
if
(
EVENT_CONNECT_STAGE_CHANGED
.
equals
(
event
))
{
TorConnectStage
stage
=
new
TorConnectStage
(
message
.
getBundle
(
"stage"
));
_lastKnownStage
.
setValue
(
stage
);
for
(
BootstrapStateChangeListener
listener
:
mBootstrapStateListeners
)
{
listener
.
onBootstrapStageChange
(
stage
);
}
...
...
@@ -717,22 +723,12 @@ public class TorAndroidIntegration implements BundleEventListener {
}
public
interface
CountryNamesGetter
{
void
onValue
(
Map
<
String
,
String
>
regions
);
void
onValue
(
GeckoBundle
regions
);
}
public
void
countryNamesGet
(
CountryNamesGetter
countryNamesGetter
)
{
EventDispatcher
.
getInstance
().
queryBundle
(
EVENT_COUNTRY_NAMES_GET
).
then
(
countryNames
->
{
if
(
countryNames
!=
null
)
{
String
[]
codes
=
countryNames
.
keys
();
Map
<
String
,
String
>
regions
=
new
HashMap
<>(
codes
.
length
);
for
(
String
code
:
codes
)
{
regions
.
put
(
code
,
countryNames
.
getString
(
code
));
}
countryNamesGetter
.
onValue
(
regions
);
}
else
{
Log
.
e
(
TAG
,
"countryNames was null"
);
countryNamesGetter
.
onValue
(
null
);
}
countryNamesGetter
.
onValue
(
countryNames
);
return
new
GeckoResult
<
Void
>();
});
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
sign in
to comment