summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorMatthew Xie <mattx@google.com>2013-05-29 10:19:06 -0700
committerMatthew Xie <mattx@google.com>2013-05-30 11:42:26 -0700
commitb30f91e38c19f6728d836293446d4b9c76705e7f (patch)
treea714ee413d9c440c0fb46b104d680d9da6d82537 /core/java/android
parent27e453617a2c179580a55d6cbe0619fa95adf693 (diff)
downloadframeworks_base-b30f91e38c19f6728d836293446d4b9c76705e7f.zip
frameworks_base-b30f91e38c19f6728d836293446d4b9c76705e7f.tar.gz
frameworks_base-b30f91e38c19f6728d836293446d4b9c76705e7f.tar.bz2
Update javadoc to give app write better guidence
Update javadoc of close methods of GATT cliet and server Update javadoc of BluetoothAdapter bug 8963528 Change-Id: I45ec618fd495225ed11a6171f33bfdc218397d4c
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/bluetooth/BluetoothAdapter.java11
-rw-r--r--core/java/android/bluetooth/BluetoothDevice.java2
-rw-r--r--core/java/android/bluetooth/BluetoothGatt.java3
-rw-r--r--core/java/android/bluetooth/BluetoothGattCallback.java3
-rw-r--r--core/java/android/bluetooth/BluetoothGattServer.java3
5 files changed, 18 insertions, 4 deletions
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index 7ec73ef..79bb476 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -47,17 +47,22 @@ import java.util.UUID;
* device discovery, query a list of bonded (paired) devices,
* instantiate a {@link BluetoothDevice} using a known MAC address, and create
* a {@link BluetoothServerSocket} to listen for connection requests from other
- * devices.
+ * devices, and start a scan for Bluetooth LE devices.
*
* <p>To get a {@link BluetoothAdapter} representing the local Bluetooth
- * adapter, call the static {@link #getDefaultAdapter} method.
+ * adapter, when running on JELLY_BEAN_MR1 and below, call the
+ * static {@link #getDefaultAdapter} method; when running on JELLY_BEAN_MR2 and
+ * higher, retrieve it through
+ * {@link android.content.Context#getSystemService} with
+ * {@link android.content.Context#BLUETOOTH_SERVICE}.
* Fundamentally, this is your starting point for all
* Bluetooth actions. Once you have the local adapter, you can get a set of
* {@link BluetoothDevice} objects representing all paired devices with
* {@link #getBondedDevices()}; start device discovery with
* {@link #startDiscovery()}; or create a {@link BluetoothServerSocket} to
* listen for incoming connection requests with
- * {@link #listenUsingRfcommWithServiceRecord(String,UUID)}.
+ * {@link #listenUsingRfcommWithServiceRecord(String,UUID)}; or start a scan for
+ * Bluetooth LE devices with {@link #startLeScan(LeScanCallback callback)}.
*
* <p class="note"><strong>Note:</strong>
* Most methods require the {@link android.Manifest.permission#BLUETOOTH}
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java
index 79a5ffe..3ee7142 100644
--- a/core/java/android/bluetooth/BluetoothDevice.java
+++ b/core/java/android/bluetooth/BluetoothDevice.java
@@ -107,7 +107,7 @@ public final class BluetoothDevice implements Parcelable {
* <p>Always contains the extra fields {@link #EXTRA_DEVICE} and {@link
* #EXTRA_CLASS}.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive.
- * @see {@link BluetoothClass}
+ * {@see BluetoothClass}
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_CLASS_CHANGED =
diff --git a/core/java/android/bluetooth/BluetoothGatt.java b/core/java/android/bluetooth/BluetoothGatt.java
index bffe64b..69dc4e2 100644
--- a/core/java/android/bluetooth/BluetoothGatt.java
+++ b/core/java/android/bluetooth/BluetoothGatt.java
@@ -565,6 +565,9 @@ public final class BluetoothGatt implements BluetoothProfile {
/**
* Close this Bluetooth GATT client.
+ *
+ * Application should call this method as early as possible after it is done with
+ * this GATT client.
*/
public void close() {
if (DBG) Log.d(TAG, "close()");
diff --git a/core/java/android/bluetooth/BluetoothGattCallback.java b/core/java/android/bluetooth/BluetoothGattCallback.java
index 2259c1e..80ea4a6 100644
--- a/core/java/android/bluetooth/BluetoothGattCallback.java
+++ b/core/java/android/bluetooth/BluetoothGattCallback.java
@@ -27,6 +27,7 @@ public abstract class BluetoothGattCallback {
*
* @param gatt GATT client
* @param status Status of the connect or disconnect operation.
+ * {@link BluetoothGatt#GATT_SUCCESS} if the operation succeeds.
* @param newState Returns the new connection state. Can be one of
* {@link BluetoothProfile#STATE_DISCONNECTED} or
* {@link BluetoothProfile#STATE_CONNECTED}
@@ -72,6 +73,7 @@ public abstract class BluetoothGattCallback {
* @param characteristic Characteristic that was written to the associated
* remote device.
* @param status The result of the write operation
+ * {@link BluetoothGatt#GATT_SUCCESS} if the operation succeeds.
*/
public void onCharacteristicWrite(BluetoothGatt gatt,
BluetoothGattCharacteristic characteristic, int status) {
@@ -108,6 +110,7 @@ public abstract class BluetoothGattCallback {
* @param descriptor Descriptor that was writte to the associated
* remote device.
* @param status The result of the write operation
+ * {@link BluetoothGatt#GATT_SUCCESS} if the operation succeeds.
*/
public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor,
int status) {
diff --git a/core/java/android/bluetooth/BluetoothGattServer.java b/core/java/android/bluetooth/BluetoothGattServer.java
index d7f150b..78d536b 100644
--- a/core/java/android/bluetooth/BluetoothGattServer.java
+++ b/core/java/android/bluetooth/BluetoothGattServer.java
@@ -289,6 +289,9 @@ public final class BluetoothGattServer implements BluetoothProfile {
/**
* Close this GATT server instance.
+ *
+ * Application should call this method as early as possible after it is done with
+ * this GATT server.
*/
public void close() {
if (DBG) Log.d(TAG, "close()");