Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa9dc683 authored by Guang Zhu's avatar Guang Zhu
Browse files

add getAddress function to return BT mac

Change-Id: Ib2bcd123e066672e411550856db862059949100e
parent 7f6ab17d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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();