Loading core/tests/bluetoothtests/src/android/bluetooth/BluetoothInstrumentation.java +14 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ import android.app.Instrumentation; import android.content.Context; import android.os.Bundle; import java.util.Set; public class BluetoothInstrumentation extends Instrumentation { private BluetoothTestUtils mUtils = null; Loading Loading @@ -66,6 +68,8 @@ public class BluetoothInstrumentation extends Instrumentation { getName(); } else if ("getAddress".equals(command)) { getAddress(); } else if ("getBondedDevices".equals(command)) { getBondedDevices(); } else { finish(null); } Loading Loading @@ -98,6 +102,16 @@ public class BluetoothInstrumentation extends Instrumentation { finish(mSuccessResult); } public void getBondedDevices() { Set<BluetoothDevice> devices = getBluetoothAdapter().getBondedDevices(); int i = 0; for (BluetoothDevice device : devices) { mSuccessResult.putString(String.format("device-%02d", i), device.getAddress()); i++; } finish(mSuccessResult); } public void finish(Bundle result) { if (result == null) { result = new Bundle(); Loading Loading
core/tests/bluetoothtests/src/android/bluetooth/BluetoothInstrumentation.java +14 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ import android.app.Instrumentation; import android.content.Context; import android.os.Bundle; import java.util.Set; public class BluetoothInstrumentation extends Instrumentation { private BluetoothTestUtils mUtils = null; Loading Loading @@ -66,6 +68,8 @@ public class BluetoothInstrumentation extends Instrumentation { getName(); } else if ("getAddress".equals(command)) { getAddress(); } else if ("getBondedDevices".equals(command)) { getBondedDevices(); } else { finish(null); } Loading Loading @@ -98,6 +102,16 @@ public class BluetoothInstrumentation extends Instrumentation { finish(mSuccessResult); } public void getBondedDevices() { Set<BluetoothDevice> devices = getBluetoothAdapter().getBondedDevices(); int i = 0; for (BluetoothDevice device : devices) { mSuccessResult.putString(String.format("device-%02d", i), device.getAddress()); i++; } finish(mSuccessResult); } public void finish(Bundle result) { if (result == null) { result = new Bundle(); Loading