Merge "add getAddress function to return BT mac" into klp-modular-dev

This commit is contained in:
Guang Zhu
2014-05-03 00:32:58 +00:00
committed by Android (Google) Code Review

View File

@@ -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();