Skip to content
Snippets Groups Projects
Commit 53f6f24d authored by akwizgran's avatar akwizgran
Browse files

Don't enable Bluetooth by default. #99

parent 8529c976
No related branches found
No related tags found
No related merge requests found
...@@ -217,7 +217,7 @@ OnClickListener { ...@@ -217,7 +217,7 @@ OnClickListener {
long duration = System.currentTimeMillis() - now; long duration = System.currentTimeMillis() - now;
if (LOG.isLoggable(INFO)) if (LOG.isLoggable(INFO))
LOG.info("Loading settings took " + duration + " ms"); LOG.info("Loading settings took " + duration + " ms");
bluetoothSetting = c.getBoolean("enable", true); bluetoothSetting = c.getBoolean("enable", false);
displaySettings(); displaySettings();
} catch (DbException e) { } catch (DbException e) {
if (LOG.isLoggable(WARNING)) if (LOG.isLoggable(WARNING))
...@@ -280,7 +280,6 @@ OnClickListener { ...@@ -280,7 +280,6 @@ OnClickListener {
} }
storeBluetoothSetting(); storeBluetoothSetting();
displaySettings(); displaySettings();
return;
} else if (view == notifyPrivateMessages) { } else if (view == notifyPrivateMessages) {
Settings s = new Settings(); Settings s = new Settings();
s.putBoolean("notifyPrivateMessages", s.putBoolean("notifyPrivateMessages",
......
...@@ -135,12 +135,14 @@ class DroidtoothPlugin implements DuplexPlugin { ...@@ -135,12 +135,14 @@ class DroidtoothPlugin implements DuplexPlugin {
// If Bluetooth is enabled, bind a socket - otherwise enable it // If Bluetooth is enabled, bind a socket - otherwise enable it
if (adapter.isEnabled()) { if (adapter.isEnabled()) {
bind(); bind();
} else if (callback.getConfig().getBoolean("enable", true)) {
wasDisabled = true;
if (adapter.enable()) LOG.info("Enabling Bluetooth");
else LOG.info("Could not enable Bluetooth");
} else { } else {
LOG.info("Not enabling Bluetooth"); wasDisabled = true;
if (callback.getConfig().getBoolean("enable", false)) {
if (adapter.enable()) LOG.info("Enabling Bluetooth");
else LOG.info("Could not enable Bluetooth");
} else {
LOG.info("Not enabling Bluetooth");
}
} }
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment