Unverified Commit b3df7adb authored by Matthew Finkel's avatar Matthew Finkel
Browse files

Merge branch 'bug_40100_00' into tor-browser-82.1.1-10.0-1

parents 35e95977 636f214a
...@@ -160,8 +160,10 @@ open class FenixApplication : LocaleAwareApplication(), Provider { ...@@ -160,8 +160,10 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
runBlocking { megazordSetup.await(); } runBlocking { megazordSetup.await(); }
} }
// Give TAS the base Context GlobalScope.launch(Dispatchers.IO) {
Prefs.setContext(applicationContext) // Give TAS the base Context
Prefs.setContext(applicationContext)
}
} }
setupLeakCanary() setupLeakCanary()
......
...@@ -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