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

Unified Diff: device/bluetooth/bluetooth_device_android.cc

Issue 2377513004: bluetooth:android: Return the advertised name if advertising (Closed)
Patch Set: Format' Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/bluetooth_device.cc ('k') | device/bluetooth/bluetooth_device_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_device_android.cc
diff --git a/device/bluetooth/bluetooth_device_android.cc b/device/bluetooth/bluetooth_device_android.cc
index ce76d20b169b8667980d7833366732b7a95be885..3189be37ba168f0697fc1464671ad2fdc796dd1e 100644
--- a/device/bluetooth/bluetooth_device_android.cc
+++ b/device/bluetooth/bluetooth_device_android.cc
@@ -100,6 +100,10 @@ uint16_t BluetoothDeviceAndroid::GetAppearance() const {
}
base::Optional<std::string> BluetoothDeviceAndroid::GetName() const {
+ if (!IsGattConnected() && advertised_name_) {
+ return advertised_name_;
+ }
+
auto name =
Java_ChromeBluetoothDevice_getName(AttachCurrentThread(), j_device_);
if (name.is_null())
« no previous file with comments | « device/bluetooth/bluetooth_device.cc ('k') | device/bluetooth/bluetooth_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698