diff options
author | Matt Porter <mporter@konsulko.com> | 2018-06-13 14:25:22 -0400 |
---|---|---|
committer | Matt Porter <mporter@konsulko.com> | 2018-06-18 22:17:07 -0400 |
commit | 01a84d2d570eddcfaf0d38117dc0c20b6b25fed3 (patch) | |
tree | 3c9a4bfe039e02f084c931cde48de1a963fa2a79 | |
parent | 14b2f421da514a3d8584f7983884a9027ac06cbb (diff) |
Add PBAP contact name lookup for incoming and outgoing calls
Adds support for searching an incoming or outgoing phone number
for a contact name. If found, displays the contact name as
appropriately when displaying the incoming or outgoing call
information.
Bug-AGL: SPEC-1513
Change-Id: I88c7cb4a91abdc34d17cd80e4fccfdcaf2e0d229
Signed-off-by: Matt Porter <mporter@konsulko.com>
-rw-r--r-- | app/Dialer.qml | 16 | ||||
-rw-r--r-- | app/main.cpp | 2 | ||||
-rw-r--r-- | package/config.xml | 1 |
3 files changed, 19 insertions, 0 deletions
diff --git a/app/Dialer.qml b/app/Dialer.qml index 03e9b41..29f251f 100644 --- a/app/Dialer.qml +++ b/app/Dialer.qml @@ -42,6 +42,7 @@ Item { onCallStateChanged: { if (telephony.callState == "incoming") { + pbap.search(telephony.callClip) rejectButton.active = true callStateLabel.text = "Incoming call from " + telephony.callClip } else if (telephony.callState == "dialing") { @@ -56,6 +57,20 @@ Item { } } + Connections { + target: pbap + + onSearchResults: { + if (name != "Not Found") { + if (telephony.callState == "incoming") { + callStateLabel.text = "Incoming call from " + name + } else if (telephony.callState == "dialing") { + callStateLabel.text = "Dialing " + name + } + } + } + } + function call(cname, cnumber) { name.text = cname var rawNumber = cnumber @@ -149,6 +164,7 @@ Item { if (telephony.callState == "incoming") { telephony.answer() } else { + pbap.search(number.text) telephony.dial(number.text) } } else { diff --git a/app/main.cpp b/app/main.cpp index c945830..e60cbe3 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -26,6 +26,7 @@ #include <libhomescreen.hpp> #include <qlibwindowmanager.h> +#include <pbap.h> #include <telephony.h> #include "calltype.h" #include "phone.h" @@ -65,6 +66,7 @@ int main(int argc, char *argv[]) context->setContextProperty("telephony", telephony); Phone *phone = new Phone(telephony); context->setContextProperty("phone", phone); + context->setContextProperty("pbap", new Pbap(bindingAddress)); QObject::connect(telephony, &Telephony::callStateChanged, phone, &Phone::onCallStateChanged); std::string token = secret.toStdString(); LibHomeScreen* hs = new LibHomeScreen(); diff --git a/package/config.xml b/package/config.xml index 183aba1..dd0a227 100644 --- a/package/config.xml +++ b/package/config.xml @@ -11,6 +11,7 @@ <param name="homescreen" value="ws" /> <param name="lib/libtelephony-binding.so" value="local" /> <param name="Bluetooth-Manager" value="ws" /> + <param name="bluetooth-pbap" value="ws" /> </feature> <feature name="urn:AGL:widget:required-permission"> <param name="urn:AGL:permission::public:no-htdocs" value="required" /> |