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
75a4a6da
Commit
75a4a6da
authored
Sep 9, 2020
by
Matthew Finkel
Browse files
Options
Downloads
Patches
Plain Diff
Bug 40028: Define bootstrapping events and Quick Start
parent
5eb6eb90
Branches
Branches containing commit
No related tags found
1 merge request
!39
Bug 40050 01
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/org/mozilla/fenix/tor/bootstrap/TorQuickStart.kt
+48
-0
48 additions, 0 deletions
...ain/java/org/mozilla/fenix/tor/bootstrap/TorQuickStart.kt
with
48 additions
and
0 deletions
app/src/main/java/org/mozilla/fenix/tor/bootstrap/TorQuickStart.kt
0 → 100644
+
48
−
0
View file @
75a4a6da
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package
org.mozilla.fenix.tor.bootstrap
import
android.content.Context
import
android.content.SharedPreferences
import
androidx.annotation.VisibleForTesting
import
mozilla.components.support.ktx.android.content.PreferencesHolder
import
mozilla.components.support.ktx.android.content.booleanPreference
class
TorQuickStart
(
context
:
Context
)
:
PreferencesHolder
{
override
val
preferences
:
SharedPreferences
=
context
.
getSharedPreferences
(
PREF_NAME_TOR_BOOTSTRAP_KEY
,
Context
.
MODE_PRIVATE
)
private
var
torQuickStart
by
booleanPreference
(
TOR_QUICK_START
,
default
=
false
)
fun
quickStartTor
()
=
torQuickStart
fun
enableQuickStartTor
()
{
torQuickStart
=
true
}
fun
disableQuickStartTor
()
{
torQuickStart
=
false
}
fun
setQuickStartTor
(
enabled
:
Boolean
)
=
if
(
enabled
)
{
enableQuickStartTor
()
}
else
{
disableQuickStartTor
()
}
companion
object
{
/**
* Name of the shared preferences file.
*/
private
const
val
PREF_NAME_TOR_BOOTSTRAP_KEY
=
"tor.bootstrap"
/**
* Key for [quickStartTor].
*/
@VisibleForTesting
internal
const
val
TOR_QUICK_START
=
"tor.bootstrap.quick_start_enabled"
}
}
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