summaryrefslogtreecommitdiffstats
path: root/core/tests/bluetoothtests/src/android
diff options
context:
space:
mode:
authorGuang Zhu <guangzhu@google.com>2014-05-02 12:38:51 -0700
committerGuang Zhu <guangzhu@google.com>2014-05-02 12:38:51 -0700
commitfa9dc683f18e68cc1170c149a40c33a191444af1 (patch)
tree8df3cc4ee1d888f6d5280106f467b0187ffc6fd7 /core/tests/bluetoothtests/src/android
parent7f6ab17d414726868563105cd995b37dd519320b (diff)
downloadframeworks_base-fa9dc683f18e68cc1170c149a40c33a191444af1.zip
frameworks_base-fa9dc683f18e68cc1170c149a40c33a191444af1.tar.gz
frameworks_base-fa9dc683f18e68cc1170c149a40c33a191444af1.tar.bz2
add getAddress function to return BT mac
Change-Id: Ib2bcd123e066672e411550856db862059949100e
Diffstat (limited to 'core/tests/bluetoothtests/src/android')
-rw-r--r--core/tests/bluetoothtests/src/android/bluetooth/BluetoothInstrumentation.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothInstrumentation.java b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothInstrumentation.java
index 0cd19f2..67203b2 100644
--- a/core/tests/bluetoothtests/src/android/bluetooth/BluetoothInstrumentation.java
+++ b/core/tests/bluetoothtests/src/android/bluetooth/BluetoothInstrumentation.java
@@ -64,6 +64,8 @@ public class BluetoothInstrumentation extends Instrumentation {
unpairAll();
} else if ("getName".equals(command)) {
getName();
+ } else if ("getAddress".equals(command)) {
+ getAddress();
} else {
finish(null);
}
@@ -90,6 +92,12 @@ public class BluetoothInstrumentation extends Instrumentation {
finish(mSuccessResult);
}
+ public void getAddress() {
+ String name = getBluetoothAdapter().getAddress();
+ mSuccessResult.putString("address", name);
+ finish(mSuccessResult);
+ }
+
public void finish(Bundle result) {
if (result == null) {
result = new Bundle();