Notification settings. Dev task #76.

This commit is contained in:
akwizgran
2014-03-10 18:00:36 +00:00
parent d151633a60
commit 4560cf17ff
11 changed files with 297 additions and 81 deletions

View File

@@ -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);