summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothAdapter.java
diff options
context:
space:
mode:
authorGanesh Ganapathi Batta <ganeshg@broadcom.com>2013-02-05 15:28:33 -0800
committerMatthew Xie <mattx@google.com>2013-02-27 18:08:14 -0800
commit40b98951361157933c2084e855f7cffef0ca7fb7 (patch)
tree17cea117c2c77918e43d81f5e651e04b8a730758 /framework/java/android/bluetooth/BluetoothAdapter.java
parent5c1f303052011bf9b359d55ff39ae2c174a84dad (diff)
Initial version of BLE support for Bluedroid
The API classes are hidden for now. Will unhide after API console approval. Change-Id: I8283dd562fd6189fdd15c866ef2efb8bbdbc4109
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
-rw-r--r--[-rwxr-xr-x]framework/java/android/bluetooth/BluetoothAdapter.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java
index 6367e16049..1bbfb5dfb3 100755..100644
--- a/framework/java/android/bluetooth/BluetoothAdapter.java
+++ b/framework/java/android/bluetooth/BluetoothAdapter.java
@@ -1136,8 +1136,9 @@ public final class BluetoothAdapter {
/**
* Get the profile proxy object associated with the profile.
*
- * <p>Profile can be one of {@link BluetoothProfile#HEALTH}, {@link BluetoothProfile#HEADSET} or
- * {@link BluetoothProfile#A2DP}. Clients must implements
+ * <p>Profile can be one of {@link BluetoothProfile#HEALTH}, {@link BluetoothProfile#HEADSET},
+ * {@link BluetoothProfile#A2DP}, {@link BluetoothProfile#GATT},
+ * or {@link BluetoothProfile#GATT_SERVER}. Clients must implements
* {@link BluetoothProfile.ServiceListener} to get notified of
* the connection status and to get the proxy object.
*
@@ -1166,6 +1167,12 @@ public final class BluetoothAdapter {
} else if (profile == BluetoothProfile.HEALTH) {
BluetoothHealth health = new BluetoothHealth(context, listener);
return true;
+ } else if (profile == BluetoothProfile.GATT) {
+ BluetoothGatt gatt = new BluetoothGatt(context, listener);
+ return true;
+ } else if (profile == BluetoothProfile.GATT_SERVER) {
+ BluetoothGattServer gattServer = new BluetoothGattServer(context, listener);
+ return true;
} else {
return false;
}
@@ -1206,6 +1213,14 @@ public final class BluetoothAdapter {
BluetoothHealth health = (BluetoothHealth)proxy;
health.close();
break;
+ case BluetoothProfile.GATT:
+ BluetoothGatt gatt = (BluetoothGatt)proxy;
+ gatt.close();
+ break;
+ case BluetoothProfile.GATT_SERVER:
+ BluetoothGattServer gattServer = (BluetoothGattServer)proxy;
+ gattServer.close();
+ break;
}
}