forked from sailfishos/ofono
Compare commits
25 Commits
mer/1.23+g
...
mer/1.23+g
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98ffc61a03 | ||
|
|
f2b1625872 | ||
|
|
2d5a22284e | ||
|
|
9d742180ab | ||
|
|
f8b0ccc1b4 | ||
|
|
7a54bb8cbe | ||
|
|
56e0923dc3 | ||
|
|
6dfce4b5e9 | ||
|
|
4ec3568d71 | ||
|
|
9b2b7127ef | ||
|
|
1053577376 | ||
|
|
22197b5e04 | ||
|
|
3a358ddc9d | ||
|
|
53929f9f1a | ||
|
|
08bae57a2b | ||
|
|
1915aeda76 | ||
|
|
51bfb17cbc | ||
|
|
a83b553032 | ||
|
|
ec00abd62d | ||
|
|
80924d5787 | ||
|
|
2bdd05aa31 | ||
|
|
544f02e5a2 | ||
|
|
6d4638f9bf | ||
|
|
6584919e9d | ||
|
|
34fb44f4eb |
@@ -189,8 +189,8 @@ CFLAGS="$CFLAGS $GLIBUTIL_CFLAGS"
|
|||||||
LIBS="$LIBS $GLIBUTIL_LIBS"
|
LIBS="$LIBS $GLIBUTIL_LIBS"
|
||||||
|
|
||||||
if (test "${enable_sailfish_rilmodem}" = "yes"); then
|
if (test "${enable_sailfish_rilmodem}" = "yes"); then
|
||||||
PKG_CHECK_MODULES(GRILIO, libgrilio >= 1.0.35, dummy=yes,
|
PKG_CHECK_MODULES(GRILIO, libgrilio >= 1.0.38, dummy=yes,
|
||||||
AC_MSG_ERROR(libgrilio >= 1.0.35 is required))
|
AC_MSG_ERROR(libgrilio >= 1.0.38 is required))
|
||||||
PKG_CHECK_MODULES(LIBMCE, libmce-glib >= 1.0.6, dummy=yes,
|
PKG_CHECK_MODULES(LIBMCE, libmce-glib >= 1.0.6, dummy=yes,
|
||||||
AC_MSG_ERROR(libmce-glib >= 1.0.6 is required))
|
AC_MSG_ERROR(libmce-glib >= 1.0.6 is required))
|
||||||
CFLAGS="$CFLAGS $GRILIO_CFLAGS $LIBMCE_CFLAGS"
|
CFLAGS="$CFLAGS $GRILIO_CFLAGS $LIBMCE_CFLAGS"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony - RIL-based devices
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015-2017 Jolla Ltd.
|
* Copyright (C) 2015-2020 Jolla Ltd.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -144,10 +144,19 @@ static void ril_cbs_notify(GRilIoChannel *io, guint code,
|
|||||||
const void *data, guint len, void *user_data)
|
const void *data, guint len, void *user_data)
|
||||||
{
|
{
|
||||||
struct ril_cbs *cd = user_data;
|
struct ril_cbs *cd = user_data;
|
||||||
|
GRilIoParser rilp;
|
||||||
|
guint32 pdu_len;
|
||||||
|
|
||||||
GASSERT(code == RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS);
|
GASSERT(code == RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS);
|
||||||
DBG_(cd, "%u bytes", len);
|
grilio_parser_init(&rilp, data, len);
|
||||||
ofono_cbs_notify(cd->cbs, data, len);
|
if (grilio_parser_get_uint32(&rilp, &pdu_len)) {
|
||||||
|
const void* pdu = grilio_parser_get_bytes(&rilp, pdu_len);
|
||||||
|
|
||||||
|
if (pdu) {
|
||||||
|
DBG_(cd, "%u bytes", pdu_len);
|
||||||
|
ofono_cbs_notify(cd->cbs, pdu, pdu_len);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ril_cbs_probe_done_cb(GRilIoChannel *io, int status,
|
static void ril_cbs_probe_done_cb(GRilIoChannel *io, int status,
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony - RIL-based devices
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016-2019 Jolla Ltd.
|
* Copyright (C) 2016-2020 Jolla Ltd.
|
||||||
|
* Copyright (C) 2020 Open Mobile Platform LLC.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -344,11 +345,24 @@ static void ril_cell_info_set_rate_cb(GRilIoChannel *io, int status,
|
|||||||
self->set_rate_id = 0;
|
self->set_rate_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean ril_cell_info_retry(GRilIoRequest* request, int ril_status,
|
||||||
|
const void* response_data, guint response_len, void* user_data)
|
||||||
|
{
|
||||||
|
switch (ril_status) {
|
||||||
|
case RIL_E_SUCCESS:
|
||||||
|
case RIL_E_RADIO_NOT_AVAILABLE:
|
||||||
|
return FALSE;
|
||||||
|
default:
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void ril_cell_info_query(struct ril_cell_info *self)
|
static void ril_cell_info_query(struct ril_cell_info *self)
|
||||||
{
|
{
|
||||||
GRilIoRequest *req = grilio_request_new();
|
GRilIoRequest *req = grilio_request_new();
|
||||||
|
|
||||||
grilio_request_set_retry(req, RIL_RETRY_MS, MAX_RETRIES);
|
grilio_request_set_retry(req, RIL_RETRY_MS, MAX_RETRIES);
|
||||||
|
grilio_request_set_retry_func(req, ril_cell_info_retry);
|
||||||
grilio_channel_cancel_request(self->io, self->query_id, FALSE);
|
grilio_channel_cancel_request(self->io, self->query_id, FALSE);
|
||||||
self->query_id = grilio_channel_send_request_full(self->io, req,
|
self->query_id = grilio_channel_send_request_full(self->io, req,
|
||||||
RIL_REQUEST_GET_CELL_INFO_LIST, ril_cell_info_list_cb,
|
RIL_REQUEST_GET_CELL_INFO_LIST, ril_cell_info_list_cb,
|
||||||
@@ -362,6 +376,7 @@ static void ril_cell_info_set_rate(struct ril_cell_info *self)
|
|||||||
(self->update_rate_ms > 0) ? self->update_rate_ms : INT_MAX);
|
(self->update_rate_ms > 0) ? self->update_rate_ms : INT_MAX);
|
||||||
|
|
||||||
grilio_request_set_retry(req, RIL_RETRY_MS, MAX_RETRIES);
|
grilio_request_set_retry(req, RIL_RETRY_MS, MAX_RETRIES);
|
||||||
|
grilio_request_set_retry_func(req, ril_cell_info_retry);
|
||||||
grilio_channel_cancel_request(self->io, self->set_rate_id, FALSE);
|
grilio_channel_cancel_request(self->io, self->set_rate_id, FALSE);
|
||||||
self->set_rate_id = grilio_channel_send_request_full(self->io, req,
|
self->set_rate_id = grilio_channel_send_request_full(self->io, req,
|
||||||
RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE,
|
RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE,
|
||||||
|
|||||||
@@ -382,6 +382,12 @@ enum ril_unsolicited_response_filter {
|
|||||||
RIL_UR_DATA_CALL_DORMANCY_CHANGED = 0x04
|
RIL_UR_DATA_CALL_DORMANCY_CHANGED = 0x04
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE result */
|
||||||
|
enum ril_network_selection_mode {
|
||||||
|
RIL_NETWORK_SELECTION_MODE_AUTO = 0,
|
||||||
|
RIL_NETWORK_SELECTION_MODE_MANUAL = 1
|
||||||
|
};
|
||||||
|
|
||||||
#endif /*__RIL_CONSTANTS_H */
|
#endif /*__RIL_CONSTANTS_H */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -218,23 +218,22 @@ static void ril_modem_schedule_online_check(struct ril_modem_data *md)
|
|||||||
static void ril_modem_update_radio_settings(struct ril_modem_data *md)
|
static void ril_modem_update_radio_settings(struct ril_modem_data *md)
|
||||||
{
|
{
|
||||||
struct ril_modem *m = &md->modem;
|
struct ril_modem *m = &md->modem;
|
||||||
if (m->radio->state == RADIO_STATE_ON && md->watch->imsi) {
|
struct ofono_radio_settings *rs = ril_modem_radio_settings(m);
|
||||||
|
|
||||||
|
if (md->watch->imsi) {
|
||||||
/* radio-settings.c assumes that IMSI is available */
|
/* radio-settings.c assumes that IMSI is available */
|
||||||
if (!ril_modem_radio_settings(m)) {
|
if (!rs) {
|
||||||
DBG_(md, "initializing radio settings interface");
|
DBG_(md, "initializing radio settings interface");
|
||||||
ofono_radio_settings_create(m->ofono, 0,
|
ofono_radio_settings_create(m->ofono, 0,
|
||||||
RILMODEM_DRIVER, md);
|
RILMODEM_DRIVER, md);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (rs) {
|
||||||
/* ofono core may remove radio settings atom internally */
|
|
||||||
struct ofono_radio_settings *rs = ril_modem_radio_settings(m);
|
|
||||||
if (rs) {
|
|
||||||
DBG_(md, "removing radio settings interface");
|
DBG_(md, "removing radio settings interface");
|
||||||
ofono_radio_settings_remove(rs);
|
ofono_radio_settings_remove(rs);
|
||||||
} else {
|
} else {
|
||||||
|
/* ofono core may remove radio settings atom internally */
|
||||||
DBG_(md, "radio settings interface is already gone");
|
DBG_(md, "radio settings interface is already gone");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ril_modem_radio_state_cb(struct ril_radio *radio, void *data)
|
static void ril_modem_radio_state_cb(struct ril_radio *radio, void *data)
|
||||||
@@ -242,7 +241,6 @@ static void ril_modem_radio_state_cb(struct ril_radio *radio, void *data)
|
|||||||
struct ril_modem_data *md = data;
|
struct ril_modem_data *md = data;
|
||||||
|
|
||||||
GASSERT(md->modem.radio == radio);
|
GASSERT(md->modem.radio == radio);
|
||||||
ril_modem_update_radio_settings(md);
|
|
||||||
ril_modem_update_online_state(md);
|
ril_modem_update_online_state(md);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -424,6 +422,7 @@ static void ril_modem_remove(struct ofono_modem *ofono)
|
|||||||
|
|
||||||
ril_radio_remove_handler(modem->radio, md->radio_state_event_id);
|
ril_radio_remove_handler(modem->radio, md->radio_state_event_id);
|
||||||
ril_radio_power_off(modem->radio, RADIO_POWER_TAG(md));
|
ril_radio_power_off(modem->radio, RADIO_POWER_TAG(md));
|
||||||
|
ril_radio_set_online(modem->radio, FALSE);
|
||||||
ril_radio_unref(modem->radio);
|
ril_radio_unref(modem->radio);
|
||||||
ril_sim_settings_unref(modem->sim_settings);
|
ril_sim_settings_unref(modem->sim_settings);
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,12 @@
|
|||||||
#include "ril_vendor.h"
|
#include "ril_vendor.h"
|
||||||
#include "ril_log.h"
|
#include "ril_log.h"
|
||||||
|
|
||||||
|
#include "ofono.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "simutil.h"
|
#include "simutil.h"
|
||||||
|
|
||||||
#define REGISTRATION_TIMEOUT (100*1000) /* ms */
|
#include <ofono/watch.h>
|
||||||
|
|
||||||
#define REGISTRATION_MAX_RETRIES (2)
|
#define REGISTRATION_MAX_RETRIES (2)
|
||||||
|
|
||||||
enum ril_netreg_events {
|
enum ril_netreg_events {
|
||||||
@@ -41,9 +43,11 @@ enum ril_netreg_network_events {
|
|||||||
struct ril_netreg {
|
struct ril_netreg {
|
||||||
GRilIoChannel *io;
|
GRilIoChannel *io;
|
||||||
GRilIoQueue *q;
|
GRilIoQueue *q;
|
||||||
|
gboolean replace_strange_oper;
|
||||||
gboolean network_selection_manual_0;
|
gboolean network_selection_manual_0;
|
||||||
int signal_strength_dbm_weak;
|
int signal_strength_dbm_weak;
|
||||||
int signal_strength_dbm_strong;
|
int signal_strength_dbm_strong;
|
||||||
|
struct ofono_watch *watch;
|
||||||
struct ofono_netreg *netreg;
|
struct ofono_netreg *netreg;
|
||||||
struct ril_network *network;
|
struct ril_network *network;
|
||||||
struct ril_vendor *vendor;
|
struct ril_vendor *vendor;
|
||||||
@@ -53,6 +57,7 @@ struct ril_netreg {
|
|||||||
guint current_operator_id;
|
guint current_operator_id;
|
||||||
gulong ril_event_id[NETREG_RIL_EVENT_COUNT];
|
gulong ril_event_id[NETREG_RIL_EVENT_COUNT];
|
||||||
gulong network_event_id[NETREG_NETWORK_EVENT_COUNT];
|
gulong network_event_id[NETREG_NETWORK_EVENT_COUNT];
|
||||||
|
int network_selection_timeout;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ril_netreg_cbd {
|
struct ril_netreg_cbd {
|
||||||
@@ -192,11 +197,74 @@ static void ril_netreg_current_operator(struct ofono_netreg *netreg,
|
|||||||
ril_netreg_cbd_free);
|
ril_netreg_cbd_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean ril_netreg_strange(const struct ofono_network_operator *op,
|
||||||
|
struct ofono_sim *sim)
|
||||||
|
{
|
||||||
|
gsize mcclen;
|
||||||
|
|
||||||
|
if (sim && op->status != OPERATOR_STATUS_CURRENT) {
|
||||||
|
const char *spn = ofono_sim_get_spn(sim);
|
||||||
|
const char *mcc = ofono_sim_get_mcc(sim);
|
||||||
|
const char *mnc = ofono_sim_get_mnc(sim);
|
||||||
|
|
||||||
|
if (spn && mcc && mnc && !strcmp(op->name, spn) &&
|
||||||
|
(strcmp(op->mcc, mcc) || strcmp(op->mnc, mnc))) {
|
||||||
|
/*
|
||||||
|
* Status is not "current", SPN matches the SIM, but
|
||||||
|
* MCC and/or MNC don't (e.g. Sony Xperia X where all
|
||||||
|
* operators could be reported with the same name
|
||||||
|
* which equals SPN).
|
||||||
|
*/
|
||||||
|
DBG("%s %s%s (sim spn?)", op->name, op->mcc, op->mnc);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mcclen = strlen(op->mcc);
|
||||||
|
if (!strncmp(op->name, op->mcc, mcclen) &&
|
||||||
|
!strcmp(op->name + mcclen, op->mnc)) {
|
||||||
|
/* Some MediaTek RILs only report numeric operator name */
|
||||||
|
DBG("%s %s%s (numeric?)", op->name, op->mcc, op->mnc);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ril_netreg_process_operators(struct ril_netreg *nd,
|
||||||
|
struct ofono_network_operator *ops, int nops)
|
||||||
|
{
|
||||||
|
if (nd->replace_strange_oper) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < nops; i++) {
|
||||||
|
struct ofono_network_operator *op = ops + i;
|
||||||
|
struct ofono_gprs_provision_data *prov = NULL;
|
||||||
|
int np = 0;
|
||||||
|
|
||||||
|
if (ril_netreg_strange(op, nd->watch->sim) &&
|
||||||
|
__ofono_gprs_provision_get_settings(op->mcc,
|
||||||
|
op->mnc, NULL, &prov, &np)) {
|
||||||
|
/* Use the first entry */
|
||||||
|
if (np > 0 && prov->provider_name &&
|
||||||
|
prov->provider_name[0]) {
|
||||||
|
DBG("%s %s%s -> %s", op->name, op->mcc,
|
||||||
|
op->mnc, prov->provider_name);
|
||||||
|
strncpy(op->name, prov->provider_name,
|
||||||
|
OFONO_MAX_OPERATOR_NAME_LENGTH);
|
||||||
|
}
|
||||||
|
__ofono_gprs_provision_free_settings(prov, np);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void ril_netreg_list_operators_cb(GRilIoChannel *io, int status,
|
static void ril_netreg_list_operators_cb(GRilIoChannel *io, int status,
|
||||||
const void *data, guint len, void *user_data)
|
const void *data, guint len, void *user_data)
|
||||||
{
|
{
|
||||||
struct ril_netreg_cbd *cbd = user_data;
|
struct ril_netreg_cbd *cbd = user_data;
|
||||||
ofono_netreg_operator_list_cb_t cb = cbd->cb.operator_list;
|
ofono_netreg_operator_list_cb_t cb = cbd->cb.operator_list;
|
||||||
|
struct ril_netreg *nd = cbd->nd;
|
||||||
struct ofono_network_operator *list;
|
struct ofono_network_operator *list;
|
||||||
struct ofono_error error;
|
struct ofono_error error;
|
||||||
int noperators = 0, i;
|
int noperators = 0, i;
|
||||||
@@ -238,21 +306,23 @@ static void ril_netreg_list_operators_cb(GRilIoChannel *io, int status,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set the proper status */
|
/* Set the proper status */
|
||||||
if (!strcmp(status, "available")) {
|
if (!status) {
|
||||||
list[i].status = OPERATOR_STATUS_AVAILABLE;
|
op->status = OPERATOR_STATUS_UNKNOWN;
|
||||||
|
} else if (!strcmp(status, "available")) {
|
||||||
|
op->status = OPERATOR_STATUS_AVAILABLE;
|
||||||
} else if (!strcmp(status, "current")) {
|
} else if (!strcmp(status, "current")) {
|
||||||
list[i].status = OPERATOR_STATUS_CURRENT;
|
op->status = OPERATOR_STATUS_CURRENT;
|
||||||
} else if (!strcmp(status, "forbidden")) {
|
} else if (!strcmp(status, "forbidden")) {
|
||||||
list[i].status = OPERATOR_STATUS_FORBIDDEN;
|
op->status = OPERATOR_STATUS_FORBIDDEN;
|
||||||
} else {
|
} else {
|
||||||
list[i].status = OPERATOR_STATUS_UNKNOWN;
|
op->status = OPERATOR_STATUS_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
op->tech = -1;
|
op->tech = -1;
|
||||||
ok = ril_parse_mcc_mnc(numeric, op);
|
ok = ril_parse_mcc_mnc(numeric, op);
|
||||||
if (ok) {
|
if (ok) {
|
||||||
if (op->tech < 0) {
|
if (op->tech < 0) {
|
||||||
op->tech = cbd->nd->network->voice.access_tech;
|
op->tech = nd->network->voice.access_tech;
|
||||||
}
|
}
|
||||||
DBG("[operator=%s, %s, %s, status: %s]", op->name,
|
DBG("[operator=%s, %s, %s, status: %s]", op->name,
|
||||||
op->mcc, op->mnc, status);
|
op->mcc, op->mnc, status);
|
||||||
@@ -267,6 +337,7 @@ static void ril_netreg_list_operators_cb(GRilIoChannel *io, int status,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
|
ril_netreg_process_operators(nd, list, noperators);
|
||||||
cb(ril_error_ok(&error), noperators, list, cbd->data);
|
cb(ril_error_ok(&error), noperators, list, cbd->data);
|
||||||
} else {
|
} else {
|
||||||
cb(ril_error_failure(&error), 0, NULL, cbd->data);
|
cb(ril_error_failure(&error), 0, NULL, cbd->data);
|
||||||
@@ -301,18 +372,55 @@ static void ril_netreg_register_cb(GRilIoChannel *io, int status,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ril_netreg_set_register_auto(struct ril_netreg *nd,
|
||||||
|
ofono_netreg_register_cb_t cb, void *data)
|
||||||
|
{
|
||||||
|
GRilIoRequest *req = grilio_request_new();
|
||||||
|
|
||||||
|
ofono_info("nw select automatic");
|
||||||
|
grilio_request_set_timeout(req, nd->network_selection_timeout);
|
||||||
|
grilio_request_set_retry(req, 0, REGISTRATION_MAX_RETRIES);
|
||||||
|
grilio_queue_send_request_full(nd->q, req,
|
||||||
|
RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC,
|
||||||
|
ril_netreg_register_cb, ril_netreg_cbd_free,
|
||||||
|
ril_netreg_cbd_new(nd, cb, data));
|
||||||
|
grilio_request_unref(req);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ril_netreg_query_register_auto_cb(GRilIoChannel *io, int status,
|
||||||
|
const void *data, guint len,
|
||||||
|
void *user_data)
|
||||||
|
{
|
||||||
|
struct ril_netreg_cbd *cbd = user_data;
|
||||||
|
ofono_netreg_register_cb_t cb = cbd->cb.reg;
|
||||||
|
|
||||||
|
if (status == RIL_E_SUCCESS) {
|
||||||
|
GRilIoParser rilp;
|
||||||
|
gint32 net_mode;
|
||||||
|
|
||||||
|
grilio_parser_init(&rilp, data, len);
|
||||||
|
if (grilio_parser_get_int32(&rilp, NULL) /* Array length */ &&
|
||||||
|
grilio_parser_get_int32(&rilp, &net_mode) &&
|
||||||
|
net_mode == RIL_NETWORK_SELECTION_MODE_AUTO) {
|
||||||
|
struct ofono_error error;
|
||||||
|
ofono_info("nw selection is already auto");
|
||||||
|
cb(ril_error_ok(&error), cbd->data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ril_netreg_set_register_auto(cbd->nd, cb, cbd->data);
|
||||||
|
}
|
||||||
|
|
||||||
static void ril_netreg_register_auto(struct ofono_netreg *netreg,
|
static void ril_netreg_register_auto(struct ofono_netreg *netreg,
|
||||||
ofono_netreg_register_cb_t cb, void *data)
|
ofono_netreg_register_cb_t cb, void *data)
|
||||||
{
|
{
|
||||||
struct ril_netreg *nd = ril_netreg_get_data(netreg);
|
struct ril_netreg *nd = ril_netreg_get_data(netreg);
|
||||||
GRilIoRequest *req = grilio_request_new();
|
GRilIoRequest *req = grilio_request_new();
|
||||||
|
|
||||||
ofono_info("nw select automatic");
|
|
||||||
grilio_request_set_timeout(req, REGISTRATION_TIMEOUT);
|
|
||||||
grilio_request_set_retry(req, 0, REGISTRATION_MAX_RETRIES);
|
|
||||||
grilio_queue_send_request_full(nd->q, req,
|
grilio_queue_send_request_full(nd->q, req,
|
||||||
RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC,
|
RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE,
|
||||||
ril_netreg_register_cb, ril_netreg_cbd_free,
|
ril_netreg_query_register_auto_cb, ril_netreg_cbd_free,
|
||||||
ril_netreg_cbd_new(nd, cb, data));
|
ril_netreg_cbd_new(nd, cb, data));
|
||||||
grilio_request_unref(req);
|
grilio_request_unref(req);
|
||||||
}
|
}
|
||||||
@@ -327,7 +435,7 @@ static void ril_netreg_register_manual(struct ofono_netreg *netreg,
|
|||||||
|
|
||||||
ofono_info("nw select manual: %s%s%s", mcc, mnc, suffix);
|
ofono_info("nw select manual: %s%s%s", mcc, mnc, suffix);
|
||||||
grilio_request_append_format(req, "%s%s%s", mcc, mnc, suffix);
|
grilio_request_append_format(req, "%s%s%s", mcc, mnc, suffix);
|
||||||
grilio_request_set_timeout(req, REGISTRATION_TIMEOUT);
|
grilio_request_set_timeout(req, nd->network_selection_timeout);
|
||||||
grilio_request_set_retry(req, 0, REGISTRATION_MAX_RETRIES);
|
grilio_request_set_retry(req, 0, REGISTRATION_MAX_RETRIES);
|
||||||
grilio_queue_send_request_full(nd->q, req,
|
grilio_queue_send_request_full(nd->q, req,
|
||||||
RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL,
|
RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL,
|
||||||
@@ -557,12 +665,15 @@ static int ril_netreg_probe(struct ofono_netreg *netreg, unsigned int vendor,
|
|||||||
DBG_(nd, "%p", netreg);
|
DBG_(nd, "%p", netreg);
|
||||||
nd->io = grilio_channel_ref(ril_modem_io(modem));
|
nd->io = grilio_channel_ref(ril_modem_io(modem));
|
||||||
nd->q = grilio_queue_new(nd->io);
|
nd->q = grilio_queue_new(nd->io);
|
||||||
|
nd->watch = ofono_watch_new(ril_modem_get_path(modem));
|
||||||
nd->vendor = ril_vendor_ref(modem->vendor);
|
nd->vendor = ril_vendor_ref(modem->vendor);
|
||||||
nd->network = ril_network_ref(modem->network);
|
nd->network = ril_network_ref(modem->network);
|
||||||
nd->netreg = netreg;
|
nd->netreg = netreg;
|
||||||
|
nd->replace_strange_oper = config->replace_strange_oper;
|
||||||
nd->network_selection_manual_0 = config->network_selection_manual_0;
|
nd->network_selection_manual_0 = config->network_selection_manual_0;
|
||||||
nd->signal_strength_dbm_weak = config->signal_strength_dbm_weak;
|
nd->signal_strength_dbm_weak = config->signal_strength_dbm_weak;
|
||||||
nd->signal_strength_dbm_strong = config->signal_strength_dbm_strong;
|
nd->signal_strength_dbm_strong = config->signal_strength_dbm_strong;
|
||||||
|
nd->network_selection_timeout = config->network_selection_timeout;
|
||||||
|
|
||||||
ofono_netreg_set_data(netreg, nd);
|
ofono_netreg_set_data(netreg, nd);
|
||||||
nd->timer_id = g_idle_add(ril_netreg_register, nd);
|
nd->timer_id = g_idle_add(ril_netreg_register, nd);
|
||||||
@@ -589,6 +700,7 @@ static void ril_netreg_remove(struct ofono_netreg *netreg)
|
|||||||
g_source_remove(nd->current_operator_id);
|
g_source_remove(nd->current_operator_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ofono_watch_unref(nd->watch);
|
||||||
ril_network_remove_all_handlers(nd->network, nd->network_event_id);
|
ril_network_remove_all_handlers(nd->network, nd->network_event_id);
|
||||||
ril_network_unref(nd->network);
|
ril_network_unref(nd->network);
|
||||||
ril_vendor_unref(nd->vendor);
|
ril_vendor_unref(nd->vendor);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* oFono - Open Source Telephony - RIL-based devices
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015-2020 Jolla Ltd.
|
* Copyright (C) 2015-2020 Jolla Ltd.
|
||||||
* Copyright (C) 2019 Open Mobile Platform LLC.
|
* Copyright (C) 2019-2020 Open Mobile Platform LLC.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -419,6 +419,18 @@ static void ril_network_poll_data_state_cb(GRilIoChannel *io, int req_status,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean ril_network_retry(GRilIoRequest* request, int ril_status,
|
||||||
|
const void* response_data, guint response_len, void* user_data)
|
||||||
|
{
|
||||||
|
switch (ril_status) {
|
||||||
|
case RIL_E_SUCCESS:
|
||||||
|
case RIL_E_RADIO_NOT_AVAILABLE:
|
||||||
|
return FALSE;
|
||||||
|
default:
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static guint ril_network_poll_and_retry(struct ril_network *self, guint id,
|
static guint ril_network_poll_and_retry(struct ril_network *self, guint id,
|
||||||
int code, GRilIoChannelResponseFunc fn)
|
int code, GRilIoChannelResponseFunc fn)
|
||||||
{
|
{
|
||||||
@@ -431,6 +443,7 @@ static guint ril_network_poll_and_retry(struct ril_network *self, guint id,
|
|||||||
GRilIoRequest *req = grilio_request_new();
|
GRilIoRequest *req = grilio_request_new();
|
||||||
|
|
||||||
grilio_request_set_retry(req, RIL_RETRY_SECS*1000, -1);
|
grilio_request_set_retry(req, RIL_RETRY_SECS*1000, -1);
|
||||||
|
grilio_request_set_retry_func(req, ril_network_retry);
|
||||||
id = grilio_queue_send_request_full(priv->q, req, code, fn,
|
id = grilio_queue_send_request_full(priv->q, req, code, fn,
|
||||||
NULL, self);
|
NULL, self);
|
||||||
grilio_request_unref(req);
|
grilio_request_unref(req);
|
||||||
@@ -998,11 +1011,10 @@ static void ril_network_query_pref_mode_cb(GRilIoChannel *io, int status,
|
|||||||
struct ril_network_priv *priv = self->priv;
|
struct ril_network_priv *priv = self->priv;
|
||||||
const enum ofono_radio_access_mode pref_mode = self->pref_mode;
|
const enum ofono_radio_access_mode pref_mode = self->pref_mode;
|
||||||
|
|
||||||
/* This request never fails because in case of error it gets retried */
|
|
||||||
GASSERT(status == RIL_E_SUCCESS);
|
|
||||||
GASSERT(priv->query_rat_id);
|
GASSERT(priv->query_rat_id);
|
||||||
|
|
||||||
priv->query_rat_id = 0;
|
priv->query_rat_id = 0;
|
||||||
|
|
||||||
|
if (status == RIL_E_SUCCESS) {
|
||||||
priv->rat = ril_network_parse_pref_resp(data, len);
|
priv->rat = ril_network_parse_pref_resp(data, len);
|
||||||
self->pref_mode = ril_network_rat_to_mode(priv->rat);
|
self->pref_mode = ril_network_rat_to_mode(priv->rat);
|
||||||
DBG_(self, "rat mode %d (%s)", priv->rat,
|
DBG_(self, "rat mode %d (%s)", priv->rat,
|
||||||
@@ -1015,6 +1027,7 @@ static void ril_network_query_pref_mode_cb(GRilIoChannel *io, int status,
|
|||||||
if (ril_network_can_set_pref_mode(self)) {
|
if (ril_network_can_set_pref_mode(self)) {
|
||||||
ril_network_check_pref_mode(self, FALSE);
|
ril_network_check_pref_mode(self, FALSE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ril_network_query_pref_mode(struct ril_network *self)
|
static void ril_network_query_pref_mode(struct ril_network *self)
|
||||||
@@ -1023,6 +1036,7 @@ static void ril_network_query_pref_mode(struct ril_network *self)
|
|||||||
GRilIoRequest *req = grilio_request_new();
|
GRilIoRequest *req = grilio_request_new();
|
||||||
|
|
||||||
grilio_request_set_retry(req, RIL_RETRY_SECS*1000, -1);
|
grilio_request_set_retry(req, RIL_RETRY_SECS*1000, -1);
|
||||||
|
grilio_request_set_retry_func(req, ril_network_retry);
|
||||||
grilio_queue_cancel_request(priv->q, priv->query_rat_id, FALSE);
|
grilio_queue_cancel_request(priv->q, priv->query_rat_id, FALSE);
|
||||||
priv->query_rat_id = grilio_queue_send_request_full(priv->q, req,
|
priv->query_rat_id = grilio_queue_send_request_full(priv->q, req,
|
||||||
RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE,
|
RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE,
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony - RIL-based devices
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015-2017 Jolla Ltd.
|
* Copyright (C) 2015-2020 Jolla Ltd.
|
||||||
|
* Copyright (C) 2020 Open Mobile Platform LLC.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -32,6 +33,11 @@ struct ril_oem_raw {
|
|||||||
|
|
||||||
#define DBG_(oem,fmt,args...) DBG("%s" fmt, (oem)->log_prefix, ##args)
|
#define DBG_(oem,fmt,args...) DBG("%s" fmt, (oem)->log_prefix, ##args)
|
||||||
|
|
||||||
|
static void ril_oem_raw_send_done(void *msg)
|
||||||
|
{
|
||||||
|
dbus_message_unref(msg);
|
||||||
|
}
|
||||||
|
|
||||||
static void ril_oem_raw_send_cb(GRilIoChannel *io, int ril_status,
|
static void ril_oem_raw_send_cb(GRilIoChannel *io, int ril_status,
|
||||||
const void *data, guint len, void *user_data)
|
const void *data, guint len, void *user_data)
|
||||||
{
|
{
|
||||||
@@ -40,20 +46,13 @@ static void ril_oem_raw_send_cb(GRilIoChannel *io, int ril_status,
|
|||||||
|
|
||||||
if (ril_status == RIL_E_SUCCESS) {
|
if (ril_status == RIL_E_SUCCESS) {
|
||||||
DBusMessageIter it, array;
|
DBusMessageIter it, array;
|
||||||
const guchar* bytes = data;
|
|
||||||
guint i;
|
|
||||||
|
|
||||||
reply = dbus_message_new_method_return(msg);
|
reply = dbus_message_new_method_return(msg);
|
||||||
dbus_message_iter_init_append(reply, &it);
|
dbus_message_iter_init_append(reply, &it);
|
||||||
dbus_message_iter_open_container(&it, DBUS_TYPE_ARRAY,
|
dbus_message_iter_open_container(&it, DBUS_TYPE_ARRAY,
|
||||||
DBUS_TYPE_BYTE_AS_STRING, &array);
|
DBUS_TYPE_BYTE_AS_STRING, &array);
|
||||||
|
dbus_message_iter_append_fixed_array(&array, DBUS_TYPE_BYTE,
|
||||||
for (i = 0; i < len; i++) {
|
&data, len);
|
||||||
guchar byte = bytes[i];
|
|
||||||
dbus_message_iter_append_basic(&array, DBUS_TYPE_BYTE,
|
|
||||||
&byte);
|
|
||||||
}
|
|
||||||
|
|
||||||
dbus_message_iter_close_container(&it, &array);
|
dbus_message_iter_close_container(&it, &array);
|
||||||
} else if (ril_status == GRILIO_STATUS_TIMEOUT) {
|
} else if (ril_status == GRILIO_STATUS_TIMEOUT) {
|
||||||
DBG("Timed out");
|
DBG("Timed out");
|
||||||
@@ -63,7 +62,7 @@ static void ril_oem_raw_send_cb(GRilIoChannel *io, int ril_status,
|
|||||||
reply = __ofono_error_failed(msg);
|
reply = __ofono_error_failed(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
__ofono_dbus_pending_reply(&msg, reply);
|
g_dbus_send_message(ofono_dbus_get_connection(), reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DBusMessage *ril_oem_raw_send(DBusConnection *conn, DBusMessage *msg,
|
static DBusMessage *ril_oem_raw_send(DBusConnection *conn, DBusMessage *msg,
|
||||||
@@ -72,6 +71,12 @@ static DBusMessage *ril_oem_raw_send(DBusConnection *conn, DBusMessage *msg,
|
|||||||
DBusMessageIter it;
|
DBusMessageIter it;
|
||||||
struct ril_oem_raw *oem = user_data;
|
struct ril_oem_raw *oem = user_data;
|
||||||
|
|
||||||
|
if (!__ofono_dbus_access_method_allowed(dbus_message_get_sender(msg),
|
||||||
|
OFONO_DBUS_ACCESS_INTF_OEMRAW,
|
||||||
|
OFONO_DBUS_ACCESS_OEMRAW_SEND, NULL)) {
|
||||||
|
return __ofono_error_access_denied(msg);
|
||||||
|
}
|
||||||
|
|
||||||
dbus_message_iter_init(msg, &it);
|
dbus_message_iter_init(msg, &it);
|
||||||
if (dbus_message_iter_get_arg_type(&it) == DBUS_TYPE_ARRAY &&
|
if (dbus_message_iter_get_arg_type(&it) == DBUS_TYPE_ARRAY &&
|
||||||
dbus_message_iter_get_element_type(&it) == DBUS_TYPE_BYTE) {
|
dbus_message_iter_get_element_type(&it) == DBUS_TYPE_BYTE) {
|
||||||
@@ -94,7 +99,7 @@ static DBusMessage *ril_oem_raw_send(DBusConnection *conn, DBusMessage *msg,
|
|||||||
grilio_request_append_bytes(req, data, data_len);
|
grilio_request_append_bytes(req, data, data_len);
|
||||||
grilio_queue_send_request_full(oem->q, req,
|
grilio_queue_send_request_full(oem->q, req,
|
||||||
RIL_REQUEST_OEM_HOOK_RAW, ril_oem_raw_send_cb,
|
RIL_REQUEST_OEM_HOOK_RAW, ril_oem_raw_send_cb,
|
||||||
NULL, dbus_message_ref(msg));
|
ril_oem_raw_send_done, dbus_message_ref(msg));
|
||||||
grilio_request_unref(req);
|
grilio_request_unref(req);
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -73,6 +73,7 @@
|
|||||||
#define RILMODEM_DEFAULT_LTE_MODE PREF_NET_TYPE_LTE_GSM_WCDMA
|
#define RILMODEM_DEFAULT_LTE_MODE PREF_NET_TYPE_LTE_GSM_WCDMA
|
||||||
#define RILMODEM_DEFAULT_UMTS_MODE PREF_NET_TYPE_GSM_WCDMA_AUTO
|
#define RILMODEM_DEFAULT_UMTS_MODE PREF_NET_TYPE_GSM_WCDMA_AUTO
|
||||||
#define RILMODEM_DEFAULT_NETWORK_MODE_TIMEOUT (20*1000) /* ms */
|
#define RILMODEM_DEFAULT_NETWORK_MODE_TIMEOUT (20*1000) /* ms */
|
||||||
|
#define RILMODEM_DEFAULT_NETWORK_SELECTION_TIMEOUT (100*1000) /* ms */
|
||||||
#define RILMODEM_DEFAULT_DBM_WEAK (-100) /* very weak, 0.0000000001 mW */
|
#define RILMODEM_DEFAULT_DBM_WEAK (-100) /* very weak, 0.0000000001 mW */
|
||||||
#define RILMODEM_DEFAULT_DBM_STRONG (-60) /* strong signal, 0.000001 mW */
|
#define RILMODEM_DEFAULT_DBM_STRONG (-60) /* strong signal, 0.000001 mW */
|
||||||
#define RILMODEM_DEFAULT_ENABLE_VOICECALL TRUE
|
#define RILMODEM_DEFAULT_ENABLE_VOICECALL TRUE
|
||||||
@@ -93,6 +94,7 @@
|
|||||||
#define RILMODEM_DEFAULT_LEGACY_IMEI_QUERY FALSE
|
#define RILMODEM_DEFAULT_LEGACY_IMEI_QUERY FALSE
|
||||||
#define RILMODEM_DEFAULT_RADIO_POWER_CYCLE TRUE
|
#define RILMODEM_DEFAULT_RADIO_POWER_CYCLE TRUE
|
||||||
#define RILMODEM_DEFAULT_CONFIRM_RADIO_POWER_ON TRUE
|
#define RILMODEM_DEFAULT_CONFIRM_RADIO_POWER_ON TRUE
|
||||||
|
#define RILMODEM_DEFAULT_REPLACE_STRANGE_OPER FALSE
|
||||||
#define RILMODEM_DEFAULT_NETWORK_SELECTION_MANUAL_0 TRUE
|
#define RILMODEM_DEFAULT_NETWORK_SELECTION_MANUAL_0 TRUE
|
||||||
#define RILMODEM_DEFAULT_FORCE_GSM_WHEN_RADIO_OFF TRUE
|
#define RILMODEM_DEFAULT_FORCE_GSM_WHEN_RADIO_OFF TRUE
|
||||||
#define RILMODEM_DEFAULT_USE_DATA_PROFILES FALSE
|
#define RILMODEM_DEFAULT_USE_DATA_PROFILES FALSE
|
||||||
@@ -134,6 +136,7 @@
|
|||||||
#define RILCONF_LTE_MODE "lteNetworkMode"
|
#define RILCONF_LTE_MODE "lteNetworkMode"
|
||||||
#define RILCONF_UMTS_MODE "umtsNetworkMode"
|
#define RILCONF_UMTS_MODE "umtsNetworkMode"
|
||||||
#define RILCONF_NETWORK_MODE_TIMEOUT "networkModeTimeout"
|
#define RILCONF_NETWORK_MODE_TIMEOUT "networkModeTimeout"
|
||||||
|
#define RILCONF_NETWORK_SELECTION_TIMEOUT "networkSelectionTimeout"
|
||||||
#define RILCONF_SIGNAL_STRENGTH_RANGE "signalStrengthRange"
|
#define RILCONF_SIGNAL_STRENGTH_RANGE "signalStrengthRange"
|
||||||
#define RILCONF_UICC_WORKAROUND "uiccWorkaround"
|
#define RILCONF_UICC_WORKAROUND "uiccWorkaround"
|
||||||
#define RILCONF_ECCLIST_FILE "ecclistFile"
|
#define RILCONF_ECCLIST_FILE "ecclistFile"
|
||||||
@@ -149,6 +152,7 @@
|
|||||||
#define RILCONF_RADIO_POWER_CYCLE "radioPowerCycle"
|
#define RILCONF_RADIO_POWER_CYCLE "radioPowerCycle"
|
||||||
#define RILCONF_CONFIRM_RADIO_POWER_ON "confirmRadioPowerOn"
|
#define RILCONF_CONFIRM_RADIO_POWER_ON "confirmRadioPowerOn"
|
||||||
#define RILCONF_SINGLE_DATA_CONTEXT "singleDataContext"
|
#define RILCONF_SINGLE_DATA_CONTEXT "singleDataContext"
|
||||||
|
#define RILCONF_REPLACE_STRANGE_OPER "replaceStrangeOperatorNames"
|
||||||
#define RILCONF_NETWORK_SELECTION_MANUAL_0 "networkSelectionManual0"
|
#define RILCONF_NETWORK_SELECTION_MANUAL_0 "networkSelectionManual0"
|
||||||
#define RILCONF_FORCE_GSM_WHEN_RADIO_OFF "forceGsmWhenRadioOff"
|
#define RILCONF_FORCE_GSM_WHEN_RADIO_OFF "forceGsmWhenRadioOff"
|
||||||
#define RILCONF_USE_DATA_PROFILES "useDataProfiles"
|
#define RILCONF_USE_DATA_PROFILES "useDataProfiles"
|
||||||
@@ -362,6 +366,7 @@ static void ril_plugin_remove_slot_handler(ril_slot *slot, int id)
|
|||||||
static void ril_plugin_shutdown_slot(ril_slot *slot, gboolean kill_io)
|
static void ril_plugin_shutdown_slot(ril_slot *slot, gboolean kill_io)
|
||||||
{
|
{
|
||||||
if (slot->modem) {
|
if (slot->modem) {
|
||||||
|
ril_data_allow(slot->data, RIL_DATA_ROLE_NONE);
|
||||||
ril_modem_delete(slot->modem);
|
ril_modem_delete(slot->modem);
|
||||||
/* The above call is expected to result in
|
/* The above call is expected to result in
|
||||||
* ril_plugin_modem_removed getting called
|
* ril_plugin_modem_removed getting called
|
||||||
@@ -381,6 +386,7 @@ static void ril_plugin_shutdown_slot(ril_slot *slot, gboolean kill_io)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (slot->cell_info) {
|
if (slot->cell_info) {
|
||||||
|
sailfish_manager_set_cell_info(slot->handle, NULL);
|
||||||
sailfish_cell_info_unref(slot->cell_info);
|
sailfish_cell_info_unref(slot->cell_info);
|
||||||
slot->cell_info = NULL;
|
slot->cell_info = NULL;
|
||||||
}
|
}
|
||||||
@@ -1038,13 +1044,13 @@ static void ril_plugin_slot_connected(ril_slot *slot)
|
|||||||
slot->path, slot->config.techs, slot->imei,
|
slot->path, slot->config.techs, slot->imei,
|
||||||
slot->imeisv, ril_plugin_sim_state(slot),
|
slot->imeisv, ril_plugin_sim_state(slot),
|
||||||
slot->slot_flags);
|
slot->slot_flags);
|
||||||
sailfish_manager_set_cell_info(slot->handle, slot->cell_info);
|
|
||||||
grilio_channel_set_enabled(slot->io, slot->handle->enabled);
|
grilio_channel_set_enabled(slot->io, slot->handle->enabled);
|
||||||
|
|
||||||
/* Check if this was the last slot we were waiting for */
|
/* Check if this was the last slot we were waiting for */
|
||||||
ril_plugin_check_if_started(plugin);
|
ril_plugin_check_if_started(plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sailfish_manager_set_cell_info(slot->handle, slot->cell_info);
|
||||||
ril_plugin_check_modem(slot);
|
ril_plugin_check_modem(slot);
|
||||||
ril_plugin_check_ready(slot);
|
ril_plugin_check_ready(slot);
|
||||||
}
|
}
|
||||||
@@ -1060,8 +1066,11 @@ static void ril_plugin_slot_connected_cb(GRilIoChannel *io, void *user_data)
|
|||||||
static void ril_plugin_init_io(ril_slot *slot)
|
static void ril_plugin_init_io(ril_slot *slot)
|
||||||
{
|
{
|
||||||
if (!slot->io) {
|
if (!slot->io) {
|
||||||
slot->io = grilio_channel_new(ofono_ril_transport_connect
|
struct grilio_transport *transport =
|
||||||
(slot->transport_name, slot->transport_params));
|
ofono_ril_transport_connect(slot->transport_name,
|
||||||
|
slot->transport_params);
|
||||||
|
|
||||||
|
slot->io = grilio_channel_new(transport);
|
||||||
if (slot->io) {
|
if (slot->io) {
|
||||||
ril_debug_trace_update(slot);
|
ril_debug_trace_update(slot);
|
||||||
ril_debug_dump_update(slot);
|
ril_debug_dump_update(slot);
|
||||||
@@ -1093,6 +1102,7 @@ static void ril_plugin_init_io(ril_slot *slot)
|
|||||||
slot);
|
slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
grilio_transport_unref(transport);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!slot->io) {
|
if (!slot->io) {
|
||||||
@@ -1193,6 +1203,8 @@ static ril_slot *ril_plugin_slot_new_take(char *transport,
|
|||||||
config->lte_network_mode = RILMODEM_DEFAULT_LTE_MODE;
|
config->lte_network_mode = RILMODEM_DEFAULT_LTE_MODE;
|
||||||
config->umts_network_mode = RILMODEM_DEFAULT_UMTS_MODE;
|
config->umts_network_mode = RILMODEM_DEFAULT_UMTS_MODE;
|
||||||
config->network_mode_timeout = RILMODEM_DEFAULT_NETWORK_MODE_TIMEOUT;
|
config->network_mode_timeout = RILMODEM_DEFAULT_NETWORK_MODE_TIMEOUT;
|
||||||
|
config->network_selection_timeout =
|
||||||
|
RILMODEM_DEFAULT_NETWORK_SELECTION_TIMEOUT;
|
||||||
config->signal_strength_dbm_weak = RILMODEM_DEFAULT_DBM_WEAK;
|
config->signal_strength_dbm_weak = RILMODEM_DEFAULT_DBM_WEAK;
|
||||||
config->signal_strength_dbm_strong = RILMODEM_DEFAULT_DBM_STRONG;
|
config->signal_strength_dbm_strong = RILMODEM_DEFAULT_DBM_STRONG;
|
||||||
config->empty_pin_query = RILMODEM_DEFAULT_EMPTY_PIN_QUERY;
|
config->empty_pin_query = RILMODEM_DEFAULT_EMPTY_PIN_QUERY;
|
||||||
@@ -1204,6 +1216,7 @@ static ril_slot *ril_plugin_slot_new_take(char *transport,
|
|||||||
config->enable_stk = RILMODEM_DEFAULT_ENABLE_STK;
|
config->enable_stk = RILMODEM_DEFAULT_ENABLE_STK;
|
||||||
config->query_available_band_mode =
|
config->query_available_band_mode =
|
||||||
RILMODEM_DEFAULT_QUERY_AVAILABLE_BAND_MODE;
|
RILMODEM_DEFAULT_QUERY_AVAILABLE_BAND_MODE;
|
||||||
|
config->replace_strange_oper = RILMODEM_DEFAULT_REPLACE_STRANGE_OPER;
|
||||||
config->network_selection_manual_0 =
|
config->network_selection_manual_0 =
|
||||||
RILMODEM_DEFAULT_NETWORK_SELECTION_MANUAL_0;
|
RILMODEM_DEFAULT_NETWORK_SELECTION_MANUAL_0;
|
||||||
config->force_gsm_when_radio_off =
|
config->force_gsm_when_radio_off =
|
||||||
@@ -1244,6 +1257,7 @@ static void ril_plugin_slot_apply_vendor_defaults(ril_slot *slot)
|
|||||||
defaults.empty_pin_query = config->empty_pin_query;
|
defaults.empty_pin_query = config->empty_pin_query;
|
||||||
defaults.mms_data_profile_id = config->mms_data_profile_id;
|
defaults.mms_data_profile_id = config->mms_data_profile_id;
|
||||||
defaults.use_data_profiles = config->use_data_profiles;
|
defaults.use_data_profiles = config->use_data_profiles;
|
||||||
|
defaults.replace_strange_oper = config->replace_strange_oper;
|
||||||
defaults.force_gsm_when_radio_off =
|
defaults.force_gsm_when_radio_off =
|
||||||
config->force_gsm_when_radio_off;
|
config->force_gsm_when_radio_off;
|
||||||
defaults.query_available_band_mode =
|
defaults.query_available_band_mode =
|
||||||
@@ -1256,6 +1270,7 @@ static void ril_plugin_slot_apply_vendor_defaults(ril_slot *slot)
|
|||||||
config->empty_pin_query = defaults.empty_pin_query;
|
config->empty_pin_query = defaults.empty_pin_query;
|
||||||
config->use_data_profiles = defaults.use_data_profiles;
|
config->use_data_profiles = defaults.use_data_profiles;
|
||||||
config->mms_data_profile_id = defaults.mms_data_profile_id;
|
config->mms_data_profile_id = defaults.mms_data_profile_id;
|
||||||
|
config->replace_strange_oper = defaults.replace_strange_oper;
|
||||||
config->force_gsm_when_radio_off =
|
config->force_gsm_when_radio_off =
|
||||||
defaults.force_gsm_when_radio_off;
|
defaults.force_gsm_when_radio_off;
|
||||||
config->query_available_band_mode =
|
config->query_available_band_mode =
|
||||||
@@ -1479,6 +1494,14 @@ static ril_slot *ril_plugin_parse_config_group(GKeyFile *file,
|
|||||||
config->enable_stk ? "yes" : "no");
|
config->enable_stk ? "yes" : "no");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* replaceStrangeOperatorNames */
|
||||||
|
if (ril_config_get_boolean(file, group,
|
||||||
|
RILCONF_REPLACE_STRANGE_OPER,
|
||||||
|
&config->replace_strange_oper)) {
|
||||||
|
DBG("%s: " RILCONF_REPLACE_STRANGE_OPER " %s", group,
|
||||||
|
config->replace_strange_oper ? "yes" : "no");
|
||||||
|
}
|
||||||
|
|
||||||
/* networkSelectionManual0 */
|
/* networkSelectionManual0 */
|
||||||
if (ril_config_get_boolean(file, group,
|
if (ril_config_get_boolean(file, group,
|
||||||
RILCONF_NETWORK_SELECTION_MANUAL_0,
|
RILCONF_NETWORK_SELECTION_MANUAL_0,
|
||||||
@@ -1565,6 +1588,14 @@ static ril_slot *ril_plugin_parse_config_group(GKeyFile *file,
|
|||||||
config->network_mode_timeout);
|
config->network_mode_timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* networkSelectionTimeout */
|
||||||
|
if (ril_config_get_integer(file, group,
|
||||||
|
RILCONF_NETWORK_SELECTION_TIMEOUT,
|
||||||
|
&config->network_selection_timeout)) {
|
||||||
|
DBG("%s: " RILCONF_NETWORK_SELECTION_TIMEOUT " %d", group,
|
||||||
|
config->network_selection_timeout);
|
||||||
|
}
|
||||||
|
|
||||||
/* signalStrengthRange */
|
/* signalStrengthRange */
|
||||||
ints = ril_config_get_ints(file, group, RILCONF_SIGNAL_STRENGTH_RANGE);
|
ints = ril_config_get_ints(file, group, RILCONF_SIGNAL_STRENGTH_RANGE);
|
||||||
if (gutil_ints_get_count(ints) == 2) {
|
if (gutil_ints_get_count(ints) == 2) {
|
||||||
|
|||||||
@@ -241,7 +241,19 @@ static void ril_radio_power_request(struct ril_radio *self, gboolean on,
|
|||||||
void ril_radio_confirm_power_on(struct ril_radio *self)
|
void ril_radio_confirm_power_on(struct ril_radio *self)
|
||||||
{
|
{
|
||||||
if (G_LIKELY(self) && ril_radio_power_should_be_on(self)) {
|
if (G_LIKELY(self) && ril_radio_power_should_be_on(self)) {
|
||||||
ril_radio_power_request(self, TRUE, TRUE);
|
struct ril_radio_priv *priv = self->priv;
|
||||||
|
|
||||||
|
if (priv->pending_id) {
|
||||||
|
if (!priv->next_state) {
|
||||||
|
/* Wait for the pending request to complete */
|
||||||
|
priv->next_state_valid = TRUE;
|
||||||
|
priv->next_state = TRUE;
|
||||||
|
DBG_(self, "on (queued)");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
DBG_(self, "on");
|
||||||
|
ril_radio_submit_power_request(self, TRUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony - RIL-based devices
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017-2018 Jolla Ltd.
|
* Copyright (C) 2017-2020 Jolla Ltd.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -1414,7 +1414,7 @@ RilRadioCapsManager *ril_radio_caps_manager_ref(RilRadioCapsManager *self)
|
|||||||
void ril_radio_caps_manager_unref(RilRadioCapsManager *self)
|
void ril_radio_caps_manager_unref(RilRadioCapsManager *self)
|
||||||
{
|
{
|
||||||
if (G_LIKELY(self)) {
|
if (G_LIKELY(self)) {
|
||||||
g_object_ref(RADIO_CAPS_MANAGER(self));
|
g_object_unref(RADIO_CAPS_MANAGER(self));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -237,6 +237,13 @@ socket=/dev/socket/rild
|
|||||||
#
|
#
|
||||||
#networkModeTimeout=20000
|
#networkModeTimeout=20000
|
||||||
|
|
||||||
|
# Timeout for RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC and
|
||||||
|
# RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL, in milliseconds.
|
||||||
|
#
|
||||||
|
# Default 100000 (100 seconds)
|
||||||
|
#
|
||||||
|
#networkSelectionTimeout=100000
|
||||||
|
|
||||||
# Comma-separated signal strength range, in dBm.
|
# Comma-separated signal strength range, in dBm.
|
||||||
#
|
#
|
||||||
# These values are used for translating dBm values returned by the modem in
|
# These values are used for translating dBm values returned by the modem in
|
||||||
@@ -275,6 +282,16 @@ socket=/dev/socket/rild
|
|||||||
#
|
#
|
||||||
#singleDataContext=false
|
#singleDataContext=false
|
||||||
|
|
||||||
|
# With some RILs, RIL_REQUEST_QUERY_AVAILABLE_NETWORKS returns strange
|
||||||
|
# operator names, i.e. numeric MCC+MNC values or the same name for all
|
||||||
|
# operators (which is actually SPN fetched from the SIM). Such strange
|
||||||
|
# names can be replaced with operator names from MBPI database, based
|
||||||
|
# on the operator's MCC and MNC. That may not be 100% accurate, though.
|
||||||
|
#
|
||||||
|
# Default false (i.e. trust RIL to report the actual names)
|
||||||
|
#
|
||||||
|
#replaceStrangeOperatorNames=false
|
||||||
|
|
||||||
# Configures whether +0 is added to MCCMNC string passed to
|
# Configures whether +0 is added to MCCMNC string passed to
|
||||||
# RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL. Some Qualcomm RILs
|
# RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL. Some Qualcomm RILs
|
||||||
# require it, some MediaTek RILs don't like it.
|
# require it, some MediaTek RILs don't like it.
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ struct ril_slot_config {
|
|||||||
enum ril_pref_net_type lte_network_mode;
|
enum ril_pref_net_type lte_network_mode;
|
||||||
enum ril_pref_net_type umts_network_mode;
|
enum ril_pref_net_type umts_network_mode;
|
||||||
int network_mode_timeout;
|
int network_mode_timeout;
|
||||||
|
int network_selection_timeout;
|
||||||
int signal_strength_dbm_weak;
|
int signal_strength_dbm_weak;
|
||||||
int signal_strength_dbm_strong;
|
int signal_strength_dbm_strong;
|
||||||
gboolean query_available_band_mode;
|
gboolean query_available_band_mode;
|
||||||
@@ -64,6 +65,7 @@ struct ril_slot_config {
|
|||||||
gboolean enable_voicecall;
|
gboolean enable_voicecall;
|
||||||
gboolean enable_cbs;
|
gboolean enable_cbs;
|
||||||
gboolean enable_stk;
|
gboolean enable_stk;
|
||||||
|
gboolean replace_strange_oper;
|
||||||
gboolean network_selection_manual_0;
|
gboolean network_selection_manual_0;
|
||||||
gboolean force_gsm_when_radio_off;
|
gboolean force_gsm_when_radio_off;
|
||||||
gboolean use_data_profiles;
|
gboolean use_data_profiles;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony - RIL-based devices
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016-2019 Jolla Ltd.
|
* Copyright (C) 2016-2020 Jolla Ltd.
|
||||||
* Copyright (C) 2019 Open Mobile Platform LLC.
|
* Copyright (C) 2019-2020 Open Mobile Platform LLC.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -24,6 +24,7 @@ struct ril_vendor_defaults {
|
|||||||
gboolean legacy_imei_query;
|
gboolean legacy_imei_query;
|
||||||
gboolean enable_cbs;
|
gboolean enable_cbs;
|
||||||
gboolean enable_stk;
|
gboolean enable_stk;
|
||||||
|
gboolean replace_strange_oper;
|
||||||
gboolean query_available_band_mode;
|
gboolean query_available_band_mode;
|
||||||
gboolean use_data_profiles;
|
gboolean use_data_profiles;
|
||||||
gboolean force_gsm_when_radio_off;
|
gboolean force_gsm_when_radio_off;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony - RIL-based devices
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016-2019 Jolla Ltd.
|
* Copyright (C) 2016-2020 Jolla Ltd.
|
||||||
* Copyright (C) 2019 Open Mobile Platform LLC.
|
* Copyright (C) 2019-2020 Open Mobile Platform LLC.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -509,6 +509,7 @@ static void ril_vendor_mtk_get_defaults(struct ril_vendor_defaults *defaults)
|
|||||||
defaults->empty_pin_query = FALSE;
|
defaults->empty_pin_query = FALSE;
|
||||||
defaults->legacy_imei_query = TRUE;
|
defaults->legacy_imei_query = TRUE;
|
||||||
defaults->force_gsm_when_radio_off = FALSE;
|
defaults->force_gsm_when_radio_off = FALSE;
|
||||||
|
defaults->replace_strange_oper = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ril_vendor_mtk_base_init(RilVendorMtk *self, GRilIoChannel *io,
|
static void ril_vendor_mtk_base_init(RilVendorMtk *self, GRilIoChannel *io,
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ enum ofono_dbus_access_intf {
|
|||||||
OFONO_DBUS_ACCESS_INTF_MODEM, /* org.ofono.Modem */
|
OFONO_DBUS_ACCESS_INTF_MODEM, /* org.ofono.Modem */
|
||||||
OFONO_DBUS_ACCESS_INTF_RADIOSETTINGS, /* org.ofono.RadioSettings */
|
OFONO_DBUS_ACCESS_INTF_RADIOSETTINGS, /* org.ofono.RadioSettings */
|
||||||
OFONO_DBUS_ACCESS_INTF_STK, /* org.ofono.SimToolkit */
|
OFONO_DBUS_ACCESS_INTF_STK, /* org.ofono.SimToolkit */
|
||||||
|
OFONO_DBUS_ACCESS_INTF_OEMRAW, /* org.ofono.OemRaw */
|
||||||
OFONO_DBUS_ACCESS_INTF_COUNT
|
OFONO_DBUS_ACCESS_INTF_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -124,6 +125,12 @@ enum ofono_dbus_access_stk_method {
|
|||||||
OFONO_DBUS_ACCESS_STK_METHOD_COUNT
|
OFONO_DBUS_ACCESS_STK_METHOD_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* OFONO_DBUS_ACCESS_INTF_OEMRAW */
|
||||||
|
enum ofono_dbus_access_oemraw_method {
|
||||||
|
OFONO_DBUS_ACCESS_OEMRAW_SEND,
|
||||||
|
OFONO_DBUS_ACCESS_OEMRAW_METHOD_COUNT
|
||||||
|
};
|
||||||
|
|
||||||
#define OFONO_DBUS_ACCESS_PRIORITY_LOW (-100)
|
#define OFONO_DBUS_ACCESS_PRIORITY_LOW (-100)
|
||||||
#define OFONO_DBUS_ACCESS_PRIORITY_DEFAULT (0)
|
#define OFONO_DBUS_ACCESS_PRIORITY_DEFAULT (0)
|
||||||
#define OFONO_DBUS_ACCESS_PRIORITY_HIGH (100)
|
#define OFONO_DBUS_ACCESS_PRIORITY_HIGH (100)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
||||||
* Copyright (C) 2013 Jolla Ltd. All rights reserved.
|
* Copyright (C) 2013 Jolla Ltd. All rights reserved.
|
||||||
|
* Copyright (C) 2020 Open Mobile Platform LLС. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -26,6 +27,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <gdbus.h>
|
#include <gdbus.h>
|
||||||
|
|
||||||
@@ -40,58 +42,42 @@
|
|||||||
|
|
||||||
#define SMS_HISTORY_INTERFACE "org.ofono.SmsHistory"
|
#define SMS_HISTORY_INTERFACE "org.ofono.SmsHistory"
|
||||||
|
|
||||||
gboolean sms_history_interface_registered = FALSE;
|
|
||||||
|
|
||||||
static const GDBusSignalTable sms_history_signals[] = {
|
static const GDBusSignalTable sms_history_signals[] = {
|
||||||
{ GDBUS_SIGNAL("StatusReport",
|
{ GDBUS_SIGNAL("StatusReport",
|
||||||
GDBUS_ARGS({ "message", "s" }, { "Delivered", "a{b}" })) },
|
GDBUS_ARGS({ "message", "s" }, { "Delivered", "a{b}" })) },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
static void sms_history_cleanup(gpointer user)
|
static int sms_history_probe(struct ofono_history_context *context)
|
||||||
{
|
{
|
||||||
struct ofono_modem *modem = user;
|
|
||||||
DBG("modem %p", modem);
|
|
||||||
ofono_modem_remove_interface(modem, SMS_HISTORY_INTERFACE);
|
|
||||||
sms_history_interface_registered = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean sms_history_ensure_interface(
|
|
||||||
struct ofono_modem *modem) {
|
|
||||||
|
|
||||||
if (sms_history_interface_registered)
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
/* Late initialization of the D-Bus interface */
|
|
||||||
DBusConnection *conn = ofono_dbus_get_connection();
|
DBusConnection *conn = ofono_dbus_get_connection();
|
||||||
if (conn == NULL)
|
struct ofono_modem *modem = context->modem;
|
||||||
return FALSE;
|
|
||||||
|
ofono_debug("SMS History Probe for modem: %p", modem);
|
||||||
|
|
||||||
if (!g_dbus_register_interface(conn,
|
if (!g_dbus_register_interface(conn,
|
||||||
ofono_modem_get_path(modem),
|
ofono_modem_get_path(modem),
|
||||||
SMS_HISTORY_INTERFACE,
|
SMS_HISTORY_INTERFACE,
|
||||||
NULL, sms_history_signals, NULL,
|
NULL, sms_history_signals,
|
||||||
modem, sms_history_cleanup)) {
|
NULL, NULL, NULL)) {
|
||||||
ofono_error("Could not create %s interface",
|
ofono_error("Could not create %s interface",
|
||||||
SMS_HISTORY_INTERFACE);
|
SMS_HISTORY_INTERFACE);
|
||||||
return FALSE;
|
return -EIO;
|
||||||
}
|
}
|
||||||
sms_history_interface_registered = TRUE;
|
|
||||||
ofono_modem_add_interface(modem, SMS_HISTORY_INTERFACE);
|
ofono_modem_add_interface(modem, SMS_HISTORY_INTERFACE);
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int sms_history_probe(struct ofono_history_context *context)
|
|
||||||
{
|
|
||||||
ofono_debug("SMS History Probe for modem: %p", context->modem);
|
|
||||||
sms_history_ensure_interface(context->modem);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sms_history_remove(struct ofono_history_context *context)
|
static void sms_history_remove(struct ofono_history_context *context)
|
||||||
{
|
{
|
||||||
ofono_debug("SMS History Remove for modem: %p", context->modem);
|
DBusConnection *conn = ofono_dbus_get_connection();
|
||||||
|
struct ofono_modem *modem = context->modem;
|
||||||
|
|
||||||
|
ofono_debug("SMS History remove for modem: %p", modem);
|
||||||
|
ofono_modem_remove_interface(modem, SMS_HISTORY_INTERFACE);
|
||||||
|
g_dbus_unregister_interface(conn, ofono_modem_get_path(modem),
|
||||||
|
SMS_HISTORY_INTERFACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sms_history_sms_send_status(
|
static void sms_history_sms_send_status(
|
||||||
@@ -102,9 +88,6 @@ static void sms_history_sms_send_status(
|
|||||||
{
|
{
|
||||||
DBG("");
|
DBG("");
|
||||||
|
|
||||||
if (!sms_history_ensure_interface(context->modem))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ((s == OFONO_HISTORY_SMS_STATUS_DELIVERED)
|
if ((s == OFONO_HISTORY_SMS_STATUS_DELIVERED)
|
||||||
|| (s == OFONO_HISTORY_SMS_STATUS_DELIVER_FAILED)) {
|
|| (s == OFONO_HISTORY_SMS_STATUS_DELIVER_FAILED)) {
|
||||||
|
|
||||||
@@ -174,4 +157,3 @@ static void sms_history_exit(void)
|
|||||||
OFONO_PLUGIN_DEFINE(sms_history, "SMS History Plugin",
|
OFONO_PLUGIN_DEFINE(sms_history, "SMS History Plugin",
|
||||||
VERSION, OFONO_PLUGIN_PRIORITY_DEFAULT,
|
VERSION, OFONO_PLUGIN_PRIORITY_DEFAULT,
|
||||||
sms_history_init, sms_history_exit)
|
sms_history_init, sms_history_exit)
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ const char *ofono_dbus_access_intf_name(enum ofono_dbus_access_intf intf)
|
|||||||
return OFONO_RADIO_SETTINGS_INTERFACE;
|
return OFONO_RADIO_SETTINGS_INTERFACE;
|
||||||
case OFONO_DBUS_ACCESS_INTF_STK:
|
case OFONO_DBUS_ACCESS_INTF_STK:
|
||||||
return OFONO_STK_INTERFACE;
|
return OFONO_STK_INTERFACE;
|
||||||
|
case OFONO_DBUS_ACCESS_INTF_OEMRAW:
|
||||||
|
return "org.ofono.OemRaw";
|
||||||
case OFONO_DBUS_ACCESS_INTF_COUNT:
|
case OFONO_DBUS_ACCESS_INTF_COUNT:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -176,6 +178,14 @@ const char *ofono_dbus_access_method_name(enum ofono_dbus_access_intf intf,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case OFONO_DBUS_ACCESS_INTF_OEMRAW:
|
||||||
|
switch ((enum ofono_dbus_access_oemraw_method)method) {
|
||||||
|
case OFONO_DBUS_ACCESS_OEMRAW_SEND:
|
||||||
|
return "Send";
|
||||||
|
case OFONO_DBUS_ACCESS_OEMRAW_METHOD_COUNT:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case OFONO_DBUS_ACCESS_INTF_COUNT:
|
case OFONO_DBUS_ACCESS_INTF_COUNT:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,12 @@ static enum ofono_dbus_access deny_method_access(const char *sender,
|
|||||||
return OFONO_DBUS_ACCESS_DENY;
|
return OFONO_DBUS_ACCESS_DENY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static enum ofono_dbus_access broken_method_access(const char *sender,
|
||||||
|
enum ofono_dbus_access_intf intf, int method, const char *arg)
|
||||||
|
{
|
||||||
|
return (enum ofono_dbus_access)(-1);
|
||||||
|
}
|
||||||
|
|
||||||
struct ofono_dbus_access_plugin access_inval;
|
struct ofono_dbus_access_plugin access_inval;
|
||||||
struct ofono_dbus_access_plugin access_dontcare = {
|
struct ofono_dbus_access_plugin access_dontcare = {
|
||||||
.name = "DontCare",
|
.name = "DontCare",
|
||||||
@@ -51,6 +57,12 @@ struct ofono_dbus_access_plugin access_deny = {
|
|||||||
.method_access = deny_method_access
|
.method_access = deny_method_access
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ofono_dbus_access_plugin access_broken = {
|
||||||
|
.name = "Broken",
|
||||||
|
.priority = OFONO_DBUS_ACCESS_PRIORITY_LOW,
|
||||||
|
.method_access = broken_method_access
|
||||||
|
};
|
||||||
|
|
||||||
/*==========================================================================*
|
/*==========================================================================*
|
||||||
* Tests
|
* Tests
|
||||||
*==========================================================================*/
|
*==========================================================================*/
|
||||||
@@ -107,6 +119,9 @@ static const struct test_method_name_data method_name_tests[] = {
|
|||||||
},{
|
},{
|
||||||
OFONO_DBUS_ACCESS_INTF_STK,
|
OFONO_DBUS_ACCESS_INTF_STK,
|
||||||
OFONO_DBUS_ACCESS_STK_METHOD_COUNT
|
OFONO_DBUS_ACCESS_STK_METHOD_COUNT
|
||||||
|
},{
|
||||||
|
OFONO_DBUS_ACCESS_INTF_OEMRAW,
|
||||||
|
OFONO_DBUS_ACCESS_OEMRAW_METHOD_COUNT
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -156,6 +171,13 @@ static void test_register()
|
|||||||
ofono_dbus_access_plugin_unregister(&access_deny);
|
ofono_dbus_access_plugin_unregister(&access_deny);
|
||||||
ofono_dbus_access_plugin_unregister(&access_dontcare);
|
ofono_dbus_access_plugin_unregister(&access_dontcare);
|
||||||
|
|
||||||
|
/* And here too */
|
||||||
|
g_assert(!ofono_dbus_access_plugin_register(&access_broken));
|
||||||
|
g_assert(!ofono_dbus_access_plugin_register(&access_deny));
|
||||||
|
g_assert(!__ofono_dbus_access_method_allowed(":1.0", 0, 1, NULL));
|
||||||
|
ofono_dbus_access_plugin_unregister(&access_deny);
|
||||||
|
ofono_dbus_access_plugin_unregister(&access_dontcare);
|
||||||
|
|
||||||
/* DontCare will allow everything */
|
/* DontCare will allow everything */
|
||||||
g_assert(!ofono_dbus_access_plugin_register(&access_dontcare));
|
g_assert(!ofono_dbus_access_plugin_register(&access_dontcare));
|
||||||
g_assert(__ofono_dbus_access_method_allowed(":1.0", 0, 1, NULL));
|
g_assert(__ofono_dbus_access_method_allowed(":1.0", 0, 1, NULL));
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ License: GPLv2
|
|||||||
URL: https://git.sailfishos.org/mer-core/ofono
|
URL: https://git.sailfishos.org/mer-core/ofono
|
||||||
Source: %{name}-%{version}.tar.bz2
|
Source: %{name}-%{version}.tar.bz2
|
||||||
|
|
||||||
%define libgrilio_version 1.0.35
|
%define libgrilio_version 1.0.38
|
||||||
%define libglibutil_version 1.0.30
|
%define libglibutil_version 1.0.30
|
||||||
%define libmce_version 1.0.6
|
%define libmce_version 1.0.6
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user