Unverified Commit 636f214a authored by Matthew Finkel's avatar Matthew Finkel
Browse files

fixup! Bug 40028: Define bootstrapping events and Quick Start

Bug 40100: Resolve startup crashes in debug build
parent 5c08ba43
......@@ -6,20 +6,24 @@ package org.mozilla.fenix.tor.bootstrap
import android.content.Context
import android.content.SharedPreferences
import android.os.StrictMode
import androidx.annotation.VisibleForTesting
import mozilla.components.support.ktx.android.content.PreferencesHolder
import mozilla.components.support.ktx.android.content.booleanPreference
import org.mozilla.fenix.ext.resetPoliciesAfter
class TorQuickStart(context: Context) : PreferencesHolder {
override val preferences: SharedPreferences = context.getSharedPreferences(
PREF_NAME_TOR_BOOTSTRAP_KEY,
Context.MODE_PRIVATE
)
override val preferences: SharedPreferences = StrictMode.allowThreadDiskReads().resetPoliciesAfter {
context.getSharedPreferences(
PREF_NAME_TOR_BOOTSTRAP_KEY,
Context.MODE_PRIVATE
)
}
private var torQuickStart by booleanPreference(TOR_QUICK_START, default = false)
fun quickStartTor() = torQuickStart
fun quickStartTor() = StrictMode.allowThreadDiskReads().resetPoliciesAfter { torQuickStart }
fun enableQuickStartTor() {
torQuickStart = true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment