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 ...@@ -6,20 +6,24 @@ package org.mozilla.fenix.tor.bootstrap
import android.content.Context import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import android.os.StrictMode
import androidx.annotation.VisibleForTesting import androidx.annotation.VisibleForTesting
import mozilla.components.support.ktx.android.content.PreferencesHolder import mozilla.components.support.ktx.android.content.PreferencesHolder
import mozilla.components.support.ktx.android.content.booleanPreference import mozilla.components.support.ktx.android.content.booleanPreference
import org.mozilla.fenix.ext.resetPoliciesAfter
class TorQuickStart(context: Context) : PreferencesHolder { class TorQuickStart(context: Context) : PreferencesHolder {
override val preferences: SharedPreferences = context.getSharedPreferences( override val preferences: SharedPreferences = StrictMode.allowThreadDiskReads().resetPoliciesAfter {
PREF_NAME_TOR_BOOTSTRAP_KEY, context.getSharedPreferences(
Context.MODE_PRIVATE PREF_NAME_TOR_BOOTSTRAP_KEY,
) Context.MODE_PRIVATE
)
}
private var torQuickStart by booleanPreference(TOR_QUICK_START, default = false) private var torQuickStart by booleanPreference(TOR_QUICK_START, default = false)
fun quickStartTor() = torQuickStart fun quickStartTor() = StrictMode.allowThreadDiskReads().resetPoliciesAfter { torQuickStart }
fun enableQuickStartTor() { fun enableQuickStartTor() {
torQuickStart = true 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