[tor-commits] [Git][tpo/applications/fenix][tor-browser-82.1.1-10.0-1] 3 commits: fixup! Bug 40028: Integrate Tor Controller into HomeFragment

Matthew Finkel gitlab at torproject.org
Fri Oct 30 14:58:45 UTC 2020



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/35e959772b2ef0402443961d0bb4153affeae598...b3df7adbfe724c2a7c5b5446b4e2a225ae2ccb06

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/fenix/-/compare/35e959772b2ef0402443961d0bb4153affeae598...b3df7adbfe724c2a7c5b5446b4e2a225ae2ccb06
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-commits/attachments/20201030/a9db72bf/attachment-0001.htm>


More information about the tor-commits mailing list