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

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 111
Merged at revision: 110
Proposed branch: lp:~tiagosh/telepathy-ofono/rtm-14.09-fix-hangup-failure
Merge into: lp:telepathy-ofono/rtm-14.09
Diff against target: 57 lines (+22/-0)
2 files modified
ofonocallchannel.cpp (+20/-0)
ofonocallchannel.h (+2/-0)
To merge this branch: bzr merge lp:~tiagosh/telepathy-ofono/rtm-14.09-fix-hangup-failure
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+249906@code.launchpad.net

Commit message

Retry when hangup() or answer() fail.

Description of the change

Retry when hangup() or answer() fail.

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

remove debugs

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ofonocallchannel.cpp'
2--- ofonocallchannel.cpp 2015-01-28 14:29:51 +0000
3+++ ofonocallchannel.cpp 2015-02-17 00:20:56 +0000
4@@ -64,6 +64,8 @@
5 mCallChannel->setHangupCallback(Tp::memFun(this,&oFonoCallChannel::onHangup));
6 mCallChannel->setAcceptCallback(Tp::memFun(this,&oFonoCallChannel::onAccept));
7
8+ QObject::connect(this, SIGNAL(hangupComplete(bool)), this, SLOT(onHangupComplete(bool)));
9+ QObject::connect(this, SIGNAL(answerComplete(bool)), this, SLOT(onAnswerComplete(bool)));
10 // init must be called after initialization, otherwise we will have no object path registered.
11 QTimer::singleShot(0, this, SLOT(init()));
12
13@@ -100,6 +102,20 @@
14 #endif
15 }
16
17+void oFonoCallChannel::onHangupComplete(bool status)
18+{
19+ if (!status) {
20+ QTimer::singleShot(2000, this, SLOT(hangup()));
21+ }
22+}
23+
24+void oFonoCallChannel::onAnswerComplete(bool status)
25+{
26+ if (!status) {
27+ QTimer::singleShot(1000, this, SLOT(answer()));
28+ }
29+}
30+
31 void oFonoCallChannel::onHangup(uint reason, const QString &detailedReason, const QString &message, Tp::DBusError *error)
32 {
33 // TODO: use the parameters sent by telepathy
34@@ -203,6 +219,10 @@
35
36 void oFonoCallChannel::onSwapCallsComplete(bool success)
37 {
38+ if (!success && errorName() == "org.ofono.Error.InProgress") {
39+ QTimer::singleShot(2000, mConnection->voiceCallManager(), SLOT(swapCalls()));
40+ return;
41+ }
42 Tp::LocalHoldState holdState = this->state() == "active" ? Tp::LocalHoldStateUnheld : Tp::LocalHoldStateHeld;
43 Tp::LocalHoldStateReason reason = success ? Tp::LocalHoldStateReasonRequested : Tp::LocalHoldStateReasonResourceNotAvailable;
44 QObject::disconnect(mConnection->voiceCallManager(), SIGNAL(swapCallsComplete(bool)), this, SLOT(onSwapCallsComplete(bool)));
45
46=== modified file 'ofonocallchannel.h'
47--- ofonocallchannel.h 2015-01-28 14:29:51 +0000
48+++ ofonocallchannel.h 2015-02-17 00:20:56 +0000
49@@ -64,6 +64,8 @@
50 void onSwapCallsComplete(bool success);
51 void sendNextDtmf();
52 void init();
53+ void onAnswerComplete(bool success);
54+ void onHangupComplete(bool success);
55
56 void onOfonoMuteChanged(bool mute);
57 void onMultipartyChanged(bool multiparty);

Subscribers

People subscribed via source and target branches