GNOME Bugzilla – Bug 790801
Device removal fixes
Last modified: 2017-11-26 16:17:10 UTC
.
Created attachment 364351 [details] [review] lib: Remove "interface-removed" callback By the time we receive this signal, the interface we might be using to monitor the device type is probably gone, meaning that we can't say what it used to be. We need to be watching for the object being removed instead.
Created attachment 364352 [details] [review] lib: Fix removing devices not removing them from the UI As mentioned in the previous commit, watching for removed interfaces and checking whether an object is of a certain type will not help us because the object would have lost its identifying interface by the time we get to it. Instead, when an object is removed, look at the proxy we have saved for its path, and remove the appropriate type of object (adapter or device) from our tree.
Created attachment 364353 [details] [review] lib: Export a way to get the default adapter proxy internally So that the Settings widget can use it.
Created attachment 364354 [details] [review] lib: Simplify removing a device We don't need to create a proxy ourselves, BluetoothClient can hand us one.
Review of attachment 364351 [details] [review]: Basically that means assuming that the Adapter1/Device1 interface will be added/removed with the object itself. That assumption seems to be true as we are not interested in any of the dynamic interfaces (e.g. org.bluez.MediaControl1). So fine with me to add the patch.
Review of attachment 364351 [details] [review]: Actually, let me suggest another fix. The interfaces are there and it works correctly in principle, the check is just wrong.
Review of attachment 364352 [details] [review]: See earlier patch.
Review of attachment 364353 [details] [review]: Looks good.
Review of attachment 364354 [details] [review]: Nice
Created attachment 364362 [details] [review] lib: Fix removal of device and adapters The interface_add routine was checking for the interfaces in the wrong way. This means that no interface removal worked and devices would not disappear from the list.
Attachment 364353 [details] pushed as 456a0e7 - lib: Export a way to get the default adapter proxy internally Attachment 364354 [details] pushed as cb52c8f - lib: Simplify removing a device Attachment 364362 [details] pushed as f5af59e - lib: Fix removal of device and adapters