summaryrefslogtreecommitdiffstats
path: root/core/tests/bluetoothtests/src/android
diff options
context:
space:
mode:
authorEric Rowe <erowe@google.com>2011-11-22 19:16:50 -0800
committerEric Rowe <erowe@google.com>2011-11-22 19:16:50 -0800
commitfca8e9d919443449807f87203609e53a64368f6b (patch)
tree1dbab2bdc14fa63986b65d1830267227aaab8b87 /core/tests/bluetoothtests/src/android
parentbfd85f9aca13aba2b954ddf3d8c6f6eb26e35f25 (diff)
downloadframeworks_base-fca8e9d919443449807f87203609e53a64368f6b.zip
frameworks_base-fca8e9d919443449807f87203609e53a64368f6b.tar.gz
frameworks_base-fca8e9d919443449807f87203609e53a64368f6b.tar.bz2
Fix SCO start stop tests.
Change-Id: Idf292bc244a494e2ffb11359e83c0d072907ea3b Bug-id: http://b/5644683
Diffstat (limited to 'core/tests/bluetoothtests/src/android')
-rw-r--r--core/tests/bluetoothtests/src/android/bluetooth/BluetoothStressTest.java11
-rw-r--r--core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java2
2 files changed, 12 insertions, 1 deletions
diff --git a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothStressTest.java b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothStressTest.java
index abd7d9a..755e7c4 100644
--- a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothStressTest.java
+++ b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothStressTest.java
@@ -32,6 +32,8 @@ import android.test.InstrumentationTestCase;
public class BluetoothStressTest extends InstrumentationTestCase {
private static final String TAG = "BluetoothStressTest";
private static final String OUTPUT_FILE = "BluetoothStressTestOutput.txt";
+ /** The amount of time to sleep between issuing start/stop SCO in ms. */
+ private static final long SCO_SLEEP_TIME = 2 * 1000;
private BluetoothTestUtils mTestUtils;
@@ -380,11 +382,20 @@ public class BluetoothStressTest extends InstrumentationTestCase {
for (int i = 0; i < iterations; i++) {
mTestUtils.writeOutput("startStopSco iteration " + (i + 1) + " of " + iterations);
mTestUtils.startSco(adapter, device);
+ sleep(SCO_SLEEP_TIME);
mTestUtils.stopSco(adapter, device);
+ sleep(SCO_SLEEP_TIME);
}
mTestUtils.disconnectProfile(adapter, device, BluetoothProfile.HEADSET, null);
mTestUtils.unpair(adapter, device);
mTestUtils.disable(adapter);
}
+
+ private void sleep(long time) {
+ try {
+ Thread.sleep(time);
+ } catch (InterruptedException e) {
+ }
+ }
}
diff --git a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java
index 42e5cd1..4858be8 100644
--- a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java
+++ b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothTestUtils.java
@@ -1425,7 +1425,7 @@ public class BluetoothTestUtils extends Assert {
}
private StartStopScoReceiver getStartStopScoReceiver(int expectedFlags) {
- String[] actions = {AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED};
+ String[] actions = {AudioManager.ACTION_SCO_AUDIO_STATE_UPDATED};
StartStopScoReceiver receiver = new StartStopScoReceiver(expectedFlags);
addReceiver(receiver, actions);
return receiver;