[-]
[+]
|
Changed |
_service:tar_git:ofono.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:ofono.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,6 +2,6 @@
<service name="tar_git">
<param name="url">https://git.merproject.org/slava/ofono.git</param>
<param name="branch">master</param>
- <param name="revision">e790553</param>
+ <param name="revision">3370c09</param>
</service>
</services>
|
[-]
[+]
|
Deleted |
_service:tar_git:ofono-1.17+git35.tar.bz2/ofono/drivers/ril/ril_mce.c
^
|
@@ -1,268 +0,0 @@
-/*
- * oFono - Open Source Telephony - RIL-based devices
- *
- * Copyright (C) 2015-2016 Jolla Ltd.
- *
- * 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_mce.h"
-#include "ril_log.h"
-
-#include <ofono/dbus.h>
-
-#include <gdbus.h>
-
-/* <mce/dbus-names.h> */
-#define MCE_SERVICE "com.nokia.mce"
-#define MCE_SIGNAL_IF "com.nokia.mce.signal"
-#define MCE_REQUEST_IF "com.nokia.mce.request"
-#define MCE_REQUEST_PATH "/com/nokia/mce/request"
-#define MCE_DISPLAY_STATUS_GET "get_display_status"
-#define MCE_DISPLAY_SIG "display_status_ind"
-#define MCE_DISPLAY_DIM_STRING "dimmed"
-#define MCE_DISPLAY_ON_STRING "on"
-#define MCE_DISPLAY_OFF_STRING "off"
-
-typedef GObjectClass RilMceClass;
-typedef struct ril_mce RilMce;
-
-struct ril_mce_priv {
- GRilIoChannel *io;
- DBusConnection *conn;
- DBusPendingCall *req;
- guint daemon_watch;
- guint signal_watch;
-};
-
-enum ril_mce_signal {
- SIGNAL_DISPLAY_STATE_CHANGED,
- SIGNAL_COUNT
-};
-
-#define SIGNAL_DISPLAY_STATE_CHANGED_NAME "ril-mce-display-state-changed"
-
-static guint ril_mce_signals[SIGNAL_COUNT] = { 0 };
-
-G_DEFINE_TYPE(RilMce, ril_mce, G_TYPE_OBJECT)
-#define RIL_MCE_TYPE (ril_mce_get_type())
-#define RIL_MCE(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj,RIL_MCE_TYPE,RilMce))
-
-static const char *ril_mce_display_state_string(enum ril_mce_display_state ds)
-{
- switch (ds) {
- case RIL_MCE_DISPLAY_OFF:
- return MCE_DISPLAY_OFF_STRING;
- case RIL_MCE_DISPLAY_DIM:
- return MCE_DISPLAY_DIM_STRING;
- case RIL_MCE_DISPLAY_ON:
- return MCE_DISPLAY_ON_STRING;
- default:
- return NULL;
- }
-}
-
-static enum ril_mce_display_state ril_mce_parse_display_state(DBusMessage *msg)
-{
- DBusMessageIter it;
-
- if (dbus_message_iter_init(msg, &it) &&
- dbus_message_iter_get_arg_type(&it) == DBUS_TYPE_STRING) {
- const char *value = NULL;
-
- dbus_message_iter_get_basic(&it, &value);
- if (!g_strcmp0(value, MCE_DISPLAY_OFF_STRING)) {
- return RIL_MCE_DISPLAY_OFF;
- } else if (!g_strcmp0(value, MCE_DISPLAY_DIM_STRING)) {
- return RIL_MCE_DISPLAY_DIM;
- } else {
- GASSERT(!g_strcmp0(value, MCE_DISPLAY_ON_STRING));
- }
- }
-
- return RIL_MCE_DISPLAY_ON;
-}
-
-static void ril_mce_update_display_state(struct ril_mce *self,
- enum ril_mce_display_state state)
-{
- if (self->display_state != state) {
- self->display_state = state;
- g_signal_emit(self, ril_mce_signals[
- SIGNAL_DISPLAY_STATE_CHANGED], 0);
- }
-}
-
-static gboolean ril_mce_display_changed(DBusConnection *conn,
- DBusMessage *msg, void *user_data)
-{
- enum ril_mce_display_state state = ril_mce_parse_display_state(msg);
-
- DBG("%s", ril_mce_display_state_string(state));
- ril_mce_update_display_state(RIL_MCE(user_data), state);
- return TRUE;
-}
-
-static void ril_mce_display_status_reply(DBusPendingCall *call, void *user_data)
-{
- struct ril_mce *self = RIL_MCE(user_data);
- struct ril_mce_priv *priv = self->priv;
- DBusMessage *reply = dbus_pending_call_steal_reply(call);
- enum ril_mce_display_state state = ril_mce_parse_display_state(reply);
-
- GASSERT(priv->req);
- dbus_message_unref(reply);
- dbus_pending_call_unref(priv->req);
- priv->req = NULL;
-
- DBG("%s", ril_mce_display_state_string(state));
- ril_mce_update_display_state(self, state);
-}
-
-static void ril_mce_connect(DBusConnection *conn, void *user_data)
-{
- struct ril_mce *self = RIL_MCE(user_data);
- struct ril_mce_priv *priv = self->priv;
-
- DBG("");
- if (!priv->req) {
- DBusMessage *msg = dbus_message_new_method_call(MCE_SERVICE,
- MCE_REQUEST_PATH, MCE_REQUEST_IF,
- MCE_DISPLAY_STATUS_GET);
- if (g_dbus_send_message_with_reply(conn, msg, &priv->req, -1)) {
- dbus_pending_call_set_notify(priv->req,
- ril_mce_display_status_reply,
- self, NULL);
- dbus_message_unref(msg);
- }
- }
- if (!priv->signal_watch) {
- priv->signal_watch = g_dbus_add_signal_watch(conn,
- MCE_SERVICE, NULL, MCE_SIGNAL_IF, MCE_DISPLAY_SIG,
- ril_mce_display_changed, self, NULL);
- }
-}
-
-static void ril_mce_disconnect(DBusConnection *conn, void *user_data)
-{
- struct ril_mce *self = user_data;
- struct ril_mce_priv *priv = self->priv;
-
- DBG("");
- if (priv->signal_watch) {
- g_dbus_remove_watch(conn, priv->signal_watch);
- priv->signal_watch = 0;
- }
- if (priv->req) {
- dbus_pending_call_cancel(priv->req);
- dbus_pending_call_unref(priv->req);
- }
-}
-
-struct ril_mce *ril_mce_new()
-{
- struct ril_mce *self = g_object_new(RIL_MCE_TYPE, NULL);
- struct ril_mce_priv *priv = self->priv;
-
- DBG("");
- priv->daemon_watch = g_dbus_add_service_watch(priv->conn, MCE_SERVICE,
- ril_mce_connect, ril_mce_disconnect, self, NULL);
- return self;
-}
-
-struct ril_mce *ril_mce_ref(struct ril_mce *self)
-{
- if (G_LIKELY(self)) {
- g_object_ref(RIL_MCE(self));
- return self;
- } else {
- return NULL;
- }
-}
-
-void ril_mce_unref(struct ril_mce *self)
-{
- if (G_LIKELY(self)) {
- g_object_unref(RIL_MCE(self));
- }
-}
-
-gulong ril_mce_add_display_state_changed_handler(struct ril_mce *self,
- ril_mce_cb_t cb, void *arg)
-{
|
[-]
[+]
|
Deleted |
_service:tar_git:ofono-1.17+git35.tar.bz2/ofono/drivers/ril/ril_mce.h
^
|
@@ -1,51 +0,0 @@
-/*
- * oFono - Open Source Telephony - RIL-based devices
- *
- * Copyright (C) 2015-2016 Jolla Ltd.
- *
- * 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.
- */
-
-#ifndef RIL_MCE_H
-#define RIL_MCE_H
-
-#include "ril_types.h"
-
-enum ril_mce_display_state {
- RIL_MCE_DISPLAY_OFF,
- RIL_MCE_DISPLAY_DIM,
- RIL_MCE_DISPLAY_ON
-};
-
-struct ril_mce_priv;
-struct ril_mce {
- GObject object;
- struct ril_mce_priv *priv;
- enum ril_mce_display_state display_state;
-};
-
-struct ril_mce *ril_mce_new(void);
-struct ril_mce *ril_mce_ref(struct ril_mce *mce);
-void ril_mce_unref(struct ril_mce *mce);
-
-typedef void (*ril_mce_cb_t)(struct ril_mce *mce, void *arg);
-gulong ril_mce_add_display_state_changed_handler(struct ril_mce *mce,
- ril_mce_cb_t cb, void *arg);
-void ril_mce_remove_handler(struct ril_mce *mce, gulong id);
-
-#endif /* RIL_MCE_H */
-
-/*
- * Local Variables:
- * mode: C
- * c-basic-offset: 8
- * indent-tabs-mode: t
- * End:
- */
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.17+git38.tar.bz2/ofono/Makefile.am
^
|
@@ -134,7 +134,6 @@
drivers/ril/ril_ecclist.c \
drivers/ril/ril_gprs.c \
drivers/ril/ril_gprs_context.c \
- drivers/ril/ril_mce.c \
drivers/ril/ril_modem.c \
drivers/ril/ril_mtu.c \
drivers/ril/ril_netreg.c \
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.17+git38.tar.bz2/ofono/configure.ac
^
|
@@ -177,8 +177,10 @@
AC_MSG_ERROR(libgrilio >= 1.0.6 is required))
PKG_CHECK_MODULES(GLIBUTIL, libglibutil >= 1.0.5, dummy=yes,
AC_MSG_ERROR(libglibutil >= 1.0.5 is required))
- CFLAGS="$CFLAGS $GRILIO_CFLAGS $GLIBUTIL_CFLAGS"
- LIBS="$LIBS $GRILIO_LIBS $GLIBUTIL_LIBS"
+ PKG_CHECK_MODULES(LIBMCE, libmce-glib, dummy=yes,
+ AC_MSG_ERROR(libmce-glib is required))
+ CFLAGS="$CFLAGS $GRILIO_CFLAGS $GLIBUTIL_CFLAGS $LIBMCE_CFLAGS"
+ LIBS="$LIBS $GRILIO_LIBS $GLIBUTIL_LIBS $LIBMCE_LIBS"
fi
AC_ARG_ENABLE(qmimodem, AC_HELP_STRING([--disable-qmimodem],
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.17+git38.tar.bz2/ofono/drivers/ril/ril_cell_info.c
^
|
@@ -17,13 +17,14 @@
#include "ril_sim_card.h"
#include "ril_radio.h"
#include "ril_util.h"
-#include "ril_mce.h"
#include "ril_log.h"
#include <grilio_channel.h>
#include <grilio_request.h>
#include <grilio_parser.h>
+#include <gutil_misc.h>
+
#define DISPLAY_ON_UPDATE_RATE (1000) /* 1 sec */
#define DISPLAY_OFF_UPDATE_RATE (60000) /* 1 min */
@@ -32,7 +33,7 @@
struct ril_cell_info_priv {
GRilIoChannel *io;
- struct ril_mce *mce;
+ MceDisplay *display;
struct ril_radio *radio;
struct ril_sim_card *sim_card;
gulong display_state_event_id;
@@ -355,11 +356,11 @@
struct ril_cell_info_priv *priv = self->priv;
ril_cell_info_set_rate(self,
- (priv->mce->display_state == RIL_MCE_DISPLAY_OFF) ?
+ (priv->display->state == MCE_DISPLAY_STATE_OFF) ?
DISPLAY_OFF_UPDATE_RATE : DISPLAY_ON_UPDATE_RATE);
}
-static void ril_cell_info_display_state_cb(struct ril_mce *mce, void *arg)
+static void ril_cell_info_display_state_cb(MceDisplay *display, void *arg)
{
struct ril_cell_info *self = RIL_CELL_INFO(arg);
struct ril_cell_info_priv *priv = self->priv;
@@ -420,14 +421,14 @@
}
struct ril_cell_info *ril_cell_info_new(GRilIoChannel *io,
- const char *log_prefix, struct ril_mce *mce,
+ const char *log_prefix, MceDisplay *display,
struct ril_radio *radio, struct ril_sim_card *sim_card)
{
struct ril_cell_info *self = g_object_new(RIL_CELL_INFO_TYPE, 0);
struct ril_cell_info_priv *priv = self->priv;
priv->io = grilio_channel_ref(io);
- priv->mce = ril_mce_ref(mce);
+ priv->display = mce_display_ref(display);
priv->radio = ril_radio_ref(radio);
priv->sim_card = ril_sim_card_ref(sim_card);
priv->log_prefix = (log_prefix && log_prefix[0]) ?
@@ -436,7 +437,7 @@
priv->event_id = grilio_channel_add_unsol_event_handler(priv->io,
ril_cell_info_list_changed_cb, RIL_UNSOL_CELL_INFO_LIST, self);
priv->display_state_event_id =
- ril_mce_add_display_state_changed_handler(mce,
+ mce_display_add_state_changed_handler(display,
ril_cell_info_display_state_cb, self);
priv->radio_state_event_id =
ril_radio_add_state_changed_handler(radio,
@@ -490,10 +491,8 @@
FALSE);
priv->set_rate_id = 0;
}
- if (priv->display_state_event_id) {
- ril_mce_remove_handler(priv->mce, priv->display_state_event_id);
- priv->display_state_event_id = 0;
- }
+ gutil_disconnect_handlers(priv->display,
+ &priv->display_state_event_id, 1);
ril_radio_remove_handlers(priv->radio, &priv->radio_state_event_id, 1);
ril_sim_card_remove_handlers(priv->sim_card,
&priv->sim_status_event_id, 1);
@@ -508,7 +507,7 @@
DBG_(self, "");
g_free(priv->log_prefix);
grilio_channel_unref(priv->io);
- ril_mce_unref(priv->mce);
+ mce_display_unref(priv->display);
ril_radio_unref(priv->radio);
ril_sim_card_unref(priv->sim_card);
g_slist_free_full(self->cells, g_free);
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.17+git38.tar.bz2/ofono/drivers/ril/ril_cell_info.h
^
|
@@ -17,6 +17,7 @@
#define RIL_CELL_INFO_H
#include "ril_types.h"
+#include <mce_display.h>
struct ril_cell {
enum ril_cell_info_type type;
@@ -42,7 +43,7 @@
const struct ril_cell *c2);
struct ril_cell_info *ril_cell_info_new(GRilIoChannel *io,
- const char *log_prefix, struct ril_mce *mce,
+ const char *log_prefix, MceDisplay *display,
struct ril_radio *radio, struct ril_sim_card *sim_card);
struct ril_cell_info *ril_cell_info_ref(struct ril_cell_info *info);
void ril_cell_info_unref(struct ril_cell_info *info);
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.17+git38.tar.bz2/ofono/drivers/ril/ril_plugin.c
^
|
@@ -22,12 +22,14 @@
#include "ril_network.h"
#include "ril_radio.h"
#include "ril_data.h"
-#include "ril_mce.h"
#include "ril_util.h"
#include "ril_log.h"
#include <gdbus.h>
#include <gutil_strv.h>
+#include <gutil_misc.h>
+#include <mce_display.h>
+#include <mce_log.h>
#include <linux/capability.h>
#include <sys/types.h>
#include <sys/syscall.h>
@@ -54,6 +56,7 @@
#define RILMODEM_DEFAULT_DM_FLAGS RIL_DATA_MANAGER_3GLTE_HANDOVER
#define RILMODEM_DEFAULT_EMPTY_PIN_QUERY TRUE /* optimistic */
+#define RILCONF_SETTINGS_EMPTY "EmptyConfig"
#define RILCONF_SETTINGS_3GHANDOVER "3GLTEHandover"
#define RILCONF_DEV_PREFIX "ril_"
@@ -84,13 +87,19 @@
IO_EVENT_COUNT
};
+enum ril_plugin_display_events {
+ DISPLAY_EVENT_VALID,
+ DISPLAY_EVENT_STATE,
+ DISPLAY_EVENT_COUNT
+};
+
struct ril_plugin_priv {
struct ril_plugin pub;
struct ril_plugin_dbus *dbus;
struct ril_data_manager *data_manager;
- struct ril_mce *mce;
+ MceDisplay *display;
gboolean display_on;
- gulong display_state_change_id;
+ gulong display_event_id[DISPLAY_EVENT_COUNT];
GSList *slots;
ril_slot_info_ptr *slots_info;
struct ril_slot *voice_slot;
@@ -117,7 +126,6 @@
struct ril_slot_config config;
struct ril_plugin_priv *plugin;
struct ril_modem *modem;
- struct ril_mce *mce;
struct ofono_sim *sim;
struct ril_radio *radio;
struct ril_network *network;
@@ -129,6 +137,7 @@
struct ril_cell_info_dbus *cell_info_dbus;
struct ril_oem_raw *oem_raw;
struct ril_data *data;
+ MceDisplay *display;
GRilIoChannel *io;
gulong io_event_id[IO_EVENT_COUNT];
gulong imei_req_id;
@@ -148,6 +157,7 @@
static void ril_debug_trace_notify(struct ofono_debug_desc *desc);
static void ril_debug_dump_notify(struct ofono_debug_desc *desc);
static void ril_debug_grilio_notify(struct ofono_debug_desc *desc);
+static void ril_debug_mce_notify(struct ofono_debug_desc *desc);
static void ril_plugin_debug_notify(struct ofono_debug_desc *desc);
static void ril_plugin_retry_init_io(struct ril_slot *slot);
@@ -180,6 +190,12 @@
.notify = ril_debug_grilio_notify
};
+static struct ofono_debug_desc mce_debug OFONO_DEBUG_ATTR = {
+ .name = "mce",
+ .flags = OFONO_DEBUG_FLAG_DEFAULT,
+ .notify = ril_debug_mce_notify
+};
+
static struct ofono_debug_desc ril_plugin_debug OFONO_DEBUG_ATTR = {
.name = "ril_plugin",
.flags = OFONO_DEBUG_FLAG_DEFAULT,
@@ -220,12 +236,18 @@
}
}
-static void ril_plugin_display_state_cb(struct ril_mce *mce, void *user_data)
+static gboolean ril_plugin_display_on(MceDisplay *display)
+{
+ return display && display->valid &&
+ display->state != MCE_DISPLAY_STATE_OFF;
+}
+
+static void ril_plugin_display_cb(MceDisplay *display, void *user_data)
{
struct ril_plugin_priv *plugin = user_data;
const gboolean display_was_on = plugin->display_on;
- plugin->display_on = (mce->display_state != RIL_MCE_DISPLAY_OFF);
+ plugin->display_on = ril_plugin_display_on(display);
if (plugin->display_on != display_was_on) {
ril_plugin_foreach_slot(plugin, ril_plugin_send_screen_state);
}
@@ -952,7 +974,7 @@
GASSERT(!slot->cell_info);
if (slot->io->ril_version > 8) {
slot->cell_info = ril_cell_info_new(slot->io, log_prefix,
- plugin->mce, slot->radio, slot->sim_card);
+ plugin->display, slot->radio, slot->sim_card);
}
ril_plugin_send_screen_state(slot);
@@ -1258,16 +1280,22 @@
GError *err = NULL;
GSList *list = NULL;
GKeyFile *file = g_key_file_new();
+ gboolean empty = FALSE;
if (g_key_file_load_from_file(file, path, 0, &err)) {
- DBG("loading %s", path);
- list = ril_plugin_parse_config_file(file, ps);
+ DBG("Loading %s", path);
+ if (ril_config_get_boolean(file, RILCONF_SETTINGS_GROUP,
+ RILCONF_SETTINGS_EMPTY, &empty) && empty) {
+ DBG("Empty config");
+ } else {
+ list = ril_plugin_parse_config_file(file, ps);
+ }
} else {
DBG("conf load error: %s", err->message);
g_error_free(err);
}
- if (!list) {
+ if (!list && !empty) {
list = ril_plugin_create_default_config();
}
@@ -1537,6 +1565,12 @@
GLOG_LEVEL_VERBOSE : GLOG_LEVEL_INHERIT;
}
+static void ril_debug_mce_notify(struct ofono_debug_desc *desc)
+{
+ mce_log.level = (desc->flags & OFONO_DEBUG_FLAG_PRINT) ?
+ GLOG_LEVEL_VERBOSE : GLOG_LEVEL_INHERIT;
+}
+
static void ril_plugin_debug_notify(struct ofono_debug_desc *desc)
{
GLOG_MODULE_NAME.level = (desc->flags & OFONO_DEBUG_FLAG_PRINT) ?
@@ -1563,6 +1597,7 @@
*/
grilio_hexdump_log.name = ril_debug_dump.name;
grilio_log.name = grilio_debug.name;
+ mce_log.name = mce_debug.name;
/*
* Debug log plugin hooks gutil_log_func2 while we replace
@@ -1579,9 +1614,8 @@
ril_plugin_init_slots(ril_plugin);
ril_plugin->dbus = ril_plugin_dbus_new(&ril_plugin->pub);
ril_plugin->data_manager = ril_data_manager_new(ps.dm_flags);
- ril_plugin->mce = ril_mce_new();
- ril_plugin->display_on =
- (ril_plugin->mce->display_state != RIL_MCE_DISPLAY_OFF);
+ ril_plugin->display = mce_display_new();
+ ril_plugin->display_on = ril_plugin_display_on(ril_plugin->display);
if (ril_plugin->slots) {
/*
@@ -1651,9 +1685,12 @@
/* Set initial screen state and register for updates */
ril_plugin_foreach_slot(ril_plugin, ril_plugin_send_screen_state);
- ril_plugin->display_state_change_id =
- ril_mce_add_display_state_changed_handler(ril_plugin->mce,
- ril_plugin_display_state_cb, ril_plugin);
+ ril_plugin->display_event_id[DISPLAY_EVENT_VALID] =
+ mce_display_add_valid_changed_handler(ril_plugin->display,
+ ril_plugin_display_cb, ril_plugin);
+ ril_plugin->display_event_id[DISPLAY_EVENT_STATE] =
+ mce_display_add_state_changed_handler(ril_plugin->display,
+ ril_plugin_display_cb, ril_plugin);
/* This will set 'ready' flag if we have no modems at all */
ril_plugin_update_ready(ril_plugin);
@@ -1687,9 +1724,9 @@
g_slist_free_full(ril_plugin->slots, ril_plugin_destroy_slot);
ril_plugin_dbus_free(ril_plugin->dbus);
ril_data_manager_unref(ril_plugin->data_manager);
- ril_mce_remove_handler(ril_plugin->mce,
- ril_plugin->display_state_change_id);
- ril_mce_unref(ril_plugin->mce);
+ gutil_disconnect_handlers(ril_plugin->display,
+ ril_plugin->display_event_id, DISPLAY_EVENT_COUNT);
+ mce_display_unref(ril_plugin->display);
g_key_file_free(ril_plugin->storage);
g_free(ril_plugin->slots_info);
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.17+git38.tar.bz2/ofono/drivers/ril/ril_sim_info.c
^
|
@@ -57,6 +57,7 @@
char *sim_spn;
char *public_spn;
char default_spn[RIL_SIM_DEFAULT_SPN_BUFSIZE];
+ int public_spn_block;
struct ofono_sim *sim;
struct ril_sim_info_watch state_watch;
struct ril_sim_info_watch iccid_watch;
@@ -209,14 +210,18 @@
static void ril_sim_info_update_public_spn(struct ril_sim_info *self)
{
struct ril_sim_info_priv *priv = self->priv;
- const char *spn = priv->sim_spn ? priv->sim_spn :
+
+ GASSERT(priv->public_spn_block >= 0);
+ if (!priv->public_spn_block) {
+ const char *spn = priv->sim_spn ? priv->sim_spn :
priv->cached_spn ? priv->cached_spn :
priv->default_spn;
- if (g_strcmp0(priv->public_spn, spn)) {
- g_free(priv->public_spn);
- self->spn = priv->public_spn = g_strdup(spn);
- ril_sim_info_signal_emit(self, SIGNAL_SPN_CHANGED);
+ if (g_strcmp0(priv->public_spn, spn)) {
+ g_free(priv->public_spn);
+ self->spn = priv->public_spn = g_strdup(spn);
+ ril_sim_info_signal_emit(self, SIGNAL_SPN_CHANGED);
+ }
}
}
@@ -226,11 +231,15 @@
struct ril_sim_info_priv *priv = self->priv;
if (g_strcmp0(priv->cached_spn, spn)) {
- DBG_(self, "cached spn \"%s\"", spn);
g_free(priv->cached_spn);
- priv->cached_spn = g_strdup(spn);
- priv->update_imsi_cache = TRUE;
- ril_sim_info_update_imsi_cache(self);
+ if (spn) {
+ DBG_(self, "cached spn \"%s\"", spn);
+ priv->cached_spn = g_strdup(spn);
+ priv->update_imsi_cache = TRUE;
+ ril_sim_info_update_imsi_cache(self);
+ } else {
+ priv->cached_spn = NULL;
+ }
ril_sim_info_update_public_spn(self);
}
}
@@ -505,6 +514,7 @@
struct ril_sim_info_priv *priv = self->priv;
if (priv->sim != sim) {
+ priv->public_spn_block++;
ril_sim_info_watch_remove(&priv->state_watch);
ril_sim_info_watch_remove(&priv->iccid_watch);
ril_sim_info_watch_remove(&priv->imsi_watch);
@@ -524,9 +534,14 @@
DBG_(self, "attached to sim");
ril_sim_info_handle_sim_state(self,
ofono_sim_get_state(sim));
+ } else {
+ DBG_(self, "detached from sim");
+ ril_sim_info_update_default_spn(self);
+ ril_sim_info_network_check(self);
}
- ril_sim_info_network_check(self);
+ priv->public_spn_block--;
+ ril_sim_info_update_public_spn(self);
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.17+git38.tar.bz2/ofono/drivers/ril/ril_subscription.conf
^
|
@@ -13,6 +13,14 @@
[Settings]
+# This option stops RIL plugin from creating any RIL modems.
+# If it's set to true, all [ril_x] sections are ignored even
+# if they are present, and no default configurtation is created.
+#
+# Default is false
+#
+#EmptyConfig=false
+
# If the phone has more than one SIM slot, the 3G/LTE module may be
# shared by all modems, meaning that only one of the slots can use
# 3G/LTE. In order to "hand 4G over" to the other slot, the modem
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.17+git38.tar.bz2/ofono/src/main.c
^
|
@@ -138,10 +138,19 @@
static gboolean parse_debug(const char *key, const char *value,
gpointer user_data, GError **error)
{
- if (value)
- option_debug = g_strdup(value);
- else
+ if (value) {
+ if (option_debug) {
+ char *prev = option_debug;
+
+ option_debug = g_strconcat(prev, ",", value, NULL);
+ g_free(prev);
+ } else {
+ option_debug = g_strdup(value);
+ }
+ } else {
+ g_free(option_debug);
option_debug = g_strdup("*");
+ }
return TRUE;
}
@@ -267,5 +276,7 @@
__ofono_log_cleanup(option_backtrace);
+ g_free(option_debug);
+
return 0;
}
|