From 2c9ce014a5113391e971093f277613af9d590db0 Mon Sep 17 00:00:00 2001 From: akwizgran Date: Fri, 26 Apr 2013 18:15:51 +0100 Subject: [PATCH] Renamed a method and expanded the javadoc to be clear that it blocks. --- .../src/net/sf/briar/android/AndroidExecutorImpl.java | 2 +- .../src/net/sf/briar/api/android/AndroidExecutor.java | 7 +++++-- .../net/sf/briar/plugins/droidtooth/DroidtoothPlugin.java | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/briar-android/src/net/sf/briar/android/AndroidExecutorImpl.java b/briar-android/src/net/sf/briar/android/AndroidExecutorImpl.java index 3cc4e2e20..79cf7db9c 100644 --- a/briar-android/src/net/sf/briar/android/AndroidExecutorImpl.java +++ b/briar-android/src/net/sf/briar/android/AndroidExecutorImpl.java @@ -46,7 +46,7 @@ class AndroidExecutorImpl implements AndroidExecutor { } } - public V run(Callable c) throws InterruptedException, + public V call(Callable c) throws InterruptedException, ExecutionException { startIfNecessary(); Future f = new FutureTask(c); diff --git a/briar-api/src/net/sf/briar/api/android/AndroidExecutor.java b/briar-api/src/net/sf/briar/api/android/AndroidExecutor.java index b950806aa..808c33785 100644 --- a/briar-api/src/net/sf/briar/api/android/AndroidExecutor.java +++ b/briar-api/src/net/sf/briar/api/android/AndroidExecutor.java @@ -9,8 +9,11 @@ import java.util.concurrent.ExecutionException; */ public interface AndroidExecutor { - /** Runs the given task on a thread with a message queue. */ - V run(Callable c) throws InterruptedException, ExecutionException; + /** + * Runs the given task on a thread with a message queue and returns the + * result of the task. + */ + V call(Callable c) throws InterruptedException, ExecutionException; void shutdown(); } diff --git a/briar-core/src/net/sf/briar/plugins/droidtooth/DroidtoothPlugin.java b/briar-core/src/net/sf/briar/plugins/droidtooth/DroidtoothPlugin.java index 5af3422c9..b8c93bbfe 100644 --- a/briar-core/src/net/sf/briar/plugins/droidtooth/DroidtoothPlugin.java +++ b/briar-core/src/net/sf/briar/plugins/droidtooth/DroidtoothPlugin.java @@ -99,7 +99,7 @@ class DroidtoothPlugin implements DuplexPlugin { // BluetoothAdapter.getDefaultAdapter() must be called on a thread // with a message queue, so submit it to the AndroidExecutor try { - adapter = androidExecutor.run(new Callable() { + adapter = androidExecutor.call(new Callable() { public BluetoothAdapter call() throws Exception { return BluetoothAdapter.getDefaultAdapter(); }