Raise minimum Java version to 6, upgrade H2. #24

This commit is contained in:
akwizgran
2015-12-02 14:59:51 +00:00
parent 2b12f0d438
commit 427efdc7d6
11 changed files with 27 additions and 33 deletions

View File

@@ -119,7 +119,7 @@ class DroidtoothPlugin implements DuplexPlugin {
Thread.currentThread().interrupt();
throw new IOException("Interrupted while getting BluetoothAdapter");
} catch (ExecutionException e) {
throw new IOException(e.toString());
throw new IOException(e);
}
if (adapter == null) {
LOG.info("Bluetooth is not supported");
@@ -156,13 +156,12 @@ class DroidtoothPlugin implements DuplexPlugin {
p.put("address", adapter.getAddress());
callback.mergeLocalProperties(p);
// Bind a server socket to accept connections from contacts
BluetoothServerSocket ss = null;
BluetoothServerSocket ss;
try {
ss = InsecureBluetooth.listen(adapter, "RFCOMM", getUuid());
} catch (IOException e) {
if (LOG.isLoggable(WARNING))
LOG.log(WARNING, e.toString(), e);
tryToClose(ss);
return;
}
if (!isRunning()) {
@@ -331,12 +330,11 @@ class DroidtoothPlugin implements DuplexPlugin {
UUID uuid = UUID.nameUUIDFromBytes(b);
if (LOG.isLoggable(INFO)) LOG.info("Invitation UUID " + uuid);
// Bind a server socket for receiving invitation connections
BluetoothServerSocket ss = null;
BluetoothServerSocket ss;
try {
ss = InsecureBluetooth.listen(adapter, "RFCOMM", uuid);
} catch (IOException e) {
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
tryToClose(ss);
return null;
}
// Start the background threads

View File

@@ -85,18 +85,18 @@ class InsecureBluetooth {
setCloseHandler.invoke(socket, mHandler, handle);
return socket;
} catch (NoSuchMethodException e) {
throw new IOException(e.toString());
throw new IOException(e);
} catch (NoSuchFieldException e) {
throw new IOException(e.toString());
throw new IOException(e);
} catch (IllegalAccessException e) {
throw new IOException(e.toString());
throw new IOException(e);
} catch (InstantiationException e) {
throw new IOException(e.toString());
throw new IOException(e);
} catch (InvocationTargetException e) {
if (e.getCause() instanceof IOException) {
throw (IOException) e.getCause();
} else {
throw new IOException(e.toString());
throw new IOException(e);
}
}
}
@@ -122,18 +122,18 @@ class InsecureBluetooth {
}
return socket;
} catch (NoSuchMethodException e) {
throw new IOException(e.toString());
throw new IOException(e);
} catch (NoSuchFieldException e) {
throw new IOException(e.toString());
throw new IOException(e);
} catch (IllegalAccessException e) {
throw new IOException(e.toString());
throw new IOException(e);
} catch (InstantiationException e) {
throw new IOException(e.toString());
throw new IOException(e);
} catch (InvocationTargetException e) {
if (e.getCause() instanceof IOException) {
throw (IOException) e.getCause();
} else {
throw new IOException(e.toString());
throw new IOException(e);
}
}
}
@@ -155,16 +155,16 @@ class InsecureBluetooth {
return constructor.newInstance(TYPE_RFCOMM, -1, false, true, device,
-1, new ParcelUuid(uuid));
} catch (NoSuchMethodException e) {
throw new IOException(e.toString());
throw new IOException(e);
} catch (IllegalAccessException e) {
throw new IOException(e.toString());
throw new IOException(e);
} catch (InstantiationException e) {
throw new IOException(e.toString());
throw new IOException(e);
} catch (InvocationTargetException e) {
if (e.getCause() instanceof IOException) {
throw (IOException) e.getCause();
} else {
throw new IOException(e.toString());
throw new IOException(e);
}
}
}