Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: device/bluetooth/test/bluetooth_test_android.cc

Issue 1765773002: bluetooth: Refactor GetDescriptorForUUID to GetDescriptorsForUUID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-notify-tommyt-
Patch Set: addressed ortuno's comments Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/test/bluetooth_test_android.h" 5 #include "device/bluetooth/test/bluetooth_test_android.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 BluetoothRemoteGattCharacteristicAndroid* characteristic_android = 169 BluetoothRemoteGattCharacteristicAndroid* characteristic_android =
170 static_cast<BluetoothRemoteGattCharacteristicAndroid*>(characteristic); 170 static_cast<BluetoothRemoteGattCharacteristicAndroid*>(characteristic);
171 171
172 Java_FakeBluetoothGattCharacteristic_rememberCharacteristicForSubsequentAction ( 172 Java_FakeBluetoothGattCharacteristic_rememberCharacteristicForSubsequentAction (
173 base::android::AttachCurrentThread(), 173 base::android::AttachCurrentThread(),
174 characteristic_android->GetJavaObject().obj()); 174 characteristic_android->GetJavaObject().obj());
175 } 175 }
176 176
177 void BluetoothTestAndroid::SimulateGattNotifySessionStarted( 177 void BluetoothTestAndroid::SimulateGattNotifySessionStarted(
178 BluetoothGattCharacteristic* characteristic) { 178 BluetoothGattCharacteristic* characteristic) {
179 BluetoothGattDescriptor* descriptor = characteristic->GetDescriptorForUUID( 179 BluetoothGattDescriptor* descriptor =
180 BluetoothGattDescriptor::ClientCharacteristicConfigurationUuid()); 180 characteristic
181 ->GetDescriptorsByUUID(
182 BluetoothGattDescriptor::ClientCharacteristicConfigurationUuid())
183 .at(0);
181 BluetoothRemoteGattDescriptorAndroid* descriptor_android = 184 BluetoothRemoteGattDescriptorAndroid* descriptor_android =
182 static_cast<BluetoothRemoteGattDescriptorAndroid*>(descriptor); 185 static_cast<BluetoothRemoteGattDescriptorAndroid*>(descriptor);
183 Java_FakeBluetoothGattDescriptor_valueWrite( 186 Java_FakeBluetoothGattDescriptor_valueWrite(
184 base::android::AttachCurrentThread(), 187 base::android::AttachCurrentThread(),
185 descriptor_android ? descriptor_android->GetJavaObject().obj() : nullptr, 188 descriptor_android ? descriptor_android->GetJavaObject().obj() : nullptr,
186 0); // android.bluetooth.BluetoothGatt.GATT_SUCCESS 189 0); // android.bluetooth.BluetoothGatt.GATT_SUCCESS
187 } 190 }
188 191
189 void BluetoothTestAndroid:: 192 void BluetoothTestAndroid::
190 SimulateGattCharacteristicSetNotifyWillFailSynchronouslyOnce( 193 SimulateGattCharacteristicSetNotifyWillFailSynchronouslyOnce(
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 } 439 }
437 440
438 void BluetoothTestAndroid::OnFakeAdapterStateChanged( 441 void BluetoothTestAndroid::OnFakeAdapterStateChanged(
439 JNIEnv* env, 442 JNIEnv* env,
440 const JavaParamRef<jobject>& caller, 443 const JavaParamRef<jobject>& caller,
441 const bool powered) { 444 const bool powered) {
442 adapter_->NotifyAdapterStateChanged(powered); 445 adapter_->NotifyAdapterStateChanged(powered);
443 } 446 }
444 447
445 } // namespace device 448 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698