[CrOS Bluetooth] Use Disconnect in BluetoothDeviceClientImpl.
This change updates the implementation to use the previous disconnect mechanism when not running on ChromeOS. This fixes an issue where non-ChromeOS builds try to invoke the "DisconnectOld" method which does not exist in upstream BlueZ. Bug: 1332640 Test: Change-Id: I466ce0623fe1f9ed372b0c1b011eb8f1d9867be3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3690211 Commit-Queue: Chad Duffin <chadduffin@chromium.org> Reviewed-by: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1012219}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
4a2d3cae9c
commit
08af24437f
@ -28,9 +28,11 @@ namespace bluez {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||||
// TODO(b/213229904): Remove this constant and replace with
|
// TODO(b/213229904): Remove this constant and replace with
|
||||||
// |bluetooth_device::kDisconnectOld| once it has been uprev'd.
|
// |bluetooth_device::kDisconnectOld| once it has been uprev'd.
|
||||||
constexpr char kDisconnectOldPlaceholder[] = "DisconnectOld";
|
constexpr char kDisconnectOldPlaceholder[] = "DisconnectOld";
|
||||||
|
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
||||||
|
|
||||||
// Value returned for the the RSSI or TX power if it cannot be read.
|
// Value returned for the the RSSI or TX power if it cannot be read.
|
||||||
const int kUnknownPower = 127;
|
const int kUnknownPower = 127;
|
||||||
@ -377,7 +379,7 @@ class BluetoothDeviceClientImpl : public BluetoothDeviceClient,
|
|||||||
? bluetooth_device::kDisconnect
|
? bluetooth_device::kDisconnect
|
||||||
: kDisconnectOldPlaceholder;
|
: kDisconnectOldPlaceholder;
|
||||||
#else // BUILDFLAG(IS_CHROMEOS_ASH)
|
#else // BUILDFLAG(IS_CHROMEOS_ASH)
|
||||||
const char* method_name = kDisconnectOldPlaceholder;
|
const char* method_name = bluetooth_device::kDisconnect;
|
||||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
||||||
dbus::MethodCall method_call(bluetooth_device::kBluetoothDeviceInterface,
|
dbus::MethodCall method_call(bluetooth_device::kBluetoothDeviceInterface,
|
||||||
method_name);
|
method_name);
|
||||||
|
Reference in New Issue
Block a user