mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Call Thread.currentThread().interrupt() when handling interruption.
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.FutureTask;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -19,6 +20,9 @@ class AndroidExecutorImpl implements AndroidExecutor {
|
||||
|
||||
private static final int SHUTDOWN = 0, RUN = 1;
|
||||
|
||||
private static final Logger LOG =
|
||||
Logger.getLogger(AndroidExecutorImpl.class.getName());
|
||||
|
||||
private final Runnable loop;
|
||||
private final AtomicBoolean started = new AtomicBoolean(false);
|
||||
private final CountDownLatch startLatch = new CountDownLatch(1);
|
||||
@@ -43,6 +47,7 @@ class AndroidExecutorImpl implements AndroidExecutor {
|
||||
try {
|
||||
startLatch.await();
|
||||
} catch(InterruptedException e) {
|
||||
LOG.warning("Interrupted while starting executor thread");
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,6 +92,7 @@ public class BriarActivity extends RoboFragmentActivity {
|
||||
service.waitForShutdown();
|
||||
} catch(InterruptedException e) {
|
||||
LOG.warning("Interrupted while waiting for service");
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
finishAndExit();
|
||||
}
|
||||
|
||||
@@ -261,7 +261,8 @@ public class TestingActivity extends BriarActivity implements OnClickListener {
|
||||
}
|
||||
});
|
||||
} catch(InterruptedException e) {
|
||||
if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
LOG.warning("Interrupted while getting BluetoothAdapter");
|
||||
Thread.currentThread().interrupt();
|
||||
} catch(ExecutionException e) {
|
||||
if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user