Merge lp:~tiagosh/telephony-service/dialpad_sounds into lp:telephony-service

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 921
Merged at revision: 930
Proposed branch: lp:~tiagosh/telephony-service/dialpad_sounds
Merge into: lp:telephony-service
Diff against target: 82 lines (+19/-2)
3 files modified
handler/callhandler.cpp (+7/-2)
libtelephonyservice/greetercontacts.cpp (+10/-0)
libtelephonyservice/greetercontacts.h (+2/-0)
To merge this branch: bzr merge lp:~tiagosh/telephony-service/dialpad_sounds
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+233751@code.launchpad.net

Commit message

Enable dialpad sounds only when enabled in the system-settings.

Description of the change

Enable dialpad sounds only when enabled in the system-settings.

--Checklist--
Are there any related MPs required for this MP to build/function as expected? Please list.
No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/telephony-service) on device or emulator?
Yes

If you changed the UI, was the change specified/approved by design?
N/A

If you changed UI labels, did you update the pot file?
N/A

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
Yes

Did CI run pass? If not, please explain why.
Yes

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes

Code looks good and works as expected!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'handler/callhandler.cpp'
2--- handler/callhandler.cpp 2014-08-22 19:01:46 +0000
3+++ handler/callhandler.cpp 2014-09-08 16:16:00 +0000
4@@ -25,6 +25,7 @@
5 #include "telepathyhelper.h"
6 #include "accountentry.h"
7 #include "tonegenerator.h"
8+#include "greetercontacts.h"
9 #include <TelepathyQt/ContactManager>
10 #include <TelepathyQt/PendingContacts>
11
12@@ -166,9 +167,13 @@
13 }
14 }
15 /*
16- * play locally (via tone generator)
17+ * play locally (via tone generator) only if we are on a call, or if this is
18+ * dialpad sounds
19 */
20- ToneGenerator::instance()->playDTMFTone((uint)event);
21+ if (GreeterContacts::instance()->dialpadSoundsEnabled() && objectPath.isEmpty()
22+ || !objectPath.isEmpty()) {
23+ ToneGenerator::instance()->playDTMFTone((uint)event);
24+ }
25
26 Tp::CallChannelPtr channel = callFromObjectPath(objectPath);
27 if (channel.isNull()) {
28
29=== modified file 'libtelephonyservice/greetercontacts.cpp'
30--- libtelephonyservice/greetercontacts.cpp 2014-08-27 22:32:34 +0000
31+++ libtelephonyservice/greetercontacts.cpp 2014-09-08 16:16:00 +0000
32@@ -171,6 +171,14 @@
33 return mIncomingMessageVibrate.toBool();
34 }
35
36+bool GreeterContacts::dialpadSoundsEnabled()
37+{
38+ if (!mDialpadSoundsEnabled.isValid()) {
39+ mDialpadSoundsEnabled = getUserValue("com.ubuntu.touch.AccountsService.Sound", "DialpadSoundsEnabled");
40+ }
41+ return mDialpadSoundsEnabled.toBool();
42+}
43+
44 void GreeterContacts::greeterListPropertiesChanged(const QString &interface,
45 const QVariantMap &changed,
46 const QStringList &invalidated)
47@@ -240,6 +248,7 @@
48 checkUpdatedValue(changed, invalidated, "IncomingMessageSound", mIncomingMessageSound);
49 checkUpdatedValue(changed, invalidated, "IncomingMessageVibrate", mIncomingMessageVibrate);
50 checkUpdatedValue(changed, invalidated, "IncomingCallVibrate", mIncomingCallVibrate);
51+ checkUpdatedValue(changed, invalidated, "DialpadSoundsEnabled", mDialpadSoundsEnabled);
52 }
53 }
54
55@@ -314,6 +323,7 @@
56 mIncomingMessageSound = QVariant();
57 mIncomingCallVibrate = QVariant();
58 mIncomingMessageVibrate = QVariant();
59+ mDialpadSoundsEnabled = QVariant();
60 signalIfNeeded();
61 }
62 }
63
64=== modified file 'libtelephonyservice/greetercontacts.h'
65--- libtelephonyservice/greetercontacts.h 2014-08-27 22:32:34 +0000
66+++ libtelephonyservice/greetercontacts.h 2014-09-08 16:16:00 +0000
67@@ -51,6 +51,7 @@
68 QString incomingMessageSound();
69 bool incomingMessageVibrate();
70 bool incomingCallVibrate();
71+ bool dialpadSoundsEnabled();
72
73 static bool isGreeterMode();
74
75@@ -94,6 +95,7 @@
76 QVariant mIncomingMessageSound;
77 QVariant mIncomingCallVibrate;
78 QVariant mIncomingMessageVibrate;
79+ QVariant mDialpadSoundsEnabled;
80 bool mGreeterActive;
81
82 QtContacts::QContactFilter mFilter;

Subscribers

People subscribed via source and target branches