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

[tor-commits] [orbot/master] fix for bug 63



commit ad68947dd414d4217d7581fcfa987d1421d870fb
Author: arrase <arrase@xxxxxxxxx>
Date:   Thu Dec 8 16:12:29 2016 +0100

    fix for bug 63
---
 .../java/org/torproject/android/OrbotMainActivity.java   | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/app/src/main/java/org/torproject/android/OrbotMainActivity.java b/app/src/main/java/org/torproject/android/OrbotMainActivity.java
index 551fb6e..062db3d 100644
--- a/app/src/main/java/org/torproject/android/OrbotMainActivity.java
+++ b/app/src/main/java/org/torproject/android/OrbotMainActivity.java
@@ -103,9 +103,8 @@ public class OrbotMainActivity extends AppCompatActivity
 	private ActionBarDrawerToggle mDrawerToggle;
 	
     /* Some tracking bits */
-    private String torStatus = TorServiceConstants.STATUS_OFF; //latest status reported from the tor service
+    private String torStatus = null; //latest status reported from the tor service
     private Intent lastStatusIntent;  // the last ACTION_STATUS Intent received
-	private Boolean isFirstRun = true;
 
     private SharedPreferences mPrefs = null;
 
@@ -1199,8 +1198,12 @@ public class OrbotMainActivity extends AppCompatActivity
 				if (resultIntent == null)
 					resultIntent = new Intent(TorServiceConstants.ACTION_START);
 
-	            resultIntent.putExtra(TorServiceConstants.EXTRA_STATUS, torStatus);
-	            setResult(RESULT_OK, resultIntent);
+				resultIntent.putExtra(
+						TorServiceConstants.EXTRA_STATUS,
+						torStatus == null?TorServiceConstants.STATUS_OFF:torStatus
+				);
+
+				setResult(RESULT_OK, resultIntent);
                 finish();
                 Log.d(TAG, "autoStartFromIntent finish");
             }
@@ -1301,10 +1304,9 @@ public class OrbotMainActivity extends AppCompatActivity
         	
         	String newTorStatus = msg.getData().getString("status");
         	String log = (String)msg.obj;
-        	
-        	if (isFirstRun && newTorStatus != null) //first time status
+
+			if (torStatus == null && newTorStatus != null) //first time status
         	{
-				isFirstRun = false;
         		torStatus = newTorStatus;
         		findViewById(R.id.frameMain).setVisibility(View.VISIBLE);
         		updateStatus(log);



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