| Index: device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc
|
| diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc b/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc
|
| index b9c2b426208db122e5e58165cb8f86c9ac8b1285..6e82279e59ef8f3ed61a37c6d165ba75928fed5b 100644
|
| --- a/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc
|
| +++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc
|
| @@ -52,7 +52,8 @@ BluetoothRemoteGattCharacteristicAndroid::
|
| AttachCurrentThread(), j_characteristic_.obj());
|
|
|
| if (pending_start_notify_calls_.size()) {
|
| - OnStartNotifySessionError(device::BluetoothGattService::GATT_ERROR_FAILED);
|
| + OnStartNotifySessionError(
|
| + device::BluetoothRemoteGattService::GATT_ERROR_FAILED);
|
| }
|
| }
|
|
|
| @@ -86,18 +87,18 @@ const std::vector<uint8_t>& BluetoothRemoteGattCharacteristicAndroid::GetValue()
|
| return value_;
|
| }
|
|
|
| -BluetoothGattService* BluetoothRemoteGattCharacteristicAndroid::GetService()
|
| - const {
|
| +BluetoothRemoteGattService*
|
| +BluetoothRemoteGattCharacteristicAndroid::GetService() const {
|
| return service_;
|
| }
|
|
|
| -BluetoothGattCharacteristic::Properties
|
| +BluetoothRemoteGattCharacteristic::Properties
|
| BluetoothRemoteGattCharacteristicAndroid::GetProperties() const {
|
| return Java_ChromeBluetoothRemoteGattCharacteristic_getProperties(
|
| AttachCurrentThread(), j_characteristic_.obj());
|
| }
|
|
|
| -BluetoothGattCharacteristic::Permissions
|
| +BluetoothRemoteGattCharacteristic::Permissions
|
| BluetoothRemoteGattCharacteristicAndroid::GetPermissions() const {
|
| NOTIMPLEMENTED();
|
| return 0;
|
| @@ -108,16 +109,16 @@ bool BluetoothRemoteGattCharacteristicAndroid::IsNotifying() const {
|
| return false;
|
| }
|
|
|
| -std::vector<BluetoothGattDescriptor*>
|
| +std::vector<BluetoothRemoteGattDescriptor*>
|
| BluetoothRemoteGattCharacteristicAndroid::GetDescriptors() const {
|
| EnsureDescriptorsCreated();
|
| - std::vector<BluetoothGattDescriptor*> descriptors;
|
| + std::vector<BluetoothRemoteGattDescriptor*> descriptors;
|
| for (const auto& map_iter : descriptors_)
|
| descriptors.push_back(map_iter.second);
|
| return descriptors;
|
| }
|
|
|
| -BluetoothGattDescriptor*
|
| +BluetoothRemoteGattDescriptor*
|
| BluetoothRemoteGattCharacteristicAndroid::GetDescriptor(
|
| const std::string& identifier) const {
|
| EnsureDescriptorsCreated();
|
| @@ -128,7 +129,7 @@ BluetoothRemoteGattCharacteristicAndroid::GetDescriptor(
|
| }
|
|
|
| bool BluetoothRemoteGattCharacteristicAndroid::AddDescriptor(
|
| - BluetoothGattDescriptor* descriptor) {
|
| + BluetoothRemoteGattDescriptor* descriptor) {
|
| NOTIMPLEMENTED();
|
| return false;
|
| }
|
| @@ -156,13 +157,15 @@ void BluetoothRemoteGattCharacteristicAndroid::StartNotifySession(
|
| if (!hasNotify && !hasIndicate) {
|
| LOG(ERROR) << "Characteristic needs NOTIFY or INDICATE";
|
| base::MessageLoop::current()->PostTask(
|
| - FROM_HERE, base::Bind(error_callback,
|
| - BluetoothGattService::GATT_ERROR_NOT_SUPPORTED));
|
| + FROM_HERE,
|
| + base::Bind(error_callback,
|
| + BluetoothRemoteGattService::GATT_ERROR_NOT_SUPPORTED));
|
| return;
|
| }
|
|
|
| - std::vector<BluetoothGattDescriptor*> ccc_descriptor = GetDescriptorsByUUID(
|
| - BluetoothGattDescriptor::ClientCharacteristicConfigurationUuid());
|
| + std::vector<BluetoothRemoteGattDescriptor*> ccc_descriptor =
|
| + GetDescriptorsByUUID(BluetoothRemoteGattDescriptor::
|
| + ClientCharacteristicConfigurationUuid());
|
|
|
| if (ccc_descriptor.size() != 1u) {
|
| LOG(ERROR) << "Found " << ccc_descriptor.size()
|
| @@ -171,8 +174,8 @@ void BluetoothRemoteGattCharacteristicAndroid::StartNotifySession(
|
| FROM_HERE,
|
| base::Bind(error_callback,
|
| (ccc_descriptor.size() == 0)
|
| - ? BluetoothGattService::GATT_ERROR_NOT_SUPPORTED
|
| - : BluetoothGattService::GATT_ERROR_FAILED));
|
| + ? BluetoothRemoteGattService::GATT_ERROR_NOT_SUPPORTED
|
| + : BluetoothRemoteGattService::GATT_ERROR_FAILED));
|
| return;
|
| }
|
|
|
| @@ -180,8 +183,8 @@ void BluetoothRemoteGattCharacteristicAndroid::StartNotifySession(
|
| AttachCurrentThread(), j_characteristic_.obj(), true)) {
|
| LOG(ERROR) << "Error enabling characteristic notification";
|
| base::MessageLoop::current()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(error_callback, BluetoothGattService::GATT_ERROR_FAILED));
|
| + FROM_HERE, base::Bind(error_callback,
|
| + BluetoothRemoteGattService::GATT_ERROR_FAILED));
|
| return;
|
| }
|
|
|
| @@ -204,16 +207,17 @@ void BluetoothRemoteGattCharacteristicAndroid::ReadRemoteCharacteristic(
|
| const ErrorCallback& error_callback) {
|
| if (read_pending_ || write_pending_) {
|
| base::MessageLoop::current()->PostTask(
|
| - FROM_HERE, base::Bind(error_callback,
|
| - BluetoothGattService::GATT_ERROR_IN_PROGRESS));
|
| + FROM_HERE,
|
| + base::Bind(error_callback,
|
| + BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS));
|
| return;
|
| }
|
|
|
| if (!Java_ChromeBluetoothRemoteGattCharacteristic_readRemoteCharacteristic(
|
| AttachCurrentThread(), j_characteristic_.obj())) {
|
| base::MessageLoop::current()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(error_callback, BluetoothGattService::GATT_ERROR_FAILED));
|
| + FROM_HERE, base::Bind(error_callback,
|
| + BluetoothRemoteGattService::GATT_ERROR_FAILED));
|
| return;
|
| }
|
|
|
| @@ -228,8 +232,9 @@ void BluetoothRemoteGattCharacteristicAndroid::WriteRemoteCharacteristic(
|
| const ErrorCallback& error_callback) {
|
| if (read_pending_ || write_pending_) {
|
| base::MessageLoop::current()->PostTask(
|
| - FROM_HERE, base::Bind(error_callback,
|
| - BluetoothGattService::GATT_ERROR_IN_PROGRESS));
|
| + FROM_HERE,
|
| + base::Bind(error_callback,
|
| + BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS));
|
| return;
|
| }
|
|
|
| @@ -238,8 +243,8 @@ void BluetoothRemoteGattCharacteristicAndroid::WriteRemoteCharacteristic(
|
| env, j_characteristic_.obj(),
|
| base::android::ToJavaByteArray(env, new_value).obj())) {
|
| base::MessageLoop::current()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(error_callback, BluetoothGattService::GATT_ERROR_FAILED));
|
| + FROM_HERE, base::Bind(error_callback,
|
| + BluetoothRemoteGattService::GATT_ERROR_FAILED));
|
| return;
|
| }
|
|
|
| @@ -268,7 +273,7 @@ void BluetoothRemoteGattCharacteristicAndroid::OnStartNotifySessionSuccess() {
|
| }
|
|
|
| void BluetoothRemoteGattCharacteristicAndroid::OnStartNotifySessionError(
|
| - BluetoothGattService::GattErrorCode error) {
|
| + BluetoothRemoteGattService::GattErrorCode error) {
|
| std::vector<PendingStartNotifyCall> reentrant_safe_callbacks;
|
| reentrant_safe_callbacks.swap(pending_start_notify_calls_);
|
|
|
|
|