Merge lp:~mzanetti/ubuntu-system-settings/bt-input into lp:ubuntu-system-settings

Proposed by Michael Zanetti
Status: Merged
Approved by: Ken VanDine
Approved revision: 1224
Merged at revision: 1235
Proposed branch: lp:~mzanetti/ubuntu-system-settings/bt-input
Merge into: lp:ubuntu-system-settings
Diff against target: 67 lines (+14/-0)
3 files modified
plugins/bluetooth/bluetooth.cpp (+8/-0)
plugins/bluetooth/device.cpp (+5/-0)
plugins/bluetooth/device.h (+1/-0)
To merge this branch: bzr merge lp:~mzanetti/ubuntu-system-settings/bt-input
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+243796@code.launchpad.net

Commit message

Enable support for Bluetooth Input devices

Description of the change

I haven't managed to properly test this yet as BlueZ seems to crash when establishing the HIDP connection. However, with this I can successfully pair a BT keyboard using the settings app.

Trying to do the same setup manually using bluez-simple-agent and dbus calls to connect the Input interface manually results in the same BlueZ crash, so I'm confident this branch is ok. We might still want to wait with landing until the BlueZ issue is resolved.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the work. Seems fine to me, but note that https://code.launchpad.net/~mathieu-tl/ubuntu-system-settings/unbreak-hid/+merge/243592 was recently proposed that drops the device type limitation, if that goes in you might need to rebase your changes

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1224. By Michael Zanetti

merte trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/bluetooth/bluetooth.cpp'
2--- plugins/bluetooth/bluetooth.cpp 2014-12-03 20:34:39 +0000
3+++ plugins/bluetooth/bluetooth.cpp 2014-12-12 21:00:48 +0000
4@@ -148,6 +148,10 @@
5 case Device::Type::Carkit:
6 m_selectedDevice->disconnect(Device::ConnectionMode::Audio);
7 break;
8+ case Device::Type::Keyboard:
9+ case Device::Type::Mouse:
10+ m_selectedDevice->disconnect(Device::ConnectionMode::Input);
11+ break;
12 default:
13 qWarning() << "Nothing to disconnect: Unsupported device type.";
14 break;
15@@ -177,6 +181,10 @@
16 case Device::Type::Carkit:
17 connMode = Device::ConnectionMode::Audio;
18 break;
19+ case Device::Type::Keyboard:
20+ case Device::Type::Mouse:
21+ connMode = Device::ConnectionMode::Input;
22+ break;
23 default:
24 qWarning() << "Nothing to connect: Unsupported device type.";
25 return;
26
27=== modified file 'plugins/bluetooth/device.cpp'
28--- plugins/bluetooth/device.cpp 2014-08-28 07:22:28 +0000
29+++ plugins/bluetooth/device.cpp 2014-12-12 21:00:48 +0000
30@@ -59,6 +59,7 @@
31 initInterface(m_audioSourceInterface, path, "org.bluez.AudioSource", bus);
32 initInterface(m_audioSinkInterface, path, "org.bluez.AudioSink", bus);
33 initInterface(m_headsetInterface, path, "org.bluez.Headset", bus);
34+ initInterface(m_inputInterface, path, "org.bluez.Input", bus);
35
36 Q_EMIT(pathChanged());
37 }
38@@ -190,6 +191,8 @@
39 interface = m_headsetInterface;
40 else if (m_audioInterface && (mode == Audio))
41 interface = m_audioInterface;
42+ else if (m_inputInterface && (mode == Input))
43+ interface = m_inputInterface;
44 else {
45 qWarning() << "Unhandled connection mode" << mode;
46 return;
47@@ -206,6 +209,8 @@
48 interface = m_headsetInterface;
49 else if (m_audioInterface && (mode == Audio))
50 interface = m_audioInterface;
51+ else if (m_inputInterface && (mode == Input))
52+ interface = m_inputInterface;
53 else {
54 qWarning() << "Unhandled connection mode" << mode;
55 return;
56
57=== modified file 'plugins/bluetooth/device.h'
58--- plugins/bluetooth/device.h 2014-08-11 09:32:31 +0000
59+++ plugins/bluetooth/device.h 2014-12-12 21:00:48 +0000
60@@ -125,6 +125,7 @@
61 QSharedPointer<QDBusInterface> m_audioSourceInterface;
62 QSharedPointer<QDBusInterface> m_audioSinkInterface;
63 QSharedPointer<QDBusInterface> m_headsetInterface;
64+ QSharedPointer<QDBusInterface> m_inputInterface;
65 QList<ConnectionMode> m_connectAfterPairing;
66
67 protected:

Subscribers

People subscribed via source and target branches