Call Thread.currentThread().interrupt() when handling interruption.

This commit is contained in:
akwizgran
2014-03-12 21:11:11 +00:00
parent b99a503f24
commit b270f0e8b1
7 changed files with 16 additions and 2 deletions

View File

@@ -110,7 +110,8 @@ class DroidtoothPlugin implements DuplexPlugin {
}
});
} catch(InterruptedException e) {
throw new IOException(e.toString());
Thread.currentThread().interrupt();
throw new IOException("Interrupted while getting BluetoothAdapter");
} catch(ExecutionException e) {
throw new IOException(e.toString());
}
@@ -427,6 +428,7 @@ class DroidtoothPlugin implements DuplexPlugin {
addresses = discoverDevices(end - now);
} catch(InterruptedException e) {
LOG.warning("Interrupted while discovering devices");
Thread.currentThread().interrupt();
return;
}
// Connect to any device with the right UUID