diff options
| author | 2015-11-24 18:19:06 +0000 | |
|---|---|---|
| committer | 2015-11-26 13:33:48 +0000 | |
| commit | bf0dc0fba790cf95f76870c37469703f8f20a57c (patch) | |
| tree | 85e107bd440377133319ea308c991b9ab442d959 | |
| parent | 764e7960cd31f12223ac6cfe72257e2fd50c7f81 (diff) | |
Add thread safety documentation
An upcoming change will remove "synchronized" from the API docs. This change
documents those cases where the guarantees can be determined from code
inspection.
Bug: 25767152
Change-Id: I75083ce01513ed315222304fe3f34190d40748cb
| -rw-r--r-- | core/java/android/bluetooth/BluetoothAdapter.java | 4 | ||||
| -rw-r--r-- | core/java/android/net/LocalSocket.java | 3 | ||||
| -rw-r--r-- | core/java/android/net/http/HttpResponseCache.java | 3 | ||||
| -rw-r--r-- | core/java/android/util/EventLog.java | 2 | ||||
| -rw-r--r-- | media/java/android/media/MediaMetadataEditor.java | 3 |
5 files changed, 10 insertions, 5 deletions
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index 2d825fa62791..3e8a51e47c9d 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -74,6 +74,8 @@ import java.util.UUID; * {@link #listenUsingRfcommWithServiceRecord(String,UUID)}; or start a scan for * Bluetooth LE devices with {@link #startLeScan(LeScanCallback callback)}. * + * <p>This class is thread safe. + * * <p class="note"><strong>Note:</strong> * Most methods require the {@link android.Manifest.permission#BLUETOOTH} * permission and some also require the @@ -82,7 +84,7 @@ import java.util.UUID; * <div class="special reference"> * <h3>Developer Guides</h3> * <p>For more information about using Bluetooth, read the - * <a href="{@docRoot}guide/topics/wireless/bluetooth.html">Bluetooth</a> developer guide.</p> + * <a href="{@docRoot}guide/topics/wireless/bluetooth.html">Bluetooth</a> developer guide. * </div> * * {@see BluetoothDevice} diff --git a/core/java/android/net/LocalSocket.java b/core/java/android/net/LocalSocket.java index a374a869d13b..e14facb1abb5 100644 --- a/core/java/android/net/LocalSocket.java +++ b/core/java/android/net/LocalSocket.java @@ -25,7 +25,8 @@ import java.net.SocketOptions; /** * Creates a (non-server) socket in the UNIX-domain namespace. The interface - * here is not entirely unlike that of java.net.Socket + * here is not entirely unlike that of java.net.Socket. This class and the streams + * returned from it may be used from multiple threads. */ public class LocalSocket implements Closeable { diff --git a/core/java/android/net/http/HttpResponseCache.java b/core/java/android/net/http/HttpResponseCache.java index 188287f5b5db..729aff0ce278 100644 --- a/core/java/android/net/http/HttpResponseCache.java +++ b/core/java/android/net/http/HttpResponseCache.java @@ -36,7 +36,8 @@ import java.util.Map; * saving time and bandwidth. This class supports {@link * java.net.HttpURLConnection} and {@link javax.net.ssl.HttpsURLConnection}; * there is no platform-provided cache for {@code DefaultHttpClient} or - * {@code AndroidHttpClient}. + * {@code AndroidHttpClient}. Installation and instances are thread + * safe. * * <h3>Installing an HTTP response cache</h3> * Enable caching of all of your application's HTTP requests by installing the diff --git a/core/java/android/util/EventLog.java b/core/java/android/util/EventLog.java index 558b8f558236..6bda83d2b315 100644 --- a/core/java/android/util/EventLog.java +++ b/core/java/android/util/EventLog.java @@ -52,7 +52,7 @@ public class EventLog { private static HashMap<String, Integer> sTagCodes = null; private static HashMap<Integer, String> sTagNames = null; - /** A previously logged event read from the logs. */ + /** A previously logged event read from the logs. Instances are thread safe. */ public static final class Event { private final ByteBuffer mBuffer; diff --git a/media/java/android/media/MediaMetadataEditor.java b/media/java/android/media/MediaMetadataEditor.java index 566b93f7c2e9..877c8729543e 100644 --- a/media/java/android/media/MediaMetadataEditor.java +++ b/media/java/android/media/MediaMetadataEditor.java @@ -73,7 +73,8 @@ import android.util.SparseIntArray; /** * Applies all of the metadata changes that have been set since the MediaMetadataEditor instance - * was created or since {@link #clear()} was called. + * was created or since {@link #clear()} was called. Subclasses should synchronize on + * {@code this} for thread safety. */ public abstract void apply(); |