From eb3a380301b8f7ec34d3649c386214d39355eaa0 Mon Sep 17 00:00:00 2001 From: Yasir-Khan Date: Mon, 8 Sep 2014 12:58:39 +0100 Subject: bluez5: Allow method calls over dbus for bluetooth daemon This patch changes the dbus policy settings in order to allow calling methods over dbus. bluez5 and pulseaudio rely on this mechanism to configure media end points. Previously bluetoothd was failing to configure the media end points with error org.freedesktop.DBus.Error.AccessDenied, due to which bluetooth headset and smartphone were unable to connect in A2DP mode. Signed-off-by: Yasir-Khan Signed-off-by: Saul Wold Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/recipes-connectivity/bluez5/bluez5/bluetooth.conf | 1 + 1 file changed, 1 insertion(+) (limited to 'meta/recipes-connectivity/bluez5/bluez5') diff --git a/meta/recipes-connectivity/bluez5/bluez5/bluetooth.conf b/meta/recipes-connectivity/bluez5/bluez5/bluetooth.conf index e21e72e3ec..26845bb73c 100644 --- a/meta/recipes-connectivity/bluez5/bluez5/bluetooth.conf +++ b/meta/recipes-connectivity/bluez5/bluez5/bluetooth.conf @@ -11,6 +11,7 @@ + -- cgit 1.2.3-korg henQi/IMAGE_ROOTFS_SIZE'>ChenQi/IMAGE_ROOTFS_SIZE OpenEmbedded Core user contribution treesGrokmirror user
summaryrefslogtreecommitdiffstats
blob: f182c8fd6278e317f3a37ef7caa2e98d6d9fb153 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
from __future__ import absolute_import
import inspect
import traceback
import bb.namedtuple_with_abc
from collections import namedtuple


class TracebackEntry(namedtuple.abc):
    """Pickleable representation of a traceback entry"""
    _fields = 'filename lineno function args code_context index'
    _header = '  File "{0.filename}", line {0.lineno}, in {0.function}{0.args}'

    def format(self, formatter=None):
        if not self.code_context:
            return self._header.format(self) + '\n'

        formatted = [self._header.format(self) + ':\n']

        for lineindex, line in enumerate(self.code_context):
            if formatter:
                line = formatter(line)

            if lineindex == self.index:
                formatted.append('    >%s' % line)
            else:
                formatted.append('     %s' % line)
        return formatted

    def __str__(self):
        return ''.join(self.format())

def _get_frame_args(frame):
    """Get the formatted arguments and class (if available) for a frame"""
    arginfo = inspect.getargvalues(frame)

    try:
        if not arginfo.args:
            return '', None
    # There have been reports from the field of python 2.6 which doesn't 
    # return a namedtuple here but simply a tuple so fallback gracefully if
    # args isn't present.
    except AttributeError:
        return '', None

    firstarg = arginfo.args[0]
    if firstarg == 'self':
        self = arginfo.locals['self']
        cls = self.__class__.__name__

        arginfo.args.pop(0)
        del arginfo.locals['self']
    else:
        cls = None

    formatted = inspect.formatargvalues(*arginfo)
    return formatted, cls

def extract_traceback(tb, context=1):
    frames = inspect.getinnerframes(tb, context)
    for frame, filename, lineno, function, code_context, index in frames:
        formatted_args, cls = _get_frame_args(frame)
        if cls:
            function = '%s.%s' % (cls, function)
        yield TracebackEntry(filename, lineno, function, formatted_args,
                             code_context, index)

def format_extracted(extracted, formatter=None, limit=None):
    if limit:
        extracted = extracted[-limit:]

    formatted = []
    for tracebackinfo in extracted:
        formatted.extend(tracebackinfo.format(formatter))
    return formatted


def format_exception(etype, value, tb, context=1, limit=None, formatter=None):
    formatted = ['Traceback (most recent call last):\n']

    if hasattr(tb, 'tb_next'):
        tb = extract_traceback(tb, context)

    formatted.extend(format_extracted(tb, formatter, limit))
    formatted.extend(traceback.format_exception_only(etype, value))
    return formatted

def to_string(exc):
    if isinstance(exc, SystemExit):
        if not isinstance(exc.code, basestring):
            return 'Exited with "%d"' % exc.code
    return str(exc)