Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix VoLTE toggling. Fix some memory related and other issues #43

Merged
merged 4 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/binder_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ binder_base_emit_queued_signals(
/* Signal handlers may release references to this object */
g_object_ref(self);

/* Emit the signals */
for (p = 0; self->queued_signals && p < BINDER_BASE_MAX_PROPERTIES; p++) {
/* Emit the signals, ignore the ANY property */
monich marked this conversation as resolved.
Show resolved Hide resolved
for (p = 1; self->queued_signals && p < BINDER_BASE_MAX_PROPERTIES; p++) {
if (self->queued_signals & BINDER_BASE_PROPERTY_BIT(p)) {
self->queued_signals &= ~BINDER_BASE_PROPERTY_BIT(p);
g_signal_emit(self, binder_base_signals[SIGNAL_PROPERTY_CHANGED],
Expand Down
3 changes: 3 additions & 0 deletions src/binder_ims.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "binder_util.h"

#include "binder_ext_ims.h"
#include "binder_ext_slot.h"

#include <ofono/ims.h>

Expand Down Expand Up @@ -211,6 +212,8 @@ binder_ims_probe(

self->handle = handle;
self->ims = binder_ims_reg_ref(modem->ims);
self->ext = binder_ext_ims_ref(binder_ext_slot_get_interface(modem->ext,
BINDER_EXT_TYPE_IMS));
self->start_id = g_idle_add(binder_ims_start, self);
ofono_ims_set_data(handle, self);
return 0;
Expand Down
10 changes: 5 additions & 5 deletions src/binder_sms.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,18 +468,19 @@ binder_sms_submit_cb(
(RADIO_MESSAGING_RESP)resp == RADIO_MESSAGING_RESP_SEND_IMS_SMS) {
if (error == RADIO_ERROR_NONE) {
GBinderReader reader;
gint32 message_ref;
char* ack_pdu = NULL;
gint32 error_code;

gbinder_reader_copy(&reader, args);

if (binder_read_parcelable_size(&reader)) {
gint32 message_ref;
char* ack_pdu = NULL;
gint32 error_code;
mlehtima marked this conversation as resolved.
Show resolved Hide resolved

gbinder_reader_read_int32(&reader, &message_ref);
ack_pdu = gbinder_reader_read_string16(&reader);
gbinder_reader_read_int32(&reader, &error_code);
DBG("%ssms msg ref: %d, ack: %s err: %d", ims ? "ims " : "",
message_ref, ack_pdu, error_code);
message_ref, ack_pdu, error_code);
g_free(ack_pdu);

/*
Expand All @@ -495,7 +496,6 @@ binder_sms_submit_cb(
return;
}
}
g_free(ack_pdu);
} else {
ofono_error("%ssms send error %s", ims ? "ims " : "",
binder_radio_error_string(error));
Expand Down
18 changes: 12 additions & 6 deletions src/binder_voicecall.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,23 +596,29 @@ binder_voicecall_lastcause_cb(

if (resp == code) {
GBinderReader reader;
const RadioLastCallFailCauseInfo* info;
gint32 cause_code;
/*
* Cause code 0 is invalid and can be used to check if code was
* obtained.
*/
gint32 cause_code = 0;

/*
* getLastCallFailCauseResponse(RadioResponseInfo,
* LastCallFailCauseInfo failCauseinfo);
*/
gbinder_reader_copy(&reader, args);
if (self->interface_aidl == RADIO_AIDL_INTERFACE_NONE) {
info = gbinder_reader_read_hidl_struct(&reader,
RadioLastCallFailCauseInfo);
cause_code = info->causeCode;
const RadioLastCallFailCauseInfo* info =
gbinder_reader_read_hidl_struct(&reader,
RadioLastCallFailCauseInfo);
if (info) {
cause_code = info->causeCode;
}
} else {
gbinder_reader_read_int32(&reader, &cause_code);
gbinder_reader_skip_string16(&reader);
}
if (info) {
if (cause_code) {
enum ofono_disconnect_reason reason =
binder_voicecall_map_cause(self, cid, cause_code);

Expand Down