Merge lp:~tiagosh/telephony-service/fix-1398427 into lp:telephony-service
- fix-1398427
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Gustavo Pichorim Boiko |
Approved revision: | 996 |
Merged at revision: | 994 |
Proposed branch: | lp:~tiagosh/telephony-service/fix-1398427 |
Merge into: | lp:telephony-service |
Diff against target: |
299 lines (+106/-8) 10 files modified
approver/Approver.xml (+7/-0) approver/approver.cpp (+53/-2) approver/approver.h (+4/-0) approver/approverdbus.cpp (+6/-1) approver/approverdbus.h (+5/-1) approver/main.cpp (+4/-4) libtelephonyservice/callmanager.cpp (+11/-0) libtelephonyservice/callmanager.h (+1/-0) libtelephonyservice/telepathyhelper.cpp (+13/-0) libtelephonyservice/telepathyhelper.h (+2/-0) |
To merge this branch: | bzr merge lp:~tiagosh/telephony-service/fix-1398427 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Zanetti (community) | Approve | ||
Gustavo Pichorim Boiko (community) | Approve | ||
PS Jenkins bot | continuous-integration | Needs Fixing | |
Michał Sawicz | Approve | ||
Review via email: mp+246224@code.launchpad.net |
Commit message
Expose HandleMediaKey(bool doubleClick) to DBus.
Description of the change
Expose HandleMediaKey(bool doubleClick) to DBus.
This is going to be called by unity8.
--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:/
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
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:991
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 992. By Tiago Salem Herrmann
-
Return a bool value in HandleMediaKey to indicate if the event will be handled by the approver.
Tiago Salem Herrmann (tiagosh) wrote : | # |
> Hey, do you think it'd make sense for you to return true/false depending on
> whether you accepted (consumed/reacted to) the event? We could fall back to
> other consumers then.
Yes, good idea. Just changed the code to match your suggestion.
- 993. By Tiago Salem Herrmann
-
export handleMediaKey(
bool) to qml plugin - 994. By Tiago Salem Herrmann
-
cache hasCalls value
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:992
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michał Sawicz (saviq) : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:994
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 995. By Tiago Salem Herrmann
-
change return name
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:995
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 996. By Tiago Salem Herrmann
-
- change approver bus name to fix dbus activation
- use a global timer and always return right away on HandleMediaKey()
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:996
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
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.
No, but that's because the tests are being run twice, and in the second run it failed.
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!
Michael Zanetti (mzanetti) wrote : | # |
Hmm... this seems to crash unity8 when I call:
callManager.
- 997. By Tiago Salem Herrmann
-
use mApproverInterface instead of mHandlerInterface
Michael Zanetti (mzanetti) wrote : | # |
Tried the current build from silo 19 (should be rev 997) but it still crashes with this backtrace:
- 998. By Tiago Salem Herrmann
-
initialize variable
Michael Zanetti (mzanetti) wrote : | # |
this works for me now
Preview Diff
1 | === modified file 'approver/Approver.xml' | |||
2 | --- approver/Approver.xml 2014-01-20 12:57:43 +0000 | |||
3 | +++ approver/Approver.xml 2015-01-15 14:17:50 +0000 | |||
4 | @@ -27,5 +27,12 @@ | |||
5 | 27 | this method has no effect. | 27 | this method has no effect. |
6 | 28 | ]]></dox:d> | 28 | ]]></dox:d> |
7 | 29 | </method> | 29 | </method> |
8 | 30 | <method name="HandleMediaKey"> | ||
9 | 31 | <dox:d><![CDATA[ | ||
10 | 32 | Handle events generated by media key buttons usually present on headsets. | ||
11 | 33 | ]]></dox:d> | ||
12 | 34 | <arg name="doubleClick" type="b" direction="in"/> | ||
13 | 35 | <arg name="accepted" type="b" direction="out"/> | ||
14 | 36 | </method> | ||
15 | 30 | </interface> | 37 | </interface> |
16 | 31 | </node> | 38 | </node> |
17 | 32 | 39 | ||
18 | === modified file 'approver/approver.cpp' | |||
19 | --- approver/approver.cpp 2015-01-08 01:05:51 +0000 | |||
20 | +++ approver/approver.cpp 2015-01-15 14:17:50 +0000 | |||
21 | @@ -32,6 +32,7 @@ | |||
22 | 32 | #include "callmanager.h" | 32 | #include "callmanager.h" |
23 | 33 | #include "callentry.h" | 33 | #include "callentry.h" |
24 | 34 | #include "tonegenerator.h" | 34 | #include "tonegenerator.h" |
25 | 35 | #include "telepathyhelper.h" | ||
26 | 35 | 36 | ||
27 | 36 | #include <QContactAvatar> | 37 | #include <QContactAvatar> |
28 | 37 | #include <QContactDisplayLabel> | 38 | #include <QContactDisplayLabel> |
29 | @@ -54,18 +55,20 @@ | |||
30 | 54 | 55 | ||
31 | 55 | Approver::Approver() | 56 | Approver::Approver() |
32 | 56 | : Tp::AbstractClientApprover(channelFilters()), | 57 | : Tp::AbstractClientApprover(channelFilters()), |
34 | 57 | mPendingSnapDecision(NULL) | 58 | mPendingSnapDecision(NULL), |
35 | 59 | mSettleTimer(new QTimer(this)) | ||
36 | 58 | { | 60 | { |
37 | 59 | mDefaultTitle = C::gettext("Unknown caller"); | 61 | mDefaultTitle = C::gettext("Unknown caller"); |
38 | 60 | mDefaultIcon = QUrl(telephonyServiceDir() + "assets/avatar-default@18.png").toEncoded(); | 62 | mDefaultIcon = QUrl(telephonyServiceDir() + "assets/avatar-default@18.png").toEncoded(); |
39 | 61 | 63 | ||
41 | 62 | ApproverDBus *dbus = new ApproverDBus(); | 64 | ApproverDBus *dbus = new ApproverDBus(this); |
42 | 63 | connect(dbus, | 65 | connect(dbus, |
43 | 64 | SIGNAL(acceptCallRequested()), | 66 | SIGNAL(acceptCallRequested()), |
44 | 65 | SLOT(onAcceptCallRequested())); | 67 | SLOT(onAcceptCallRequested())); |
45 | 66 | connect(dbus, | 68 | connect(dbus, |
46 | 67 | SIGNAL(rejectCallRequested()), | 69 | SIGNAL(rejectCallRequested()), |
47 | 68 | SLOT(onRejectCallRequested())); | 70 | SLOT(onRejectCallRequested())); |
48 | 71 | |||
49 | 69 | dbus->connectToBus(); | 72 | dbus->connectToBus(); |
50 | 70 | 73 | ||
51 | 71 | if (GreeterContacts::isGreeterMode()) { | 74 | if (GreeterContacts::isGreeterMode()) { |
52 | @@ -79,6 +82,17 @@ | |||
53 | 79 | mRejectActions["rejectMessage1"] = C::gettext("I'm busy at the moment. I'll call later."); | 82 | mRejectActions["rejectMessage1"] = C::gettext("I'm busy at the moment. I'll call later."); |
54 | 80 | mRejectActions["rejectMessage2"] = C::gettext("I'm running late, on my way now."); | 83 | mRejectActions["rejectMessage2"] = C::gettext("I'm running late, on my way now."); |
55 | 81 | mRejectActions["rejectMessage3"] = C::gettext("Please call me back later."); | 84 | mRejectActions["rejectMessage3"] = C::gettext("Please call me back later."); |
56 | 85 | |||
57 | 86 | mSettleTimer->setInterval(500); | ||
58 | 87 | mSettleTimer->setSingleShot(true); | ||
59 | 88 | connect(mSettleTimer, SIGNAL(timeout()), this, SLOT(onSettleTimerTimeout())); | ||
60 | 89 | mSettleTimer->start(); | ||
61 | 90 | } | ||
62 | 91 | |||
63 | 92 | void Approver::onSettleTimerTimeout() | ||
64 | 93 | { | ||
65 | 94 | mSettleTimer->deleteLater(); | ||
66 | 95 | mSettleTimer = NULL; | ||
67 | 82 | } | 96 | } |
68 | 83 | 97 | ||
69 | 84 | Approver::~Approver() | 98 | Approver::~Approver() |
70 | @@ -663,3 +677,40 @@ | |||
71 | 663 | } | 677 | } |
72 | 664 | } | 678 | } |
73 | 665 | 679 | ||
74 | 680 | bool Approver::handleMediaKey(bool doubleClick) | ||
75 | 681 | { | ||
76 | 682 | Q_UNUSED(doubleClick) | ||
77 | 683 | |||
78 | 684 | // hasCalls gets the value from handler, so even if CallManager isn't ready right now, we know | ||
79 | 685 | // if the event will be handled later | ||
80 | 686 | bool accepted = mPendingSnapDecision || CallManager::instance()->hasCalls(); | ||
81 | 687 | |||
82 | 688 | // FIXME: Telepathy-qt does not let us know if existing channels are being recovered, | ||
83 | 689 | // so if this is the first run, call this method again when mSettleTimer is done | ||
84 | 690 | if (mSettleTimer) { | ||
85 | 691 | QObject::connect(mSettleTimer, &QTimer::timeout, [=]() { | ||
86 | 692 | handleMediaKey(doubleClick); | ||
87 | 693 | }); | ||
88 | 694 | return accepted; | ||
89 | 695 | } | ||
90 | 696 | |||
91 | 697 | // postpone this to avoid blocking dbus method callers | ||
92 | 698 | QMetaObject::invokeMethod(this, "processHandleMediaKey", Qt::QueuedConnection, Q_ARG(bool, doubleClick)); | ||
93 | 699 | return accepted; | ||
94 | 700 | } | ||
95 | 701 | |||
96 | 702 | void Approver::processHandleMediaKey(bool doubleClick) | ||
97 | 703 | { | ||
98 | 704 | Q_UNUSED(doubleClick) | ||
99 | 705 | |||
100 | 706 | if (mPendingSnapDecision) { | ||
101 | 707 | onAcceptCallRequested(); | ||
102 | 708 | } else if (CallManager::instance()->hasCalls()) { | ||
103 | 709 | // if there is no incoming call, we have to hangup the current active call | ||
104 | 710 | CallEntry *call = CallManager::instance()->foregroundCall(); | ||
105 | 711 | if (call) { | ||
106 | 712 | call->endCall(); | ||
107 | 713 | } | ||
108 | 714 | } | ||
109 | 715 | } | ||
110 | 716 | |||
111 | 666 | 717 | ||
112 | === modified file 'approver/approver.h' | |||
113 | --- approver/approver.h 2014-10-09 19:32:20 +0000 | |||
114 | +++ approver/approver.h 2015-01-15 14:17:50 +0000 | |||
115 | @@ -56,6 +56,7 @@ | |||
116 | 56 | bool showSnapDecision(const Tp::ChannelDispatchOperationPtr dispatchOperation, | 56 | bool showSnapDecision(const Tp::ChannelDispatchOperationPtr dispatchOperation, |
117 | 57 | const Tp::ChannelPtr channel, | 57 | const Tp::ChannelPtr channel, |
118 | 58 | const QContact &contact = QContact()); | 58 | const QContact &contact = QContact()); |
119 | 59 | bool handleMediaKey(bool doubleClick); | ||
120 | 59 | 60 | ||
121 | 60 | protected: | 61 | protected: |
122 | 61 | Tp::ChannelDispatchOperationPtr dispatchOperationForIncomingCall(); | 62 | Tp::ChannelDispatchOperationPtr dispatchOperationForIncomingCall(); |
123 | @@ -71,6 +72,8 @@ | |||
124 | 71 | void onAcceptCallRequested(); | 72 | void onAcceptCallRequested(); |
125 | 72 | void onRejectCallRequested(); | 73 | void onRejectCallRequested(); |
126 | 73 | void updateNotification(const QtContacts::QContact &contact); | 74 | void updateNotification(const QtContacts::QContact &contact); |
127 | 75 | void onSettleTimerTimeout(); | ||
128 | 76 | void processHandleMediaKey(bool doubleClick); | ||
129 | 74 | 77 | ||
130 | 75 | private: | 78 | private: |
131 | 76 | QList<Tp::ChannelDispatchOperationPtr> mDispatchOps; | 79 | QList<Tp::ChannelDispatchOperationPtr> mDispatchOps; |
132 | @@ -81,6 +84,7 @@ | |||
133 | 81 | QString mCachedBody; | 84 | QString mCachedBody; |
134 | 82 | QFeedbackHapticsEffect mVibrateEffect; | 85 | QFeedbackHapticsEffect mVibrateEffect; |
135 | 83 | QTimer mVibrateTimer; | 86 | QTimer mVibrateTimer; |
136 | 87 | QTimer *mSettleTimer; | ||
137 | 84 | QMap<QString,QString> mRejectActions; | 88 | QMap<QString,QString> mRejectActions; |
138 | 85 | }; | 89 | }; |
139 | 86 | 90 | ||
140 | 87 | 91 | ||
141 | === modified file 'approver/approverdbus.cpp' | |||
142 | --- approver/approverdbus.cpp 2014-01-20 12:57:43 +0000 | |||
143 | +++ approver/approverdbus.cpp 2015-01-15 14:17:50 +0000 | |||
144 | @@ -29,7 +29,7 @@ | |||
145 | 29 | static const char* DBUS_SERVICE = "com.canonical.Approver"; | 29 | static const char* DBUS_SERVICE = "com.canonical.Approver"; |
146 | 30 | static const char* DBUS_OBJECT_PATH = "/com/canonical/Approver"; | 30 | static const char* DBUS_OBJECT_PATH = "/com/canonical/Approver"; |
147 | 31 | 31 | ||
149 | 32 | ApproverDBus::ApproverDBus(QObject* parent) : QObject(parent) | 32 | ApproverDBus::ApproverDBus(Approver *approver, QObject* parent) : QObject(parent), mApprover(approver) |
150 | 33 | { | 33 | { |
151 | 34 | } | 34 | } |
152 | 35 | 35 | ||
153 | @@ -64,3 +64,8 @@ | |||
154 | 64 | { | 64 | { |
155 | 65 | Q_EMIT rejectCallRequested(); | 65 | Q_EMIT rejectCallRequested(); |
156 | 66 | } | 66 | } |
157 | 67 | |||
158 | 68 | bool ApproverDBus::HandleMediaKey(bool doubleClick) | ||
159 | 69 | { | ||
160 | 70 | return mApprover->handleMediaKey(doubleClick); | ||
161 | 71 | } | ||
162 | 67 | 72 | ||
163 | === modified file 'approver/approverdbus.h' | |||
164 | --- approver/approverdbus.h 2014-01-20 12:57:43 +0000 | |||
165 | +++ approver/approverdbus.h 2015-01-15 14:17:50 +0000 | |||
166 | @@ -26,6 +26,7 @@ | |||
167 | 26 | #include <QtCore/QObject> | 26 | #include <QtCore/QObject> |
168 | 27 | #include <QtDBus/QDBusContext> | 27 | #include <QtDBus/QDBusContext> |
169 | 28 | #include "chatmanager.h" | 28 | #include "chatmanager.h" |
170 | 29 | #include "approver.h" | ||
171 | 29 | 30 | ||
172 | 30 | /** | 31 | /** |
173 | 31 | * DBus interface for the phone approver | 32 | * DBus interface for the phone approver |
174 | @@ -35,7 +36,7 @@ | |||
175 | 35 | Q_OBJECT | 36 | Q_OBJECT |
176 | 36 | 37 | ||
177 | 37 | public: | 38 | public: |
179 | 38 | ApproverDBus(QObject* parent=0); | 39 | ApproverDBus(Approver *approver, QObject* parent=0); |
180 | 39 | ~ApproverDBus(); | 40 | ~ApproverDBus(); |
181 | 40 | 41 | ||
182 | 41 | bool connectToBus(); | 42 | bool connectToBus(); |
183 | @@ -44,11 +45,14 @@ | |||
184 | 44 | Q_NOREPLY void HangUpAndAcceptCall(); | 45 | Q_NOREPLY void HangUpAndAcceptCall(); |
185 | 45 | Q_NOREPLY void AcceptCall(); | 46 | Q_NOREPLY void AcceptCall(); |
186 | 46 | Q_NOREPLY void RejectCall(); | 47 | Q_NOREPLY void RejectCall(); |
187 | 48 | bool HandleMediaKey(bool doubleClick); | ||
188 | 47 | 49 | ||
189 | 48 | Q_SIGNALS: | 50 | Q_SIGNALS: |
190 | 49 | void hangUpAndAcceptCallRequested(); | 51 | void hangUpAndAcceptCallRequested(); |
191 | 50 | void acceptCallRequested(); | 52 | void acceptCallRequested(); |
192 | 51 | void rejectCallRequested(); | 53 | void rejectCallRequested(); |
193 | 54 | private: | ||
194 | 55 | Approver *mApprover; | ||
195 | 52 | }; | 56 | }; |
196 | 53 | 57 | ||
197 | 54 | #endif // APPROVERDBUS_H | 58 | #endif // APPROVERDBUS_H |
198 | 55 | 59 | ||
199 | === modified file 'approver/main.cpp' | |||
200 | --- approver/main.cpp 2015-01-08 01:05:51 +0000 | |||
201 | +++ approver/main.cpp 2015-01-15 14:17:50 +0000 | |||
202 | @@ -58,11 +58,11 @@ | |||
203 | 58 | qputenv("UBUNTU_PLATFORM_API_BACKEND", "touch_mirclient"); | 58 | qputenv("UBUNTU_PLATFORM_API_BACKEND", "touch_mirclient"); |
204 | 59 | #endif | 59 | #endif |
205 | 60 | 60 | ||
209 | 61 | // register the approver | 61 | QObject::connect(TelepathyHelper::instance(), &TelepathyHelper::setupReady, []() { |
210 | 62 | Approver *approver = new Approver(); | 62 | // register the approver |
211 | 63 | QObject::connect(TelepathyHelper::instance(), &TelepathyHelper::setupReady, [approver]() { | 63 | TelepathyHelper::instance()->registerChannelObserver("TelephonyServiceObserver"); |
212 | 64 | Approver *approver = new Approver(); | ||
213 | 64 | TelepathyHelper::instance()->registerClient(approver, "TelephonyServiceApprover"); | 65 | TelepathyHelper::instance()->registerClient(approver, "TelephonyServiceApprover"); |
214 | 65 | TelepathyHelper::instance()->registerChannelObserver("TelephonyServiceObserver"); | ||
215 | 66 | }); | 66 | }); |
216 | 67 | 67 | ||
217 | 68 | return app.exec(); | 68 | return app.exec(); |
218 | 69 | 69 | ||
219 | === modified file 'libtelephonyservice/callmanager.cpp' | |||
220 | --- libtelephonyservice/callmanager.cpp 2014-09-11 18:12:50 +0000 | |||
221 | +++ libtelephonyservice/callmanager.cpp 2015-01-15 14:17:50 +0000 | |||
222 | @@ -380,3 +380,14 @@ | |||
223 | 380 | /* calling without channel, DTMF tone is played only locally */ | 380 | /* calling without channel, DTMF tone is played only locally */ |
224 | 381 | phoneAppHandler->call("SendDTMF", "" , key); | 381 | phoneAppHandler->call("SendDTMF", "" , key); |
225 | 382 | } | 382 | } |
226 | 383 | |||
227 | 384 | bool CallManager::handleMediaKey(bool doubleClick) | ||
228 | 385 | { | ||
229 | 386 | QDBusInterface *approverInterface = TelepathyHelper::instance()->approverInterface(); | ||
230 | 387 | QDBusReply<bool> reply = approverInterface->call("HandleMediaKey", doubleClick); | ||
231 | 388 | if (reply.isValid()) { | ||
232 | 389 | return reply.value(); | ||
233 | 390 | } | ||
234 | 391 | return false; | ||
235 | 392 | } | ||
236 | 393 | |||
237 | 383 | 394 | ||
238 | === modified file 'libtelephonyservice/callmanager.h' | |||
239 | --- libtelephonyservice/callmanager.h 2014-08-22 19:01:46 +0000 | |||
240 | +++ libtelephonyservice/callmanager.h 2015-01-15 14:17:50 +0000 | |||
241 | @@ -61,6 +61,7 @@ | |||
242 | 61 | Q_INVOKABLE void mergeCalls(CallEntry *firstCall, CallEntry *secondCall); | 61 | Q_INVOKABLE void mergeCalls(CallEntry *firstCall, CallEntry *secondCall); |
243 | 62 | Q_INVOKABLE void splitCall(CallEntry *callEntry); | 62 | Q_INVOKABLE void splitCall(CallEntry *callEntry); |
244 | 63 | Q_INVOKABLE void playTone(const QString &key); | 63 | Q_INVOKABLE void playTone(const QString &key); |
245 | 64 | Q_INVOKABLE bool handleMediaKey(bool doubleClick); | ||
246 | 64 | 65 | ||
247 | 65 | CallEntry *foregroundCall() const; | 66 | CallEntry *foregroundCall() const; |
248 | 66 | CallEntry *backgroundCall() const; | 67 | CallEntry *backgroundCall() const; |
249 | 67 | 68 | ||
250 | === modified file 'libtelephonyservice/telepathyhelper.cpp' | |||
251 | --- libtelephonyservice/telepathyhelper.cpp 2014-12-17 12:54:52 +0000 | |||
252 | +++ libtelephonyservice/telepathyhelper.cpp 2015-01-15 14:17:50 +0000 | |||
253 | @@ -43,6 +43,7 @@ | |||
254 | 43 | mFirstTime(true), | 43 | mFirstTime(true), |
255 | 44 | mConnected(false), | 44 | mConnected(false), |
256 | 45 | mHandlerInterface(0), | 45 | mHandlerInterface(0), |
257 | 46 | mApproverInterface(0), | ||
258 | 46 | mDefaultSimSettings(new QGSettings("com.ubuntu.phone")), | 47 | mDefaultSimSettings(new QGSettings("com.ubuntu.phone")), |
259 | 47 | mFlightModeInterface("org.freedesktop.URfkill", | 48 | mFlightModeInterface("org.freedesktop.URfkill", |
260 | 48 | "/org/freedesktop/URfkill", | 49 | "/org/freedesktop/URfkill", |
261 | @@ -172,6 +173,18 @@ | |||
262 | 172 | return mHandlerInterface; | 173 | return mHandlerInterface; |
263 | 173 | } | 174 | } |
264 | 174 | 175 | ||
265 | 176 | QDBusInterface *TelepathyHelper::approverInterface() const | ||
266 | 177 | { | ||
267 | 178 | if (!mApproverInterface) { | ||
268 | 179 | mApproverInterface = new QDBusInterface("org.freedesktop.Telepathy.Client.TelephonyServiceApprover", | ||
269 | 180 | "/com/canonical/Approver", | ||
270 | 181 | "com.canonical.TelephonyServiceApprover", | ||
271 | 182 | QDBusConnection::sessionBus(), | ||
272 | 183 | const_cast<TelepathyHelper*>(this)); | ||
273 | 184 | } | ||
274 | 185 | return mApproverInterface; | ||
275 | 186 | } | ||
276 | 187 | |||
277 | 175 | bool TelepathyHelper::connected() const | 188 | bool TelepathyHelper::connected() const |
278 | 176 | { | 189 | { |
279 | 177 | if (QCoreApplication::applicationName() != "telephony-service-handler" && | 190 | if (QCoreApplication::applicationName() != "telephony-service-handler" && |
280 | 178 | 191 | ||
281 | === modified file 'libtelephonyservice/telepathyhelper.h' | |||
282 | --- libtelephonyservice/telepathyhelper.h 2014-12-17 12:54:52 +0000 | |||
283 | +++ libtelephonyservice/telepathyhelper.h 2015-01-15 14:17:50 +0000 | |||
284 | @@ -67,6 +67,7 @@ | |||
285 | 67 | QQmlListProperty<AccountEntry> qmlActiveAccounts(); | 67 | QQmlListProperty<AccountEntry> qmlActiveAccounts(); |
286 | 68 | ChannelObserver *channelObserver() const; | 68 | ChannelObserver *channelObserver() const; |
287 | 69 | QDBusInterface *handlerInterface() const; | 69 | QDBusInterface *handlerInterface() const; |
288 | 70 | QDBusInterface *approverInterface() const; | ||
289 | 70 | AccountEntry *defaultMessagingAccount() const; | 71 | AccountEntry *defaultMessagingAccount() const; |
290 | 71 | AccountEntry *defaultCallAccount() const; | 72 | AccountEntry *defaultCallAccount() const; |
291 | 72 | 73 | ||
292 | @@ -136,6 +137,7 @@ | |||
293 | 136 | bool mFirstTime; | 137 | bool mFirstTime; |
294 | 137 | bool mConnected; | 138 | bool mConnected; |
295 | 138 | mutable QDBusInterface *mHandlerInterface; | 139 | mutable QDBusInterface *mHandlerInterface; |
296 | 140 | mutable QDBusInterface *mApproverInterface; | ||
297 | 139 | QGSettings *mDefaultSimSettings; | 141 | QGSettings *mDefaultSimSettings; |
298 | 140 | QDBusInterface mFlightModeInterface; | 142 | QDBusInterface mFlightModeInterface; |
299 | 141 | }; | 143 | }; |
Hey, do you think it'd make sense for you to return true/false depending on whether you accepted (consumed/reacted to) the event? We could fall back to other consumers then.