summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Neil Fuller <nfuller@google.com> 2015-11-24 18:19:06 +0000
committer Neil Fuller <nfuller@google.com> 2016-01-15 16:26:26 +0000
commit2c9d40a06e261553bd9c0c9c6313475653a2c912 (patch)
treef32d82813c3e374c4903b140f53a57c98b4df630
parentb0d92f4717af4e4736dc80b2a822dae8e5a52587 (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 (cherry-picked from commit bf0dc0fba790cf95f76870c37469703f8f20a57c) Change-Id: I328b96328e89950b90d537bf0a6a704242de4993
-rw-r--r--core/java/android/bluetooth/BluetoothAdapter.java4
-rw-r--r--core/java/android/net/LocalSocket.java3
-rw-r--r--core/java/android/net/http/HttpResponseCache.java3
-rw-r--r--core/java/android/util/EventLog.java2
-rw-r--r--media/java/android/media/MediaMetadataEditor.java3
5 files changed, 10 insertions, 5 deletions
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index 1f3ff5148716..6b3e7ab4eeef 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -76,6 +76,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
@@ -84,7 +86,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();