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
1=== modified file 'ofonocallchannel.cpp'
2--- ofonocallchannel.cpp 2015-01-23 21:14:32 +0000
3+++ ofonocallchannel.cpp 2015-02-17 17:08:35 +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-19 20:36:07 +0000
48+++ ofonocallchannel.h 2015-02-17 17:08:35 +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