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.
This commit is contained in:
parent
232098eeaf
commit
ddaae1d941
|
@ -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
|
* Starts tor and related daemons by sending an
|
||||||
private void startTor () throws RemoteException
|
* {@link TorServiceConstants#ACTION_START} {@link Intent} to
|
||||||
{
|
* {@link TorService}
|
||||||
Log.i("OrbotMainActivity", "startTor");
|
*/
|
||||||
|
private void startTor() throws RemoteException {
|
||||||
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));
|
|
||||||
|
|
||||||
sendIntentToService(TorServiceConstants.ACTION_START);
|
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) {
|
public boolean onLongClick(View view) {
|
||||||
|
|
Loading…
Reference in New Issue