am 1edfd835: Merge "add getAddress function to return BT mac" into klp-modular-dev
* commit '1edfd835c2573711587cc77befeefd96083ccba5': add getAddress function to return BT mac
This commit is contained in:
@@ -64,6 +64,8 @@ public class BluetoothInstrumentation extends Instrumentation {
|
|||||||
unpairAll();
|
unpairAll();
|
||||||
} else if ("getName".equals(command)) {
|
} else if ("getName".equals(command)) {
|
||||||
getName();
|
getName();
|
||||||
|
} else if ("getAddress".equals(command)) {
|
||||||
|
getAddress();
|
||||||
} else {
|
} else {
|
||||||
finish(null);
|
finish(null);
|
||||||
}
|
}
|
||||||
@@ -90,6 +92,12 @@ public class BluetoothInstrumentation extends Instrumentation {
|
|||||||
finish(mSuccessResult);
|
finish(mSuccessResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void getAddress() {
|
||||||
|
String name = getBluetoothAdapter().getAddress();
|
||||||
|
mSuccessResult.putString("address", name);
|
||||||
|
finish(mSuccessResult);
|
||||||
|
}
|
||||||
|
|
||||||
public void finish(Bundle result) {
|
public void finish(Bundle result) {
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
result = new Bundle();
|
result = new Bundle();
|
||||||
|
|||||||
Reference in New Issue
Block a user