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

Allow configuration of set_udub ril op #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions ril_subscription.conf
Original file line number Diff line number Diff line change
Expand Up @@ -371,3 +371,10 @@ socket=/dev/socket/rild
# Default 30000
#
#cellInfoIntervalLongMs=30000

# Configure the ril request originated in ril_voicecall_set_udub. Some
# devices like the Volla phone halts the modem when asking if the user
# is busy through this function. This produces that, if you cancel an
# awaiting call because of an on going one, both calls will be hang up.
#
#rilRequestOnSetUdub=13
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT the default for RIL_REQUEST_UDUB is 17, please mention that in a way similar to how it's done for other entries.

13 changes: 13 additions & 0 deletions src/ril_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "ril_vendor.h"
#include "ril_devmon.h"
#include "ril_log.h"
#include "ril-constants.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/ril_plugin.c:30:10: fatal error: ril-constants.h: No such file or directory
 #include "ril-constants.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated.

I think you can just drop this line, this header must be included from elsewhere as <ofono/ril-constants.h>


#include <ofono/slot.h>
#include <ofono/storage.h>
Expand Down Expand Up @@ -100,6 +101,7 @@
#define RILMODEM_DEFAULT_SLOT_FLAGS OFONO_SLOT_NO_FLAGS
#define RILMODEM_DEFAULT_CELL_INFO_INTERVAL_SHORT_MS (2000) /* 2 sec */
#define RILMODEM_DEFAULT_CELL_INFO_INTERVAL_LONG_MS (30000) /* 30 sec */
#define RILMODEM_DEFAULT_RIL_REQUEST_ON_SET_UDUB RIL_REQUEST_UDUB

/* RIL socket transport name and parameters */
#define RIL_TRANSPORT_MODEM "modem"
Expand Down Expand Up @@ -160,6 +162,7 @@
#define RILCONF_DEVMON "deviceStateTracking"
#define RILCONF_CELL_INFO_INTERVAL_SHORT_MS "cellInfoIntervalShortMs"
#define RILCONF_CELL_INFO_INTERVAL_LONG_MS "cellInfoIntervalLongMs"
#define RILCONF_RIL_REQUEST_ON_SET_UDUB "rilRequestOnSetUdub"

/* Modem error ids */
#define RIL_ERROR_ID_RILD_RESTART "rild-restart"
Expand Down Expand Up @@ -1278,6 +1281,8 @@ static RilSlot *ril_plugin_slot_new_take(char *transport,
RILMODEM_DEFAULT_CELL_INFO_INTERVAL_SHORT_MS;
config->cell_info_interval_long_ms =
RILMODEM_DEFAULT_CELL_INFO_INTERVAL_LONG_MS;
config->ril_request_on_set_udub =
RILMODEM_DEFAULT_RIL_REQUEST_ON_SET_UDUB;
slot->timeout = RILMODEM_DEFAULT_TIMEOUT;
slot->sim_flags = RILMODEM_DEFAULT_SIM_FLAGS;
slot->slot_flags = RILMODEM_DEFAULT_SLOT_FLAGS;
Expand Down Expand Up @@ -1806,6 +1811,14 @@ static RilSlot *ril_plugin_parse_config_group(GKeyFile *file,
group, config->cell_info_interval_long_ms);
}

/* rilRequestOnSetUdub */
if (ril_config_get_integer(file, group,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/ril_plugin.c:1815:6: warning: implicit declaration of function 'ril_config_get_integer'; did you mean 'ril_config_get_ints'? [-Wimplicit-function-declaration]
  if (ril_config_get_integer(file, group,
      ^~~~~~~~~~~~~~~~~~~~~~

Should be ofono_conf_get_integer()

RILCONF_RIL_REQUEST_ON_SET_UDUB,
&config->ril_request_on_set_udub)) {
DBG("%s: " RILCONF_RIL_REQUEST_ON_SET_UDUB " %d",
group, config->ril_request_on_set_udub);
}

/* Replace devmon with a new one with applied settings */
ril_devmon_free(slot->devmon);
slot->devmon = NULL;
Expand Down
1 change: 1 addition & 0 deletions src/ril_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ struct ril_slot_config {
GUtilInts *remote_hangup_reasons;
int cell_info_interval_short_ms;
int cell_info_interval_long_ms;
int ril_request_on_set_udub;
};

/* Some values copied from ofono's internal common.h */
Expand Down
8 changes: 7 additions & 1 deletion src/ril_voicecall.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ struct ril_voicecall {
gulong supp_svc_notification_id;
gulong ringback_tone_event_id;
gulong ecclist_change_id;
int ril_request_on_set_udub;
};

struct ril_voicecall_request_data {
Expand Down Expand Up @@ -856,8 +857,10 @@ static void ril_voicecall_release_all_active(struct ofono_voicecall *vc,
static void ril_voicecall_set_udub(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
struct ril_voicecall *vd = ril_voicecall_get_data(vc);
DBG("");
ril_voicecall_request(RIL_REQUEST_UDUB, vc, NULL, cb, data);
ril_voicecall_request(vd->ril_request_on_set_udub,
vc, NULL, cb, data);
}

static void ril_voicecall_enable_supp_svc(struct ril_voicecall *vd)
Expand Down Expand Up @@ -955,6 +958,9 @@ static int ril_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,
if (modem->ecclist_file) {
vd->ecclist = ril_ecclist_new(modem->ecclist_file);
}
if (cfg->ril_request_on_set_udub) {
vd->ril_request_on_set_udub = cfg->ril_request_on_set_udub;
}
ril_voicecall_clear_dtmf_queue(vd);
ofono_voicecall_set_data(vc, vd);
gutil_idle_queue_add(vd->idleq, ril_voicecall_register, vd);
Expand Down