summaryrefslogtreecommitdiffstats
path: root/app/Dialer.qml
diff options
context:
space:
mode:
authorMatt Porter <mporter@konsulko.com>2017-05-16 16:14:30 -0400
committerMatt Porter <mporter@konsulko.com>2017-05-19 10:01:02 -0400
commited2a6d1359b7967d56172c0a37660181722a2019 (patch)
tree67b7145462a64774cce87a420a2951f9c9c73697 /app/Dialer.qml
parent676ce330cfa62121c9cd68b29fec5dd2458b9eee (diff)
Dial and hangup from a voice call using the dial pad
Adds support for initiating and hanging up a voice call from the phone app dial pad. This support leverages the basic telephony binder API and pulseaudio as an ofono agent. AGL-Bug: SPEC-597 Change-Id: I94e8c64a76164f04c6573d7126a8cc725b3c679d Signed-off-by: Matt Porter <mporter@konsulko.com>
Diffstat (limited to 'app/Dialer.qml')
-rw-r--r--app/Dialer.qml23
1 files changed, 8 insertions, 15 deletions
diff --git a/app/Dialer.qml b/app/Dialer.qml
index 8937f0d..49495b3 100644
--- a/app/Dialer.qml
+++ b/app/Dialer.qml
@@ -20,10 +20,16 @@ import QtQuick.Controls 2.0
import QtMultimedia 5.5
import AGL.Demo.Controls 1.0
import 'models'
+import 'api' as API
Item {
id: root
+ API.Telephony {
+ id: telephony
+ url: bindingAddress
+ }
+
signal showContacts
function call(contact) {
name.text = contact.name
@@ -106,19 +112,6 @@ Item {
offImage: './images/HMI_Phone_Call.svg'
opacity: number.text.length > 0 ? 1 : 0.25
- Loader {
- id: ringtone
- active: false
- sourceComponent: Component {
- SoundEffect {
- loops: SoundEffect.Infinite
- source: './Phone.wav'
- category: 'phone'
- Component.onCompleted: play()
- }
- }
- }
-
onCheckedChanged: {
if (checked) {
if (number.text.length === 0) {
@@ -130,11 +123,11 @@ Item {
if (contact.name === '')
contact.name = 'Unknown'
history.insert(0, contact)
- ringtone.active = true
+ telephony.dial(number.text)
} else {
name.text = ''
number.text = ''
- ringtone.active = false
+ telephony.hangup()
}
}
}