From ddaae1d941d0f1a565438f5ddea73e8be1497547 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 12 Jun 2015 14:54:04 -0400 Subject: [PATCH] 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. --- .../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 b1635f28..5707960c 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) {