summaryrefslogtreecommitdiffstats
path: root/core/tests/bluetoothtests/src
diff options
context:
space:
mode:
authorGuang Zhu <guangzhu@google.com>2014-04-28 20:12:35 -0700
committerGuang Zhu <guangzhu@google.com>2014-04-28 20:12:35 -0700
commite47ebbeec672ece19e260ccd7f4b83a297bce61e (patch)
tree5483772b1bf0f2b18cbab6a27f959cd1892f47b3 /core/tests/bluetoothtests/src
parent26a5c2dd740f309f3168790fc55a164738963835 (diff)
downloadframeworks_base-e47ebbeec672ece19e260ccd7f4b83a297bce61e.zip
frameworks_base-e47ebbeec672ece19e260ccd7f4b83a297bce61e.tar.gz
frameworks_base-e47ebbeec672ece19e260ccd7f4b83a297bce61e.tar.bz2
make success explicit in BT instrumentation util
Change-Id: I6c8eb8cdb7928fa6a7c1bc96b374667d1d6ae6a1
Diffstat (limited to 'core/tests/bluetoothtests/src')
-rw-r--r--core/tests/bluetoothtests/src/android/bluetooth/BluetoothInstrumentation.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothInstrumentation.java b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothInstrumentation.java
index 34393f9..0cd19f2 100644
--- a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothInstrumentation.java
+++ b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothInstrumentation.java
@@ -25,6 +25,7 @@ public class BluetoothInstrumentation extends Instrumentation {
private BluetoothTestUtils mUtils = null;
private BluetoothAdapter mAdapter = null;
private Bundle mArgs = null;
+ private Bundle mSuccessResult = null;
private BluetoothTestUtils getBluetoothTestUtils() {
if (mUtils == null) {
@@ -46,6 +47,9 @@ public class BluetoothInstrumentation extends Instrumentation {
public void onCreate(Bundle arguments) {
super.onCreate(arguments);
mArgs = arguments;
+ // create the default result response, but only use it in success code path
+ mSuccessResult = new Bundle();
+ mSuccessResult.putString("result", "SUCCESS");
start();
}
@@ -67,24 +71,23 @@ public class BluetoothInstrumentation extends Instrumentation {
public void enable() {
getBluetoothTestUtils().enable(getBluetoothAdapter());
- finish(null);
+ finish(mSuccessResult);
}
public void disable() {
getBluetoothTestUtils().disable(getBluetoothAdapter());
- finish(null);
+ finish(mSuccessResult);
}
public void unpairAll() {
getBluetoothTestUtils().unpairAll(getBluetoothAdapter());
- finish(null);
+ finish(mSuccessResult);
}
public void getName() {
String name = getBluetoothAdapter().getName();
- Bundle bundle = new Bundle();
- bundle.putString("name", name);
- finish(bundle);
+ mSuccessResult.putString("name", name);
+ finish(mSuccessResult);
}
public void finish(Bundle result) {