| Index: device/bluetooth/test/bluetooth_test_android.cc
|
| diff --git a/device/bluetooth/test/bluetooth_test_android.cc b/device/bluetooth/test/bluetooth_test_android.cc
|
| index 4b55498dda947984fbe682123bfdb9aba781d373..7e7e1cc158907afcdce32b7ce9627d478760f93f 100644
|
| --- a/device/bluetooth/test/bluetooth_test_android.cc
|
| +++ b/device/bluetooth/test/bluetooth_test_android.cc
|
| @@ -56,19 +56,25 @@ bool BluetoothTestAndroid::PlatformSupportsLowEnergy() {
|
|
|
| void BluetoothTestAndroid::InitWithDefaultAdapter() {
|
| adapter_ = BluetoothAdapterAndroid::Create(
|
| - BluetoothAdapterWrapper_CreateWithDefaultAdapter())
|
| + BluetoothAdapterWrapper_CreateWithDefaultAdapter(),
|
| + BluetoothManagerWrapper_CreateWithDefaultManager())
|
| .get();
|
| }
|
|
|
| void BluetoothTestAndroid::InitWithoutDefaultAdapter() {
|
| - adapter_ = BluetoothAdapterAndroid::Create(NULL).get();
|
| + adapter_ = BluetoothAdapterAndroid::Create(NULL, NULL).get();
|
| }
|
|
|
| void BluetoothTestAndroid::InitWithFakeAdapter() {
|
| - j_fake_bluetooth_adapter_.Reset(Java_FakeBluetoothAdapter_create(
|
| - AttachCurrentThread(), reinterpret_cast<intptr_t>(this)));
|
| -
|
| - adapter_ = BluetoothAdapterAndroid::Create(j_fake_bluetooth_adapter_).get();
|
| + JNIEnv* env = AttachCurrentThread();
|
| + j_fake_bluetooth_adapter_.Reset(
|
| + Java_FakeBluetoothAdapter_create(env, reinterpret_cast<intptr_t>(this)));
|
| + j_fake_bluetooth_manager_.Reset(
|
| + Java_FakeBluetoothManager_create(env, reinterpret_cast<intptr_t>(this)));
|
| +
|
| + adapter_ = BluetoothAdapterAndroid::Create(j_fake_bluetooth_adapter_,
|
| + j_fake_bluetooth_manager_)
|
| + .get();
|
| }
|
|
|
| bool BluetoothTestAndroid::DenyPermission() {
|
| @@ -85,6 +91,13 @@ BluetoothDevice* BluetoothTestAndroid::SimulateLowEnergyDevice(
|
| return observer.last_device();
|
| }
|
|
|
| +void BluetoothTestAndroid::SimulateConnectedLowEnergyDevice(
|
| + ConnectedDeviceType device_type) {
|
| + Java_FakeBluetoothManager_simulateConnectedLowEnergyDevice(
|
| + AttachCurrentThread(), j_fake_bluetooth_manager_,
|
| + static_cast<int32_t>(device_type));
|
| +}
|
| +
|
| void BluetoothTestAndroid::RememberDeviceForSubsequentAction(
|
| BluetoothDevice* device) {
|
| BluetoothDeviceAndroid* device_android =
|
| @@ -518,6 +531,12 @@ void BluetoothTestAndroid::OnFakeBluetoothGattWriteDescriptor(
|
| base::android::JavaByteArrayToByteVector(env, value, &last_write_value_);
|
| }
|
|
|
| +void BluetoothTestAndroid::OnFakeManagerGetConnectedDevices(
|
| + JNIEnv* env,
|
| + const JavaParamRef<jobject>& caller) {
|
| + manager_get_connected_devices_attempts_++;
|
| +}
|
| +
|
| void BluetoothTestAndroid::OnFakeAdapterStateChanged(
|
| JNIEnv* env,
|
| const JavaParamRef<jobject>& caller,
|
|
|