broadcast Tor state to any app that might want to know

In order for apps to follow the current state of Tor, this broadcasts the
state both locally, since global broadcasts are insecure, and globally, for
any app to receive.  The internal workings of Orbot need to use a local
broadcast, otherwise any app could trigger stop, start, etc or DoS in other
ways.
This commit is contained in:
Hans-Christoph Steiner 2015-06-09 13:34:14 -04:00
parent 3580cbe05d
commit 4d8a9dab27
1 changed files with 3 additions and 0 deletions

View File

@ -1882,7 +1882,10 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
Intent intent = new Intent(ACTION_STATUS); Intent intent = new Intent(ACTION_STATUS);
intent.putExtra(EXTRA_STATUS, currentStatus); intent.putExtra(EXTRA_STATUS, currentStatus);
// send for Orbot internals, using secure local broadcast
LocalBroadcastManager.getInstance(this).sendBroadcast(intent); LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
// send for any apps that are interested
sendBroadcast(intent);
} }
/* /*