summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/Dialer.qml18
-rw-r--r--telephony-binding/telephony-binding.c4
2 files changed, 21 insertions, 1 deletions
diff --git a/app/Dialer.qml b/app/Dialer.qml
index 51f6a53..be13ec5 100644
--- a/app/Dialer.qml
+++ b/app/Dialer.qml
@@ -54,14 +54,18 @@ Item {
onCallStatusChanged: {
if (callStatus == "incoming") {
ringtone.active = true
+ rejectButton.active = true
callStatusLabel.text = "Incoming call from " + callClipColp
} else if (callStatus == "dialing") {
callStatusLabel.text = "Dialing " + callClipColp
} else if (callStatus == "active") {
+ rejectButton.active = false
callTimer.startTime = getTime()
callTimer.restart()
} else if (callStatus == "disconnected") {
ringtone.active = false
+ rejectButton.active = false
+ callButton.checked = false
callTimer.stop()
callStatusLabel.text = ""
}
@@ -167,7 +171,7 @@ Item {
Layout.alignment: Qt.AlignHCenter
onImage: './images/HMI_Phone_Hangup.svg'
offImage: './images/HMI_Phone_Call.svg'
- property var active: (number.text.length > 0) || (telephony.callStatus == "incoming")
+ property var active: (number.text.length > 0) || (telephony.callStatus == "incoming") || (telephony.callStatus == "active")
opacity: active ? 1 : 0.25
onCheckedChanged: {
@@ -195,6 +199,18 @@ Item {
}
}
+ Loader {
+ id: rejectButton
+ Layout.alignment: Qt.AlignHCenter
+ active: false
+ sourceComponent: ImageButton {
+ offImage: './images/HMI_Phone_Hangup.svg'
+ onClicked: {
+ telephony.hangup()
+ }
+ }
+ }
+
ListView {
Layout.fillWidth: true
Layout.preferredHeight: 130
diff --git a/telephony-binding/telephony-binding.c b/telephony-binding/telephony-binding.c
index 41164f0..e3c6d2f 100644
--- a/telephony-binding/telephony-binding.c
+++ b/telephony-binding/telephony-binding.c
@@ -64,6 +64,10 @@ static void hangup(struct afb_req request)
DEBUG(interface, "Hangup voice call\n");
ofono_voicecall_hangup(voice_call);
afb_req_success(request, NULL, NULL);
+ } else if (incoming_call) {
+ DEBUG(interface, "Reject incoming call\n");
+ ofono_voicecall_hangup(incoming_call);
+ afb_req_success(request, NULL, NULL);
} else {
ERROR(interface, "Hangup: no active call");
afb_req_fail(request, "failed hangup", NULL);