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
=== modified file 'ofonocallchannel.cpp'
--- ofonocallchannel.cpp 2015-01-28 14:29:51 +0000
+++ ofonocallchannel.cpp 2015-02-17 00:20:56 +0000
@@ -64,6 +64,8 @@
64 mCallChannel->setHangupCallback(Tp::memFun(this,&oFonoCallChannel::onHangup));64 mCallChannel->setHangupCallback(Tp::memFun(this,&oFonoCallChannel::onHangup));
65 mCallChannel->setAcceptCallback(Tp::memFun(this,&oFonoCallChannel::onAccept));65 mCallChannel->setAcceptCallback(Tp::memFun(this,&oFonoCallChannel::onAccept));
6666
67 QObject::connect(this, SIGNAL(hangupComplete(bool)), this, SLOT(onHangupComplete(bool)));
68 QObject::connect(this, SIGNAL(answerComplete(bool)), this, SLOT(onAnswerComplete(bool)));
67 // init must be called after initialization, otherwise we will have no object path registered.69 // init must be called after initialization, otherwise we will have no object path registered.
68 QTimer::singleShot(0, this, SLOT(init()));70 QTimer::singleShot(0, this, SLOT(init()));
6971
@@ -100,6 +102,20 @@
100#endif102#endif
101}103}
102104
105void oFonoCallChannel::onHangupComplete(bool status)
106{
107 if (!status) {
108 QTimer::singleShot(2000, this, SLOT(hangup()));
109 }
110}
111
112void oFonoCallChannel::onAnswerComplete(bool status)
113{
114 if (!status) {
115 QTimer::singleShot(1000, this, SLOT(answer()));
116 }
117}
118
103void oFonoCallChannel::onHangup(uint reason, const QString &detailedReason, const QString &message, Tp::DBusError *error)119void oFonoCallChannel::onHangup(uint reason, const QString &detailedReason, const QString &message, Tp::DBusError *error)
104{120{
105 // TODO: use the parameters sent by telepathy121 // TODO: use the parameters sent by telepathy
@@ -203,6 +219,10 @@
203219
204void oFonoCallChannel::onSwapCallsComplete(bool success)220void oFonoCallChannel::onSwapCallsComplete(bool success)
205{221{
222 if (!success && errorName() == "org.ofono.Error.InProgress") {
223 QTimer::singleShot(2000, mConnection->voiceCallManager(), SLOT(swapCalls()));
224 return;
225 }
206 Tp::LocalHoldState holdState = this->state() == "active" ? Tp::LocalHoldStateUnheld : Tp::LocalHoldStateHeld;226 Tp::LocalHoldState holdState = this->state() == "active" ? Tp::LocalHoldStateUnheld : Tp::LocalHoldStateHeld;
207 Tp::LocalHoldStateReason reason = success ? Tp::LocalHoldStateReasonRequested : Tp::LocalHoldStateReasonResourceNotAvailable;227 Tp::LocalHoldStateReason reason = success ? Tp::LocalHoldStateReasonRequested : Tp::LocalHoldStateReasonResourceNotAvailable;
208 QObject::disconnect(mConnection->voiceCallManager(), SIGNAL(swapCallsComplete(bool)), this, SLOT(onSwapCallsComplete(bool)));228 QObject::disconnect(mConnection->voiceCallManager(), SIGNAL(swapCallsComplete(bool)), this, SLOT(onSwapCallsComplete(bool)));
209229
=== modified file 'ofonocallchannel.h'
--- ofonocallchannel.h 2015-01-28 14:29:51 +0000
+++ ofonocallchannel.h 2015-02-17 00:20:56 +0000
@@ -64,6 +64,8 @@
64 void onSwapCallsComplete(bool success);64 void onSwapCallsComplete(bool success);
65 void sendNextDtmf();65 void sendNextDtmf();
66 void init();66 void init();
67 void onAnswerComplete(bool success);
68 void onHangupComplete(bool success);
6769
68 void onOfonoMuteChanged(bool mute);70 void onOfonoMuteChanged(bool mute);
69 void onMultipartyChanged(bool multiparty);71 void onMultipartyChanged(bool multiparty);

Subscribers

People subscribed via source and target branches