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

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 131
Merged at revision: 131
Proposed branch: lp:~tiagosh/telepathy-ofono/fix-hangup-failure
Merge into: lp:telepathy-ofono
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/fix-hangup-failure
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+250040@code.launchpad.net

Commit message

Retry when hangup() or answer() fail.

Description of the change

Retry when hangup() or answer() fail.

--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/<package-name>) 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 'ofonocallchannel.cpp'
--- ofonocallchannel.cpp 2015-01-23 21:14:32 +0000
+++ ofonocallchannel.cpp 2015-02-17 17:08:35 +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-19 20:36:07 +0000
+++ ofonocallchannel.h 2015-02-17 17:08:35 +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