Merge lp:~boiko/telephony-service/sync_ota5_fixes into lp:telephony-service

Proposed by Gustavo Pichorim Boiko
Status: Merged
Approved by: Tiago Salem Herrmann
Approved revision: 1099
Merged at revision: 1099
Proposed branch: lp:~boiko/telephony-service/sync_ota5_fixes
Merge into: lp:telephony-service
Diff against target: 1020 lines (+487/-43)
30 files modified
.bzrignore (+1/-0)
CMakeLists.txt (+8/-0)
approver/approver.cpp (+20/-3)
approver/approver.h (+1/-0)
cmake/modules/GenerateTest.cmake (+8/-3)
debian/telephony-service.install (+3/-3)
handler/callhandler.cpp (+2/-3)
handler/handler.cpp (+30/-3)
handler/handler.h (+1/-0)
indicator/icons/CMakeLists.txt (+2/-1)
indicator/messagingmenu.cpp (+0/-1)
indicator/ussdindicator.cpp (+13/-6)
libtelephonyservice/applicationutils.cpp (+9/-7)
libtelephonyservice/callentry.cpp (+1/-1)
libtelephonyservice/telepathyhelper.cpp (+1/-0)
po/CMakeLists.txt (+1/-1)
tests/CMakeLists.txt (+1/-0)
tests/approver/ApproverTest.cpp (+108/-0)
tests/approver/CMakeLists.txt (+16/-0)
tests/approver/approvercontroller.cpp (+49/-0)
tests/approver/approvercontroller.h (+41/-0)
tests/common/CMakeLists.txt (+3/-0)
tests/common/NotificationsMock.cpp (+86/-0)
tests/common/mock/callchannel.cpp (+11/-1)
tests/handler/HandlerTest.cpp (+50/-7)
tests/handler/approver.cpp (+7/-1)
tests/handler/approver.h (+1/-1)
tests/handler/handlercontroller.cpp (+6/-0)
tests/handler/handlercontroller.h (+1/-0)
tests/libtelephonyservice/CallEntryTest.cpp (+6/-1)
To merge this branch: bzr merge lp:~boiko/telephony-service/sync_ota5_fixes
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+264207@code.launchpad.net

Commit message

Sync the fixes that were released in OTA5:

  [ Andreas Pokorny ]
  * sbuild fix

  [ Gustavo Pichorim Boiko ]
  * Do not update the pot file automatically on builds, it causes
    conflicts when multiple changes are applied together.

  [ Iain Lane ]
  * We don't inherit from the 'gnome' icon theme any more, so our icons
    weren't being found in a default Unity session using ubuntu-mono-
    dark. We do, however, inherit from Humanity, so put the icons under
    this theme. (LP: #1412709)

  [ Sebastien Bacher ]
  * Don't play keypad sounds in silentmode (LP: #1384274)
  * don't unref a non owned variant, g_variant_new_strv() returns a
    floating reference which is consumed by calling
    messaging_menu_message_add_action() thanks Lars Uebernickel for
    pointing the issue (LP: #1427286)

  [ Tiago Salem Herrmann ]
  * Check if targetContact() returns a valid pointer before using it.
    (LP: #1433068)

  [ Gustavo Pichorim Boiko ]
  * Prevent telephony-service from auto-accepting calls in the case of
    an approver failure. added: tests/approver/
    tests/approver/ApproverTest.cpp tests/approver/CMakeLists.txt
    tests/approver/approvercontroller.cpp
    tests/approver/approvercontroller.h

  [ Tiago Salem Herrmann ]
  * Do not let USSD and incoming call snap decisions timeout. Initialize
    m_notificationId with -1, as 0 is a valid id. Do not call
    CloseNotification() when notificationClosed() is received to avoid
    loop. (LP: #1453004)

Description of the change

Sync the fixes that were released in OTA5:

  [ Andreas Pokorny ]
  * sbuild fix

  [ Gustavo Pichorim Boiko ]
  * Do not update the pot file automatically on builds, it causes
    conflicts when multiple changes are applied together.

  [ Iain Lane ]
  * We don't inherit from the 'gnome' icon theme any more, so our icons
    weren't being found in a default Unity session using ubuntu-mono-
    dark. We do, however, inherit from Humanity, so put the icons under
    this theme. (LP: #1412709)

  [ Sebastien Bacher ]
  * Don't play keypad sounds in silentmode (LP: #1384274)
  * don't unref a non owned variant, g_variant_new_strv() returns a
    floating reference which is consumed by calling
    messaging_menu_message_add_action() thanks Lars Uebernickel for
    pointing the issue (LP: #1427286)

  [ Tiago Salem Herrmann ]
  * Check if targetContact() returns a valid pointer before using it.
    (LP: #1433068)

  [ Gustavo Pichorim Boiko ]
  * Prevent telephony-service from auto-accepting calls in the case of
    an approver failure. added: tests/approver/
    tests/approver/ApproverTest.cpp tests/approver/CMakeLists.txt
    tests/approver/approvercontroller.cpp
    tests/approver/approvercontroller.h

  [ Tiago Salem Herrmann ]
  * Do not let USSD and incoming call snap decisions timeout. Initialize
    m_notificationId with -1, as 0 is a valid id. Do not call
    CloseNotification() when notificationClosed() is received to avoid
    loop. (LP: #1453004)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Tiago Salem Herrmann (tiagosh) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2015-05-21 18:02:42 +0000
3+++ .bzrignore 2015-07-08 21:44:54 +0000
4@@ -47,6 +47,7 @@
5
6 tests/*/*Test
7 tests/common/dbus-test-wrapper.sh
8+tests/common/NotificationsMock
9 tests/common/MockConnectionInterface.*
10 tests/common/mock/mockconnectionadaptor.*
11 tests/common/mock/telepathy-mock
12
13=== modified file 'CMakeLists.txt'
14--- CMakeLists.txt 2015-06-10 21:05:50 +0000
15+++ CMakeLists.txt 2015-07-08 21:44:54 +0000
16@@ -12,6 +12,9 @@
17 # Instruct CMake to run moc automatically when needed.
18 set(CMAKE_AUTOMOC ON)
19
20+# just to make debug easier, print the system processor
21+message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}")
22+
23 # Check if should build using ubuntu platform api
24 check_include_file_cxx("ubuntu/application/init.h" USE_UBUNTU_PLATFORM_API)
25
26@@ -47,6 +50,11 @@
27 OUTPUT_STRIP_TRAILING_WHITESPACE
28 )
29
30+# sbuild/cross-compilation fallback:
31+if (QT_INSTALL_QML STREQUAL "")
32+ set(QT_INSTALL_QML ${CMAKE_INSTALL_LIBDIR}/qt5/qml)
33+endif()
34+
35 find_package(PkgConfig REQUIRED)
36 pkg_check_modules(TP_QT5 REQUIRED TelepathyQt5)
37 pkg_check_modules(NOTIFY REQUIRED libnotify)
38
39=== modified file 'approver/approver.cpp'
40--- approver/approver.cpp 2015-06-10 21:05:50 +0000
41+++ approver/approver.cpp 2015-07-08 21:44:54 +0000
42@@ -334,8 +334,8 @@
43 request->setFilter(QContactPhoneNumber::match(contact->id()));
44
45 // lambda function to update the notification
46- QObject::connect(request, &QContactAbstractRequest::stateChanged, [this, request, dispatchOp, channel]() {
47- if (!request || request->state() != QContactAbstractRequest::FinishedState) {
48+ QObject::connect(request, &QContactAbstractRequest::stateChanged, [this, request, dispatchOp, channel](QContactAbstractRequest::State state) {
49+ if (!request || state != QContactAbstractRequest::FinishedState) {
50 return;
51 }
52
53@@ -349,7 +349,6 @@
54 // Also notify greeter via AccountsService
55 GreeterContacts::emitContact(contact);
56 }
57-
58 showSnapDecision(dispatchOp, channel, contact);
59 });
60
61@@ -368,6 +367,8 @@
62 {
63 closeSnapDecision();
64
65+ acceptCallChannels(dispatchOp);
66+
67 // forward the channel to the handler
68 dispatchOp->handleWith(TELEPHONY_SERVICE_HANDLER);
69
70@@ -386,6 +387,8 @@
71 CallManager::instance()->foregroundCall()->endCall();
72 }
73
74+ acceptCallChannels(dispatchOp);
75+
76 // forward the channel to the handler
77 dispatchOp->handleWith(TELEPHONY_SERVICE_HANDLER);
78
79@@ -477,6 +480,9 @@
80 notify_notification_set_hint_string(notification,
81 "x-canonical-secondary-icon",
82 "incoming-call");
83+ notify_notification_set_hint_int32(notification,
84+ "x-canonical-snap-decisions-timeout",
85+ -1);
86
87 QString acceptTitle = hasCalls ? C::gettext("Hold + Answer") :
88 C::gettext("Accept");
89@@ -551,6 +557,17 @@
90 return true;
91 }
92
93+void Approver::acceptCallChannels(const Tp::ChannelDispatchOperationPtr dispatchOp)
94+{
95+ // accept all channels
96+ Q_FOREACH(Tp::ChannelPtr channel, dispatchOp->channels()) {
97+ Tp::CallChannelPtr callChannel = Tp::CallChannelPtr::dynamicCast(channel);
98+ if (callChannel) {
99+ callChannel->accept();
100+ }
101+ }
102+}
103+
104 Tp::ChannelDispatchOperationPtr Approver::dispatchOperationForIncomingCall()
105 {
106 Tp::ChannelDispatchOperationPtr callDispatchOp;
107
108=== modified file 'approver/approver.h'
109--- approver/approver.h 2015-01-20 12:46:29 +0000
110+++ approver/approver.h 2015-07-08 21:44:54 +0000
111@@ -56,6 +56,7 @@
112 bool showSnapDecision(const Tp::ChannelDispatchOperationPtr dispatchOperation,
113 const Tp::ChannelPtr channel,
114 const QContact &contact = QContact());
115+ void acceptCallChannels(const Tp::ChannelDispatchOperationPtr dispatchOp);
116 bool handleMediaKey(bool doubleClick);
117
118 protected:
119
120=== modified file 'cmake/modules/GenerateTest.cmake'
121--- cmake/modules/GenerateTest.cmake 2015-06-02 20:39:25 +0000
122+++ cmake/modules/GenerateTest.cmake 2015-07-08 21:44:54 +0000
123@@ -77,7 +77,8 @@
124 HISTORY_SQLITE_DBPATH=:memory:
125 MC_ACCOUNT_DIR=${TMPDIR}
126 MC_MANAGER_DIR=${TMPDIR}
127- MC_CLIENTS_DIR=${TMPDIR})
128+ MC_CLIENTS_DIR=${TMPDIR}
129+ TELEPHONY_SERVICE_TEST=1)
130 endif ()
131
132 set(TEST_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME} ${PLATFORM} -p -o -p -,txt -p -o -p ${CMAKE_BINARY_DIR}/test_${TESTNAME}.xml,xunitxml)
133@@ -105,11 +106,12 @@
134
135 function(generate_telepathy_test TESTNAME)
136 set(options "")
137- set(oneValueArgs "")
138+ set(oneValueArgs WAIT_FOR)
139 set(multiValueArgs TASKS LIBRARIES QT5_MODULES)
140 cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
141
142 set(TASKS --task gnome-keyring-daemon -p -r -p -d --task-name gnome-keyring --ignore-return
143+ --task ${CMAKE_BINARY_DIR}/tests/common/NotificationsMock --task-name notifications --ignore-return
144 --task /usr/lib/dconf/dconf-service --task-name dconf-service --ignore-return
145 --task dconf -p write -p /org/gnome/empathy/use-conn -p false --task-name dconf-write --wait-for ca.desrt.dconf --ignore-return
146 --task /usr/lib/telepathy/mission-control-5 --task-name mission-control --wait-for ca.desrt.dconf --ignore-return
147@@ -125,10 +127,13 @@
148 if (NOT DEFINED ARG_QT5_MODULES)
149 set(ARG_QT5_MODULES Core DBus Test Qml)
150 endif (NOT DEFINED ARG_QT5_MODULES)
151+ if (NOT DEFINED ARG_WAIT_FOR)
152+ set(ARG_WAIT_FOR org.freedesktop.Telepathy.Client.TelephonyServiceHandler)
153+ endif (NOT DEFINED ARG_WAIT_FOR)
154 generate_test(${TESTNAME} ${ARGN}
155 TASKS ${TASKS}
156 LIBRARIES ${ARG_LIBRARIES}
157 QT5_MODULES ${ARG_QT5_MODULES}
158 USE_DBUS USE_UI
159- WAIT_FOR org.freedesktop.Telepathy.Client.TelephonyServiceHandler)
160+ WAIT_FOR ${ARG_WAIT_FOR})
161 endfunction(generate_telepathy_test)
162
163=== modified file 'debian/telephony-service.install'
164--- debian/telephony-service.install 2015-06-11 13:32:01 +0000
165+++ debian/telephony-service.install 2015-07-08 21:44:54 +0000
166@@ -8,9 +8,9 @@
167 usr/share/icons/ubuntu-mono-dark/status/*/indicator-call.svg
168 usr/share/icons/ubuntu-mono-light/status/*/indicator-call.svg
169 usr/share/locale/*/LC_MESSAGES/telephony-service.mo
170-usr/share/notify-osd/icons/gnome/scalable/status/notification-group-call.svg
171-usr/share/notify-osd/icons/gnome/scalable/status/notification-unavailable-image-call.svg
172-usr/share/notify-osd/icons/gnome/scalable/status/notification-unknown-call.svg
173+usr/share/notify-osd/icons/Humanity/scalable/status/notification-group-call.svg
174+usr/share/notify-osd/icons/Humanity/scalable/status/notification-unavailable-image-call.svg
175+usr/share/notify-osd/icons/Humanity/scalable/status/notification-unknown-call.svg
176 usr/share/polkit-1/actions/*TelephonyService*.policy
177 usr/share/telepathy/clients/TelephonyService*.client
178 usr/share/telephony-service/assets/*
179
180=== modified file 'handler/callhandler.cpp'
181--- handler/callhandler.cpp 2015-03-04 18:02:13 +0000
182+++ handler/callhandler.cpp 2015-07-08 21:44:54 +0000
183@@ -177,7 +177,8 @@
184 * play locally (via tone generator) only if we are on a call, or if this is
185 * dialpad sounds
186 */
187- if (GreeterContacts::instance()->dialpadSoundsEnabled() && objectPath.isEmpty()
188+ if (GreeterContacts::instance()->dialpadSoundsEnabled() &&
189+ !GreeterContacts::instance()->silentMode() && objectPath.isEmpty()
190 || !objectPath.isEmpty()) {
191 ToneGenerator::instance()->playDTMFTone((uint)event);
192 }
193@@ -264,8 +265,6 @@
194
195 void CallHandler::onCallChannelAvailable(Tp::CallChannelPtr channel)
196 {
197- channel->accept();
198-
199 QDBusInterface callChannelIface(channel->busName(), channel->objectPath(), DBUS_PROPERTIES_IFACE);
200 QDBusMessage reply = callChannelIface.call("GetAll", CANONICAL_TELEPHONY_AUDIOOUTPUTS_IFACE);
201 QVariantList args = reply.arguments();
202
203=== modified file 'handler/handler.cpp'
204--- handler/handler.cpp 2015-06-10 21:05:50 +0000
205+++ handler/handler.cpp 2015-07-08 21:44:54 +0000
206@@ -21,6 +21,7 @@
207 */
208
209 #include "handler.h"
210+#include "accountentry.h"
211 #include "protocolmanager.h"
212 #include "telepathyhelper.h"
213
214@@ -60,6 +61,7 @@
215
216
217 Q_FOREACH(const Tp::ChannelPtr channel, channels) {
218+ mContexts[channel.data()] = context;
219 Tp::TextChannelPtr textChannel = Tp::TextChannelPtr::dynamicCast(channel);
220 if (textChannel) {
221 Tp::PendingReady *pr = textChannel->becomeReady(Tp::Features()
222@@ -89,7 +91,6 @@
223 }
224
225 }
226- context->setFinished();
227 }
228
229 Tp::ChannelClassSpecList Handler::channelFilters()
230@@ -121,6 +122,10 @@
231 }
232
233 mReadyRequests.remove(pr);
234+ Tp::MethodInvocationContextPtr<> context = mContexts.take(textChannel.data());
235+ if (context) {
236+ context->setFinished();
237+ }
238
239 Q_EMIT textChannelAvailable(textChannel);
240 }
241@@ -134,15 +139,37 @@
242 return;
243 }
244
245- Tp::ChannelPtr channel = mReadyRequests[pr];
246+ Tp::ChannelPtr channel = mReadyRequests.take(pr);
247 Tp::CallChannelPtr callChannel = Tp::CallChannelPtr::dynamicCast(channel);
248+ Tp::MethodInvocationContextPtr<> context = mContexts.take(channel.data());
249
250 if(!callChannel) {
251+ if (context) {
252+ context->setFinishedWithError(TP_QT_ERROR_CONFUSED, "Channel was not a call channel");
253+ }
254 qCritical() << "The saved channel is not a Tp::CallChannel";
255 return;
256 }
257
258- mReadyRequests.remove(pr);
259+ // if the call is neither Accepted nor Active, it means it got dispatched directly to the handler without passing
260+ // through any approver. For phone calls, this would mean calls getting auto-accepted which is not desirable
261+ // so we return an error here
262+ bool incoming = false;
263+ AccountEntry *accountEntry = TelepathyHelper::instance()->accountForConnection(callChannel->connection());
264+ if (accountEntry) {
265+ incoming = callChannel->initiatorContact() != accountEntry->account()->connection()->selfContact();
266+ }
267+ if (incoming && callChannel->callState() != Tp::CallStateAccepted && callChannel->callState() != Tp::CallStateActive) {
268+ qWarning() << "Available channel was not approved by telephony-service-approver, ignoring it.";
269+ if (context) {
270+ context->setFinishedWithError(TP_QT_ERROR_NOT_CAPABLE, "Only channels approved and accepted by telephony-service-approver are supported");
271+ }
272+ return;
273+ }
274+
275+ if (context) {
276+ context->setFinished();
277+ }
278
279 Q_EMIT callChannelAvailable(callChannel);
280 }
281
282=== modified file 'handler/handler.h'
283--- handler/handler.h 2013-07-18 17:02:10 +0000
284+++ handler/handler.h 2015-07-08 21:44:54 +0000
285@@ -56,6 +56,7 @@
286
287 private:
288 QMap<Tp::PendingReady*, Tp::ChannelPtr> mReadyRequests;
289+ QMap<Tp::Channel*, Tp::MethodInvocationContextPtr<> > mContexts;
290 };
291
292 #endif // HANDLER_H
293
294=== modified file 'indicator/icons/CMakeLists.txt'
295--- indicator/icons/CMakeLists.txt 2012-07-20 14:14:47 +0000
296+++ indicator/icons/CMakeLists.txt 2015-07-08 21:44:54 +0000
297@@ -1,3 +1,4 @@
298+set (icon-theme Humanity)
299
300 set(icons
301 notification-group-call.svg
302@@ -5,4 +6,4 @@
303 notification-unknown-call.svg
304 )
305
306-install(FILES ${icons} DESTINATION share/notify-osd/icons/gnome/scalable/status)
307+install(FILES ${icons} DESTINATION share/notify-osd/icons/${icon-theme}/scalable/status)
308
309=== modified file 'indicator/messagingmenu.cpp'
310--- indicator/messagingmenu.cpp 2015-06-11 16:38:02 +0000
311+++ indicator/messagingmenu.cpp 2015-07-08 21:44:54 +0000
312@@ -251,7 +251,6 @@
313 messaging_menu_app_append_message(mCallsApp, message, SOURCE_ID, true);
314 mCalls.append(call);
315
316- g_variant_unref(messages);
317 g_object_unref(file);
318 g_object_unref(icon);
319 g_object_unref(message);
320
321=== modified file 'indicator/ussdindicator.cpp'
322--- indicator/ussdindicator.cpp 2015-04-28 19:18:55 +0000
323+++ indicator/ussdindicator.cpp 2015-07-08 21:44:54 +0000
324@@ -32,6 +32,7 @@
325
326 USSDIndicator::USSDIndicator(QObject *parent)
327 : QObject(parent),
328+ m_notificationId(-1),
329 m_menuRequest(true),
330 m_menuNotification(false),
331 m_notifications("org.freedesktop.Notifications",
332@@ -99,7 +100,13 @@
333
334 void USSDIndicator::onStateChanged(const QString &state)
335 {
336- // TODO: check if we should close notifications when the state is idle
337+ if (m_notificationId == -1) {
338+ return;
339+ }
340+
341+ if (state == "idle") {
342+ m_notifications.CloseNotification(m_notificationId);
343+ }
344 }
345
346 void USSDIndicator::showUSSDNotification(const QString &message, bool replyRequired, USSDManager *ussdManager)
347@@ -116,6 +123,7 @@
348 QVariantMap notificationHints;
349 notificationHints["x-canonical-snap-decisions"] = "true";
350 notificationHints["x-canonical-private-button-tint"] = "true";
351+ notificationHints["x-canonical-snap-decisions-timeout"] = -1;
352
353 QVariantMap menuModelActions;
354 menuModelActions["notifications"] = menu->actionPath();
355@@ -148,7 +156,7 @@
356 return;
357 }
358
359- m_notificationId = 0;
360+ m_notificationId = -1;
361
362 if (actionKey == "reply_id") {
363 ussdManager->respond(m_menuRequest.response());
364@@ -162,19 +170,18 @@
365 if (id != m_notificationId) {
366 return;
367 }
368- m_notifications.CloseNotification(m_notificationId);
369- m_notificationId = 0;
370+ m_notificationId = -1;
371 }
372
373 void USSDIndicator::clear()
374 {
375- if (m_notificationId != 0) {
376+ if (m_notificationId != -1) {
377 USSDManager *ussdManager = mUSSDRequests.take(m_notificationId);
378 if (ussdManager) {
379 ussdManager->cancel();
380 }
381
382 m_notifications.CloseNotification(m_notificationId);
383- m_notificationId = 0;
384+ m_notificationId = -1;
385 }
386 }
387
388=== modified file 'libtelephonyservice/applicationutils.cpp'
389--- libtelephonyservice/applicationutils.cpp 2015-05-21 18:02:42 +0000
390+++ libtelephonyservice/applicationutils.cpp 2015-07-08 21:44:54 +0000
391@@ -60,13 +60,15 @@
392 bool ApplicationUtils::openUrl(const QUrl &url)
393 {
394 #ifdef USE_UBUNTU_PLATFORM_API
395- UAUrlDispatcherSession* session = ua_url_dispatcher_session();
396- if (!session)
397- return false;
398-
399- ua_url_dispatcher_session_open(session, url.toEncoded().constData(), NULL, NULL);
400-
401- free(session);
402+ if (qgetenv("TELEPHONY_SERVICE_TEST").isEmpty()) {
403+ UAUrlDispatcherSession* session = ua_url_dispatcher_session();
404+ if (!session)
405+ return false;
406+
407+ ua_url_dispatcher_session_open(session, url.toEncoded().constData(), NULL, NULL);
408+
409+ free(session);
410+ }
411 #endif
412 return true;
413 }
414
415=== modified file 'libtelephonyservice/callentry.cpp'
416--- libtelephonyservice/callentry.cpp 2015-04-28 20:44:57 +0000
417+++ libtelephonyservice/callentry.cpp 2015-07-08 21:44:54 +0000
418@@ -295,7 +295,7 @@
419
420 QString CallEntry::phoneNumber() const
421 {
422- if (mChannel->isConference() || !mChannel->actualFeatures().contains(Tp::CallChannel::FeatureCore)) {
423+ if (mChannel->isConference() || !mChannel->actualFeatures().contains(Tp::CallChannel::FeatureCore) || mChannel->targetContact().isNull()) {
424 return "";
425 }
426 return mChannel->targetContact()->id();
427
428=== modified file 'libtelephonyservice/telepathyhelper.cpp'
429--- libtelephonyservice/telepathyhelper.cpp 2015-06-11 16:48:18 +0000
430+++ libtelephonyservice/telepathyhelper.cpp 2015-07-08 21:44:54 +0000
431@@ -466,6 +466,7 @@
432 }
433
434 if (mAccounts.count() == 0) {
435+ mFirstTime = false;
436 Q_EMIT setupReady();
437 return;
438 }
439
440=== modified file 'po/CMakeLists.txt'
441--- po/CMakeLists.txt 2014-08-20 09:35:55 +0000
442+++ po/CMakeLists.txt 2015-07-08 21:44:54 +0000
443@@ -28,7 +28,7 @@
444
445 find_program(XGETTEXT_EXECUTABLE xgettext)
446 if(XGETTEXT_EXECUTABLE)
447- add_custom_target(${POT_FILE} ALL
448+ add_custom_target(${POT_FILE}
449 COMMENT "Generating translation template"
450 COMMAND ${XGETTEXT_EXECUTABLE} --c++ --qt --add-comments=TRANSLATORS --keyword=GettextMarkExtraction --keyword=tr --keyword=tr:1,2 -D ${CMAKE_SOURCE_DIR} -s -p ${CMAKE_CURRENT_SOURCE_DIR} -o ${POT_FILE} ${I18N_SRCS}
451 )
452
453=== modified file 'tests/CMakeLists.txt'
454--- tests/CMakeLists.txt 2015-05-21 18:02:42 +0000
455+++ tests/CMakeLists.txt 2015-07-08 21:44:54 +0000
456@@ -1,6 +1,7 @@
457 include (GenerateTest)
458
459 add_subdirectory(common)
460+add_subdirectory(approver)
461 add_subdirectory(handler)
462 add_subdirectory(indicator)
463 add_subdirectory(libtelephonyservice)
464
465=== added directory 'tests/approver'
466=== added file 'tests/approver/ApproverTest.cpp'
467--- tests/approver/ApproverTest.cpp 1970-01-01 00:00:00 +0000
468+++ tests/approver/ApproverTest.cpp 2015-07-08 21:44:54 +0000
469@@ -0,0 +1,108 @@
470+/*
471+ * Copyright (C) 2013-2015 Canonical, Ltd.
472+ *
473+ * This file is part of telephony-service.
474+ *
475+ * telephony-service is free software; you can redistribute it and/or modify
476+ * it under the terms of the GNU General Public License as published by
477+ * the Free Software Foundation; version 3.
478+ *
479+ * telephony-service is distributed in the hope that it will be useful,
480+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
481+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
482+ * GNU General Public License for more details.
483+ *
484+ * You should have received a copy of the GNU General Public License
485+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
486+ */
487+
488+#include <QtCore/QObject>
489+#include <QtTest/QtTest>
490+#include "telepathytest.h"
491+#include "approvercontroller.h"
492+#include "mockcontroller.h"
493+#include "accountentry.h"
494+#include "accountentryfactory.h"
495+#include "telepathyhelper.h"
496+
497+class ApproverTest : public TelepathyTest
498+{
499+ Q_OBJECT
500+
501+private Q_SLOTS:
502+ void initTestCase();
503+ void init();
504+ void cleanup();
505+ void testSnapDecisionTimeout();
506+ void testAcceptCall();
507+
508+private:
509+ void waitForCallActive(const QString &callerId);
510+ MockController *mMockController;
511+ Tp::AccountPtr mTpAccount;
512+};
513+
514+void ApproverTest::initTestCase()
515+{
516+ initialize();
517+
518+ QSignalSpy setupReadySpy(TelepathyHelper::instance(), SIGNAL(setupReady()));
519+ TRY_COMPARE(setupReadySpy.count(), 1);
520+}
521+
522+void ApproverTest::init()
523+{
524+ mTpAccount = addAccount("mock", "mock", "the account");
525+
526+ // and create the mock controller
527+ mMockController = new MockController("mock", this);
528+}
529+
530+void ApproverTest::cleanup()
531+{
532+ doCleanup();
533+ mMockController->deleteLater();
534+}
535+
536+void ApproverTest::testSnapDecisionTimeout()
537+{
538+ QString callerId("12345");
539+ QVariantMap properties;
540+ properties["Caller"] = callerId;
541+ properties["State"] = "incoming";
542+
543+ QDBusInterface notificationsMock("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications");
544+ QSignalSpy notificationSpy(&notificationsMock, SIGNAL(MockNotificationReceived(QString, uint, QString, QString, QString, QStringList, QVariantMap, int)));
545+ mMockController->placeCall(properties);
546+ TRY_COMPARE(notificationSpy.count(), 1);
547+ QVariantMap hints = notificationSpy.first()[6].toMap();
548+ QVERIFY(hints.contains("x-canonical-snap-decisions-timeout"));
549+ QCOMPARE(hints["x-canonical-snap-decisions-timeout"].toInt(), -1);
550+ mMockController->HangupCall(callerId);
551+}
552+
553+void ApproverTest::testAcceptCall()
554+{
555+ QString callerId("7654321");
556+
557+ QVariantMap properties;
558+ properties["Caller"] = callerId;
559+ properties["State"] = "incoming";
560+
561+ QDBusInterface notificationsMock("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications");
562+ QSignalSpy notificationSpy(&notificationsMock, SIGNAL(MockNotificationReceived(QString, uint, QString, QString, QString, QStringList, QVariantMap, int)));
563+ QString objectPath = mMockController->placeCall(properties);
564+ TRY_COMPARE(notificationSpy.count(), 1);
565+
566+ // at this point we are already sure the approver has the call, as the notification was placed
567+ QSignalSpy callStateSpy(mMockController, SIGNAL(CallStateChanged(QString,QString,QString)));
568+ ApproverController::instance()->acceptCall();
569+ TRY_COMPARE(callStateSpy.count(), 1);
570+ QCOMPARE(callStateSpy.first()[0].toString(), callerId);
571+ QCOMPARE(callStateSpy.first()[1].toString(), objectPath);
572+ QCOMPARE(callStateSpy.first()[2].toString(), QString("accepted"));
573+ mMockController->HangupCall(callerId);
574+}
575+
576+QTEST_MAIN(ApproverTest)
577+#include "ApproverTest.moc"
578
579=== added file 'tests/approver/CMakeLists.txt'
580--- tests/approver/CMakeLists.txt 1970-01-01 00:00:00 +0000
581+++ tests/approver/CMakeLists.txt 2015-07-08 21:44:54 +0000
582@@ -0,0 +1,16 @@
583+include_directories(
584+ ${CMAKE_CURRENT_BINARY_DIR}
585+ ${CMAKE_CURRENT_SOURCE_DIR}/../common
586+ ${CMAKE_SOURCE_DIR}
587+ ${CMAKE_SOURCE_DIR}/libtelephonyservice
588+ ${CMAKE_BINARY_DIR}/tests/common
589+ ${TP_QT5_INCLUDE_DIRS}
590+ ${GSETTINGS_QT_INCLUDE_DIRS}
591+ )
592+
593+if (NOT ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64"))
594+ generate_telepathy_test(ApproverTest
595+ SOURCES ApproverTest.cpp approvercontroller.cpp
596+ TASKS --task ${CMAKE_BINARY_DIR}/approver/telephony-service-approver --task-name telephony-service-approver --wait-for com.canonical.TelephonyServiceHandler --ignore-return
597+ WAIT_FOR org.freedesktop.Telepathy.Client.TelephonyServiceApprover)
598+endif()
599
600=== added file 'tests/approver/approvercontroller.cpp'
601--- tests/approver/approvercontroller.cpp 1970-01-01 00:00:00 +0000
602+++ tests/approver/approvercontroller.cpp 2015-07-08 21:44:54 +0000
603@@ -0,0 +1,49 @@
604+/**
605+ * Copyright (C) 2013-2015 Canonical, Ltd.
606+ *
607+ * This program is free software: you can redistribute it and/or modify it under
608+ * the terms of the GNU General Public License version 3, as published by
609+ * the Free Software Foundation.
610+ *
611+ * This program is distributed in the hope that it will be useful, but WITHOUT
612+ * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
613+ * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
614+ * General Public License for more details.
615+ *
616+ * You should have received a copy of the GNU General Public License
617+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
618+ *
619+ * Authors:
620+ * Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
621+ */
622+
623+#include <QStringList>
624+#include "approvercontroller.h"
625+#include <QDBusReply>
626+#include <QDebug>
627+
628+#define APPROVER_SERVICE "com.canonical.Approver"
629+#define APPROVER_OBJECT "/com/canonical/Approver"
630+#define APPROVER_INTERFACE "com.canonical.TelephonyServiceApprover"
631+
632+ApproverController *ApproverController::instance()
633+{
634+ static ApproverController *self = new ApproverController();
635+ return self;
636+}
637+
638+ApproverController::ApproverController(QObject *parent) :
639+ QObject(parent),
640+ mApproverInterface(APPROVER_SERVICE, APPROVER_OBJECT, APPROVER_INTERFACE)
641+{
642+}
643+
644+void ApproverController::acceptCall()
645+{
646+ mApproverInterface.call("AcceptCall");
647+}
648+
649+void ApproverController::hangUpAndAcceptCall()
650+{
651+ mApproverInterface.call("HangUpAndAcceptCall");
652+}
653
654=== added file 'tests/approver/approvercontroller.h'
655--- tests/approver/approvercontroller.h 1970-01-01 00:00:00 +0000
656+++ tests/approver/approvercontroller.h 2015-07-08 21:44:54 +0000
657@@ -0,0 +1,41 @@
658+/**
659+ * Copyright (C) 2013-2015 Canonical, Ltd.
660+ *
661+ * This program is free software: you can redistribute it and/or modify it under
662+ * the terms of the GNU General Public License version 3, as published by
663+ * the Free Software Foundation.
664+ *
665+ * This program is distributed in the hope that it will be useful, but WITHOUT
666+ * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
667+ * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
668+ * General Public License for more details.
669+ *
670+ * You should have received a copy of the GNU General Public License
671+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
672+ *
673+ * Authors:
674+ * Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
675+ */
676+
677+#ifndef APPROVERCONTROLLER_H
678+#define APPROVERCONTROLLER_H
679+
680+#include <QObject>
681+#include <QDBusInterface>
682+
683+class ApproverController : public QObject
684+{
685+ Q_OBJECT
686+public:
687+ static ApproverController *instance();
688+
689+public Q_SLOTS:
690+ void acceptCall();
691+ void hangUpAndAcceptCall();
692+
693+private:
694+ explicit ApproverController(QObject *parent = 0);
695+ QDBusInterface mApproverInterface;
696+};
697+
698+#endif // ApproverController_H
699
700=== modified file 'tests/common/CMakeLists.txt'
701--- tests/common/CMakeLists.txt 2015-06-05 18:42:14 +0000
702+++ tests/common/CMakeLists.txt 2015-07-08 21:44:54 +0000
703@@ -5,6 +5,9 @@
704
705 configure_file(dbus-session.conf.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-session.conf)
706
707+add_executable(NotificationsMock NotificationsMock.cpp)
708+qt5_use_modules(NotificationsMock Core DBus)
709+
710 qt5_add_dbus_interface(mockcontroller_SRCS mock/MockConnection.xml MockConnectionInterface)
711 add_library(mockcontroller STATIC mockcontroller.cpp mockcontroller.h ${mockcontroller_SRCS})
712 qt5_use_modules(mockcontroller Core DBus)
713
714=== added file 'tests/common/NotificationsMock.cpp'
715--- tests/common/NotificationsMock.cpp 1970-01-01 00:00:00 +0000
716+++ tests/common/NotificationsMock.cpp 2015-07-08 21:44:54 +0000
717@@ -0,0 +1,86 @@
718+/*
719+ * Copyright (C) 2015 Canonical, Ltd.
720+ *
721+ * This file is part of telephony-service.
722+ *
723+ * telephony-service is free software; you can redistribute it and/or modify
724+ * it under the terms of the GNU General Public License as published by
725+ * the Free Software Foundation; version 3.
726+ *
727+ * telephony-service is distributed in the hope that it will be useful,
728+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
729+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
730+ * GNU General Public License for more details.
731+ *
732+ * You should have received a copy of the GNU General Public License
733+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
734+ */
735+
736+#include <QObject>
737+#include <QCoreApplication>
738+#include <QDBusConnection>
739+#include <QDBusMessage>
740+#include <QDBusObjectPath>
741+#include <QDebug>
742+
743+#define NOTIFICATIONS_DBUS_SERVICE_NAME "org.freedesktop.Notifications"
744+#define NOTIFICATIONS_DBUS_OBJ_PATH "/org/freedesktop/Notifications"
745+
746+class NotificationsMock : public QObject
747+{
748+ Q_OBJECT
749+ Q_CLASSINFO("D-Bus Interface", NOTIFICATIONS_DBUS_SERVICE_NAME)
750+
751+public:
752+ Q_SCRIPTABLE uint Notify(QString app_name, uint replaces_id, QString app_icon, QString summary, QString body, QStringList actions, QVariantMap hints, int expire_timeout);
753+ Q_SCRIPTABLE void CloseNotification(uint id);
754+ Q_SCRIPTABLE QString GetServerInformation(QString& vendor, QString& version, QString& spec_version);
755+
756+ // Mock specific method
757+ Q_SCRIPTABLE void MockInvokeAction(uint id, QString action_key);
758+
759+Q_SIGNALS:
760+ Q_SCRIPTABLE void NotificationClosed(uint id, uint reason);
761+ Q_SCRIPTABLE void ActionInvoked(uint id, QString action_key);
762+
763+ // Mock specific signal
764+ Q_SCRIPTABLE void MockNotificationReceived(QString app_name, uint replaces_id, QString app_icon, QString summary, QString body, QStringList actions, QVariantMap hints, int expire_timeout);
765+};
766+
767+uint NotificationsMock::Notify(QString app_name, uint replaces_id, QString app_icon, QString summary, QString body, QStringList actions, QVariantMap hints, int expire_timeout)
768+{
769+ Q_EMIT MockNotificationReceived(app_name, replaces_id, app_icon, summary, body, actions, hints, expire_timeout);
770+ static uint id = 1;
771+ return (replaces_id != 0 ? replaces_id : id++);
772+}
773+
774+void NotificationsMock::MockInvokeAction(uint id, QString action_key)
775+{
776+ Q_EMIT ActionInvoked(id, action_key);
777+ Q_EMIT NotificationClosed(id, 2); // 2 is dismissed by user
778+}
779+
780+void NotificationsMock::CloseNotification(uint id)
781+{
782+ Q_EMIT NotificationClosed(id, 3); // 3 is closed by a CloseNotification() call
783+}
784+
785+QString NotificationsMock::GetServerInformation(QString &vendor, QString &version, QString &spec_version)
786+{
787+ return QString();
788+}
789+
790+int main(int argc, char **argv)
791+{
792+ QCoreApplication a(argc, argv);
793+
794+ QDBusConnection connection = QDBusConnection::sessionBus();
795+
796+ NotificationsMock notifications;
797+ connection.registerObject(NOTIFICATIONS_DBUS_OBJ_PATH, &notifications, QDBusConnection::ExportScriptableContents);
798+ connection.registerService(NOTIFICATIONS_DBUS_SERVICE_NAME);
799+
800+ return a.exec();
801+}
802+
803+#include "NotificationsMock.moc"
804
805=== modified file 'tests/common/mock/callchannel.cpp'
806--- tests/common/mock/callchannel.cpp 2015-06-16 15:59:34 +0000
807+++ tests/common/mock/callchannel.cpp 2015-07-08 21:44:54 +0000
808@@ -68,7 +68,15 @@
809
810 void MockCallChannel::onAccept(Tp::DBusError*)
811 {
812- setCallState("active");
813+ setCallState("accepted");
814+ QTimer *timer = new QTimer(this);
815+ timer->setSingleShot(true);
816+ timer->setInterval(100);
817+ connect(timer, &QTimer::timeout, [this, timer]() {
818+ setCallState("active");
819+ timer->deleteLater();
820+ });
821+ timer->start();
822 }
823
824 void MockCallChannel::init()
825@@ -195,6 +203,8 @@
826 }
827 mCallChannel->setCallState(Tp::CallStateEnded, 0, reason, stateDetails);
828 mBaseChannel->close();
829+ } else if (state == "accepted") {
830+ mCallChannel->setCallState(Tp::CallStateAccepted, 0, reason, stateDetails);
831 } else if (state == "active") {
832 qDebug() << "active";
833 mHoldIface->setHoldState(Tp::LocalHoldStateUnheld, Tp::LocalHoldStateReasonNone);
834
835=== modified file 'tests/handler/HandlerTest.cpp'
836--- tests/handler/HandlerTest.cpp 2015-05-07 16:44:43 +0000
837+++ tests/handler/HandlerTest.cpp 2015-07-08 21:44:54 +0000
838@@ -41,8 +41,11 @@
839 void testConferenceCall();
840 void testSendMessage();
841 void testActiveCallIndicator();
842+ void testNotApprovedChannels();
843
844 private:
845+ void registerApprover();
846+ void unregisterApprover();
847 void waitForCallActive(const QString &callerId);
848 Approver *mApprover;
849 MockController *mMockController;
850@@ -56,11 +59,7 @@
851 QSignalSpy setupReadySpy(TelepathyHelper::instance(), SIGNAL(setupReady()));
852 TRY_COMPARE(setupReadySpy.count(), 1);
853
854- // register the approver
855- mApprover = new Approver(this);
856- TelepathyHelper::instance()->registerClient(mApprover, "TelephonyTestApprover");
857- // Tp-qt does not set registered status to approvers
858- TRY_VERIFY(QDBusConnection::sessionBus().interface()->isServiceRegistered(TELEPHONY_SERVICE_APPROVER));
859+ registerApprover();
860 }
861
862 void HandlerTest::init()
863@@ -163,6 +162,8 @@
864 TRY_COMPARE(approverCallSpy.count(), 1);
865 mApprover->acceptCall();
866
867+ waitForCallActive(callerId);
868+
869 // wait until the call properties are changed
870 TRY_VERIFY(handlerCallPropertiesSpy.count() > 0);
871 QString objectPath = handlerCallPropertiesSpy.last()[0].toString();
872@@ -302,21 +303,63 @@
873 QVERIFY(!HandlerController::instance()->callIndicatorVisible());
874 }
875
876+void HandlerTest::testNotApprovedChannels()
877+{
878+ QVariantMap properties;
879+ properties["Caller"] = "123456";
880+ properties["State"] = "incoming";
881+
882+ QSignalSpy approverCallSpy(mApprover, SIGNAL(newCall()));
883+
884+ QSignalSpy callStateSpy(mMockController, SIGNAL(CallStateChanged(QString,QString,QString)));
885+ QString objectPath = mMockController->placeCall(properties);
886+ QVERIFY(!objectPath.isEmpty());
887+
888+ // wait for the channel to hit the approver
889+ TRY_COMPARE(approverCallSpy.count(), 1);
890+
891+ // accept the call but do not call callChannel->accept() on the channel
892+ mApprover->acceptCall(false);
893+
894+ // wait for a few seconds
895+ QTest::qWait(3000);
896+
897+ // no state changes should happen, as the channel was not accepted
898+ QVERIFY(callStateSpy.isEmpty());
899+}
900+
901+void HandlerTest::registerApprover()
902+{
903+ // register the approver
904+ mApprover = new Approver();
905+ QVERIFY(TelepathyHelper::instance()->registerClient(mApprover, "TelephonyTestApprover"));
906+ // Tp-qt does not set registered status to approvers
907+ TRY_VERIFY(QDBusConnection::sessionBus().interface()->isServiceRegistered(TELEPHONY_SERVICE_APPROVER));
908+}
909+
910+void HandlerTest::unregisterApprover()
911+{
912+ QVERIFY(TelepathyHelper::instance()->unregisterClient(mApprover));
913+ mApprover->deleteLater();
914+ mApprover = NULL;
915+ TRY_VERIFY(!QDBusConnection::sessionBus().interface()->isServiceRegistered(TELEPHONY_SERVICE_APPROVER));
916+}
917+
918 void HandlerTest::waitForCallActive(const QString &callerId)
919 {
920- // wait until the call state is "accepted"
921 QSignalSpy callStateSpy(mMockController, SIGNAL(CallStateChanged(QString,QString,QString)));
922 QString state;
923 QString objectPath;
924 QString caller;
925 int tries = 0;
926- while (state != "active" && caller != callerId && tries < 5) {
927+ while ((state != "active" || caller != callerId) && tries < 5) {
928 TRY_COMPARE(callStateSpy.count(), 1);
929 caller = callStateSpy.first()[0].toString();
930 objectPath = callStateSpy.first()[1].toString();
931 state = callStateSpy.first()[2].toString();
932 callStateSpy.clear();
933 tries++;
934+ qDebug() << "Waiting for call active, try " << tries << " failed.";
935 }
936
937 QCOMPARE(caller, callerId);
938
939=== modified file 'tests/handler/approver.cpp'
940--- tests/handler/approver.cpp 2015-03-23 19:59:50 +0000
941+++ tests/handler/approver.cpp 2015-07-08 21:44:54 +0000
942@@ -107,11 +107,17 @@
943 }
944 }
945
946-void Approver::acceptCall()
947+void Approver::acceptCall(bool callAcceptOnChannel)
948 {
949 Q_FOREACH (Tp::ChannelDispatchOperationPtr dispatchOperation, mDispatchOps) {
950 QList<Tp::ChannelPtr> channels = dispatchOperation->channels();
951 Q_FOREACH (Tp::ChannelPtr channel, channels) {
952+ if (callAcceptOnChannel) {
953+ Tp::CallChannelPtr callChannel = Tp::CallChannelPtr::dynamicCast(channel);
954+ if (callChannel) {
955+ callChannel->accept();
956+ }
957+ }
958 if (dispatchOperation->possibleHandlers().contains(TELEPHONY_SERVICE_HANDLER)) {
959 dispatchOperation->handleWith(TELEPHONY_SERVICE_HANDLER);
960 mDispatchOps.removeAll(dispatchOperation);
961
962=== modified file 'tests/handler/approver.h'
963--- tests/handler/approver.h 2014-01-07 19:53:45 +0000
964+++ tests/handler/approver.h 2015-07-08 21:44:54 +0000
965@@ -44,7 +44,7 @@
966 void newCall();
967
968 public Q_SLOTS:
969- void acceptCall();
970+ void acceptCall(bool callAcceptOnChannel = true);
971 void rejectCall();
972
973 private Q_SLOTS:
974
975=== modified file 'tests/handler/handlercontroller.cpp'
976--- tests/handler/handlercontroller.cpp 2014-06-17 17:46:07 +0000
977+++ tests/handler/handlercontroller.cpp 2015-07-08 21:44:54 +0000
978@@ -99,6 +99,12 @@
979 mHandlerInterface.call("SendDTMF", objectPath, key);
980 }
981
982+bool HandlerController::hasCalls()
983+{
984+ QDBusReply<bool> reply = mHandlerInterface.call("HasCalls");
985+ return reply.isValid() && reply.value();
986+}
987+
988 void HandlerController::createConferenceCall(const QStringList &objectPaths)
989 {
990 mHandlerInterface.call("CreateConferenceCall", objectPaths);
991
992=== modified file 'tests/handler/handlercontroller.h'
993--- tests/handler/handlercontroller.h 2014-06-17 17:46:07 +0000
994+++ tests/handler/handlercontroller.h 2015-07-08 21:44:54 +0000
995@@ -40,6 +40,7 @@
996 void setMuted(const QString &objectPath, bool muted);
997 void setSpeakerMode(const QString &objectPath, bool enabled);
998 void sendDTMF(const QString &objectPath, const QString &key);
999+ bool hasCalls();
1000
1001 // conference call methods
1002 void createConferenceCall(const QStringList &objectPaths);
1003
1004=== modified file 'tests/libtelephonyservice/CallEntryTest.cpp'
1005--- tests/libtelephonyservice/CallEntryTest.cpp 2015-05-08 21:57:06 +0000
1006+++ tests/libtelephonyservice/CallEntryTest.cpp 2015-07-08 21:44:54 +0000
1007@@ -122,7 +122,12 @@
1008
1009 void CallEntryTest::onCallChannelAvailable(const Tp::CallChannelPtr &channel)
1010 {
1011- mCallChannel = channel;
1012+ channel->accept();
1013+ connect(channel->becomeReady(Tp::Features() << Tp::CallChannel::FeatureCore
1014+ << Tp::CallChannel::FeatureCallState),
1015+ &Tp::PendingOperation::finished, [this, channel] {
1016+ mCallChannel = channel;
1017+ });
1018 }
1019
1020 QTEST_MAIN(CallEntryTest)

Subscribers

People subscribed via source and target branches