Commit 63264e1
committed
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.1 parent 4d058ed commit 63264e1
2 files changed
+17
-41
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
387 | 389 | | |
388 | 390 | | |
389 | 391 | | |
| |||
400 | 402 | | |
401 | 403 | | |
402 | 404 | | |
403 | | - | |
404 | | - | |
| 405 | + | |
| 406 | + | |
405 | 407 | | |
406 | 408 | | |
407 | 409 | | |
| |||
412 | 414 | | |
413 | 415 | | |
414 | 416 | | |
415 | | - | |
| 417 | + | |
416 | 418 | | |
417 | 419 | | |
418 | 420 | | |
| |||
455 | 457 | | |
456 | 458 | | |
457 | 459 | | |
458 | | - | |
459 | | - | |
| 460 | + | |
| 461 | + | |
460 | 462 | | |
461 | 463 | | |
462 | 464 | | |
| |||
499 | 501 | | |
500 | 502 | | |
501 | 503 | | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
536 | 512 | | |
537 | 513 | | |
538 | 514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
0 commit comments