diff options
author | Matthew Xie <mattx@google.com> | 2013-03-01 18:41:02 -0800 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2013-03-28 15:36:10 -0700 |
commit | 9afa274491ca272dc30f6f6211ef2719b7a2226e (patch) | |
tree | 86160d595db22be6160e19247fd48b8f21597421 /framework/java/android/bluetooth/BluetoothGattDescriptor.java | |
parent | daef329568bccaa8265a1af4ac62f64adc862d76 (diff) |
Unhide Bluetooth Low Energy public APIs
Updated API headers. Add BluetoothManager to be retrieved by
context.getSystemService(Context.BLUETOOTH_SERVICE).
LE scan functions are placed in BluetoothAdapter
The GATT API are device driven instead of a profile-driver.
bug 8450158
Change-Id: I424a4cedaac3ef8120a05996500008dd210d2553
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothGattDescriptor.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothGattDescriptor.java | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/framework/java/android/bluetooth/BluetoothGattDescriptor.java b/framework/java/android/bluetooth/BluetoothGattDescriptor.java index ba1f28afd7..6ba2db704f 100644 --- a/framework/java/android/bluetooth/BluetoothGattDescriptor.java +++ b/framework/java/android/bluetooth/BluetoothGattDescriptor.java @@ -19,8 +19,7 @@ package android.bluetooth; import java.util.UUID; /** - * Represents a Bluetooth Gatt Descriptor - * @hide + * Represents a Bluetooth GATT Descriptor */ public class BluetoothGattDescriptor { @@ -109,12 +108,28 @@ public class BluetoothGattDescriptor { * Create a new BluetoothGattDescriptor. * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. * + * @param uuid The UUID for this descriptor + * @param permissions Permissions for this descriptor + */ + public BluetoothGattDescriptor(UUID uuid, int permissions) { + initDescriptor(null, uuid, permissions); + } + + /** + * Create a new BluetoothGattDescriptor. + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. + * * @param characteristic The characteristic this descriptor belongs to * @param uuid The UUID for this descriptor * @param permissions Permissions for this descriptor */ /*package*/ BluetoothGattDescriptor(BluetoothGattCharacteristic characteristic, UUID uuid, int permissions) { + initDescriptor(characteristic, uuid, permissions); + } + + private void initDescriptor(BluetoothGattCharacteristic characteristic, UUID uuid, + int permissions) { mCharacteristic = characteristic; mUuid = uuid; mPermissions = permissions; @@ -129,8 +144,15 @@ public class BluetoothGattDescriptor { } /** + * Set the back-reference to the associated characteristic + * @hide + */ + /*package*/ void setCharacteristic(BluetoothGattCharacteristic characteristic) { + mCharacteristic = characteristic; + } + + /** * Returns the UUID of this descriptor. - * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. * * @return UUID of this descriptor */ @@ -140,7 +162,6 @@ public class BluetoothGattDescriptor { /** * Returns the permissions for this descriptor. - * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. * * @return Permissions of this descriptor */ @@ -152,12 +173,10 @@ public class BluetoothGattDescriptor { * Returns the stored value for this descriptor * * <p>This function returns the stored value for this descriptor as - * retrieved by calling {@link BluetoothGatt#readDescriptor}. To cached + * retrieved by calling {@link BluetoothGatt#readDescriptor}. The cached * value of the descriptor is updated as a result of a descriptor read * operation. * - * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. - * * @return Cached value of the descriptor */ public byte[] getValue() { @@ -172,8 +191,6 @@ public class BluetoothGattDescriptor { * {@link BluetoothGatt#writeDescriptor} to send the value to the * remote device. * - * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. - * * @param value New value for this descriptor * @return true if the locally stored value has been set, false if the * requested value could not be stored locally. |