~ubuntu-branches/ubuntu/vivid/blueman/vivid-proposed

« back to all changes in this revision

Viewing changes to debian/patches/02_dont_crash_on_non-bluetooth_card.patch

  • Committer: Package Import Robot
  • Author(s): Artur Rona
  • Date: 2014-12-24 18:33:36 UTC
  • mfrom: (2.3.8 sid)
  • Revision ID: package-import@ubuntu.com-20141224183336-cyb82ot0y8tz8flq
Tags: 1.99~alpha1-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - debian/patches/01_dont_autostart_lxde.patch:
    + Don't autostart the applet in LXDE.
  - debian/patches/03_filemanager_fix.patch:
    + Add support for more filemanagers.
* debian/patches/02_dont_crash_on_non-bluetooth_card.patch:
  - Dropped, no longer applicable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2
 
Subject: Avoid crashing when receiving event for cards blueman shouldn't handle
3
 
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/precise/+source/blueman/+bug/962469
4
 
 
5
 
We'll run card_cb for every CHANGE or CARD event. Some of those may be for
6
 
changes to non-bluetooth device; in which case we don't need to handle them.
7
 
 
8
 
It's a little less efficient to do this in card_cb() than in on_pulse_event()
9
 
directly, but doing it this way makes for much clearer code as to what we're
10
 
trying to achieve exactly.
11
 
 
12
 
---
13
 
 blueman/plugins/applet/PulseAudio.py |    4 ++++
14
 
 1 file changed, 4 insertions(+)
15
 
 
16
 
Index: b/blueman/plugins/applet/PulseAudio.py
17
 
===================================================================
18
 
--- a/blueman/plugins/applet/PulseAudio.py
19
 
+++ b/blueman/plugins/applet/PulseAudio.py
20
 
@@ -210,6 +210,10 @@ class PulseAudio(AppletPlugin):
21
 
                if (EventType.CARD | EventType.CHANGE) == event:
22
 
                        dprint(event)
23
 
                        def card_cb(c):
24
 
+                               if "bluez.path" not in c["proplist"]:
25
 
+                                       # we're dealing with an event on a non-bluetooth device, we don't care
26
 
+                                       # about those.
27
 
+                                       return
28
 
                                dprint(c)
29
 
                                m = self.loaded_modules[c["proplist"]["bluez.path"]]
30
 
                                if c["owner_module"] == m.id: