Merge lp:~tiagosh/telepathy-ofono/rtm-14.09-fix-1398525 into lp:telepathy-ofono/rtm-14.09

Proposed by Tiago Salem Herrmann on 2014-12-12
Status: Merged
Approved by: Bill Filler on 2014-12-15
Approved revision: 104
Merged at revision: 104
Proposed branch: lp:~tiagosh/telepathy-ofono/rtm-14.09-fix-1398525
Merge into: lp:telepathy-ofono/rtm-14.09
Diff against target: 61 lines (+18/-6)
2 files modified
connection.cpp (+4/-3)
powerdaudiomodemediator.cpp (+14/-3)
To merge this branch: bzr merge lp:~tiagosh/telepathy-ofono/rtm-14.09-fix-1398525
Reviewer Review Type Date Requested Status
Bill Filler (community) 2014-12-12 Approve on 2014-12-15
Review via email: mp+244623@code.launchpad.net

Commit message

Disable proximity sensor also when using a wired headset.

Description of the change

Disable proximity sensor also when using a wired headset.

To post a comment you must log in.
Bill Filler (bfiller) wrote :

tested, approved

review: Approve
105. By Tiago Salem Herrmann on 2014-12-15

power the screen on before disabling the proximity handling

Bill Filler (bfiller) wrote :

re-tested, works with updated fix

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'connection.cpp'
2--- connection.cpp 2014-10-15 12:32:16 +0000
3+++ connection.cpp 2014-12-15 19:42:30 +0000
4@@ -1005,9 +1005,10 @@
5 {
6 qDebug("PulseAudio audio mode changed: 0x%x", mode);
7
8- if ((mode == AudioModeEarpiece && mActiveAudioOutput != "default") ||
9- (mode == AudioModeWiredHeadset && mActiveAudioOutput != "default")) {
10- setActiveAudioOutput("default");
11+ if (mode == AudioModeEarpiece && mActiveAudioOutput != "earpiece") {
12+ setActiveAudioOutput("earpiece");
13+ } else if (mode == AudioModeWiredHeadset && mActiveAudioOutput != "wired_headset") {
14+ setActiveAudioOutput("wired_headset");
15 } else if (mode == AudioModeSpeaker && mActiveAudioOutput != "speaker") {
16 setActiveAudioOutput("speaker");
17 } else if (mode == AudioModeBluetooth && mActiveAudioOutput != "bluetooth") {
18
19=== modified file 'powerdaudiomodemediator.cpp'
20--- powerdaudiomodemediator.cpp 2014-09-30 17:25:02 +0000
21+++ powerdaudiomodemediator.cpp 2014-12-15 19:42:30 +0000
22@@ -16,6 +16,7 @@
23 * Authors: Andreas Pokorny <andreas.pokorny@canonical.com>
24 */
25
26+#include <QDBusInterface>
27 #include "powerdaudiomodemediator.h"
28
29 PowerDAudioModeMediator::PowerDAudioModeMediator(PowerD &powerd)
30@@ -25,7 +26,7 @@
31
32 void PowerDAudioModeMediator::audioModeChanged(const QString &mode)
33 {
34- bool enableProximity = !(mode == "speaker" || mode == "bluetooth");
35+ bool enableProximity = !(mode == "speaker" || mode == "bluetooth" || mode == "wired_headset");
36
37 if (mProximityEnabled != enableProximity)
38 {
39@@ -36,10 +37,20 @@
40
41 void PowerDAudioModeMediator::apply() const
42 {
43- if (mProximityEnabled)
44+ if (mProximityEnabled) {
45 powerd.enableProximityHandling();
46- else
47+ } else {
48+ // we need to power the screen on before disabling the proximity handling
49+ QDBusInterface unityIface("com.canonical.Unity.Screen",
50+ "/com/canonical/Unity/Screen",
51+ "com.canonical.Unity.Screen",
52+ QDBusConnection::systemBus());
53+ QList<QVariant> args;
54+ args.append("on");
55+ args.append(3);
56+ unityIface.callWithArgumentList(QDBus::NoBlock, "setScreenPowerMode", args);
57 powerd.disableProximityHandling();
58+ }
59 }
60
61 void PowerDAudioModeMediator::audioOutputClosed()

Subscribers

People subscribed via source and target branches