mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 13:49:53 +01:00
Renamed a method and expanded the javadoc to be clear that it blocks.
This commit is contained in:
@@ -46,7 +46,7 @@ class AndroidExecutorImpl implements AndroidExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public <V> V run(Callable<V> c) throws InterruptedException,
|
public <V> V call(Callable<V> c) throws InterruptedException,
|
||||||
ExecutionException {
|
ExecutionException {
|
||||||
startIfNecessary();
|
startIfNecessary();
|
||||||
Future<V> f = new FutureTask<V>(c);
|
Future<V> f = new FutureTask<V>(c);
|
||||||
|
|||||||
@@ -9,8 +9,11 @@ import java.util.concurrent.ExecutionException;
|
|||||||
*/
|
*/
|
||||||
public interface AndroidExecutor {
|
public interface AndroidExecutor {
|
||||||
|
|
||||||
/** Runs the given task on a thread with a message queue. */
|
/**
|
||||||
<V> V run(Callable<V> c) throws InterruptedException, ExecutionException;
|
* Runs the given task on a thread with a message queue and returns the
|
||||||
|
* result of the task.
|
||||||
|
*/
|
||||||
|
<V> V call(Callable<V> c) throws InterruptedException, ExecutionException;
|
||||||
|
|
||||||
void shutdown();
|
void shutdown();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ class DroidtoothPlugin implements DuplexPlugin {
|
|||||||
// BluetoothAdapter.getDefaultAdapter() must be called on a thread
|
// BluetoothAdapter.getDefaultAdapter() must be called on a thread
|
||||||
// with a message queue, so submit it to the AndroidExecutor
|
// with a message queue, so submit it to the AndroidExecutor
|
||||||
try {
|
try {
|
||||||
adapter = androidExecutor.run(new Callable<BluetoothAdapter>() {
|
adapter = androidExecutor.call(new Callable<BluetoothAdapter>() {
|
||||||
public BluetoothAdapter call() throws Exception {
|
public BluetoothAdapter call() throws Exception {
|
||||||
return BluetoothAdapter.getDefaultAdapter();
|
return BluetoothAdapter.getDefaultAdapter();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user