Merge lp:~vicamo/telephony-service/send-stop-tone-at-last into lp:telephony-service

Proposed by You-Sheng Yang
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 1043
Merged at revision: 1059
Proposed branch: lp:~vicamo/telephony-service/send-stop-tone-at-last
Merge into: lp:telephony-service
Diff against target: 38 lines (+6/-10)
1 file modified
libtelephonyservice/tonegenerator.cpp (+6/-10)
To merge this branch: bzr merge lp:~vicamo/telephony-service/send-stop-tone-at-last
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
Review via email: mp+248214@code.launchpad.net

Commit message

Class ToneGenerator creates a oneshot timer to keep track of when to send a StopTone req after successfully sending a StartEventTone one. However, when playDTMFTone() is called the second time within the timeout interval (0.2s), it's currently completely ignored and no tone will ever be generated. As a result, when someone presses dialpad buttons very quickly, some of them sound missed because not each of them is accompanied by a DTMF tone.

This patch changes the behavior as: for each playDTMFTone() call, send a StartEventTone and (re)start the timer. This way, every dialpad press causes a DTMF tone being generated and the longest duration of each tone is still 0.2 second.

Description of the change

Class ToneGenerator creates a oneshot timer to keep track of when to send a StopTone req after successfully sending a StartEventTone one. However, when playDTMFTone() is called the second time within the timeout interval (0.2s), it's currently completely ignored and no tone will ever be generated. As a result, when someone presses dialpad buttons very quickly, some of them sound missed because not each of them is accompanied by a DTMF tone.

This patch changes the behavior as: for each playDTMFTone() call, send a StartEventTone and (re)start the timer. This way, every dialpad press causes a DTMF tone being generated and the longest duration of each tone is still 0.2 second.

To post a comment you must log in.
1010. By Gustavo Pichorim Boiko

Move the serial to be a property on account entry, and make sure it is read even
when the account is not connected.
Approved by: PS Jenkins bot

1011. By CI Train Bot Account

Releasing 0.1+15.04.20150203-0ubuntu1

1012. By Tiago Salem Herrmann

Add initial MMS group chat support. Fixes: #1415458

1013. By CI Train Bot Account

Releasing 0.1+15.04.20150205-0ubuntu1

1014. By Tiago Salem Herrmann

Avoid using ofono to get the list of modems in ofono-setup. Fixes: #1413316
Approved by: PS Jenkins bot

1015. By CI Train Bot Account

Releasing 0.1+15.04.20150205.1-0ubuntu1

1016. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1017. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1018. By Gustavo Pichorim Boiko

Ignore accounts not explicitly supported for now. Fixes: #1340758
Approved by: PS Jenkins bot

1019. By Tiago Salem Herrmann

Initialize variables to avoid randomly showing the voicemail indicator for telepathy accounts that do not support the voicemail interface.

1020. By CI Train Bot Account

Releasing 0.1+15.04.20150211-0ubuntu1

1021. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1022. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1023. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1024. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1025. By Tiago Salem Herrmann

Don't remove the call channel if hangup() does not succeed.

1026. By CI Train Bot Account

Releasing 0.1+15.04.20150217-0ubuntu1

1027. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1028. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1029. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1030. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1031. By Tiago Salem Herrmann

Check if default sim is active before sending messages. Fixes: #1423942
Approved by: Sebastien Bacher

1032. By Tiago Salem Herrmann

Do not create instance of GreeterContacts to avoid dealock with unity. Fixes: #1426399

1033. By CI Train Bot Account

Releasing 0.1+15.04.20150227-0ubuntu1

1034. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1035. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1036. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1037. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1038. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1039. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1040. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1041. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1042. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

1043. By You-Sheng Yang

Send StopTone at the last dialpad press

Class ToneGenerator creates a oneshot timer to keep track of when to
send a StopTone req after successfully sending a StartEventTone one.
However, when playDTMFTone() is called the second time within the
timeout interval (0.2s), it's currently completely ignored and no
tone will ever be generated. As a result, when someone presses
dialpad buttons very quickly, some of them sound missed because not
each of them is accompanied by a DTMF tone.

This patch changes the behavior as: for each playDTMFTone() call,
send a StartEventTone and (re)start the timer. This way, every
dialpad press causes a DTMF tone being generated and the longest
duration of each tone is still 0.2 second.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

Any comments?

Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Code looks good and works as expected!

Sorry for the long time to review that.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libtelephonyservice/tonegenerator.cpp'
2--- libtelephonyservice/tonegenerator.cpp 2014-10-16 17:04:19 +0000
3+++ libtelephonyservice/tonegenerator.cpp 2015-03-24 08:39:49 +0000
4@@ -69,20 +69,17 @@
5
6 void ToneGenerator::playDTMFTone(uint key)
7 {
8- if (!mDTMFPlaybackTimer) {
9- mDTMFPlaybackTimer = new QTimer(this);
10- mDTMFPlaybackTimer->setSingleShot(true);
11- connect(mDTMFPlaybackTimer, SIGNAL(timeout()), this, SLOT(stopDTMFTone()));
12- }
13- if (mDTMFPlaybackTimer->isActive()) {
14- qDebug() << "Already playing a tone, ignore.";
15- return;
16- }
17 if (key > 11) {
18 qDebug() << "Invalid DTMF tone, ignore.";
19 return;
20 }
21+
22 if (startEventTone(key)) {
23+ if (!mDTMFPlaybackTimer) {
24+ mDTMFPlaybackTimer = new QTimer(this);
25+ mDTMFPlaybackTimer->setSingleShot(true);
26+ connect(mDTMFPlaybackTimer, SIGNAL(timeout()), this, SLOT(stopDTMFTone()));
27+ }
28 mDTMFPlaybackTimer->start(DTMF_LOCAL_PLAYBACK_DURATION);
29 }
30 }
31@@ -103,7 +100,6 @@
32 if (mDTMFPlaybackTimer) {
33 mDTMFPlaybackTimer->stop();
34 }
35-
36 }
37
38 void ToneGenerator::playWaitingTone()

Subscribers

People subscribed via source and target branches