Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fenix
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
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
The Tor Project
Applications
fenix
Commits
fc5c3aa6
Commit
fc5c3aa6
authored
Sep 28, 2020
by
Matthew Finkel
Browse files
Options
Downloads
Patches
Plain Diff
fixup! Bug 40028: Implement Tor connect and logger screens
parent
50a2e757
Branches
Branches containing commit
No related tags found
1 merge request
!26
Bug 40041 09
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/TorBootstrapLoggerViewHolder.kt
+8
-4
8 additions, 4 deletions
...essioncontrol/viewholders/TorBootstrapLoggerViewHolder.kt
with
8 additions
and
4 deletions
app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/TorBootstrapLoggerViewHolder.kt
+
8
−
4
View file @
fc5c3aa6
...
...
@@ -31,9 +31,9 @@ class TorBootstrapLoggerViewHolder(
filter
{
!(
it
.
first
!!
.
startsWith
(
"Circuit"
)
&&
it
.
second
==
"ON"
)
}.
// Keep synchronized with format in onTorStatusUpdate
flatMap
{
listOf
(
"(${it.second}) '${it.first}'"
)
}
val
entries
_l
en
=
currentEntries
.
size
val
subListOffset
=
if
(
entries
_l
en
>
24
)
24
else
entries
_l
en
entries
=
currentEntries
.
subList
((
entries
_l
en
-
subListOffset
),
entries
_l
en
)
as
MutableList
<
String
>
val
entries
L
en
=
currentEntries
.
size
val
subListOffset
=
if
(
entries
L
en
>
MAX_NEW_ENTRIES
)
MAX_NEW_ENTRIES
else
entries
L
en
entries
=
currentEntries
.
subList
((
entries
L
en
-
subListOffset
),
entries
L
en
)
as
MutableList
<
String
>
val
initLog
=
"---------------"
+
view
.
resources
.
getString
(
R
.
string
.
tor_initializing_log
)
+
"---------------"
entries
.
add
(
0
,
initLog
)
...
...
@@ -45,6 +45,7 @@ class TorBootstrapLoggerViewHolder(
private
fun
formatLogEntries
(
entries
:
List
<
String
>)
=
entries
.
joinToString
(
"\n"
)
@SuppressWarnings
(
"EmptyFunctionBlock"
)
override
fun
onTorConnecting
()
{
}
...
...
@@ -52,6 +53,7 @@ class TorBootstrapLoggerViewHolder(
components
.
torController
.
unregisterTorListener
(
this
)
}
@SuppressWarnings
(
"EmptyFunctionBlock"
)
override
fun
onTorStopped
()
{
}
...
...
@@ -59,7 +61,7 @@ class TorBootstrapLoggerViewHolder(
if
(
status
==
null
||
entry
==
null
)
return
if
(
status
==
"ON"
&&
entry
.
startsWith
(
"Circuit"
))
return
if
(
entries
.
size
>
25
)
{
if
(
entries
.
size
>
MAX_LINES
)
{
entries
=
entries
.
drop
(
1
)
as
MutableList
<
String
>
}
entries
.
add
(
"(${status}) '${entry}'"
)
...
...
@@ -69,5 +71,7 @@ class TorBootstrapLoggerViewHolder(
companion
object
{
const
val
LAYOUT_ID
=
R
.
layout
.
tor_bootstrap_logger
const
val
MAX_NEW_ENTRIES
=
24
const
val
MAX_LINES
=
25
}
}
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