summaryrefslogtreecommitdiffstats
path: root/core/tests/bluetoothtests/src
diff options
context:
space:
mode:
authorJaikumar Ganesh <jaikumar@google.com>2011-06-14 21:33:03 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-14 21:33:03 -0700
commitc04c457eb7783a98fa452449484a818dbb7e0b45 (patch)
tree56b0640c30ff2e5b0600e26456f7e74e471d4c12 /core/tests/bluetoothtests/src
parent15856f7b62d06d968f57441ffe7dd31aac631952 (diff)
parentf8789167e903b637b1dbe8f710e7c66c4cfd74fd (diff)
downloadframeworks_base-c04c457eb7783a98fa452449484a818dbb7e0b45.zip
frameworks_base-c04c457eb7783a98fa452449484a818dbb7e0b45.tar.gz
frameworks_base-c04c457eb7783a98fa452449484a818dbb7e0b45.tar.bz2
Merge "Refactor Bluetooth Profile."
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 047481e..42e5cd1 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);