Matthew Finkel pushed to branch tor-browser-82.1.1-10.0-1 at The Tor Project / Applications / fenix
Commits: 5c08ba43 by Matthew Finkel at 2020-10-27T23:12:50+00:00 fixup! Bug 40028: Integrate Tor Controller into HomeFragment
Bug 40100: Resolve startup crashes in debug build
- - - - - 636f214a by Matthew Finkel at 2020-10-29T19:53:19+00:00 fixup! Bug 40028: Define bootstrapping events and Quick Start
Bug 40100: Resolve startup crashes in debug build
- - - - - b3df7adb by Matthew Finkel at 2020-10-30T14:57:49+00:00 Merge branch 'bug_40100_00' into tor-browser-82.1.1-10.0-1
- - - - -
2 changed files:
- app/src/main/java/org/mozilla/fenix/FenixApplication.kt - app/src/main/java/org/mozilla/fenix/tor/bootstrap/TorQuickStart.kt
Changes:
===================================== app/src/main/java/org/mozilla/fenix/FenixApplication.kt ===================================== @@ -160,8 +160,10 @@ open class FenixApplication : LocaleAwareApplication(), Provider { runBlocking { megazordSetup.await(); } }
- // Give TAS the base Context - Prefs.setContext(applicationContext) + GlobalScope.launch(Dispatchers.IO) { + // Give TAS the base Context + Prefs.setContext(applicationContext) + } }
setupLeakCanary()
===================================== app/src/main/java/org/mozilla/fenix/tor/bootstrap/TorQuickStart.kt ===================================== @@ -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
View it on GitLab: https://gitlab.torproject.org/tpo/applications/fenix/-/compare/35e959772b2ef...
tor-commits@lists.torproject.org