summaryrefslogtreecommitdiffstats
path: root/core/java/android/bluetooth
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-09-19 14:30:37 -0400
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-09-19 14:30:37 -0400
commitac810e53b70aa01c148c998c57f6888160e1557a (patch)
treec7c3f891ed4950e28a24d2883e51ddd0a240fa0e /core/java/android/bluetooth
parent338c48554f35dbee3faa4e39525a972f20a7c32d (diff)
parent1caa6d111eff6814760ec156b14adc29aa3aae6c (diff)
downloadframeworks_base-ac810e53b70aa01c148c998c57f6888160e1557a.zip
frameworks_base-ac810e53b70aa01c148c998c57f6888160e1557a.tar.gz
frameworks_base-ac810e53b70aa01c148c998c57f6888160e1557a.tar.bz2
Merge change 25779 into eclair
* changes: Add new API for fetching UUIDs using SDP.
Diffstat (limited to 'core/java/android/bluetooth')
-rw-r--r--core/java/android/bluetooth/BluetoothDevice.java45
-rw-r--r--core/java/android/bluetooth/IBluetooth.aidl1
2 files changed, 46 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java
index f81ba73..b52a822 100644
--- a/core/java/android/bluetooth/BluetoothDevice.java
+++ b/core/java/android/bluetooth/BluetoothDevice.java
@@ -28,6 +28,7 @@ import android.util.Log;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
+import java.util.UUID;
/**
* Represents a remote Bluetooth device.
@@ -226,6 +227,20 @@ public final class BluetoothDevice implements Parcelable {
public static final String EXTRA_PASSKEY = "android.bluetooth.device.extra.PASSKEY";
/**
+ * Broadcast Action: This intent is used to broadcast the {@link UUID}
+ * wrapped as a {@link ParcelUuid} of the remote device after it has been
+ * fetched. This intent is sent only when the UUIDs of the remote device
+ * are requested to be fetched using Service Discovery Protocol
+ * <p> Always contains the extra field {@link #EXTRA_DEVICE}
+ * <p> Always contains the extra filed {@link #EXTRA_UUID}
+ * <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive.
+ * @hide
+ */
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_UUID =
+ "android.bleutooth.device.action.UUID";
+
+ /**
* Broadcast Action: Indicates a failure to retrieve the name of a remote
* device.
* <p>Always contains the extra field {@link #EXTRA_DEVICE}.
@@ -292,6 +307,15 @@ public final class BluetoothDevice implements Parcelable {
* @hide */
public static final int PAIRING_VARIANT_DISPLAY_PASSKEY = 4;
+ /**
+ * Used as an extra field in {@link #ACTION_UUID} intents,
+ * Contains the {@link ParcelUuid}s of the remote device which is a parcelable
+ * version of {@link UUID}.
+ * @hide
+ */
+ public static final String EXTRA_UUID = "android.bluetooth.device.extra.UUID";
+
+
private static IBluetooth sService; /* Guarenteed constant after first object constructed */
private final String mAddress;
@@ -507,6 +531,27 @@ public final class BluetoothDevice implements Parcelable {
return null;
}
+ /**
+ * Perform a SDP query on the remote device to get the UUIDs
+ * supported. This API is asynchronous and an Intent is sent,
+ * with the UUIDs supported by the remote end. If there is an error
+ * in getting the SDP records or if the process takes a long time,
+ * an Intent is sent with the UUIDs that is currently present in the
+ * cache. Clients should use the {@link getUuids} to get UUIDs
+ * is SDP is not to be performed.
+ *
+ * @return False if the sanity check fails, True if the process
+ * of initiating an ACL connection to the remote device
+ * was started.
+ * @hide
+ */
+ public boolean fetchUuidsWithSdp() {
+ try {
+ return sService.fetchRemoteUuidsWithSdp(mAddress);
+ } catch (RemoteException e) {Log.e(TAG, "", e);}
+ return false;
+ }
+
/** @hide */
public int getServiceChannel(ParcelUuid uuid) {
try {
diff --git a/core/java/android/bluetooth/IBluetooth.aidl b/core/java/android/bluetooth/IBluetooth.aidl
index 04c8ec9..203a61d 100644
--- a/core/java/android/bluetooth/IBluetooth.aidl
+++ b/core/java/android/bluetooth/IBluetooth.aidl
@@ -53,6 +53,7 @@ interface IBluetooth
String getRemoteName(in String address);
int getRemoteClass(in String address);
ParcelUuid[] getRemoteUuids(in String address);
+ boolean fetchRemoteUuidsWithSdp(in String address);
int getRemoteServiceChannel(in String address,in ParcelUuid uuid);
boolean setPin(in String address, in byte[] pin);