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
=== modified file 'handler/callhandler.cpp'
--- handler/callhandler.cpp 2014-08-22 19:01:46 +0000
+++ handler/callhandler.cpp 2014-09-08 16:16:00 +0000
@@ -25,6 +25,7 @@
25#include "telepathyhelper.h"25#include "telepathyhelper.h"
26#include "accountentry.h"26#include "accountentry.h"
27#include "tonegenerator.h"27#include "tonegenerator.h"
28#include "greetercontacts.h"
28#include <TelepathyQt/ContactManager>29#include <TelepathyQt/ContactManager>
29#include <TelepathyQt/PendingContacts>30#include <TelepathyQt/PendingContacts>
3031
@@ -166,9 +167,13 @@
166 }167 }
167 }168 }
168 /*169 /*
169 * play locally (via tone generator)170 * play locally (via tone generator) only if we are on a call, or if this is
171 * dialpad sounds
170 */172 */
171 ToneGenerator::instance()->playDTMFTone((uint)event);173 if (GreeterContacts::instance()->dialpadSoundsEnabled() && objectPath.isEmpty()
174 || !objectPath.isEmpty()) {
175 ToneGenerator::instance()->playDTMFTone((uint)event);
176 }
172177
173 Tp::CallChannelPtr channel = callFromObjectPath(objectPath);178 Tp::CallChannelPtr channel = callFromObjectPath(objectPath);
174 if (channel.isNull()) {179 if (channel.isNull()) {
175180
=== modified file 'libtelephonyservice/greetercontacts.cpp'
--- libtelephonyservice/greetercontacts.cpp 2014-08-27 22:32:34 +0000
+++ libtelephonyservice/greetercontacts.cpp 2014-09-08 16:16:00 +0000
@@ -171,6 +171,14 @@
171 return mIncomingMessageVibrate.toBool();171 return mIncomingMessageVibrate.toBool();
172}172}
173173
174bool GreeterContacts::dialpadSoundsEnabled()
175{
176 if (!mDialpadSoundsEnabled.isValid()) {
177 mDialpadSoundsEnabled = getUserValue("com.ubuntu.touch.AccountsService.Sound", "DialpadSoundsEnabled");
178 }
179 return mDialpadSoundsEnabled.toBool();
180}
181
174void GreeterContacts::greeterListPropertiesChanged(const QString &interface,182void GreeterContacts::greeterListPropertiesChanged(const QString &interface,
175 const QVariantMap &changed,183 const QVariantMap &changed,
176 const QStringList &invalidated)184 const QStringList &invalidated)
@@ -240,6 +248,7 @@
240 checkUpdatedValue(changed, invalidated, "IncomingMessageSound", mIncomingMessageSound);248 checkUpdatedValue(changed, invalidated, "IncomingMessageSound", mIncomingMessageSound);
241 checkUpdatedValue(changed, invalidated, "IncomingMessageVibrate", mIncomingMessageVibrate);249 checkUpdatedValue(changed, invalidated, "IncomingMessageVibrate", mIncomingMessageVibrate);
242 checkUpdatedValue(changed, invalidated, "IncomingCallVibrate", mIncomingCallVibrate);250 checkUpdatedValue(changed, invalidated, "IncomingCallVibrate", mIncomingCallVibrate);
251 checkUpdatedValue(changed, invalidated, "DialpadSoundsEnabled", mDialpadSoundsEnabled);
243 }252 }
244}253}
245254
@@ -314,6 +323,7 @@
314 mIncomingMessageSound = QVariant();323 mIncomingMessageSound = QVariant();
315 mIncomingCallVibrate = QVariant();324 mIncomingCallVibrate = QVariant();
316 mIncomingMessageVibrate = QVariant();325 mIncomingMessageVibrate = QVariant();
326 mDialpadSoundsEnabled = QVariant();
317 signalIfNeeded();327 signalIfNeeded();
318 }328 }
319}329}
320330
=== modified file 'libtelephonyservice/greetercontacts.h'
--- libtelephonyservice/greetercontacts.h 2014-08-27 22:32:34 +0000
+++ libtelephonyservice/greetercontacts.h 2014-09-08 16:16:00 +0000
@@ -51,6 +51,7 @@
51 QString incomingMessageSound();51 QString incomingMessageSound();
52 bool incomingMessageVibrate();52 bool incomingMessageVibrate();
53 bool incomingCallVibrate();53 bool incomingCallVibrate();
54 bool dialpadSoundsEnabled();
5455
55 static bool isGreeterMode();56 static bool isGreeterMode();
5657
@@ -94,6 +95,7 @@
94 QVariant mIncomingMessageSound;95 QVariant mIncomingMessageSound;
95 QVariant mIncomingCallVibrate;96 QVariant mIncomingCallVibrate;
96 QVariant mIncomingMessageVibrate;97 QVariant mIncomingMessageVibrate;
98 QVariant mDialpadSoundsEnabled;
97 bool mGreeterActive;99 bool mGreeterActive;
98100
99 QtContacts::QContactFilter mFilter;101 QtContacts::QContactFilter mFilter;

Subscribers

People subscribed via source and target branches