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

Side by Side Diff: device/bluetooth/bluetooth_remote_gatt_service_android.cc

Issue 1422093002: bluetooth: android: BluetoothRemoteGattCharacteristicAndroid::GetUUID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-cleanup-
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/bluetooth_remote_gatt_service_android.h" 5 #include "device/bluetooth/bluetooth_remote_gatt_service_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "device/bluetooth/bluetooth_adapter_android.h" 9 #include "device/bluetooth/bluetooth_adapter_android.h"
10 #include "device/bluetooth/bluetooth_device_android.h" 10 #include "device/bluetooth/bluetooth_device_android.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 const jstring& instanceId, 124 const jstring& instanceId,
125 jobject /* BluetoothGattCharacteristicWrapper */ 125 jobject /* BluetoothGattCharacteristicWrapper */
126 bluetooth_gatt_characteristic_wrapper) { 126 bluetooth_gatt_characteristic_wrapper) {
127 std::string instanceIdString = 127 std::string instanceIdString =
128 base::android::ConvertJavaStringToUTF8(env, instanceId); 128 base::android::ConvertJavaStringToUTF8(env, instanceId);
129 129
130 DCHECK(!characteristics_.contains(instanceIdString)); 130 DCHECK(!characteristics_.contains(instanceIdString));
131 131
132 characteristics_.set( 132 characteristics_.set(
133 instanceIdString, 133 instanceIdString,
134 BluetoothRemoteGattCharacteristicAndroid::Create(instanceIdString)); 134 BluetoothRemoteGattCharacteristicAndroid::Create(
135 instanceIdString, bluetooth_gatt_characteristic_wrapper));
135 } 136 }
136 137
137 BluetoothRemoteGattServiceAndroid::BluetoothRemoteGattServiceAndroid( 138 BluetoothRemoteGattServiceAndroid::BluetoothRemoteGattServiceAndroid(
138 BluetoothAdapterAndroid* adapter, 139 BluetoothAdapterAndroid* adapter,
139 BluetoothDeviceAndroid* device, 140 BluetoothDeviceAndroid* device,
140 const std::string& instanceId) 141 const std::string& instanceId)
141 : adapter_(adapter), device_(device), instanceId_(instanceId) {} 142 : adapter_(adapter), device_(device), instanceId_(instanceId) {}
142 143
143 void BluetoothRemoteGattServiceAndroid::EnsureCharacteristicsCreated() const { 144 void BluetoothRemoteGattServiceAndroid::EnsureCharacteristicsCreated() const {
144 if (!characteristics_.empty()) 145 if (!characteristics_.empty())
145 return; 146 return;
146 147
147 // Java call 148 // Java call
148 Java_ChromeBluetoothRemoteGattService_ensureCharacteristicsCreated( 149 Java_ChromeBluetoothRemoteGattService_ensureCharacteristicsCreated(
149 AttachCurrentThread(), j_service_.obj()); 150 AttachCurrentThread(), j_service_.obj());
150 } 151 }
151 152
152 } // namespace device 153 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698