Merge lp:~boiko/telephony-service/rtm-notify_conf_and_hold_errors into lp:telephony-service/rtm-14.09

Proposed by Gustavo Pichorim Boiko
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 932
Merged at revision: 932
Proposed branch: lp:~boiko/telephony-service/rtm-notify_conf_and_hold_errors
Merge into: lp:telephony-service/rtm-14.09
Diff against target: 239 lines (+76/-3)
9 files modified
handler/Handler.xml (+12/-0)
handler/callhandler.cpp (+12/-2)
handler/callhandler.h (+2/-0)
handler/handlerdbus.cpp (+6/-0)
handler/handlerdbus.h (+2/-0)
libtelephonyservice/callentry.cpp (+23/-1)
libtelephonyservice/callentry.h (+5/-0)
libtelephonyservice/callmanager.cpp (+12/-0)
libtelephonyservice/callmanager.h (+2/-0)
To merge this branch: bzr merge lp:~boiko/telephony-service/rtm-notify_conf_and_hold_errors
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+247847@code.launchpad.net

Commit message

Notify errors when creating conference calls and putting calls on hold.

Description of the change

Notify errors when creating conference calls and putting calls on hold.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'handler/Handler.xml'
2--- handler/Handler.xml 2014-09-10 04:27:25 +0000
3+++ handler/Handler.xml 2015-01-28 14:57:55 +0000
4@@ -141,6 +141,18 @@
5 <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
6 <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
7 </signal>
8+ <signal name="ConferenceCallRequestFinished">
9+ <dox:d><![CDATA[
10+ A conference call request has finished.
11+ ]]></dox:d>
12+ <arg name="succeeded" type="b"/>
13+ </signal>
14+ <signal name="CallHoldingFailed">
15+ <dox:d><![CDATA[
16+ Setting a call on hold failed
17+ ]]></dox:d>
18+ <arg name="objectPath" type="s"/>
19+ </signal>
20 <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true"/>
21 <property name="CallIndicatorVisible" type="b" access="readwrite"/>
22 <signal name="CallIndicatorVisibleChanged">
23
24=== modified file 'handler/callhandler.cpp'
25--- handler/callhandler.cpp 2014-10-16 17:04:19 +0000
26+++ handler/callhandler.cpp 2015-01-28 14:57:55 +0000
27@@ -28,6 +28,7 @@
28 #include "greetercontacts.h"
29 #include <TelepathyQt/ContactManager>
30 #include <TelepathyQt/PendingContacts>
31+#include <TelepathyQt/PendingChannelRequest>
32
33 #define TELEPATHY_MUTE_IFACE "org.freedesktop.Telepathy.Call1.Interface.Mute"
34 #define DBUS_PROPERTIES_IFACE "org.freedesktop.DBus.Properties"
35@@ -129,7 +130,12 @@
36 return;
37 }
38
39- channel->requestHold(hold);
40+ Tp::PendingOperation *op = channel->requestHold(hold);
41+ connect(op, &Tp::PendingOperation::finished, [this, objectPath, op] {
42+ if (op->isError()) {
43+ Q_EMIT callHoldingFailed(objectPath);
44+ }
45+ });
46 }
47
48 void CallHandler::setMuted(const QString &objectPath, bool muted)
49@@ -224,7 +230,11 @@
50 }
51
52 // there is no need to check the pending request. The new channel will arrive at some point.
53- accountEntry->account()->createConferenceCall(calls, QStringList(), QDateTime::currentDateTime(), TP_QT_IFACE_CLIENT + ".TelephonyServiceHandler");
54+ Tp::PendingChannelRequest *pcr = accountEntry->account()->createConferenceCall(calls, QStringList(), QDateTime::currentDateTime(),
55+ TP_QT_IFACE_CLIENT + ".TelephonyServiceHandler");
56+ connect(pcr, &Tp::PendingChannelRequest::finished, [this, pcr] {
57+ Q_EMIT conferenceCallRequestFinished(!pcr->isError());
58+ });
59 }
60
61 void CallHandler::mergeCall(const QString &conferenceObjectPath, const QString &callObjectPath)
62
63=== modified file 'handler/callhandler.h'
64--- handler/callhandler.h 2014-08-05 04:34:24 +0000
65+++ handler/callhandler.h 2015-01-28 14:57:55 +0000
66@@ -54,6 +54,8 @@
67
68 Q_SIGNALS:
69 void callPropertiesChanged(const QString &objectPath, const QVariantMap &properties);
70+ void conferenceCallRequestFinished(bool succeeded);
71+ void callHoldingFailed(const QString &objectPath);
72
73 protected:
74 Tp::CallChannelPtr existingCall(const QString &phoneNumber);
75
76=== modified file 'handler/handlerdbus.cpp'
77--- handler/handlerdbus.cpp 2014-09-10 04:27:25 +0000
78+++ handler/handlerdbus.cpp 2015-01-28 14:57:55 +0000
79@@ -38,6 +38,12 @@
80 connect(CallHandler::instance(),
81 SIGNAL(callPropertiesChanged(QString,QVariantMap)),
82 SIGNAL(CallPropertiesChanged(QString,QVariantMap)));
83+ connect(CallHandler::instance(),
84+ SIGNAL(callHoldingFailed(QString)),
85+ SIGNAL(CallHoldingFailed(QString)));
86+ connect(CallHandler::instance(),
87+ SIGNAL(conferenceCallRequestFinished(bool)),
88+ SIGNAL(ConferenceCallRequestFinished(bool)));
89 }
90
91 HandlerDBus::~HandlerDBus()
92
93=== modified file 'handler/handlerdbus.h'
94--- handler/handlerdbus.h 2014-09-10 04:27:25 +0000
95+++ handler/handlerdbus.h 2015-01-28 14:57:55 +0000
96@@ -77,6 +77,8 @@
97 void onMessageSent(const QString &number, const QString &message);
98 void CallPropertiesChanged(const QString &objectPath, const QVariantMap &properties);
99 void CallIndicatorVisibleChanged(bool visible);
100+ void ConferenceCallRequestFinished(bool succeeded);
101+ void CallHoldingFailed(const QString &objectPath);
102
103 private:
104 bool mCallIndicatorVisible;
105
106=== modified file 'libtelephonyservice/callentry.cpp'
107--- libtelephonyservice/callentry.cpp 2014-12-12 16:15:07 +0000
108+++ libtelephonyservice/callentry.cpp 2015-01-28 14:57:55 +0000
109@@ -72,6 +72,10 @@
110 SIGNAL(CallPropertiesChanged(QString, QVariantMap)),
111 SLOT(onCallPropertiesChanged(QString,QVariantMap)));
112
113+ connect(TelepathyHelper::instance()->handlerInterface(),
114+ SIGNAL(CallHoldingFailed(QString)),
115+ SLOT(onCallHoldingFailed(QString)));
116+
117 if (mAccount && !mAccount->voicemailNumber().isEmpty()) {
118 setVoicemail(phoneNumber() == mAccount->voicemailNumber());
119 }
120@@ -153,6 +157,16 @@
121 entry->deleteLater();
122 }
123
124+void CallEntry::onCallHoldingFailed(const QString &objectPath)
125+{
126+ if (objectPath != mChannel->objectPath()) {
127+ return;
128+ }
129+
130+ // make sure we get the hold state again
131+ Q_EMIT heldChanged();
132+}
133+
134 void CallEntry::setupCallChannel()
135 {
136 connect(mChannel.data(),
137@@ -163,7 +177,7 @@
138 SLOT(onCallFlagsChanged(Tp::CallFlags)));
139 connect(mChannel.data(),
140 SIGNAL(localHoldStateChanged(Tp::LocalHoldState,Tp::LocalHoldStateReason)),
141- SIGNAL(heldChanged()));
142+ SLOT(onCallLocalHoldStateChanged(Tp::LocalHoldState,Tp::LocalHoldStateReason)));
143
144 mLocalMuteState = mMuteInterface.property("LocalMuteState") == 1;
145 connect(&mMuteInterface,
146@@ -439,6 +453,14 @@
147 Q_EMIT ringingChanged();
148 }
149
150+void CallEntry::onCallLocalHoldStateChanged(Tp::LocalHoldState state, Tp::LocalHoldStateReason reason)
151+{
152+ if (reason == Tp::LocalHoldStateReasonResourceNotAvailable) {
153+ Q_EMIT callHoldingFailed();
154+ }
155+ Q_EMIT heldChanged();
156+}
157+
158 void CallEntry::setVoicemail(bool voicemail)
159 {
160 mVoicemail = voicemail;
161
162=== modified file 'libtelephonyservice/callentry.h'
163--- libtelephonyservice/callentry.h 2014-08-25 14:49:53 +0000
164+++ libtelephonyservice/callentry.h 2015-01-28 14:57:55 +0000
165@@ -135,6 +135,7 @@
166 protected Q_SLOTS:
167 void onCallStateChanged(Tp::CallState state);
168 void onCallFlagsChanged(Tp::CallFlags flags);
169+ void onCallLocalHoldStateChanged(Tp::LocalHoldState state, Tp::LocalHoldStateReason reason);
170 void onMutedChanged(uint state);
171 void onCallPropertiesChanged(const QString &objectPath, const QVariantMap &properties);
172 void onAudioOutputsChanged(const AudioOutputDBusList &outputs);
173@@ -145,6 +146,9 @@
174 void onConferenceChannelRemoved(const Tp::ChannelPtr &channel, const Tp::Channel::GroupMemberChangeDetails &details);
175 void onInternalCallEnded();
176
177+ // handler error notification
178+ void onCallHoldingFailed(const QString &objectPath);
179+
180 protected:
181 void setupCallChannel();
182 void updateChannelProperties(const QVariantMap &properties = QVariantMap());
183@@ -166,6 +170,7 @@
184 void elapsedTimeChanged();
185 void activeAudioOutputChanged();
186 void audioOutputsChanged();
187+ void callHoldingFailed();
188
189 private:
190 void refreshProperties();
191
192=== modified file 'libtelephonyservice/callmanager.cpp'
193--- libtelephonyservice/callmanager.cpp 2015-01-20 12:13:46 +0000
194+++ libtelephonyservice/callmanager.cpp 2015-01-28 14:57:55 +0000
195@@ -57,6 +57,11 @@
196 "com.canonical.TelephonyServiceHandler",
197 "CallIndicatorVisibleChanged",
198 this, SLOT(onCallIndicatorVisibleChanged(bool)));
199+ connection.connect("com.canonical.TelephonyServiceHandler",
200+ "/com/canonical/TelephonyServiceHandler",
201+ "com.canonical.TelephonyServiceHandler",
202+ "ConferenceCallRequestFinished",
203+ this, SLOT(onConferenceCallRequestFinished(bool)));
204 }
205
206 void CallManager::refreshProperties()
207@@ -190,6 +195,13 @@
208 Q_EMIT callIndicatorVisibleChanged(visible);
209 }
210
211+void CallManager::onConferenceCallRequestFinished(bool succeeded)
212+{
213+ if (!succeeded) {
214+ Q_EMIT conferenceRequestFailed();
215+ }
216+}
217+
218 CallEntry *CallManager::foregroundCall() const
219 {
220 CallEntry *call = 0;
221
222=== modified file 'libtelephonyservice/callmanager.h'
223--- libtelephonyservice/callmanager.h 2015-01-20 12:13:46 +0000
224+++ libtelephonyservice/callmanager.h 2015-01-28 14:57:55 +0000
225@@ -92,12 +92,14 @@
226 void voicemailNumberChanged();
227 void emergencyNumbersChanged();
228 void callIndicatorVisibleChanged(bool visible);
229+ void conferenceRequestFailed();
230
231 public Q_SLOTS:
232 void onCallChannelAvailable(Tp::CallChannelPtr channel);
233 void onChannelObserverUnregistered();
234 void onCallEnded();
235 void onCallIndicatorVisibleChanged(bool visible);
236+ void onConferenceCallRequestFinished(bool succeeded);
237
238 private:
239 explicit CallManager(QObject *parent = 0);

Subscribers

People subscribed via source and target branches