summaryrefslogtreecommitdiffstats
path: root/core/tests/bluetoothtests/src
diff options
context:
space:
mode:
authorJaikumar Ganesh <jaikumar@google.com>2011-05-26 13:56:40 -0700
committerJaikumar Ganesh <jaikumar@google.com>2011-06-14 21:29:52 -0700
commitf8789167e903b637b1dbe8f710e7c66c4cfd74fd (patch)
treece6d510207d96901e26966b252afdf0323628d3b /core/tests/bluetoothtests/src
parent0fe7b26aa2f87d5ba5611b6368cf7ec34cded108 (diff)
downloadframeworks_base-f8789167e903b637b1dbe8f710e7c66c4cfd74fd.zip
frameworks_base-f8789167e903b637b1dbe8f710e7c66c4cfd74fd.tar.gz
frameworks_base-f8789167e903b637b1dbe8f710e7c66c4cfd74fd.tar.bz2
Refactor Bluetooth Profile.
Move connect / disconnect / set and get priority functions down the interface as they are not generic enough for all profiles. Change-Id: I2656e1bdbc8046c53bb0dfbd9172f5f10b57aa7d
Diffstat (limited to 'core/tests/bluetoothtests/src')
-rw-r--r--core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java
index 5f4c226..0efa377 100644
--- a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java
+++ b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java
@@ -936,7 +936,13 @@ public class BluetoothTestUtils extends Assert {
case BluetoothProfile.STATE_DISCONNECTED:
case BluetoothProfile.STATE_DISCONNECTING:
start = System.currentTimeMillis();
- assertTrue(proxy.connect(device));
+ if (profile == BluetoothProfile.A2DP) {
+ assertTrue(((BluetoothA2dp)proxy).connect(device));
+ } else if (profile == BluetoothProfile.HEADSET) {
+ assertTrue(((BluetoothHeadset)proxy).connect(device));
+ } else if (profile == BluetoothProfile.INPUT_DEVICE) {
+ assertTrue(((BluetoothInputDevice)proxy).connect(device));
+ }
break;
default:
removeReceiver(receiver);
@@ -1005,7 +1011,13 @@ public class BluetoothTestUtils extends Assert {
case BluetoothProfile.STATE_CONNECTED:
case BluetoothProfile.STATE_CONNECTING:
start = System.currentTimeMillis();
- assertTrue(proxy.disconnect(device));
+ if (profile == BluetoothProfile.A2DP) {
+ assertTrue(((BluetoothA2dp)proxy).disconnect(device));
+ } else if (profile == BluetoothProfile.HEADSET) {
+ assertTrue(((BluetoothHeadset)proxy).disconnect(device));
+ } else if (profile == BluetoothProfile.INPUT_DEVICE) {
+ assertTrue(((BluetoothInputDevice)proxy).disconnect(device));
+ }
break;
case BluetoothProfile.STATE_DISCONNECTED:
removeReceiver(receiver);