mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Notification settings. Dev task #76.
This commit is contained in:
@@ -43,11 +43,12 @@ public class AndroidPluginsModule extends AbstractModule {
|
||||
AndroidExecutor androidExecutor, Application app,
|
||||
CryptoComponent crypto, LocationUtils locationUtils,
|
||||
ShutdownManager shutdownManager) {
|
||||
Context ctx = app.getApplicationContext();
|
||||
Context appContext = app.getApplicationContext();
|
||||
DuplexPluginFactory droidtooth = new DroidtoothPluginFactory(
|
||||
pluginExecutor, androidExecutor, ctx, crypto.getSecureRandom());
|
||||
pluginExecutor, androidExecutor, appContext,
|
||||
crypto.getSecureRandom());
|
||||
DuplexPluginFactory tor = new TorPluginFactory(pluginExecutor,
|
||||
ctx, locationUtils, shutdownManager);
|
||||
appContext, locationUtils, shutdownManager);
|
||||
DuplexPluginFactory lan = new LanTcpPluginFactory(pluginExecutor);
|
||||
final Collection<DuplexPluginFactory> factories =
|
||||
Arrays.asList(droidtooth, tor, lan);
|
||||
|
||||
@@ -155,8 +155,7 @@ class DroidtoothPlugin implements DuplexPlugin {
|
||||
|
||||
private boolean enableBluetooth() {
|
||||
if(adapter.isEnabled()) return true;
|
||||
String enable = callback.getConfig().get("enable");
|
||||
if("false".equals(enable)) {
|
||||
if(!callback.getConfig().getBoolean("enable", true)) {
|
||||
if(LOG.isLoggable(INFO)) LOG.info("Not enabling Bluetooth");
|
||||
return false;
|
||||
}
|
||||
@@ -267,7 +266,7 @@ class DroidtoothPlugin implements DuplexPlugin {
|
||||
|
||||
public void poll(Collection<ContactId> connected) {
|
||||
if(!running) return;
|
||||
if(!enableBluetooth()) return;
|
||||
if(!adapter.isEnabled()) return;
|
||||
// Try to connect to known devices in parallel
|
||||
Map<ContactId, TransportProperties> remote =
|
||||
callback.getRemoteProperties();
|
||||
@@ -349,7 +348,7 @@ class DroidtoothPlugin implements DuplexPlugin {
|
||||
public DuplexTransportConnection createInvitationConnection(PseudoRandom r,
|
||||
long timeout) {
|
||||
if(!running) return null;
|
||||
if(!enableBluetooth()) return null;
|
||||
if(!adapter.isEnabled()) return null;
|
||||
// Use the invitation codes to generate the UUID
|
||||
byte[] b = r.nextBytes(UUID_BYTES);
|
||||
UUID uuid = UUID.nameUUIDFromBytes(b);
|
||||
|
||||
Reference in New Issue
Block a user