mirror of
https://github.com/servo/servo.git
synced 2025-06-18 13:24:29 +00:00
Auto merge of #14428 - dati91:connected, r=jdm
Add missing connection check for disconnect <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors <!-- Either: --> - [X] There are tests for these changes <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14428) <!-- Reviewable:end -->
This commit is contained in:
commit
73b6e705b4
1 changed files with 4 additions and 1 deletions
|
@ -90,7 +90,10 @@ impl BluetoothRemoteGATTServerMethods for BluetoothRemoteGATTServer {
|
|||
fn Disconnect(&self) -> ErrorResult {
|
||||
// TODO: Step 1: Implement activeAlgorithms internal slot for BluetoothRemoteGATTServer.
|
||||
|
||||
// TODO: Step 2: Check if this.connected is false here too.
|
||||
// Step 2.
|
||||
if !self.Connected() {
|
||||
return Ok(());
|
||||
}
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
self.get_bluetooth_thread().send(
|
||||
BluetoothRequest::GATTServerDisconnect(String::from(self.Device().Id()), sender)).unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue