[tor-commits] [orbot/master] drive main screen UI updated entirely from TorService status updates

n8fr8 at torproject.org n8fr8 at torproject.org
Thu Jun 25 14:59:59 UTC 2015


commit ddaae1d941d0f1a565438f5ddea73e8be1497547
Author: Hans-Christoph Steiner <hans at eds.org>
Date:   Fri Jun 12 14:54:04 2015 -0400

    drive main screen UI updated entirely from TorService status updates
    
    Now that STATUS_STARTING is sent in TorService.onCreate(), the response
    time is snappy enough that we don't need hacks in OrbotMainActivity to
    show that long press happened.
---
 src/org/torproject/android/OrbotMainActivity.java |   24 ++++++---------------
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/src/org/torproject/android/OrbotMainActivity.java b/src/org/torproject/android/OrbotMainActivity.java
index b1635f2..5707960 100644
--- a/src/org/torproject/android/OrbotMainActivity.java
+++ b/src/org/torproject/android/OrbotMainActivity.java
@@ -1113,25 +1113,13 @@ public class OrbotMainActivity extends Activity
         }
     }
 
-  // guess what? this start's Tor! actually no it just requests via the local ITorService to the remote TorService instance
-  // to start Tor
-    private void startTor () throws RemoteException
-    {
-        Log.i("OrbotMainActivity", "startTor");
-				
-		mTxtOrbotLog.setText("");
-
-        //here we update the UI which is a bit sloppy and mixed up code wise
-        //might be best to just call updateStatus() instead of directly manipulating UI in this method - yep makes sense
-        imgStatus.setImageResource(R.drawable.torstarting);
-        lblStatus.setText(getString(R.string.status_starting_up));
-
+    /**
+     * Starts tor and related daemons by sending an
+     * {@link TorServiceConstants#ACTION_START} {@link Intent} to
+     * {@link TorService}
+     */
+    private void startTor() throws RemoteException {
         sendIntentToService(TorServiceConstants.ACTION_START);
-        
-        //we send a message here to the progressDialog i believe, but we can clarify that shortly
-        Message msg = mStatusUpdateHandler.obtainMessage(STATUS_UPDATE);
-        msg.obj = getString(R.string.status_starting_up);
-        mStatusUpdateHandler.sendMessage(msg);
     }
 
     public boolean onLongClick(View view) {





More information about the tor-commits mailing list