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

Unified Diff: device/bluetooth/bluez/bluetooth_device_bluez.cc

Issue 2009753002: bluetooth: Make public BluetoothDevice::GetName method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge TOT Created 4 years, 5 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/bluez/bluetooth_device_bluez.cc
diff --git a/device/bluetooth/bluez/bluetooth_device_bluez.cc b/device/bluetooth/bluez/bluetooth_device_bluez.cc
index 3cb677ce08d1335789cadb5c16558408537c4448..15617f25d09624414d9759c5350e1839679fc9e9 100644
--- a/device/bluetooth/bluez/bluetooth_device_bluez.cc
+++ b/device/bluetooth/bluez/bluetooth_device_bluez.cc
@@ -214,15 +214,6 @@ device::BluetoothTransport BluetoothDeviceBlueZ::GetType() const {
return device::BLUETOOTH_TRANSPORT_INVALID;
}
-std::string BluetoothDeviceBlueZ::GetDeviceName() const {
- bluez::BluetoothDeviceClient::Properties* properties =
- bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->GetProperties(
- object_path_);
- DCHECK(properties);
-
- return properties->alias.value();
-}
-
void BluetoothDeviceBlueZ::CreateGattConnectionImpl() {
// BlueZ implementation does not use the default CreateGattConnection
// implementation.
@@ -293,6 +284,17 @@ uint16_t BluetoothDeviceBlueZ::GetAppearance() const {
return properties->appearance.value();
}
+base::Optional<std::string> BluetoothDeviceBlueZ::GetName() const {
+ bluez::BluetoothDeviceClient::Properties* properties =
+ bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->GetProperties(
+ object_path_);
+ DCHECK(properties);
+
+ if (properties->name.is_valid())
+ return base::Optional<std::string>(properties->name.value());
+ return base::Optional<std::string>();
+}
+
bool BluetoothDeviceBlueZ::IsPaired() const {
bluez::BluetoothDeviceClient::Properties* properties =
bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->GetProperties(

Powered by Google App Engine
This is Rietveld 408576698