From f8789167e903b637b1dbe8f710e7c66c4cfd74fd Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Thu, 26 May 2011 13:56:40 -0700 Subject: 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 --- .../src/android/bluetooth/BluetoothTestUtils.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'core/tests/bluetoothtests/src') 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); -- cgit v1.1