-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bluez5: Clean up static default properties, re-drop PairDevice class_…
… parameter Over the years, this template has accumulated some hacks and bad API which made PairDevice()'s handling of the Modalias/Class/Icon properties buggy and hard to understand: * These are *static* device properties, they are not supposed to change during pairing. * Commit ee29a44 added these as some kind of "dynamic fallback default" when they were not initialized by the caller after AddDevice(). * Commit 59d6af0 silently broke that fallback default by changing AddDevice() to set these device properties to empty strings. * Commit fae4be7 added another really bad API for setting Class in PairDevice()(). That API didn't fit into D-Bus (see commit 8968284 which had to make it a non-default parameter) and also broke the API, and moreover it is totally unintuitive -- the device class has nothing to do with pairing. Clean up all of these: Set the static property defaults in AddDevice() right away, so that the caller can adjust them afterwards. Re-drop the `class_` argument in PairDevice(). Adjust the documentation of AddDevice() to point out that properties should be changed after calling that. Consequently, PairDevice() will stop claiming that the static properties changed. This also gets rid of some redundant code.
- Loading branch information
1 parent
4d058ed
commit 63264e1
Showing
2 changed files
with
17 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters