mirror of
https://github.com/sailfishos/ofono
synced 2025-11-24 03:19:44 +08:00
Compare commits
31 Commits
mer/1.23+g
...
mer/1.23+g
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22197b5e04 | ||
|
|
3a358ddc9d | ||
|
|
53929f9f1a | ||
|
|
08bae57a2b | ||
|
|
1915aeda76 | ||
|
|
51bfb17cbc | ||
|
|
a83b553032 | ||
|
|
ec00abd62d | ||
|
|
80924d5787 | ||
|
|
2bdd05aa31 | ||
|
|
544f02e5a2 | ||
|
|
6d4638f9bf | ||
|
|
6584919e9d | ||
|
|
34fb44f4eb | ||
|
|
c98d2f41c5 | ||
|
|
b279be4528 | ||
|
|
a7912fea39 | ||
|
|
f291cea905 | ||
|
|
68f7d30b77 | ||
|
|
890a2697fe | ||
|
|
9568c8449b | ||
|
|
cf91be9742 | ||
|
|
087771dc0f | ||
|
|
645dfe47e5 | ||
|
|
68e8b02d3b | ||
|
|
aa4309e8cb | ||
|
|
cb6b24d950 | ||
|
|
6d1ab13c74 | ||
|
|
45424a3f96 | ||
|
|
4f7398e39d | ||
|
|
cd118ce70b |
@@ -151,8 +151,10 @@ builtin_sources += drivers/ril/ril_call_barring.c \
|
|||||||
drivers/ril/ril_devinfo.c \
|
drivers/ril/ril_devinfo.c \
|
||||||
drivers/ril/ril_devmon.c \
|
drivers/ril/ril_devmon.c \
|
||||||
drivers/ril/ril_devmon_auto.c \
|
drivers/ril/ril_devmon_auto.c \
|
||||||
|
drivers/ril/ril_devmon_combine.c \
|
||||||
drivers/ril/ril_devmon_ds.c \
|
drivers/ril/ril_devmon_ds.c \
|
||||||
drivers/ril/ril_devmon_ss.c \
|
drivers/ril/ril_devmon_ss.c \
|
||||||
|
drivers/ril/ril_devmon_ur.c \
|
||||||
drivers/ril/ril_ecclist.c \
|
drivers/ril/ril_ecclist.c \
|
||||||
drivers/ril/ril_gprs.c \
|
drivers/ril/ril_gprs.c \
|
||||||
drivers/ril/ril_gprs_context.c \
|
drivers/ril/ril_gprs_context.c \
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony - RIL-based devices
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015-2019 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
|
||||||
@@ -186,6 +186,72 @@ gboolean ril_config_get_enum(GKeyFile *file, const char *group,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean ril_config_get_mask(GKeyFile *file, const char *group,
|
||||||
|
const char *key, int *result,
|
||||||
|
const char *name, int value, ...)
|
||||||
|
{
|
||||||
|
char *str = ril_config_get_string(file, group, key);
|
||||||
|
gboolean ok = FALSE;
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
*result = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (str) {
|
||||||
|
/*
|
||||||
|
* Some people are thinking that # is a comment
|
||||||
|
* anywhere on the line, not just at the beginning
|
||||||
|
*/
|
||||||
|
char *comment = strchr(str, '#');
|
||||||
|
char **values, **ptr;
|
||||||
|
|
||||||
|
if (comment) *comment = 0;
|
||||||
|
values = g_strsplit(str, "+", -1);
|
||||||
|
|
||||||
|
for (ok = TRUE, ptr = values; *ptr && ok; ptr++) {
|
||||||
|
const char* found_str = NULL;
|
||||||
|
const char* s = g_strstrip(*ptr);
|
||||||
|
|
||||||
|
if (!strcasecmp(s, name)) {
|
||||||
|
found_str = name;
|
||||||
|
if (result) {
|
||||||
|
*result |= value;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
va_list args;
|
||||||
|
const char* known;
|
||||||
|
|
||||||
|
va_start(args, value);
|
||||||
|
while ((known = va_arg(args, char*)) != NULL) {
|
||||||
|
const int bit = va_arg(args, int);
|
||||||
|
|
||||||
|
if (!strcasecmp(s, known)) {
|
||||||
|
found_str = known;
|
||||||
|
if (result) {
|
||||||
|
*result |= bit;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!found_str) {
|
||||||
|
ofono_error("Unknown bit '%s' in %s", s, key);
|
||||||
|
ok = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
g_strfreev(values);
|
||||||
|
g_free(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ok && result) {
|
||||||
|
*result = 0;
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
GUtilInts *ril_config_get_ints(GKeyFile *file, const char *group,
|
GUtilInts *ril_config_get_ints(GKeyFile *file, const char *group,
|
||||||
const char *key)
|
const char *key)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony - RIL-based devices
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015-2019 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
|
||||||
@@ -35,7 +35,12 @@ gboolean ril_config_get_flag(GKeyFile *file, const char *group,
|
|||||||
const char *key, int flag, int *flags);
|
const char *key, int flag, int *flags);
|
||||||
gboolean ril_config_get_enum(GKeyFile *file, const char *group,
|
gboolean ril_config_get_enum(GKeyFile *file, const char *group,
|
||||||
const char *key, int *result,
|
const char *key, int *result,
|
||||||
const char *name, int value, ...);
|
const char *name, int value, ...)
|
||||||
|
G_GNUC_NULL_TERMINATED;
|
||||||
|
gboolean ril_config_get_mask(GKeyFile *file, const char *group,
|
||||||
|
const char *key, int *result,
|
||||||
|
const char *name, int value, ...)
|
||||||
|
G_GNUC_NULL_TERMINATED;
|
||||||
GUtilInts *ril_config_get_ints(GKeyFile *file, const char *group,
|
GUtilInts *ril_config_get_ints(GKeyFile *file, const char *group,
|
||||||
const char *key);
|
const char *key);
|
||||||
char *ril_config_ints_to_string(GUtilInts *ints, char separator);
|
char *ril_config_ints_to_string(GUtilInts *ints, char separator);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2013 Canonical Ltd.
|
* Copyright (C) 2013 Canonical Ltd.
|
||||||
* Copyright (C) 2013-2019 Jolla Ltd.
|
* Copyright (C) 2013-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
|
||||||
@@ -205,10 +205,44 @@ enum ril_data_call_fail_cause {
|
|||||||
PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22,
|
PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22,
|
||||||
PDP_FAIL_NSAPI_IN_USE = 0x23,
|
PDP_FAIL_NSAPI_IN_USE = 0x23,
|
||||||
PDP_FAIL_REGULAR_DEACTIVATION = 0x24,
|
PDP_FAIL_REGULAR_DEACTIVATION = 0x24,
|
||||||
|
PDP_FAIL_QOS_NOT_ACCEPTED = 0x25,
|
||||||
|
PDP_FAIL_NETWORK_FAILURE = 0x26,
|
||||||
|
PDP_FAIL_UMTS_REACTIVATION_REQ = 0x27,
|
||||||
|
PDP_FAIL_FEATURE_NOT_SUPP = 0x28,
|
||||||
|
PDP_FAIL_TFT_SEMANTIC_ERROR = 0x29,
|
||||||
|
PDP_FAIL_TFT_SYTAX_ERROR = 0x2A,
|
||||||
|
PDP_FAIL_UNKNOWN_PDP_CONTEXT = 0x2B,
|
||||||
|
PDP_FAIL_FILTER_SEMANTIC_ERROR = 0x2C,
|
||||||
|
PDP_FAIL_FILTER_SYTAX_ERROR = 0x2D,
|
||||||
|
PDP_FAIL_PDP_WITHOUT_ACTIVE_TFT = 0x2E,
|
||||||
PDP_FAIL_ONLY_IPV4_ALLOWED = 0x32,
|
PDP_FAIL_ONLY_IPV4_ALLOWED = 0x32,
|
||||||
PDP_FAIL_ONLY_IPV6_ALLOWED = 0x33,
|
PDP_FAIL_ONLY_IPV6_ALLOWED = 0x33,
|
||||||
PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED = 0x34,
|
PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED = 0x34,
|
||||||
|
PDP_FAIL_ESM_INFO_NOT_RECEIVED = 0x35,
|
||||||
|
PDP_FAIL_PDN_CONN_DOES_NOT_EXIST = 0x36,
|
||||||
|
PDP_FAIL_MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 0x37,
|
||||||
|
PDP_FAIL_MAX_ACTIVE_PDP_CONTEXT_REACHED = 0x41,
|
||||||
|
PDP_FAIL_UNSUPPORTED_APN_IN_CURRENT_PLMN = 0x42,
|
||||||
|
PDP_FAIL_INVALID_TRANSACTION_ID = 0x51,
|
||||||
|
PDP_FAIL_MESSAGE_INCORRECT_SEMANTIC = 0x5F,
|
||||||
|
PDP_FAIL_INVALID_MANDATORY_INFO = 0x60,
|
||||||
|
PDP_FAIL_MESSAGE_TYPE_UNSUPPORTED = 0x61,
|
||||||
|
PDP_FAIL_MSG_TYPE_NONCOMPATIBLE_STATE = 0x62,
|
||||||
|
PDP_FAIL_UNKNOWN_INFO_ELEMENT = 0x63,
|
||||||
|
PDP_FAIL_CONDITIONAL_IE_ERROR = 0x64,
|
||||||
|
PDP_FAIL_MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 0x65,
|
||||||
PDP_FAIL_PROTOCOL_ERRORS = 0x6F,
|
PDP_FAIL_PROTOCOL_ERRORS = 0x6F,
|
||||||
|
PDP_FAIL_APN_TYPE_CONFLICT = 0x70,
|
||||||
|
PDP_FAIL_INVALID_PCSCF_ADDR = 0x71,
|
||||||
|
PDP_FAIL_INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 0x72,
|
||||||
|
PDP_FAIL_EMM_ACCESS_BARRED = 0x73,
|
||||||
|
PDP_FAIL_EMERGENCY_IFACE_ONLY = 0x74,
|
||||||
|
PDP_FAIL_IFACE_MISMATCH = 0x75,
|
||||||
|
PDP_FAIL_COMPANION_IFACE_IN_USE = 0x76,
|
||||||
|
PDP_FAIL_IP_ADDRESS_MISMATCH = 0x77,
|
||||||
|
PDP_FAIL_IFACE_AND_POL_FAMILY_MISMATCH = 0x78,
|
||||||
|
PDP_FAIL_EMM_ACCESS_BARRED_INFINITE_RETRY = 0x79,
|
||||||
|
PDP_FAIL_AUTH_FAILURE_ON_EMERGENCY_CALL = 0x7A,
|
||||||
PDP_FAIL_VOICE_REGISTRATION_FAIL = -1,
|
PDP_FAIL_VOICE_REGISTRATION_FAIL = -1,
|
||||||
PDP_FAIL_DATA_REGISTRATION_FAIL = -2,
|
PDP_FAIL_DATA_REGISTRATION_FAIL = -2,
|
||||||
PDP_FAIL_SIGNAL_LOST = -3,
|
PDP_FAIL_SIGNAL_LOST = -3,
|
||||||
@@ -341,6 +375,19 @@ enum ril_restricted_state {
|
|||||||
#define RIL_FACILITY_UNLOCK "0"
|
#define RIL_FACILITY_UNLOCK "0"
|
||||||
#define RIL_FACILITY_LOCK "1"
|
#define RIL_FACILITY_LOCK "1"
|
||||||
|
|
||||||
|
/* See RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER (RIL_VERSION >= 15) */
|
||||||
|
enum ril_unsolicited_response_filter {
|
||||||
|
RIL_UR_SIGNAL_STRENGTH = 0x01,
|
||||||
|
RIL_UR_FULL_NETWORK_STATE = 0x02,
|
||||||
|
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 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* 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 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
|
||||||
@@ -14,6 +14,8 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
#include "ril_data.h"
|
#include "ril_data.h"
|
||||||
#include "ril_radio.h"
|
#include "ril_radio.h"
|
||||||
#include "ril_network.h"
|
#include "ril_network.h"
|
||||||
@@ -29,6 +31,8 @@
|
|||||||
#include <grilio_parser.h>
|
#include <grilio_parser.h>
|
||||||
#include <grilio_request.h>
|
#include <grilio_request.h>
|
||||||
|
|
||||||
|
#include "common.h" /* ACCESS_TECHNOLOGY_EUTRAN */
|
||||||
|
|
||||||
/* Yes, it does sometimes take minutes in roaming */
|
/* Yes, it does sometimes take minutes in roaming */
|
||||||
#define SETUP_DATA_CALL_TIMEOUT (300*1000) /* ms */
|
#define SETUP_DATA_CALL_TIMEOUT (300*1000) /* ms */
|
||||||
|
|
||||||
@@ -115,6 +119,7 @@ struct ril_data_priv {
|
|||||||
gulong io_event_id[IO_EVENT_COUNT];
|
gulong io_event_id[IO_EVENT_COUNT];
|
||||||
gulong settings_event_id[SETTINGS_EVENT_COUNT];
|
gulong settings_event_id[SETTINGS_EVENT_COUNT];
|
||||||
GHashTable* grab;
|
GHashTable* grab;
|
||||||
|
gboolean downgraded_tech; /* Status 55 workaround */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ril_data_signal {
|
enum ril_data_signal {
|
||||||
@@ -815,6 +820,31 @@ static gboolean ril_data_call_setup_retry(void *user_data)
|
|||||||
return G_SOURCE_REMOVE;
|
return G_SOURCE_REMOVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean ril_data_call_retry(struct ril_data_request_setup *setup)
|
||||||
|
{
|
||||||
|
struct ril_data_request *req = &setup->req;
|
||||||
|
const struct ril_data_options *options = &req->data->priv->options;
|
||||||
|
|
||||||
|
if (setup->retry_count < options->data_call_retry_limit) {
|
||||||
|
req->pending_id = 0;
|
||||||
|
GASSERT(!setup->retry_delay_id);
|
||||||
|
if (!setup->retry_count) {
|
||||||
|
/* No delay first time */
|
||||||
|
setup->retry_count++;
|
||||||
|
DBG("silent retry %u out of %u", setup->retry_count,
|
||||||
|
options->data_call_retry_limit);
|
||||||
|
req->submit(req);
|
||||||
|
} else {
|
||||||
|
const guint ms = options->data_call_retry_delay_ms;
|
||||||
|
DBG("silent retry scheduled in %u ms", ms);
|
||||||
|
setup->retry_delay_id = g_timeout_add(ms,
|
||||||
|
ril_data_call_setup_retry, setup);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static void ril_data_call_setup_cb(GRilIoChannel *io, int ril_status,
|
static void ril_data_call_setup_cb(GRilIoChannel *io, int ril_status,
|
||||||
const void *data, guint len, void *user_data)
|
const void *data, guint len, void *user_data)
|
||||||
{
|
{
|
||||||
@@ -839,33 +869,49 @@ static void ril_data_call_setup_cb(GRilIoChannel *io, int ril_status,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (call && call->status == PDP_FAIL_ERROR_UNSPECIFIED &&
|
if (call) {
|
||||||
setup->retry_count < priv->options.data_call_retry_limit) {
|
switch (call->status) {
|
||||||
/*
|
/*
|
||||||
* According to the comment from ril.h we should silently
|
* According to the comment from ril.h we should silently
|
||||||
* retry. First time we retry immediately and if that doedsn't
|
* retry. First time we retry immediately and if that doesn't
|
||||||
* work, then after certain delay.
|
* work, then after certain delay.
|
||||||
*/
|
*/
|
||||||
req->pending_id = 0;
|
case PDP_FAIL_ERROR_UNSPECIFIED:
|
||||||
GASSERT(!setup->retry_delay_id);
|
if (ril_data_call_retry(setup)) {
|
||||||
if (!setup->retry_count) {
|
ril_data_call_list_free(list);
|
||||||
setup->retry_count++;
|
return;
|
||||||
DBG("silent retry %u out of %u", setup->retry_count,
|
}
|
||||||
priv->options.data_call_retry_limit);
|
break;
|
||||||
req->submit(req);
|
/*
|
||||||
} else {
|
* With some networks we sometimes start getting error 55
|
||||||
guint ms = priv->options.data_call_retry_delay_ms;
|
* (Multiple PDN connections for a given APN not allowed)
|
||||||
DBG("silent retry scheduled in %u ms", ms);
|
* when trying to setup an LTE data call and this error
|
||||||
setup->retry_delay_id = g_timeout_add(ms,
|
* doesn't go away until we successfully establish a data
|
||||||
ril_data_call_setup_retry, setup);
|
* call over 3G. Then we can switch back to LTE.
|
||||||
|
*/
|
||||||
|
case PDP_FAIL_MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED:
|
||||||
|
if (priv->network->data.access_tech ==
|
||||||
|
ACCESS_TECHNOLOGY_EUTRAN &&
|
||||||
|
!priv->downgraded_tech) {
|
||||||
|
DBG("downgrading preferred technology");
|
||||||
|
priv->downgraded_tech = TRUE;
|
||||||
|
ril_data_manager_check_network_mode(priv->dm);
|
||||||
|
/* And let this call fail */
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
ril_data_call_list_free(list);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ril_data_request_completed(req);
|
ril_data_request_completed(req);
|
||||||
|
|
||||||
if (call && call->status == PDP_FAIL_NONE) {
|
if (call && call->status == PDP_FAIL_NONE) {
|
||||||
|
if (priv->downgraded_tech) {
|
||||||
|
DBG("done with status 55 workaround");
|
||||||
|
priv->downgraded_tech = FALSE;
|
||||||
|
ril_data_manager_check_network_mode(priv->dm);
|
||||||
|
}
|
||||||
if (ril_data_call_list_move_calls(self->data_calls, list) > 0) {
|
if (ril_data_call_list_move_calls(self->data_calls, list) > 0) {
|
||||||
DBG("data call(s) added");
|
DBG("data call(s) added");
|
||||||
ril_data_signal_emit(self, SIGNAL_CALLS_CHANGED);
|
ril_data_signal_emit(self, SIGNAL_CALLS_CHANGED);
|
||||||
@@ -1151,6 +1197,11 @@ static struct ril_data_request *ril_data_allow_new(struct ril_data *data,
|
|||||||
/*==========================================================================*
|
/*==========================================================================*
|
||||||
* ril_data
|
* ril_data
|
||||||
*==========================================================================*/
|
*==========================================================================*/
|
||||||
|
static enum ofono_radio_access_mode ril_data_max_mode(struct ril_data *self)
|
||||||
|
{
|
||||||
|
return self->priv->downgraded_tech ? OFONO_RADIO_ACCESS_MODE_UMTS :
|
||||||
|
OFONO_RADIO_ACCESS_MODE_ANY;
|
||||||
|
}
|
||||||
|
|
||||||
gulong ril_data_add_allow_changed_handler(struct ril_data *self,
|
gulong ril_data_add_allow_changed_handler(struct ril_data *self,
|
||||||
ril_data_cb_t cb, void *arg)
|
ril_data_cb_t cb, void *arg)
|
||||||
@@ -1684,7 +1735,7 @@ static void ril_data_manager_check_network_mode(struct ril_data_manager *self)
|
|||||||
|
|
||||||
ril_network_set_max_pref_mode(network,
|
ril_network_set_max_pref_mode(network,
|
||||||
(network == lte_network) ?
|
(network == lte_network) ?
|
||||||
OFONO_RADIO_ACCESS_MODE_ANY :
|
ril_data_max_mode(data) :
|
||||||
OFONO_RADIO_ACCESS_MODE_GSM,
|
OFONO_RADIO_ACCESS_MODE_GSM,
|
||||||
FALSE);
|
FALSE);
|
||||||
}
|
}
|
||||||
@@ -1694,7 +1745,7 @@ static void ril_data_manager_check_network_mode(struct ril_data_manager *self)
|
|||||||
for (l= self->data_list; l; l = l->next) {
|
for (l= self->data_list; l; l = l->next) {
|
||||||
struct ril_data *data = l->data;
|
struct ril_data *data = l->data;
|
||||||
ril_network_set_max_pref_mode(data->priv->network,
|
ril_network_set_max_pref_mode(data->priv->network,
|
||||||
OFONO_RADIO_ACCESS_MODE_ANY, FALSE);
|
ril_data_max_mode(data), FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1723,7 +1774,7 @@ static void ril_data_manager_switch_data_on(struct ril_data_manager *self,
|
|||||||
|
|
||||||
if (ril_data_manager_handover(self)) {
|
if (ril_data_manager_handover(self)) {
|
||||||
ril_network_set_max_pref_mode(priv->network,
|
ril_network_set_max_pref_mode(priv->network,
|
||||||
OFONO_RADIO_ACCESS_MODE_ANY, TRUE);
|
ril_data_max_mode(data), TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->options.allow_data == RIL_ALLOW_DATA_ENABLED) {
|
if (priv->options.allow_data == RIL_ALLOW_DATA_ENABLED) {
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony - RIL-based devices
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2019 Jolla Ltd.
|
* Copyright (C) 2019-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
|
||||||
@@ -50,11 +51,22 @@ struct ril_devmon *ril_devmon_ss_new(void);
|
|||||||
*/
|
*/
|
||||||
struct ril_devmon *ril_devmon_ds_new(void);
|
struct ril_devmon *ril_devmon_ds_new(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This Device Monitor implementation controls network state updates
|
||||||
|
* by sending SET_UNSOLICITED_RESPONSE_FILTER.
|
||||||
|
*/
|
||||||
|
struct ril_devmon *ril_devmon_ur_new(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This one selects the type based on the RIL version.
|
* This one selects the type based on the RIL version.
|
||||||
*/
|
*/
|
||||||
struct ril_devmon *ril_devmon_auto_new(void);
|
struct ril_devmon *ril_devmon_auto_new(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This one combines several methods. Takes ownership of ril_devmon objects.
|
||||||
|
*/
|
||||||
|
struct ril_devmon *ril_devmon_combine(struct ril_devmon *devmon[], guint n);
|
||||||
|
|
||||||
/* Utilities (NULL tolerant) */
|
/* Utilities (NULL tolerant) */
|
||||||
struct ril_devmon_io *ril_devmon_start_io(struct ril_devmon *devmon,
|
struct ril_devmon_io *ril_devmon_start_io(struct ril_devmon *devmon,
|
||||||
GRilIoChannel *channel, struct sailfish_cell_info *cell_info);
|
GRilIoChannel *channel, struct sailfish_cell_info *cell_info);
|
||||||
|
|||||||
104
ofono/drivers/ril/ril_devmon_combine.c
Normal file
104
ofono/drivers/ril/ril_devmon_combine.c
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
/*
|
||||||
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
|
*
|
||||||
|
* Copyright (C) 2020 Jolla Ltd.
|
||||||
|
* Copyright (C) 2020 Open Mobile Platform LLC.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ril_devmon.h"
|
||||||
|
|
||||||
|
#include <ofono/log.h>
|
||||||
|
|
||||||
|
typedef struct ril_devmon_combine {
|
||||||
|
struct ril_devmon pub;
|
||||||
|
struct ril_devmon **impl;
|
||||||
|
guint count;
|
||||||
|
} DevMon;
|
||||||
|
|
||||||
|
typedef struct ril_devmon_combine_io {
|
||||||
|
struct ril_devmon_io pub;
|
||||||
|
struct ril_devmon_io **impl;
|
||||||
|
guint count;
|
||||||
|
} DevMonIo;
|
||||||
|
|
||||||
|
static inline DevMon *ril_devmon_combine_cast(struct ril_devmon *dm)
|
||||||
|
{
|
||||||
|
return G_CAST(dm, DevMon, pub);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline DevMonIo *ril_devmon_ds_io_cast(struct ril_devmon_io *io)
|
||||||
|
{
|
||||||
|
return G_CAST(io, DevMonIo, pub);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ril_devmon_combine_io_free(struct ril_devmon_io *io)
|
||||||
|
{
|
||||||
|
guint i;
|
||||||
|
DevMonIo *self = ril_devmon_ds_io_cast(io);
|
||||||
|
|
||||||
|
for (i = 0; i < self->count; i++) {
|
||||||
|
ril_devmon_io_free(self->impl[i]);
|
||||||
|
}
|
||||||
|
g_free(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct ril_devmon_io *ril_devmon_combine_start_io(struct ril_devmon *dm,
|
||||||
|
GRilIoChannel *chan, struct sailfish_cell_info *ci)
|
||||||
|
{
|
||||||
|
guint i;
|
||||||
|
DevMon *self = ril_devmon_combine_cast(dm);
|
||||||
|
DevMonIo *io = g_malloc0(sizeof(DevMonIo) +
|
||||||
|
sizeof(struct ril_devmon_io *) * self->count);
|
||||||
|
|
||||||
|
io->pub.free = ril_devmon_combine_io_free;
|
||||||
|
io->impl = (struct ril_devmon_io**)(io + 1);
|
||||||
|
io->count = self->count;
|
||||||
|
for (i = 0; i < io->count; i++) {
|
||||||
|
io->impl[i] = ril_devmon_start_io(self->impl[i], chan, ci);
|
||||||
|
}
|
||||||
|
return &io->pub;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ril_devmon_combine_free(struct ril_devmon *dm)
|
||||||
|
{
|
||||||
|
DevMon *self = ril_devmon_combine_cast(dm);
|
||||||
|
guint i;
|
||||||
|
|
||||||
|
for (i = 0; i < self->count; i++) {
|
||||||
|
ril_devmon_free(self->impl[i]);
|
||||||
|
}
|
||||||
|
g_free(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct ril_devmon *ril_devmon_combine(struct ril_devmon *dm[], guint n)
|
||||||
|
{
|
||||||
|
guint i;
|
||||||
|
DevMon *self = g_malloc0(sizeof(DevMon) +
|
||||||
|
sizeof(struct ril_devmon *) * n);
|
||||||
|
|
||||||
|
self->pub.free = ril_devmon_combine_free;
|
||||||
|
self->pub.start_io = ril_devmon_combine_start_io;
|
||||||
|
self->impl = (struct ril_devmon **)(self + 1);
|
||||||
|
self->count = n;
|
||||||
|
for (i = 0; i < n; i++) {
|
||||||
|
self->impl[i] = dm[i];
|
||||||
|
}
|
||||||
|
return &self->pub;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local Variables:
|
||||||
|
* mode: C
|
||||||
|
* c-basic-offset: 8
|
||||||
|
* indent-tabs-mode: t
|
||||||
|
* End:
|
||||||
|
*/
|
||||||
254
ofono/drivers/ril/ril_devmon_ur.c
Normal file
254
ofono/drivers/ril/ril_devmon_ur.c
Normal file
@@ -0,0 +1,254 @@
|
|||||||
|
/*
|
||||||
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
|
*
|
||||||
|
* Copyright (C) 2019 Jolla Ltd.
|
||||||
|
* Copyright (C) 2020 Open Mobile Platform LLC
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ril_devmon.h"
|
||||||
|
|
||||||
|
#include <ofono/log.h>
|
||||||
|
#include <ofono/ril-constants.h>
|
||||||
|
|
||||||
|
#include <mce_battery.h>
|
||||||
|
#include <mce_charger.h>
|
||||||
|
#include <mce_display.h>
|
||||||
|
|
||||||
|
#include <grilio_channel.h>
|
||||||
|
#include <grilio_request.h>
|
||||||
|
|
||||||
|
#include <gutil_macros.h>
|
||||||
|
|
||||||
|
#define RIL_UR_ENABLE_ALL (RIL_UR_SIGNAL_STRENGTH | \
|
||||||
|
RIL_UR_FULL_NETWORK_STATE | \
|
||||||
|
RIL_UR_DATA_CALL_DORMANCY_CHANGED)
|
||||||
|
|
||||||
|
enum ril_devmon_ur_battery_event {
|
||||||
|
BATTERY_EVENT_VALID,
|
||||||
|
BATTERY_EVENT_STATUS,
|
||||||
|
BATTERY_EVENT_COUNT
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ril_devmon_ur_charger_event {
|
||||||
|
CHARGER_EVENT_VALID,
|
||||||
|
CHARGER_EVENT_STATE,
|
||||||
|
CHARGER_EVENT_COUNT
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ril_devmon_ur_display_event {
|
||||||
|
DISPLAY_EVENT_VALID,
|
||||||
|
DISPLAY_EVENT_STATE,
|
||||||
|
DISPLAY_EVENT_COUNT
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct ril_devmon_ur {
|
||||||
|
struct ril_devmon pub;
|
||||||
|
MceBattery *battery;
|
||||||
|
MceCharger *charger;
|
||||||
|
MceDisplay *display;
|
||||||
|
} DevMon;
|
||||||
|
|
||||||
|
typedef struct ril_devmon_ur_io {
|
||||||
|
struct ril_devmon_io pub;
|
||||||
|
struct sailfish_cell_info *cell_info;
|
||||||
|
MceBattery *battery;
|
||||||
|
MceCharger *charger;
|
||||||
|
MceDisplay *display;
|
||||||
|
GRilIoChannel *io;
|
||||||
|
gboolean display_on;
|
||||||
|
gboolean unsol_filter_supported;
|
||||||
|
gulong battery_event_id[BATTERY_EVENT_COUNT];
|
||||||
|
gulong charger_event_id[CHARGER_EVENT_COUNT];
|
||||||
|
gulong display_event_id[DISPLAY_EVENT_COUNT];
|
||||||
|
guint req_id;
|
||||||
|
} DevMonIo;
|
||||||
|
|
||||||
|
#define DBG_(self,fmt,args...) DBG("%s: " fmt, (self)->io->name, ##args)
|
||||||
|
|
||||||
|
inline static DevMon *ril_devmon_ur_cast(struct ril_devmon *pub)
|
||||||
|
{
|
||||||
|
return G_CAST(pub, DevMon, pub);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static DevMonIo *ril_devmon_ur_io_cast(struct ril_devmon_io *pub)
|
||||||
|
{
|
||||||
|
return G_CAST(pub, DevMonIo, pub);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline gboolean ril_devmon_ur_battery_ok(MceBattery *battery)
|
||||||
|
{
|
||||||
|
return battery->valid && battery->status >= MCE_BATTERY_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline gboolean ril_devmon_ur_charging(MceCharger *charger)
|
||||||
|
{
|
||||||
|
return charger->valid && charger->state == MCE_CHARGER_ON;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean ril_devmon_ur_display_on(MceDisplay *display)
|
||||||
|
{
|
||||||
|
return display->valid && display->state != MCE_DISPLAY_STATE_OFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ril_devmon_ur_io_unsol_response_filter_sent(GRilIoChannel *io,
|
||||||
|
int status, const void *data, guint len,
|
||||||
|
void *user_data)
|
||||||
|
{
|
||||||
|
DevMonIo *self = user_data;
|
||||||
|
|
||||||
|
self->req_id = 0;
|
||||||
|
if (status == RIL_E_REQUEST_NOT_SUPPORTED) {
|
||||||
|
/* This is a permanent failure */
|
||||||
|
DBG_(self, "Unsolicited response filter is not supported");
|
||||||
|
self->unsol_filter_supported = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ril_devmon_ur_io_set_unsol_response_filter(DevMonIo *self)
|
||||||
|
{
|
||||||
|
if (self->unsol_filter_supported) {
|
||||||
|
const gint32 value = self->display_on ? RIL_UR_ENABLE_ALL : 0;
|
||||||
|
GRilIoRequest *req = grilio_request_array_int32_new(1, value);
|
||||||
|
|
||||||
|
DBG_(self, "Setting unsolicited response filter: %u", value);
|
||||||
|
|
||||||
|
grilio_channel_cancel_request(self->io, self->req_id, FALSE);
|
||||||
|
self->req_id =
|
||||||
|
grilio_channel_send_request_full(self->io, req,
|
||||||
|
RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER,
|
||||||
|
ril_devmon_ur_io_unsol_response_filter_sent,
|
||||||
|
NULL, self);
|
||||||
|
grilio_request_unref(req);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ril_devmon_ur_io_set_cell_info_update_interval(DevMonIo *self)
|
||||||
|
{
|
||||||
|
sailfish_cell_info_set_update_interval(self->cell_info,
|
||||||
|
(self->display_on && (ril_devmon_ur_charging(self->charger) ||
|
||||||
|
ril_devmon_ur_battery_ok(self->battery))) ?
|
||||||
|
RIL_CELL_INFO_INTERVAL_SHORT_MS :
|
||||||
|
RIL_CELL_INFO_INTERVAL_LONG_MS);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ril_devmon_ur_io_battery_cb(MceBattery *battery, void *user_data)
|
||||||
|
{
|
||||||
|
ril_devmon_ur_io_set_cell_info_update_interval(user_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ril_devmon_ur_io_charger_cb(MceCharger *charger, void *user_data)
|
||||||
|
{
|
||||||
|
ril_devmon_ur_io_set_cell_info_update_interval(user_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ril_devmon_ur_io_display_cb(MceDisplay *display, void *user_data)
|
||||||
|
{
|
||||||
|
DevMonIo *self = user_data;
|
||||||
|
const gboolean display_on = ril_devmon_ur_display_on(display);
|
||||||
|
|
||||||
|
if (self->display_on != display_on) {
|
||||||
|
self->display_on = display_on;
|
||||||
|
ril_devmon_ur_io_set_unsol_response_filter(self);
|
||||||
|
ril_devmon_ur_io_set_cell_info_update_interval(self);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ril_devmon_ur_io_free(struct ril_devmon_io *devmon_io)
|
||||||
|
{
|
||||||
|
DevMonIo *self = ril_devmon_ur_io_cast(devmon_io);
|
||||||
|
|
||||||
|
mce_battery_remove_all_handlers(self->battery, self->battery_event_id);
|
||||||
|
mce_battery_unref(self->battery);
|
||||||
|
|
||||||
|
mce_charger_remove_all_handlers(self->charger, self->charger_event_id);
|
||||||
|
mce_charger_unref(self->charger);
|
||||||
|
|
||||||
|
mce_display_remove_all_handlers(self->display, self->display_event_id);
|
||||||
|
mce_display_unref(self->display);
|
||||||
|
|
||||||
|
grilio_channel_cancel_request(self->io, self->req_id, FALSE);
|
||||||
|
grilio_channel_unref(self->io);
|
||||||
|
|
||||||
|
sailfish_cell_info_unref(self->cell_info);
|
||||||
|
g_free(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct ril_devmon_io *ril_devmon_ur_start_io(struct ril_devmon *devmon,
|
||||||
|
GRilIoChannel *io, struct sailfish_cell_info *cell_info)
|
||||||
|
{
|
||||||
|
DevMon *ur = ril_devmon_ur_cast(devmon);
|
||||||
|
DevMonIo *self = g_new0(DevMonIo, 1);
|
||||||
|
|
||||||
|
self->pub.free = ril_devmon_ur_io_free;
|
||||||
|
self->unsol_filter_supported = TRUE;
|
||||||
|
self->io = grilio_channel_ref(io);
|
||||||
|
self->cell_info = sailfish_cell_info_ref(cell_info);
|
||||||
|
|
||||||
|
self->battery = mce_battery_ref(ur->battery);
|
||||||
|
self->battery_event_id[BATTERY_EVENT_VALID] =
|
||||||
|
mce_battery_add_valid_changed_handler(self->battery,
|
||||||
|
ril_devmon_ur_io_battery_cb, self);
|
||||||
|
self->battery_event_id[BATTERY_EVENT_STATUS] =
|
||||||
|
mce_battery_add_status_changed_handler(self->battery,
|
||||||
|
ril_devmon_ur_io_battery_cb, self);
|
||||||
|
|
||||||
|
self->charger = mce_charger_ref(ur->charger);
|
||||||
|
self->charger_event_id[CHARGER_EVENT_VALID] =
|
||||||
|
mce_charger_add_valid_changed_handler(self->charger,
|
||||||
|
ril_devmon_ur_io_charger_cb, self);
|
||||||
|
self->charger_event_id[CHARGER_EVENT_STATE] =
|
||||||
|
mce_charger_add_state_changed_handler(self->charger,
|
||||||
|
ril_devmon_ur_io_charger_cb, self);
|
||||||
|
|
||||||
|
self->display = mce_display_ref(ur->display);
|
||||||
|
self->display_on = ril_devmon_ur_display_on(self->display);
|
||||||
|
self->display_event_id[DISPLAY_EVENT_VALID] =
|
||||||
|
mce_display_add_valid_changed_handler(self->display,
|
||||||
|
ril_devmon_ur_io_display_cb, self);
|
||||||
|
self->display_event_id[DISPLAY_EVENT_STATE] =
|
||||||
|
mce_display_add_state_changed_handler(self->display,
|
||||||
|
ril_devmon_ur_io_display_cb, self);
|
||||||
|
|
||||||
|
ril_devmon_ur_io_set_unsol_response_filter(self);
|
||||||
|
ril_devmon_ur_io_set_cell_info_update_interval(self);
|
||||||
|
return &self->pub;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ril_devmon_ur_free(struct ril_devmon *devmon)
|
||||||
|
{
|
||||||
|
DevMon *self = ril_devmon_ur_cast(devmon);
|
||||||
|
|
||||||
|
mce_battery_unref(self->battery);
|
||||||
|
mce_charger_unref(self->charger);
|
||||||
|
mce_display_unref(self->display);
|
||||||
|
g_free(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct ril_devmon *ril_devmon_ur_new()
|
||||||
|
{
|
||||||
|
DevMon *self = g_new0(DevMon, 1);
|
||||||
|
|
||||||
|
self->pub.free = ril_devmon_ur_free;
|
||||||
|
self->pub.start_io = ril_devmon_ur_start_io;
|
||||||
|
self->battery = mce_battery_new();
|
||||||
|
self->charger = mce_charger_new();
|
||||||
|
self->display = mce_display_new();
|
||||||
|
return &self->pub;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local Variables:
|
||||||
|
* mode: C
|
||||||
|
* c-basic-offset: 8
|
||||||
|
* indent-tabs-mode: t
|
||||||
|
* End:
|
||||||
|
*/
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* 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 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
|
||||||
@@ -14,6 +14,8 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
#include "ril_ecclist.h"
|
#include "ril_ecclist.h"
|
||||||
#include "ril_log.h"
|
#include "ril_log.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony - RIL-based devices
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015-2019 Jolla Ltd.
|
* Copyright (C) 2015-2020 Jolla Ltd.
|
||||||
* Copyright (C) 2019 Open Mobile Platform LLC.
|
* Copyright (C) 2019 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
|
||||||
@@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#include <ofono/watch.h>
|
#include <ofono/watch.h>
|
||||||
|
|
||||||
#define MAX_PDP_CONTEXTS (2)
|
|
||||||
#define ONLINE_TIMEOUT_SECS (15) /* 20 sec is hardcoded in ofono core */
|
#define ONLINE_TIMEOUT_SECS (15) /* 20 sec is hardcoded in ofono core */
|
||||||
|
|
||||||
enum ril_modem_power_state {
|
enum ril_modem_power_state {
|
||||||
@@ -219,22 +218,21 @@ 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 if (rs) {
|
||||||
|
DBG_(md, "removing radio settings interface");
|
||||||
|
ofono_radio_settings_remove(rs);
|
||||||
} else {
|
} else {
|
||||||
/* ofono core may remove radio settings atom internally */
|
/* ofono core may remove radio settings atom internally */
|
||||||
struct ofono_radio_settings *rs = ril_modem_radio_settings(m);
|
DBG_(md, "radio settings interface is already gone");
|
||||||
if (rs) {
|
|
||||||
DBG_(md, "removing radio settings interface");
|
|
||||||
ofono_radio_settings_remove(rs);
|
|
||||||
} else {
|
|
||||||
DBG_(md, "radio settings interface is already gone");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,15 +304,22 @@ static void ril_modem_post_sim(struct ofono_modem *modem)
|
|||||||
ofono_sms_create(modem, 0, RILMODEM_DRIVER, md);
|
ofono_sms_create(modem, 0, RILMODEM_DRIVER, md);
|
||||||
gprs = ofono_gprs_create(modem, 0, RILMODEM_DRIVER, md);
|
gprs = ofono_gprs_create(modem, 0, RILMODEM_DRIVER, md);
|
||||||
if (gprs) {
|
if (gprs) {
|
||||||
int i;
|
guint i;
|
||||||
|
static const enum ofono_gprs_context_type ap_types[] = {
|
||||||
|
OFONO_GPRS_CONTEXT_TYPE_INTERNET,
|
||||||
|
OFONO_GPRS_CONTEXT_TYPE_MMS,
|
||||||
|
OFONO_GPRS_CONTEXT_TYPE_IMS
|
||||||
|
};
|
||||||
|
|
||||||
for (i = 0; i < MAX_PDP_CONTEXTS; i++) {
|
/* Create a context for each type */
|
||||||
|
for (i = 0; i < G_N_ELEMENTS(ap_types); i++) {
|
||||||
struct ofono_gprs_context *gc =
|
struct ofono_gprs_context *gc =
|
||||||
ofono_gprs_context_create(modem, 0,
|
ofono_gprs_context_create(modem, 0,
|
||||||
RILMODEM_DRIVER, md);
|
RILMODEM_DRIVER, md);
|
||||||
if (gc == NULL)
|
if (gc == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
ofono_gprs_context_set_type(gc, ap_types[i]);
|
||||||
ofono_gprs_add_context(gprs, gc);
|
ofono_gprs_add_context(gprs, gc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -418,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);
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "simutil.h"
|
#include "simutil.h"
|
||||||
|
|
||||||
#define REGISTRATION_TIMEOUT (100*1000) /* ms */
|
|
||||||
#define REGISTRATION_MAX_RETRIES (2)
|
#define REGISTRATION_MAX_RETRIES (2)
|
||||||
|
|
||||||
enum ril_netreg_events {
|
enum ril_netreg_events {
|
||||||
@@ -53,6 +52,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 {
|
||||||
@@ -301,18 +301,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 +364,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,
|
||||||
@@ -563,6 +600,7 @@ static int ril_netreg_probe(struct ofono_netreg *netreg, unsigned int vendor,
|
|||||||
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);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony - RIL-based devices
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015-2019 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
|
||||||
@@ -14,6 +14,8 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
#include "ril_network.h"
|
#include "ril_network.h"
|
||||||
#include "ril_radio.h"
|
#include "ril_radio.h"
|
||||||
#include "ril_sim_card.h"
|
#include "ril_sim_card.h"
|
||||||
@@ -417,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)
|
||||||
{
|
{
|
||||||
@@ -429,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);
|
||||||
@@ -996,22 +1011,22 @@ 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;
|
||||||
priv->rat = ril_network_parse_pref_resp(data, len);
|
|
||||||
self->pref_mode = ril_network_rat_to_mode(priv->rat);
|
if (status == RIL_E_SUCCESS) {
|
||||||
DBG_(self, "rat mode %d (%s)", priv->rat,
|
priv->rat = ril_network_parse_pref_resp(data, len);
|
||||||
|
self->pref_mode = ril_network_rat_to_mode(priv->rat);
|
||||||
|
DBG_(self, "rat mode %d (%s)", priv->rat,
|
||||||
ofono_radio_access_mode_to_string(self->pref_mode));
|
ofono_radio_access_mode_to_string(self->pref_mode));
|
||||||
|
|
||||||
if (self->pref_mode != pref_mode) {
|
if (self->pref_mode != pref_mode) {
|
||||||
ril_network_emit(self, SIGNAL_PREF_MODE_CHANGED);
|
ril_network_emit(self, SIGNAL_PREF_MODE_CHANGED);
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1021,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,
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -134,6 +135,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"
|
||||||
@@ -179,10 +181,9 @@ enum ril_set_radio_cap_opt {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum ril_devmon_opt {
|
enum ril_devmon_opt {
|
||||||
RIL_DEVMON_NONE,
|
RIL_DEVMON_SS = 0x01,
|
||||||
RIL_DEVMON_AUTO,
|
RIL_DEVMON_DS = 0x02,
|
||||||
RIL_DEVMON_SS,
|
RIL_DEVMON_UR = 0x04
|
||||||
RIL_DEVMON_DS
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ril_plugin_identity {
|
struct ril_plugin_identity {
|
||||||
@@ -363,6 +364,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
|
||||||
@@ -382,6 +384,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;
|
||||||
}
|
}
|
||||||
@@ -1039,13 +1042,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);
|
||||||
}
|
}
|
||||||
@@ -1061,8 +1064,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);
|
||||||
@@ -1094,6 +1100,7 @@ static void ril_plugin_init_io(ril_slot *slot)
|
|||||||
slot);
|
slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
grilio_transport_unref(transport);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!slot->io) {
|
if (!slot->io) {
|
||||||
@@ -1194,6 +1201,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;
|
||||||
@@ -1566,6 +1575,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) {
|
||||||
@@ -1706,23 +1723,32 @@ static ril_slot *ril_plugin_parse_config_group(GKeyFile *file,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* deviceStateTracking */
|
/* deviceStateTracking */
|
||||||
if (ril_config_get_enum(file, group, RILCONF_DEVMON, &ival,
|
if (ril_config_get_mask(file, group, RILCONF_DEVMON, &ival,
|
||||||
"none", RIL_DEVMON_NONE,
|
|
||||||
"auto", RIL_DEVMON_AUTO,
|
|
||||||
"ds", RIL_DEVMON_DS,
|
"ds", RIL_DEVMON_DS,
|
||||||
"ss", RIL_DEVMON_SS, NULL)) {
|
"ss", RIL_DEVMON_SS,
|
||||||
DBG("%s: " RILCONF_DEVMON " %s", group,
|
"ur", RIL_DEVMON_UR, NULL) && ival) {
|
||||||
ival == RIL_DEVMON_NONE ? "off" :
|
int n = 0;
|
||||||
ival == RIL_DEVMON_DS ? "on" :
|
struct ril_devmon *devmon[3];
|
||||||
ival == RIL_DEVMON_SS ? "legacy" :
|
|
||||||
"auto");
|
if (ival & RIL_DEVMON_DS) devmon[n++] = ril_devmon_ds_new();
|
||||||
if (ival != RIL_DEVMON_AUTO) {
|
if (ival & RIL_DEVMON_SS) devmon[n++] = ril_devmon_ss_new();
|
||||||
/* Default is automatic, reallocate the object */
|
if (ival & RIL_DEVMON_UR) devmon[n++] = ril_devmon_ur_new();
|
||||||
ril_devmon_free(slot->devmon);
|
DBG("%s: " RILCONF_DEVMON " 0x%x", group, ival);
|
||||||
slot->devmon =
|
ril_devmon_free(slot->devmon);
|
||||||
(ival == RIL_DEVMON_DS ? ril_devmon_ds_new() :
|
slot->devmon = ril_devmon_combine(devmon, n);
|
||||||
ival == RIL_DEVMON_SS ? ril_devmon_ss_new() :
|
} else {
|
||||||
NULL);
|
/* Try special values */
|
||||||
|
sval = ril_config_get_string(file, group, RILCONF_DEVMON);
|
||||||
|
if (sval) {
|
||||||
|
if (!g_ascii_strcasecmp(sval, "none")) {
|
||||||
|
DBG("%s: " RILCONF_DEVMON " %s", group, sval);
|
||||||
|
ril_devmon_free(slot->devmon);
|
||||||
|
slot->devmon = NULL;
|
||||||
|
} else if (!g_ascii_strcasecmp(sval, "auto")) {
|
||||||
|
DBG("%s: " RILCONF_DEVMON " %s", group, sval);
|
||||||
|
/* This is the default */
|
||||||
|
}
|
||||||
|
g_free(sval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony - RIL-based devices
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015-2019 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
|
||||||
@@ -13,6 +13,8 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
#include "ril_radio.h"
|
#include "ril_radio.h"
|
||||||
#include "ril_util.h"
|
#include "ril_util.h"
|
||||||
#include "ril_log.h"
|
#include "ril_log.h"
|
||||||
@@ -239,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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony - RIL-based devices
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015-2018 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
|
||||||
@@ -13,6 +13,8 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
#include "ril_sim_card.h"
|
#include "ril_sim_card.h"
|
||||||
#include "ril_radio.h"
|
#include "ril_radio.h"
|
||||||
#include "ril_util.h"
|
#include "ril_util.h"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* 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.
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@@ -13,6 +13,8 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
#include "ril_sim_settings.h"
|
#include "ril_sim_settings.h"
|
||||||
#include "ril_log.h"
|
#include "ril_log.h"
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -302,9 +309,15 @@ socket=/dev/socket/rild
|
|||||||
#
|
#
|
||||||
# ss = Use legacy device state management (RIL_REQUEST_SCREEN_STATE)
|
# ss = Use legacy device state management (RIL_REQUEST_SCREEN_STATE)
|
||||||
# ds = Use newer device state management (RIL_REQUEST_SEND_DEVICE_STATE)
|
# ds = Use newer device state management (RIL_REQUEST_SEND_DEVICE_STATE)
|
||||||
# auto = Choose one of the above based on the RIL version
|
# ur = Use URC filter (RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER)
|
||||||
|
# This may be useful on devices with RIL version >= 15 if auto
|
||||||
|
# method fails
|
||||||
|
# auto = Choose ss or ds based on the RIL version
|
||||||
# none = Disable device state management
|
# none = Disable device state management
|
||||||
#
|
#
|
||||||
|
# In addition to specifying ss, ds or ur method, one can specify a
|
||||||
|
# combination of methods, e.g. ds+ur
|
||||||
|
#
|
||||||
# Default auto
|
# Default auto
|
||||||
#
|
#
|
||||||
#deviceStateTracking=auto
|
#deviceStateTracking=auto
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony
|
* oFono - Open Source Telephony
|
||||||
*
|
*
|
||||||
* Copyright (C) 2019 Jolla Ltd.
|
* Copyright (C) 2019-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
|
||||||
@@ -25,7 +26,7 @@ extern "C" {
|
|||||||
enum ofono_dbus_access {
|
enum ofono_dbus_access {
|
||||||
OFONO_DBUS_ACCESS_DENY, /* Deny access */
|
OFONO_DBUS_ACCESS_DENY, /* Deny access */
|
||||||
OFONO_DBUS_ACCESS_ALLOW, /* Allow access */
|
OFONO_DBUS_ACCESS_ALLOW, /* Allow access */
|
||||||
OFONO_DBUS_ACCESS_DONT_CARE, /* No decision */
|
OFONO_DBUS_ACCESS_DONT_CARE /* No decision */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ofono_dbus_access_intf {
|
enum ofono_dbus_access_intf {
|
||||||
@@ -38,6 +39,7 @@ enum ofono_dbus_access_intf {
|
|||||||
OFONO_DBUS_ACCESS_INTF_SIMMGR, /* org.ofono.SimManager */
|
OFONO_DBUS_ACCESS_INTF_SIMMGR, /* org.ofono.SimManager */
|
||||||
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_COUNT
|
OFONO_DBUS_ACCESS_INTF_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -116,6 +118,12 @@ enum ofono_dbus_access_radiosettings_method {
|
|||||||
OFONO_DBUS_ACCESS_RADIOSETTINGS_METHOD_COUNT
|
OFONO_DBUS_ACCESS_RADIOSETTINGS_METHOD_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* OFONO_DBUS_ACCESS_INTF_STK */
|
||||||
|
enum ofono_dbus_access_stk_method {
|
||||||
|
OFONO_DBUS_ACCESS_STK_REGISTER_AGENT,
|
||||||
|
OFONO_DBUS_ACCESS_STK_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)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* oFono - Open Source Telephony
|
* oFono - Open Source Telephony
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
||||||
* 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
|
||||||
@@ -60,6 +60,7 @@ const char *mbpi_database = MBPI_DATABASE;
|
|||||||
*/
|
*/
|
||||||
enum ofono_gprs_proto mbpi_default_internet_proto = OFONO_GPRS_PROTO_IPV4V6;
|
enum ofono_gprs_proto mbpi_default_internet_proto = OFONO_GPRS_PROTO_IPV4V6;
|
||||||
enum ofono_gprs_proto mbpi_default_mms_proto = OFONO_GPRS_PROTO_IP;
|
enum ofono_gprs_proto mbpi_default_mms_proto = OFONO_GPRS_PROTO_IP;
|
||||||
|
enum ofono_gprs_proto mbpi_default_ims_proto = OFONO_GPRS_PROTO_IPV4V6;
|
||||||
enum ofono_gprs_proto mbpi_default_proto = OFONO_GPRS_PROTO_IP;
|
enum ofono_gprs_proto mbpi_default_proto = OFONO_GPRS_PROTO_IP;
|
||||||
enum ofono_gprs_auth_method mbpi_default_auth_method = OFONO_GPRS_AUTH_METHOD_ANY;
|
enum ofono_gprs_auth_method mbpi_default_auth_method = OFONO_GPRS_AUTH_METHOD_ANY;
|
||||||
|
|
||||||
@@ -246,6 +247,9 @@ static void usage_start(GMarkupParseContext *context,
|
|||||||
} else if (strcmp(text, "mms") == 0) {
|
} else if (strcmp(text, "mms") == 0) {
|
||||||
apn->type = OFONO_GPRS_CONTEXT_TYPE_MMS;
|
apn->type = OFONO_GPRS_CONTEXT_TYPE_MMS;
|
||||||
apn->proto = mbpi_default_mms_proto;
|
apn->proto = mbpi_default_mms_proto;
|
||||||
|
} else if (strcmp(text, "ims") == 0) {
|
||||||
|
apn->type = OFONO_GPRS_CONTEXT_TYPE_IMS;
|
||||||
|
apn->proto = mbpi_default_ims_proto;
|
||||||
} else if (strcmp(text, "wap") == 0)
|
} else if (strcmp(text, "wap") == 0)
|
||||||
apn->type = OFONO_GPRS_CONTEXT_TYPE_WAP;
|
apn->type = OFONO_GPRS_CONTEXT_TYPE_WAP;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
* oFono - Open Source Telephony
|
* oFono - Open Source Telephony
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
||||||
|
* Copyright (C) 2013-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
|
||||||
@@ -22,6 +23,7 @@
|
|||||||
extern const char *mbpi_database;
|
extern const char *mbpi_database;
|
||||||
extern enum ofono_gprs_proto mbpi_default_internet_proto;
|
extern enum ofono_gprs_proto mbpi_default_internet_proto;
|
||||||
extern enum ofono_gprs_proto mbpi_default_mms_proto;
|
extern enum ofono_gprs_proto mbpi_default_mms_proto;
|
||||||
|
extern enum ofono_gprs_proto mbpi_default_ims_proto;
|
||||||
extern enum ofono_gprs_proto mbpi_default_proto;
|
extern enum ofono_gprs_proto mbpi_default_proto;
|
||||||
extern enum ofono_gprs_auth_method mbpi_default_auth_method;
|
extern enum ofono_gprs_auth_method mbpi_default_auth_method;
|
||||||
|
|
||||||
|
|||||||
@@ -743,18 +743,32 @@ static int sailfish_manager_update_modem_paths(struct sailfish_manager_priv *p)
|
|||||||
*/
|
*/
|
||||||
if (sailfish_manager_all_sims_are_initialized(p)) {
|
if (sailfish_manager_all_sims_are_initialized(p)) {
|
||||||
slot = sailfish_manager_find_slot_imsi(p, NULL);
|
slot = sailfish_manager_find_slot_imsi(p, NULL);
|
||||||
if (slot && slot->watch->online &&
|
if (slot && slot->watch->imsi && slot->watch->online &&
|
||||||
p->auto_data_sim == SIM_AUTO_SELECT_ONCE) {
|
p->auto_data_sim == SIM_AUTO_SELECT_ONCE) {
|
||||||
|
const char *imsi = slot->watch->imsi;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Data SIM only needs to be auto-selected
|
* Data SIM only needs to be auto-selected
|
||||||
* once and it's done. Write that down.
|
* once and it's done. Write that down.
|
||||||
*/
|
*/
|
||||||
|
DBG("Default data sim set to %s once", imsi);
|
||||||
p->auto_data_sim_done = TRUE;
|
p->auto_data_sim_done = TRUE;
|
||||||
g_key_file_set_boolean(p->storage,
|
g_key_file_set_boolean(p->storage,
|
||||||
SF_STORE_GROUP,
|
SF_STORE_GROUP,
|
||||||
SF_STORE_AUTO_DATA_SIM_DONE,
|
SF_STORE_AUTO_DATA_SIM_DONE,
|
||||||
p->auto_data_sim_done);
|
p->auto_data_sim_done);
|
||||||
|
|
||||||
|
g_free(p->default_data_imsi);
|
||||||
|
p->pub.default_data_imsi =
|
||||||
|
p->default_data_imsi = g_strdup(imsi);
|
||||||
|
g_key_file_set_string(p->storage,
|
||||||
|
SF_STORE_GROUP,
|
||||||
|
SF_STORE_DEFAULT_DATA_SIM,
|
||||||
|
imsi);
|
||||||
|
|
||||||
storage_sync(NULL, SF_STORE, p->storage);
|
storage_sync(NULL, SF_STORE, p->storage);
|
||||||
|
sailfish_manager_dbus_signal(p->dbus,
|
||||||
|
SAILFISH_MANAGER_SIGNAL_DATA_IMSI);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DBG("Skipping auto-selection of data SIM");
|
DBG("Skipping auto-selection of data SIM");
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony
|
* oFono - Open Source Telephony
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017-2019 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
|
||||||
@@ -13,6 +13,8 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* oFono - Open Source Telephony
|
* oFono - Open Source Telephony
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
||||||
* Copyright (C) 2013-2017 Jolla Ltd.
|
* Copyright (C) 2013-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
|
||||||
@@ -136,38 +136,56 @@ static GSList *provision_pick_best_ap(GSList *list, const char *spn,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the list containing exactly one INTERNET and one MMS access point */
|
/**
|
||||||
|
* Returns the list containing INTERNET, MMS and IMS access points,
|
||||||
|
* always all three of them and always in this order.
|
||||||
|
*/
|
||||||
static GSList *provision_normalize_apn_list(GSList *apns, const char *spn)
|
static GSList *provision_normalize_apn_list(GSList *apns, const char *spn)
|
||||||
{
|
{
|
||||||
static const struct provision_ap_defaults internet_defaults =
|
static const struct provision_ap_defaults internet_defaults =
|
||||||
{ OFONO_GPRS_CONTEXT_TYPE_INTERNET, "Internet", "internet" };
|
{ OFONO_GPRS_CONTEXT_TYPE_INTERNET, "Internet", "internet" };
|
||||||
static const struct provision_ap_defaults mms_defaults =
|
static const struct provision_ap_defaults mms_defaults =
|
||||||
{ OFONO_GPRS_CONTEXT_TYPE_MMS, "MMS", "mms" };
|
{ OFONO_GPRS_CONTEXT_TYPE_MMS, "MMS", "mms" };
|
||||||
|
static const struct provision_ap_defaults ims_defaults =
|
||||||
|
{ OFONO_GPRS_CONTEXT_TYPE_IMS, "IMS", "ims" };
|
||||||
|
|
||||||
GSList *internet_apns = NULL;
|
GSList *internet_apns = NULL;
|
||||||
GSList *mms_apns = NULL;
|
GSList *mms_apns = NULL;
|
||||||
|
GSList *ims_apns = NULL;
|
||||||
|
|
||||||
/* Split internet and mms apns, delete all others */
|
/* Build separate apn list for each type */
|
||||||
while (apns) {
|
while (apns) {
|
||||||
GSList *link = apns;
|
GSList *link = apns;
|
||||||
struct ofono_gprs_provision_data *ap = link->data;
|
struct ofono_gprs_provision_data *ap = link->data;
|
||||||
|
|
||||||
apns = g_slist_remove_link(apns, link);
|
apns = g_slist_remove_link(apns, link);
|
||||||
if (ap->type == OFONO_GPRS_CONTEXT_TYPE_INTERNET) {
|
switch (ap->type) {
|
||||||
|
case OFONO_GPRS_CONTEXT_TYPE_INTERNET:
|
||||||
internet_apns = g_slist_concat(internet_apns, link);
|
internet_apns = g_slist_concat(internet_apns, link);
|
||||||
} else if (ap->type == OFONO_GPRS_CONTEXT_TYPE_MMS) {
|
break;
|
||||||
|
case OFONO_GPRS_CONTEXT_TYPE_MMS:
|
||||||
mms_apns = g_slist_concat(mms_apns, link);
|
mms_apns = g_slist_concat(mms_apns, link);
|
||||||
} else {
|
break;
|
||||||
|
case OFONO_GPRS_CONTEXT_TYPE_IMS:
|
||||||
|
ims_apns = g_slist_concat(ims_apns, link);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
g_slist_free_full(link, provision_free_ap);
|
g_slist_free_full(link, provision_free_ap);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pick the best ap of each type and concatenate them */
|
/* Pick the best ap of each type */
|
||||||
return g_slist_concat(
|
internet_apns = provision_pick_best_ap(internet_apns, spn,
|
||||||
provision_pick_best_ap(internet_apns, spn,
|
mbpi_default_internet_proto, &internet_defaults);
|
||||||
mbpi_default_internet_proto, &internet_defaults),
|
mms_apns = provision_pick_best_ap(mms_apns, spn,
|
||||||
provision_pick_best_ap(mms_apns, spn,
|
mbpi_default_mms_proto, &mms_defaults);
|
||||||
mbpi_default_mms_proto, &mms_defaults));
|
ims_apns = provision_pick_best_ap(ims_apns, spn,
|
||||||
|
mbpi_default_ims_proto, &ims_defaults);
|
||||||
|
|
||||||
|
/* And concatenate them in the right order */
|
||||||
|
return g_slist_concat(internet_apns, g_slist_concat(mms_apns,
|
||||||
|
ims_apns));
|
||||||
}
|
}
|
||||||
|
|
||||||
int provision_get_settings(const char *mcc, const char *mnc,
|
int provision_get_settings(const char *mcc, const char *mnc,
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony
|
* oFono - Open Source Telephony
|
||||||
*
|
*
|
||||||
* Copyright (C) 2019 Jolla Ltd.
|
* Copyright (C) 2019-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
|
||||||
@@ -41,6 +42,8 @@ const char *ofono_dbus_access_intf_name(enum ofono_dbus_access_intf intf)
|
|||||||
return OFONO_MODEM_INTERFACE;
|
return OFONO_MODEM_INTERFACE;
|
||||||
case OFONO_DBUS_ACCESS_INTF_RADIOSETTINGS:
|
case OFONO_DBUS_ACCESS_INTF_RADIOSETTINGS:
|
||||||
return OFONO_RADIO_SETTINGS_INTERFACE;
|
return OFONO_RADIO_SETTINGS_INTERFACE;
|
||||||
|
case OFONO_DBUS_ACCESS_INTF_STK:
|
||||||
|
return OFONO_STK_INTERFACE;
|
||||||
case OFONO_DBUS_ACCESS_INTF_COUNT:
|
case OFONO_DBUS_ACCESS_INTF_COUNT:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -165,6 +168,14 @@ const char *ofono_dbus_access_method_name(enum ofono_dbus_access_intf intf,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case OFONO_DBUS_ACCESS_INTF_STK:
|
||||||
|
switch ((enum ofono_dbus_access_stk_method)method) {
|
||||||
|
case OFONO_DBUS_ACCESS_STK_REGISTER_AGENT:
|
||||||
|
return "RegisterAgent";
|
||||||
|
case OFONO_DBUS_ACCESS_STK_METHOD_COUNT:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case OFONO_DBUS_ACCESS_INTF_COUNT:
|
case OFONO_DBUS_ACCESS_INTF_COUNT:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* oFono - Open Source Telephony
|
* oFono - Open Source Telephony
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
||||||
* Copyright (C) 2015-2019 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
|
||||||
@@ -2874,12 +2874,53 @@ static void provision_contexts(struct ofono_gprs *gprs, const char *mcc,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++) {
|
||||||
provision_context(&settings[i], gprs);
|
const struct ofono_gprs_provision_data *ap = settings + i;
|
||||||
|
|
||||||
|
if (!ofono_gprs_context_settings_by_type(gprs, ap->type)) {
|
||||||
|
provision_context(ap, gprs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
__ofono_gprs_provision_free_settings(settings, count);
|
__ofono_gprs_provision_free_settings(settings, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean all_contexts_configured(struct ofono_gprs *gprs)
|
||||||
|
{
|
||||||
|
GSList *l;
|
||||||
|
|
||||||
|
for (l = gprs->context_drivers; l; l = l->next) {
|
||||||
|
struct ofono_gprs_context *gc = l->data;
|
||||||
|
|
||||||
|
if (gc->type != OFONO_GPRS_CONTEXT_TYPE_ANY &&
|
||||||
|
!ofono_gprs_context_settings_by_type(gprs, gc->type)) {
|
||||||
|
return FALSE; /* Not yet */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void configure_remaining_contexts(struct ofono_gprs *gprs)
|
||||||
|
{
|
||||||
|
GSList *l;
|
||||||
|
|
||||||
|
for (l = gprs->context_drivers; l; l = l->next) {
|
||||||
|
struct ofono_gprs_context *gc = l->data;
|
||||||
|
|
||||||
|
if (gc->type != OFONO_GPRS_CONTEXT_TYPE_ANY &&
|
||||||
|
!ofono_gprs_context_settings_by_type(gprs, gc->type)) {
|
||||||
|
add_context(gprs, NULL, gc->type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make sure internet context is there */
|
||||||
|
if (!ofono_gprs_context_settings_by_type(gprs,
|
||||||
|
OFONO_GPRS_CONTEXT_TYPE_INTERNET)) {
|
||||||
|
add_context(gprs, NULL, OFONO_GPRS_CONTEXT_TYPE_INTERNET);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void remove_non_active_context(struct ofono_gprs *gprs,
|
static void remove_non_active_context(struct ofono_gprs *gprs,
|
||||||
struct pri_context *ctx, DBusConnection *conn)
|
struct pri_context *ctx, DBusConnection *conn)
|
||||||
{
|
{
|
||||||
@@ -2960,8 +3001,7 @@ static DBusMessage *gprs_reset_contexts(DBusConnection *conn,
|
|||||||
provision_contexts(gprs, ofono_sim_get_mcc(sim),
|
provision_contexts(gprs, ofono_sim_get_mcc(sim),
|
||||||
ofono_sim_get_mnc(sim), ofono_sim_get_spn(sim));
|
ofono_sim_get_mnc(sim), ofono_sim_get_spn(sim));
|
||||||
|
|
||||||
if (gprs->contexts == NULL) /* Automatic provisioning failed */
|
configure_remaining_contexts(gprs);
|
||||||
add_context(gprs, NULL, OFONO_GPRS_CONTEXT_TYPE_INTERNET);
|
|
||||||
|
|
||||||
for (l = gprs->contexts; l; l = l->next) {
|
for (l = gprs->contexts; l; l = l->next) {
|
||||||
struct pri_context *ctx = l->data;
|
struct pri_context *ctx = l->data;
|
||||||
@@ -3832,8 +3872,7 @@ static void ofono_gprs_finish_register(struct ofono_gprs *gprs)
|
|||||||
struct ofono_modem *modem = __ofono_atom_get_modem(gprs->atom);
|
struct ofono_modem *modem = __ofono_atom_get_modem(gprs->atom);
|
||||||
const char *path = __ofono_atom_get_path(gprs->atom);
|
const char *path = __ofono_atom_get_path(gprs->atom);
|
||||||
|
|
||||||
if (gprs->contexts == NULL) /* Automatic provisioning failed */
|
configure_remaining_contexts(gprs);
|
||||||
add_context(gprs, NULL, OFONO_GPRS_CONTEXT_TYPE_INTERNET);
|
|
||||||
|
|
||||||
if (!g_dbus_register_interface(conn, path,
|
if (!g_dbus_register_interface(conn, path,
|
||||||
OFONO_CONNECTION_MANAGER_INTERFACE,
|
OFONO_CONNECTION_MANAGER_INTERFACE,
|
||||||
@@ -3856,56 +3895,14 @@ static void ofono_gprs_finish_register(struct ofono_gprs *gprs)
|
|||||||
__ofono_atom_register(gprs->atom, gprs_unregister);
|
__ofono_atom_register(gprs->atom, gprs_unregister);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean mms_context_configured(struct ofono_gprs *gprs)
|
|
||||||
{
|
|
||||||
GSList *l;
|
|
||||||
|
|
||||||
for (l = gprs->contexts; l; l = l->next) {
|
|
||||||
struct pri_context *ctx = l->data;
|
|
||||||
|
|
||||||
if (ctx->type == OFONO_GPRS_CONTEXT_TYPE_MMS)
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void provision_mms_context(struct ofono_gprs *gprs, const char *mcc,
|
|
||||||
const char *mnc, const char *spn)
|
|
||||||
{
|
|
||||||
struct ofono_gprs_provision_data *settings;
|
|
||||||
int count;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (__ofono_gprs_provision_get_settings(mcc, mnc, spn,
|
|
||||||
&settings, &count) == FALSE) {
|
|
||||||
ofono_warn("Provisioning failed");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
|
||||||
if (settings[i].type == OFONO_GPRS_CONTEXT_TYPE_MMS) {
|
|
||||||
provision_context(&settings[i], gprs);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
__ofono_gprs_provision_free_settings(settings, count);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void spn_read_cb(const char *spn, const char *dc, void *data)
|
static void spn_read_cb(const char *spn, const char *dc, void *data)
|
||||||
{
|
{
|
||||||
struct ofono_gprs *gprs = data;
|
struct ofono_gprs *gprs = data;
|
||||||
struct ofono_modem *modem = __ofono_atom_get_modem(gprs->atom);
|
struct ofono_modem *modem = __ofono_atom_get_modem(gprs->atom);
|
||||||
struct ofono_sim *sim = __ofono_atom_find(OFONO_ATOM_TYPE_SIM, modem);
|
struct ofono_sim *sim = __ofono_atom_find(OFONO_ATOM_TYPE_SIM, modem);
|
||||||
|
|
||||||
if (gprs->contexts == NULL) {
|
provision_contexts(gprs, ofono_sim_get_mcc(sim),
|
||||||
provision_contexts(gprs, ofono_sim_get_mcc(sim),
|
|
||||||
ofono_sim_get_mnc(sim), spn);
|
ofono_sim_get_mnc(sim), spn);
|
||||||
} else if (!mms_context_configured(gprs)) {
|
|
||||||
provision_mms_context(gprs, ofono_sim_get_mcc(sim),
|
|
||||||
ofono_sim_get_mnc(sim), spn);
|
|
||||||
}
|
|
||||||
|
|
||||||
ofono_sim_remove_spn_watch(sim, &gprs->spn_watch);
|
ofono_sim_remove_spn_watch(sim, &gprs->spn_watch);
|
||||||
|
|
||||||
@@ -3927,7 +3924,7 @@ void ofono_gprs_register(struct ofono_gprs *gprs)
|
|||||||
|
|
||||||
gprs_load_settings(gprs, ofono_sim_get_imsi(sim));
|
gprs_load_settings(gprs, ofono_sim_get_imsi(sim));
|
||||||
|
|
||||||
if (mms_context_configured(gprs))
|
if (all_contexts_configured(gprs))
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
||||||
ofono_sim_add_spn_watch(sim, &gprs->spn_watch, spn_read_cb, gprs, NULL);
|
ofono_sim_add_spn_watch(sim, &gprs->spn_watch, spn_read_cb, gprs, NULL);
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
* oFono - Open Source Telephony
|
* oFono - Open Source Telephony
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
||||||
|
* Copyright (C) 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
|
||||||
@@ -725,6 +727,12 @@ static DBusMessage *stk_register_agent(DBusConnection *conn,
|
|||||||
if (!dbus_validate_path(agent_path, NULL))
|
if (!dbus_validate_path(agent_path, NULL))
|
||||||
return __ofono_error_invalid_format(msg);
|
return __ofono_error_invalid_format(msg);
|
||||||
|
|
||||||
|
if (!__ofono_dbus_access_method_allowed(dbus_message_get_sender(msg),
|
||||||
|
OFONO_DBUS_ACCESS_INTF_STK,
|
||||||
|
OFONO_DBUS_ACCESS_STK_REGISTER_AGENT,
|
||||||
|
agent_path))
|
||||||
|
return __ofono_error_access_denied(msg);
|
||||||
|
|
||||||
stk->default_agent = stk_agent_new(agent_path,
|
stk->default_agent = stk_agent_new(agent_path,
|
||||||
dbus_message_get_sender(msg),
|
dbus_message_get_sender(msg),
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony
|
* oFono - Open Source Telephony
|
||||||
*
|
*
|
||||||
* Copyright (C) 2019 Jolla Ltd.
|
* Copyright (C) 2019-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
|
||||||
@@ -103,6 +104,9 @@ static const struct test_method_name_data method_name_tests[] = {
|
|||||||
},{
|
},{
|
||||||
OFONO_DBUS_ACCESS_INTF_RADIOSETTINGS,
|
OFONO_DBUS_ACCESS_INTF_RADIOSETTINGS,
|
||||||
OFONO_DBUS_ACCESS_RADIOSETTINGS_METHOD_COUNT
|
OFONO_DBUS_ACCESS_RADIOSETTINGS_METHOD_COUNT
|
||||||
|
},{
|
||||||
|
OFONO_DBUS_ACCESS_INTF_STK,
|
||||||
|
OFONO_DBUS_ACCESS_STK_METHOD_COUNT
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony
|
* oFono - Open Source Telephony
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014-2017 Jolla. All rights reserved.
|
* Copyright (C) 2014-2020 Jolla. 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
|
||||||
@@ -105,21 +105,21 @@ static void test_provision(gconstpointer test_data)
|
|||||||
|
|
||||||
g_assert(actual->type == expected->type);
|
g_assert(actual->type == expected->type);
|
||||||
g_assert(actual->proto == expected->proto);
|
g_assert(actual->proto == expected->proto);
|
||||||
g_assert(!g_strcmp0(actual->provider_name,
|
g_assert_cmpstr(actual->provider_name, ==,
|
||||||
expected->provider_name));
|
expected->provider_name);
|
||||||
g_assert(!g_strcmp0(actual->name, expected->name));
|
g_assert_cmpstr(actual->name, ==, expected->name);
|
||||||
g_assert(actual->provider_primary ==
|
g_assert(actual->provider_primary ==
|
||||||
expected->provider_primary);
|
expected->provider_primary);
|
||||||
g_assert(!g_strcmp0(actual->apn, expected->apn));
|
g_assert_cmpstr(actual->apn, ==, expected->apn);
|
||||||
g_assert(!g_strcmp0(actual->username,
|
g_assert_cmpstr(actual->username, ==,
|
||||||
expected->username));
|
expected->username);
|
||||||
g_assert(!g_strcmp0(actual->password,
|
g_assert_cmpstr(actual->password, ==,
|
||||||
expected->password));
|
expected->password);
|
||||||
g_assert(actual->auth_method == expected->auth_method);
|
g_assert(actual->auth_method == expected->auth_method);
|
||||||
g_assert(!g_strcmp0(actual->message_proxy,
|
g_assert_cmpstr(actual->message_proxy, ==,
|
||||||
expected->message_proxy));
|
expected->message_proxy);
|
||||||
g_assert(!g_strcmp0(actual->message_center,
|
g_assert_cmpstr(actual->message_center, ==,
|
||||||
expected->message_center));
|
expected->message_center);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
g_assert(!__ofono_gprs_provision_get_settings(test->mcc,
|
g_assert(!__ofono_gprs_provision_get_settings(test->mcc,
|
||||||
@@ -212,6 +212,14 @@ static char telia_fi_message_center [] = "http://mms/";
|
|||||||
.apn = "mms", \
|
.apn = "mms", \
|
||||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||||
|
|
||||||
|
/* Default IMS settings */
|
||||||
|
#define DEFAULT_IMS_SETTINGS \
|
||||||
|
.type = OFONO_GPRS_CONTEXT_TYPE_IMS, \
|
||||||
|
.proto = OFONO_GPRS_PROTO_IPV4V6, \
|
||||||
|
.name = "IMS", \
|
||||||
|
.apn = "ims", \
|
||||||
|
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||||
|
|
||||||
static const struct ofono_gprs_provision_data telia_fi_internet_mms_p[] = {
|
static const struct ofono_gprs_provision_data telia_fi_internet_mms_p[] = {
|
||||||
{
|
{
|
||||||
.type = OFONO_GPRS_CONTEXT_TYPE_INTERNET,
|
.type = OFONO_GPRS_CONTEXT_TYPE_INTERNET,
|
||||||
@@ -231,7 +239,8 @@ static const struct ofono_gprs_provision_data telia_fi_internet_mms_p[] = {
|
|||||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE,
|
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE,
|
||||||
.message_proxy = telia_fi_message_proxy,
|
.message_proxy = telia_fi_message_proxy,
|
||||||
.message_center = telia_fi_message_center
|
.message_center = telia_fi_message_center
|
||||||
}
|
},
|
||||||
|
{ DEFAULT_IMS_SETTINGS }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ofono_gprs_provision_data telia_fi_internet_mms[] = {
|
static const struct ofono_gprs_provision_data telia_fi_internet_mms[] = {
|
||||||
@@ -251,7 +260,8 @@ static const struct ofono_gprs_provision_data telia_fi_internet_mms[] = {
|
|||||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE,
|
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE,
|
||||||
.message_proxy = telia_fi_message_proxy,
|
.message_proxy = telia_fi_message_proxy,
|
||||||
.message_center = telia_fi_message_center
|
.message_center = telia_fi_message_center
|
||||||
}
|
},
|
||||||
|
{ DEFAULT_IMS_SETTINGS }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ofono_gprs_provision_data telia_fi_internet[] = {
|
static const struct ofono_gprs_provision_data telia_fi_internet[] = {
|
||||||
@@ -263,7 +273,8 @@ static const struct ofono_gprs_provision_data telia_fi_internet[] = {
|
|||||||
.apn = telia_fi_apn_internet,
|
.apn = telia_fi_apn_internet,
|
||||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||||
},
|
},
|
||||||
{ DEFAULT_MMS_SETTINGS }
|
{ DEFAULT_MMS_SETTINGS },
|
||||||
|
{ DEFAULT_IMS_SETTINGS }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ofono_gprs_provision_data telia_fi_mms[] = {
|
static const struct ofono_gprs_provision_data telia_fi_mms[] = {
|
||||||
@@ -277,12 +288,14 @@ static const struct ofono_gprs_provision_data telia_fi_mms[] = {
|
|||||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE,
|
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE,
|
||||||
.message_proxy = telia_fi_message_proxy,
|
.message_proxy = telia_fi_message_proxy,
|
||||||
.message_center = telia_fi_message_center
|
.message_center = telia_fi_message_center
|
||||||
}
|
},
|
||||||
|
{ DEFAULT_IMS_SETTINGS }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ofono_gprs_provision_data default_settings[] = {
|
static const struct ofono_gprs_provision_data default_settings[] = {
|
||||||
{ DEFAILT_INTERNET_SETTINGS },
|
{ DEFAILT_INTERNET_SETTINGS },
|
||||||
{ DEFAULT_MMS_SETTINGS }
|
{ DEFAULT_MMS_SETTINGS },
|
||||||
|
{ DEFAULT_IMS_SETTINGS }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ofono_gprs_provision_data no_auth_settings[] = {
|
static const struct ofono_gprs_provision_data no_auth_settings[] = {
|
||||||
@@ -300,7 +313,8 @@ static const struct ofono_gprs_provision_data no_auth_settings[] = {
|
|||||||
.name = "MMS",
|
.name = "MMS",
|
||||||
.apn = "mms",
|
.apn = "mms",
|
||||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||||
}
|
},
|
||||||
|
{ DEFAULT_IMS_SETTINGS }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ofono_gprs_provision_data auth_settings[] = {
|
static const struct ofono_gprs_provision_data auth_settings[] = {
|
||||||
@@ -318,7 +332,8 @@ static const struct ofono_gprs_provision_data auth_settings[] = {
|
|||||||
.apn = "mms",
|
.apn = "mms",
|
||||||
.password = "password",
|
.password = "password",
|
||||||
.auth_method = OFONO_GPRS_AUTH_METHOD_ANY
|
.auth_method = OFONO_GPRS_AUTH_METHOD_ANY
|
||||||
}
|
},
|
||||||
|
{ DEFAULT_IMS_SETTINGS }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ofono_gprs_provision_data settings_ip[] = {
|
static const struct ofono_gprs_provision_data settings_ip[] = {
|
||||||
@@ -329,7 +344,8 @@ static const struct ofono_gprs_provision_data settings_ip[] = {
|
|||||||
.apn = "internet",
|
.apn = "internet",
|
||||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||||
},
|
},
|
||||||
{ DEFAULT_MMS_SETTINGS }
|
{ DEFAULT_MMS_SETTINGS },
|
||||||
|
{ DEFAULT_IMS_SETTINGS }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ofono_gprs_provision_data settings_ipv6[] = {
|
static const struct ofono_gprs_provision_data settings_ipv6[] = {
|
||||||
@@ -345,7 +361,8 @@ static const struct ofono_gprs_provision_data settings_ipv6[] = {
|
|||||||
.name = "MMS",
|
.name = "MMS",
|
||||||
.apn = "mms",
|
.apn = "mms",
|
||||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||||
}
|
},
|
||||||
|
{ DEFAULT_IMS_SETTINGS }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ofono_gprs_provision_data settings_ipv4v6[] = {
|
static const struct ofono_gprs_provision_data settings_ipv4v6[] = {
|
||||||
@@ -356,7 +373,40 @@ static const struct ofono_gprs_provision_data settings_ipv4v6[] = {
|
|||||||
.name = "MMS",
|
.name = "MMS",
|
||||||
.apn = "mms",
|
.apn = "mms",
|
||||||
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||||
}
|
},
|
||||||
|
{ DEFAULT_IMS_SETTINGS }
|
||||||
|
};
|
||||||
|
|
||||||
|
static char beeline_provider_name [] = "Beeline";
|
||||||
|
static const struct ofono_gprs_provision_data beeline_ims[] = {
|
||||||
|
{
|
||||||
|
.type = OFONO_GPRS_CONTEXT_TYPE_INTERNET,
|
||||||
|
.proto = OFONO_GPRS_PROTO_IPV4V6,
|
||||||
|
.provider_name = beeline_provider_name,
|
||||||
|
.name = "Beeline Internet",
|
||||||
|
.apn = "internet.beeline.ru",
|
||||||
|
.username = "beeline",
|
||||||
|
.password = "beeline",
|
||||||
|
.auth_method = OFONO_GPRS_AUTH_METHOD_ANY
|
||||||
|
}, {
|
||||||
|
.type = OFONO_GPRS_CONTEXT_TYPE_MMS,
|
||||||
|
.proto = OFONO_GPRS_PROTO_IP,
|
||||||
|
.provider_name = beeline_provider_name,
|
||||||
|
.name = "Beeline MMS",
|
||||||
|
.apn = "mms.beeline.ru",
|
||||||
|
.username = "beeline",
|
||||||
|
.password = "beeline",
|
||||||
|
.auth_method = OFONO_GPRS_AUTH_METHOD_PAP,
|
||||||
|
.message_proxy = "192.168.94.23:8080",
|
||||||
|
.message_center = "http://mms/"
|
||||||
|
}, {
|
||||||
|
.type = OFONO_GPRS_CONTEXT_TYPE_IMS,
|
||||||
|
.proto = OFONO_GPRS_PROTO_IPV4V6,
|
||||||
|
.provider_name = beeline_provider_name,
|
||||||
|
.name = "Beeline IMS",
|
||||||
|
.apn = "ims.beeline.ru",
|
||||||
|
.auth_method = OFONO_GPRS_AUTH_METHOD_NONE
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static char test_provider_name[] = "Test provider";
|
static char test_provider_name[] = "Test provider";
|
||||||
@@ -382,7 +432,8 @@ static const struct ofono_gprs_provision_data test_username_password[] = {
|
|||||||
.auth_method = OFONO_GPRS_AUTH_METHOD_CHAP,
|
.auth_method = OFONO_GPRS_AUTH_METHOD_CHAP,
|
||||||
.message_proxy = test_message_proxy,
|
.message_proxy = test_message_proxy,
|
||||||
.message_center = test_message_center
|
.message_center = test_message_center
|
||||||
}
|
},
|
||||||
|
{ DEFAULT_IMS_SETTINGS }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char telia_fi_internet_xml[] =
|
static const char telia_fi_internet_xml[] =
|
||||||
@@ -806,6 +857,42 @@ static const struct provision_test_case test_cases[] = {
|
|||||||
.mnc = "91",
|
.mnc = "91",
|
||||||
.settings = telia_fi_mms,
|
.settings = telia_fi_mms,
|
||||||
.count = G_N_ELEMENTS(telia_fi_mms)
|
.count = G_N_ELEMENTS(telia_fi_mms)
|
||||||
|
},{
|
||||||
|
.name = TEST_SUITE "ims",
|
||||||
|
.xml =
|
||||||
|
"<serviceproviders format=\"2.0\">\n\
|
||||||
|
<country code=\"ru\">\n\
|
||||||
|
<provider>\n\
|
||||||
|
<name>Beeline</name>\n\
|
||||||
|
<gsm>\n\
|
||||||
|
<network-id mcc=\"250\" mnc=\"99\"/>\n\
|
||||||
|
<apn value=\"internet.beeline.ru\">\n\
|
||||||
|
<usage type=\"internet\"/>\n\
|
||||||
|
<name>Beeline Internet</name>\n\
|
||||||
|
<username>beeline</username>\n\
|
||||||
|
<password>beeline</password>\n\
|
||||||
|
</apn>\n\
|
||||||
|
<apn value=\"mms.beeline.ru\">\n\
|
||||||
|
<usage type=\"mms\"/>\n\
|
||||||
|
<name>Beeline MMS</name>\n\
|
||||||
|
<authentication method=\"pap\"/>\n\
|
||||||
|
<username>beeline</username>\n\
|
||||||
|
<password>beeline</password>\n\
|
||||||
|
<mmsc>http://mms/</mmsc>\n\
|
||||||
|
<mmsproxy>192.168.94.23:8080</mmsproxy>\n\
|
||||||
|
</apn>\n\
|
||||||
|
<apn value=\"ims.beeline.ru\">\n\
|
||||||
|
<usage type=\"ims\"/>\n\
|
||||||
|
<name>Beeline IMS</name>\n\
|
||||||
|
</apn>\n\
|
||||||
|
</gsm>\n\
|
||||||
|
</provider>\n\
|
||||||
|
</country>\n\
|
||||||
|
</serviceproviders>\n",
|
||||||
|
.mcc = "250",
|
||||||
|
.mnc = "99",
|
||||||
|
.settings = beeline_ims,
|
||||||
|
.count = G_N_ELEMENTS(beeline_ims)
|
||||||
},{
|
},{
|
||||||
.name = TEST_SUITE "not_found_mcc",
|
.name = TEST_SUITE "not_found_mcc",
|
||||||
.xml = telia_fi_internet_xml,
|
.xml = telia_fi_internet_xml,
|
||||||
@@ -1297,3 +1384,11 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
return g_test_run();
|
return g_test_run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local Variables:
|
||||||
|
* mode: C
|
||||||
|
* c-basic-offset: 8
|
||||||
|
* indent-tabs-mode: t
|
||||||
|
* End:
|
||||||
|
*/
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony
|
* oFono - Open Source Telephony
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018-2019 Jolla Ltd.
|
* Copyright (C) 2018-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
|
||||||
@@ -377,6 +377,39 @@ static void test_get_enum(void)
|
|||||||
test_get_value(conf, test_get_enum_cb);
|
test_get_value(conf, test_get_enum_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ==== get_mask ==== */
|
||||||
|
|
||||||
|
static void test_get_mask_cb(GKeyFile *k)
|
||||||
|
{
|
||||||
|
int v = 0;
|
||||||
|
|
||||||
|
g_assert(!ril_config_get_mask(k, "g1", "k", NULL, "x",1, "y",2, NULL));
|
||||||
|
g_assert(!ril_config_get_mask(k, "g1", "k", &v, "x",1, "y",2, NULL));
|
||||||
|
g_assert_cmpint(v, ==, 0);
|
||||||
|
|
||||||
|
g_assert(ril_config_get_mask(k, "g", "k", NULL, "x",1, "y",2, NULL));
|
||||||
|
g_assert(ril_config_get_mask(k, "g", "k", &v, "x",1, "y",2, NULL));
|
||||||
|
g_assert_cmpint(v, ==, 1);
|
||||||
|
|
||||||
|
g_assert(ril_config_get_mask(k, "g", "k1", NULL, "x",1, "y",2, NULL));
|
||||||
|
g_assert(ril_config_get_mask(k, "g", "k1", &v, "x",1, "y",2, NULL));
|
||||||
|
g_assert_cmpint(v, ==, 3);
|
||||||
|
|
||||||
|
g_assert(!ril_config_get_mask(k, "g", "k2", NULL, "x",1, "y",2, NULL));
|
||||||
|
g_assert(!ril_config_get_mask(k, "g", "k2", &v, "x",1, "y",2, NULL));
|
||||||
|
g_assert_cmpint(v, ==, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test_get_mask(void)
|
||||||
|
{
|
||||||
|
static const char conf [] = "[g]\n"
|
||||||
|
"k = x# comment\n"
|
||||||
|
"k1 = x+y\n"
|
||||||
|
"k2 = x+z+y\n";
|
||||||
|
|
||||||
|
test_get_value(conf, test_get_mask_cb);
|
||||||
|
}
|
||||||
|
|
||||||
/* ==== get_ints ==== */
|
/* ==== get_ints ==== */
|
||||||
|
|
||||||
static void test_get_ints_cb(GKeyFile *k)
|
static void test_get_ints_cb(GKeyFile *k)
|
||||||
@@ -451,6 +484,7 @@ int main(int argc, char *argv[])
|
|||||||
g_test_add_func(TEST_("get_boolean3"), test_get_boolean3);
|
g_test_add_func(TEST_("get_boolean3"), test_get_boolean3);
|
||||||
g_test_add_func(TEST_("get_flag"), test_get_flag);
|
g_test_add_func(TEST_("get_flag"), test_get_flag);
|
||||||
g_test_add_func(TEST_("get_enum"), test_get_enum);
|
g_test_add_func(TEST_("get_enum"), test_get_enum);
|
||||||
|
g_test_add_func(TEST_("get_mask"), test_get_mask);
|
||||||
g_test_add_func(TEST_("get_ints"), test_get_ints);
|
g_test_add_func(TEST_("get_ints"), test_get_ints);
|
||||||
g_test_add_func(TEST_("ints_to_string"), test_ints_to_string);
|
g_test_add_func(TEST_("ints_to_string"), test_ints_to_string);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user