[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-android-service/master] Bug 40003: Setup Tor in the main thread



commit 972188be3819b20a4ea73692d48d238c4fb69a83
Author: Matthew Finkel <Matthew.Finkel@xxxxxxxxx>
Date:   Thu Oct 15 02:50:59 2020 +0000

    Bug 40003: Setup Tor in the main thread
---
 .../main/java/org/torproject/android/service/TorService.java  | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/service/src/main/java/org/torproject/android/service/TorService.java b/service/src/main/java/org/torproject/android/service/TorService.java
index 971c2e9..f1ddcda 100644
--- a/service/src/main/java/org/torproject/android/service/TorService.java
+++ b/service/src/main/java/org/torproject/android/service/TorService.java
@@ -234,13 +234,10 @@ public final class TorService extends Service implements TorServiceConstants, Or
         mActionBroadcastReceiver = new ActionBroadcastReceiver();
         registerReceiver(mActionBroadcastReceiver, new IntentFilter(CMD_NEWNYM));
 
-        new Thread(new Runnable() {
-            public void run() {
-                if (setupTor()) {
-                    notifyIfConnectedToTorNetwork();
-                }
-            }
-        }).start();
+        if (setupTor()) {
+            mEventBroadcaster.broadcastNotice("Preparing Tor, please wait...");
+            notifyIfConnectedToTorNetwork();
+        }
 
         Log.i("TorService", "onCreate end");
     }



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits