Merge lp:~tiagosh/telephony-service/rtm-14.09-fix-hangup-failure into lp:telephony-service/rtm-14.09

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 940
Merged at revision: 942
Proposed branch: lp:~tiagosh/telephony-service/rtm-14.09-fix-hangup-failure
Merge into: lp:telephony-service/rtm-14.09
Diff against target: 48 lines (+8/-3)
2 files modified
handler/callhandler.cpp (+7/-3)
handler/callhandler.h (+1/-0)
To merge this branch: bzr merge lp:~tiagosh/telephony-service/rtm-14.09-fix-hangup-failure
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+249905@code.launchpad.net

Commit message

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

Description of the change

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

To post a comment you must log in.
940. By Tiago Salem Herrmann

add comment back and remove channel from mClosingChannels

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 2015-01-28 14:51:24 +0000
3+++ handler/callhandler.cpp 2015-02-17 00:19:46 +0000
4@@ -87,7 +87,8 @@
5 }
6
7 CallHandler::CallHandler(QObject *parent)
8-: QObject(parent)
9+: QObject(parent),
10+ mHangupRequested(false)
11 {
12 }
13
14@@ -317,7 +318,9 @@
15 // if you request it to be closed, the CallStateEnded will never be reached and the UI
16 // and logging will be broken.
17 Tp::CallChannelPtr channel = mClosingChannels.take(op);
18- mCallChannels.removeAll(channel);
19+ if (mCallChannels.count() == 1) {
20+ mHangupRequested = true;
21+ }
22 }
23
24 void CallHandler::onCallChannelInvalidated()
25@@ -330,9 +333,10 @@
26
27 mCallChannels.removeAll(channel);
28
29- if (mCallChannels.isEmpty()) {
30+ if (mCallChannels.isEmpty() && !mHangupRequested) {
31 ToneGenerator::instance()->playCallEndedTone();
32 }
33+ mHangupRequested = false;
34 }
35
36 void CallHandler::onCallStateChanged(Tp::CallState state)
37
38=== modified file 'handler/callhandler.h'
39--- handler/callhandler.h 2015-01-28 14:51:24 +0000
40+++ handler/callhandler.h 2015-02-17 00:19:46 +0000
41@@ -73,6 +73,7 @@
42 QMap<QString, Tp::ContactPtr> mContacts;
43 QList<Tp::CallChannelPtr> mCallChannels;
44 QMap<Tp::PendingOperation*,Tp::CallChannelPtr> mClosingChannels;
45+ bool mHangupRequested;
46 };
47
48 #endif // CALLHANDLER_H

Subscribers

People subscribed via source and target branches