Commit 1101e55e authored by Mohamed Amir Yosef's avatar Mohamed Amir Yosef Committed by Commit Bot

Revert "bluetooth: add BluetoothAdapter::IsPeripheralRoleSupported()"

This reverts commit ba7954e5.

Reason for revert: This probably caused the failure in 
DevToolsBeforeUnloadTest.TestUndockedDevToolsClose
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8882815412590626512/+/steps/browser_tests_on_Windows-10-15063/0/logs/Deterministic_failure:_DevToolsBeforeUnloadTest.TestUndockedDevToolsClose__status_FAILURE_/0


Original change's description:
> bluetooth: add BluetoothAdapter::IsPeripheralRoleSupported()
> 
> It appears that on Windows, Bluetooth hardware does not generally
> support the BLE peripheral role (i.e. BLE advertisements). Add a method
> to BluetoothAdapter that returns the
> BluetoothAdapter.IsPeripheralRoleSupported property [0] on WinRT and
> true everywhere else, so that client code can detect these cases.
> 
> [0]
> https://docs.microsoft.com/en-us/uwp/api/windows.devices.bluetooth.bluetoothadapter.isperipheralrolesupported
> 
> Bug: 1069140
> Change-Id: If8f2f448f30db6aaf720c10e00391dea3f65944e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2152892
> Commit-Queue: Martin Kreichgauer <martinkr@chromium.org>
> Reviewed-by: Reilly Grant <reillyg@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#759836}

TBR=reillyg@chromium.org,martinkr@chromium.org

Change-Id: I993fe1e58bf4704977cd07b18cf61aba04f402ce
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1069140
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2153434Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759999}
parent 380171a4
......@@ -91,11 +91,6 @@ void BluetoothAdapter::SetPowered(bool powered,
set_powered_callbacks_->error_callback = error_callback;
}
bool BluetoothAdapter::IsPeripheralRoleSupported() const {
// TODO(crbug/1071595): Implement this for more platforms.
return true;
}
std::unordered_map<BluetoothDevice*, BluetoothDevice::UUIDSet>
BluetoothAdapter::RetrieveGattConnectedDevicesWithDiscoveryFilter(
const BluetoothDiscoveryFilter& discovery_filter) {
......
......@@ -433,9 +433,6 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapter
const base::Closure& callback,
const ErrorCallback& error_callback);
// Indicates whether the adapter support the LowEnergy peripheral role.
virtual bool IsPeripheralRoleSupported() const;
// Indicates whether the adapter radio is discoverable.
virtual bool IsDiscoverable() const = 0;
......
......@@ -765,7 +765,6 @@ TEST_F(BluetoothTest, MAYBE_ConstructFakeAdapter) {
EXPECT_TRUE(adapter_->CanPower());
EXPECT_TRUE(adapter_->IsPresent());
EXPECT_TRUE(adapter_->IsPowered());
EXPECT_TRUE(adapter_->IsPeripheralRoleSupported());
EXPECT_FALSE(adapter_->IsDiscoverable());
EXPECT_FALSE(adapter_->IsDiscovering());
}
......
......@@ -533,16 +533,6 @@ bool BluetoothAdapterWinrt::IsPowered() const {
return GetState(radio_.Get()) == RadioState_On;
}
bool BluetoothAdapterWinrt::IsPeripheralRoleSupported() const {
boolean supported = false;
HRESULT hr = adapter_->get_IsPeripheralRoleSupported(&supported);
if (FAILED(hr)) {
BLUETOOTH_LOG(ERROR) << "Getting IsPeripheralRoleSupported failed: "
<< logging::SystemErrorCodeToString(hr);
}
return supported;
}
bool BluetoothAdapterWinrt::IsDiscoverable() const {
NOTIMPLEMENTED();
return false;
......
......@@ -43,7 +43,6 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterWinrt : public BluetoothAdapter {
bool IsPresent() const override;
bool CanPower() const override;
bool IsPowered() const override;
bool IsPeripheralRoleSupported() const override;
bool IsDiscoverable() const override;
void SetDiscoverable(bool discoverable,
const base::Closure& callback,
......
......@@ -73,8 +73,7 @@ HRESULT FakeBluetoothAdapterWinrt::get_IsLowEnergySupported(boolean* value) {
HRESULT FakeBluetoothAdapterWinrt::get_IsPeripheralRoleSupported(
boolean* value) {
*value = true;
return S_OK;
return E_NOTIMPL;
}
HRESULT FakeBluetoothAdapterWinrt::get_IsCentralRoleSupported(boolean* value) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment