From 01a84d2d570eddcfaf0d38117dc0c20b6b25fed3 Mon Sep 17 00:00:00 2001 From: Matt Porter Date: Wed, 13 Jun 2018 14:25:22 -0400 Subject: 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 --- app/Dialer.qml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'app/Dialer.qml') 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 { -- cgit 1.2.3-korg