commit bf3572eb82d888142fcc5002cf2364a533f07361 Author: Hans-Christoph Steiner hans@eds.org Date: Tue Jun 9 15:30:28 2015 -0400
use the same action string for local and broadcast status
No need to have separate action strings, using the LocalBroadcastManager enforces the local-only messaging, and Orbot does not claim the global broadcasts in any kind of receiver. --- src/org/torproject/android/OrbotMainActivity.java | 4 ++-- src/org/torproject/android/service/TorServiceConstants.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/org/torproject/android/OrbotMainActivity.java b/src/org/torproject/android/OrbotMainActivity.java index c540163..6eff421 100644 --- a/src/org/torproject/android/OrbotMainActivity.java +++ b/src/org/torproject/android/OrbotMainActivity.java @@ -109,7 +109,7 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon * info to this app */ LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(this); lbm.registerReceiver(mLocalBroadcastReceiver, - new IntentFilter(TorServiceConstants.LOCAL_ACTION_STATUS)); + new IntentFilter(TorServiceConstants.ACTION_STATUS)); lbm.registerReceiver(mLocalBroadcastReceiver, new IntentFilter(TorServiceConstants.LOCAL_ACTION_BANDWIDTH)); lbm.registerReceiver(mLocalBroadcastReceiver, @@ -161,7 +161,7 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon msg.getData().putLong("writeTotal", written); mStatusUpdateHandler.sendMessage(msg);
- } else if (action.equals(TorServiceConstants.LOCAL_ACTION_STATUS)) { + } else if (action.equals(TorServiceConstants.ACTION_STATUS)) { torStatus = intent.getStringExtra(TorServiceConstants.EXTRA_STATUS); updateStatus(""); } diff --git a/src/org/torproject/android/service/TorServiceConstants.java b/src/org/torproject/android/service/TorServiceConstants.java index a79b7d7..c2c326a 100644 --- a/src/org/torproject/android/service/TorServiceConstants.java +++ b/src/org/torproject/android/service/TorServiceConstants.java @@ -69,7 +69,7 @@ public interface TorServiceConstants {
public final static String ACTION_STATUS = "org.torproject.android.intent.action.STATUS"; public final static String EXTRA_STATUS = "org.torproject.android.intent.extra.STATUS"; - public final static String LOCAL_ACTION_STATUS = "status"; + public final static String LOCAL_ACTION_LOG = "log"; public final static String LOCAL_ACTION_BANDWIDTH = "bandwidth"; public final static String LOCAL_EXTRA_LOG = "log";
tor-commits@lists.torproject.org