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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_service_android.cc

Issue 1898643002: Refactor device::BluetoothGattXXX classes to split into remote/local. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_remote_gatt_service_android.cc
diff --git a/device/bluetooth/bluetooth_remote_gatt_service_android.cc b/device/bluetooth/bluetooth_remote_gatt_service_android.cc
index 935dfaa540099bfb1d3a7182f31c0a2bf1c5b5eb..38c477e87cad145e2e6074fc735877afc715c6e9 100644
--- a/device/bluetooth/bluetooth_remote_gatt_service_android.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_service_android.cc
@@ -55,11 +55,11 @@ BluetoothRemoteGattServiceAndroid::GetJavaObject() {
}
// static
-BluetoothGattService::GattErrorCode
+BluetoothRemoteGattService::GattErrorCode
BluetoothRemoteGattServiceAndroid::GetGattErrorCode(int bluetooth_gatt_code) {
DCHECK(bluetooth_gatt_code != 0) << "Only errors valid. 0 == GATT_SUCCESS.";
- // TODO(scheib) Create new BluetoothGattService::GattErrorCode enums for
+ // TODO(scheib) Create new BluetoothRemoteGattService::GattErrorCode enums for
// android values not yet represented. http://crbug.com/548498
switch (bluetooth_gatt_code) { // android.bluetooth.BluetoothGatt values:
case 0x00000101: // GATT_FAILURE
@@ -74,14 +74,14 @@ BluetoothRemoteGattServiceAndroid::GetGattErrorCode(int bluetooth_gatt_code) {
return GATT_ERROR_NOT_PERMITTED;
default:
VLOG(1) << "Unhandled status: " << bluetooth_gatt_code;
- return BluetoothGattService::GATT_ERROR_UNKNOWN;
+ return BluetoothRemoteGattService::GATT_ERROR_UNKNOWN;
}
}
// static
int BluetoothRemoteGattServiceAndroid::GetAndroidErrorCode(
- BluetoothGattService::GattErrorCode error_code) {
- // TODO(scheib) Create new BluetoothGattService::GattErrorCode enums for
+ BluetoothRemoteGattService::GattErrorCode error_code) {
+ // TODO(scheib) Create new BluetoothRemoteGattService::GattErrorCode enums for
// android values not yet represented. http://crbug.com/548498
switch (error_code) { // Return values from android.bluetooth.BluetoothGatt:
case GATT_ERROR_UNKNOWN:
@@ -118,10 +118,6 @@ device::BluetoothUUID BluetoothRemoteGattServiceAndroid::GetUUID() const {
AttachCurrentThread(), j_service_.obj())));
}
-bool BluetoothRemoteGattServiceAndroid::IsLocal() const {
- return false;
-}
-
bool BluetoothRemoteGattServiceAndroid::IsPrimary() const {
NOTIMPLEMENTED();
return true;
@@ -131,22 +127,22 @@ device::BluetoothDevice* BluetoothRemoteGattServiceAndroid::GetDevice() const {
return device_;
}
-std::vector<device::BluetoothGattCharacteristic*>
+std::vector<device::BluetoothRemoteGattCharacteristic*>
BluetoothRemoteGattServiceAndroid::GetCharacteristics() const {
EnsureCharacteristicsCreated();
- std::vector<device::BluetoothGattCharacteristic*> characteristics;
+ std::vector<device::BluetoothRemoteGattCharacteristic*> characteristics;
for (const auto& map_iter : characteristics_)
characteristics.push_back(map_iter.second);
return characteristics;
}
-std::vector<device::BluetoothGattService*>
+std::vector<device::BluetoothRemoteGattService*>
BluetoothRemoteGattServiceAndroid::GetIncludedServices() const {
NOTIMPLEMENTED();
- return std::vector<device::BluetoothGattService*>();
+ return std::vector<device::BluetoothRemoteGattService*>();
}
-device::BluetoothGattCharacteristic*
+device::BluetoothRemoteGattCharacteristic*
BluetoothRemoteGattServiceAndroid::GetCharacteristic(
const std::string& identifier) const {
EnsureCharacteristicsCreated();
@@ -156,28 +152,6 @@ BluetoothRemoteGattServiceAndroid::GetCharacteristic(
return iter->second;
}
-bool BluetoothRemoteGattServiceAndroid::AddCharacteristic(
- device::BluetoothGattCharacteristic* characteristic) {
- return false;
-}
-
-bool BluetoothRemoteGattServiceAndroid::AddIncludedService(
- device::BluetoothGattService* service) {
- return false;
-}
-
-void BluetoothRemoteGattServiceAndroid::Register(
- const base::Closure& callback,
- const ErrorCallback& error_callback) {
- error_callback.Run(GATT_ERROR_NOT_SUPPORTED);
-}
-
-void BluetoothRemoteGattServiceAndroid::Unregister(
- const base::Closure& callback,
- const ErrorCallback& error_callback) {
- error_callback.Run(GATT_ERROR_NOT_SUPPORTED);
-}
-
void BluetoothRemoteGattServiceAndroid::CreateGattRemoteCharacteristic(
JNIEnv* env,
const JavaParamRef<jobject>& caller,
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_service_android.h ('k') | device/bluetooth/bluetooth_remote_gatt_service_bluez.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698