From fa9dc683f18e68cc1170c149a40c33a191444af1 Mon Sep 17 00:00:00 2001 From: Guang Zhu Date: Fri, 2 May 2014 12:38:51 -0700 Subject: add getAddress function to return BT mac Change-Id: Ib2bcd123e066672e411550856db862059949100e --- .../src/android/bluetooth/BluetoothInstrumentation.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/tests') 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(); -- cgit v1.1