mirror of git://git.sysmocom.de/ofono
cdma-voicecall: Refactor previous commit
This commit is contained in:
parent
42c50e2dc3
commit
f0d01bdf37
|
@ -109,31 +109,23 @@ static void append_voicecall_properties(struct ofono_cdma_voicecall *vc,
|
||||||
{
|
{
|
||||||
const char *status;
|
const char *status;
|
||||||
const char *lineid;
|
const char *lineid;
|
||||||
const char *waiting_call = NULL;
|
const char *waiting_call;
|
||||||
ofono_bool_t call_waiting;
|
dbus_bool_t call_waiting = FALSE;
|
||||||
|
|
||||||
status = cdma_call_status_to_string(vc->status);
|
status = cdma_call_status_to_string(vc->status);
|
||||||
|
|
||||||
ofono_dbus_dict_append(dict, "State", DBUS_TYPE_STRING, &status);
|
ofono_dbus_dict_append(dict, "State", DBUS_TYPE_STRING, &status);
|
||||||
|
|
||||||
if (vc->status != CDMA_CALL_STATUS_DISCONNECTED) {
|
lineid = cdma_phone_number_to_string(&vc->phone_number);
|
||||||
if (vc->phone_number.number[0] != '\0') {
|
ofono_dbus_dict_append(dict, "LineIdentification",
|
||||||
lineid = cdma_phone_number_to_string(&vc->phone_number);
|
DBUS_TYPE_STRING, &lineid);
|
||||||
ofono_dbus_dict_append(dict, "LineIdentification",
|
|
||||||
DBUS_TYPE_STRING, &lineid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (vc->waiting_number.number[0] != '\0') {
|
if (vc->waiting_number.number[0] != '\0') {
|
||||||
waiting_call = cdma_phone_number_to_string(
|
waiting_call = cdma_phone_number_to_string(&vc->waiting_number);
|
||||||
&vc->waiting_number);
|
ofono_dbus_dict_append(dict, "CallWaitingNumber",
|
||||||
|
|
||||||
ofono_dbus_dict_append(dict, "CallWaitingNumber",
|
|
||||||
DBUS_TYPE_STRING, &waiting_call);
|
DBUS_TYPE_STRING, &waiting_call);
|
||||||
}
|
call_waiting = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
call_waiting = (waiting_call != NULL);
|
|
||||||
|
|
||||||
ofono_dbus_dict_append(dict, "CallWaiting",
|
ofono_dbus_dict_append(dict, "CallWaiting",
|
||||||
DBUS_TYPE_BOOLEAN, &call_waiting);
|
DBUS_TYPE_BOOLEAN, &call_waiting);
|
||||||
|
|
||||||
|
@ -193,6 +185,7 @@ static void voicecall_set_call_status(struct ofono_cdma_voicecall *vc,
|
||||||
enum cdma_call_status old_status;
|
enum cdma_call_status old_status;
|
||||||
|
|
||||||
DBG("status: %s", cdma_call_status_to_string(status));
|
DBG("status: %s", cdma_call_status_to_string(status));
|
||||||
|
|
||||||
if (vc->status == status)
|
if (vc->status == status)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -220,6 +213,7 @@ static void voicecall_set_call_status(struct ofono_cdma_voicecall *vc,
|
||||||
×tr);
|
×tr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: Properly signal property changes here */
|
||||||
if (status == CDMA_CALL_STATUS_DISCONNECTED) {
|
if (status == CDMA_CALL_STATUS_DISCONNECTED) {
|
||||||
memset(&vc->phone_number, 0,
|
memset(&vc->phone_number, 0,
|
||||||
sizeof(struct ofono_cdma_phone_number));
|
sizeof(struct ofono_cdma_phone_number));
|
||||||
|
|
Loading…
Reference in New Issue