Compare commits

...

4 Commits

Author SHA1 Message Date
Slava Monich
f7f007a122 Merge branch 'EFspn' into 'master'
Add ServiceProviderName property to SimManager

Contains the service provider name fetched from the SIM card, if available.

See merge request !27
2016-01-25 23:57:21 +00:00
Slava Monich
5769656848 [ofono] sim: Add ServiceProviderName property to SimManager
Contains the service provider name fetched from the SIM card, if available.
2016-01-26 00:21:23 +02:00
Slava Monich
bbc276b4c7 [ril] Reduced the amount of debug trace produced by ril_radio.c 2016-01-23 18:53:05 +02:00
Slava Monich
4b79de53fe [gprs] Removed unnecessary debug trace 2016-01-21 14:05:11 +02:00
4 changed files with 32 additions and 12 deletions

View File

@@ -93,6 +93,11 @@ Properties boolean Present [readonly]
Contains the IMSI of the SIM, if available.
string ServiceProviderName [readonly, optional]
Contains the service provider name fetched from the
SIM card, if available.
string MobileCountryCode [readonly, optional]
Contains the Mobile Country Code (MCC) of the home

View File

@@ -228,12 +228,15 @@ void ril_radio_power_on(struct ril_radio *self, gpointer tag)
{
if (G_LIKELY(self)) {
struct ril_radio_priv *priv = self->priv;
const gboolean was_on = ril_radio_power_should_be_on(self);
DBG("%s%p", priv->log_prefix, tag);
g_hash_table_insert(priv->req_table, tag, tag);
if (!was_on) {
ril_radio_power_request(self, TRUE, FALSE);
if (!g_hash_table_contains(priv->req_table, tag)) {
gboolean was_on = ril_radio_power_should_be_on(self);
DBG("%s%p", priv->log_prefix, tag);
g_hash_table_insert(priv->req_table, tag, tag);
if (!was_on) {
ril_radio_power_request(self, TRUE, FALSE);
}
}
}
}
@@ -243,11 +246,12 @@ void ril_radio_power_off(struct ril_radio *self, gpointer tag)
if (G_LIKELY(self)) {
struct ril_radio_priv *priv = self->priv;
DBG("%s%p", priv->log_prefix, tag);
if (g_hash_table_remove(priv->req_table, tag) &&
!ril_radio_power_should_be_on(self)) {
/* The last one turns the lights off */
ril_radio_power_request(self, FALSE, FALSE);
if (g_hash_table_remove(priv->req_table, tag)) {
DBG("%s%p", priv->log_prefix, tag);
if (!ril_radio_power_should_be_on(self)) {
/* The last one turns the lights off */
ril_radio_power_request(self, FALSE, FALSE);
}
}
}
}

View File

@@ -844,8 +844,6 @@ static gboolean pri_str_changed(const char *val, const char *newval)
static gboolean pri_str_update(char *val, const char *newval,
const int maxlen)
{
DBG("oldval: %s, newval: %s, mmaxlen: %d", val, newval, maxlen);
if (newval) {
if (strcmp(val, newval)) {
strncpy(val, newval, maxlen);

View File

@@ -380,6 +380,10 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
ofono_dbus_dict_append(&dict, "SubscriberIdentity",
DBUS_TYPE_STRING, &sim->imsi);
if (sim->spn)
ofono_dbus_dict_append(&dict, "ServiceProviderName",
DBUS_TYPE_STRING, &sim->spn);
fdn = sim->fixed_dialing;
ofono_dbus_dict_append(&dict, "FixedDialing", DBUS_TYPE_BOOLEAN, &fdn);
@@ -2570,6 +2574,9 @@ static inline void spn_watches_notify(struct ofono_sim *sim)
static void sim_spn_set(struct ofono_sim *sim, const void *data, int length,
const unsigned char *dc)
{
DBusConnection *conn = ofono_dbus_get_connection();
const char *path = __ofono_atom_get_path(sim->atom);
g_free(sim->spn);
sim->spn = NULL;
@@ -2611,6 +2618,12 @@ static void sim_spn_set(struct ofono_sim *sim, const void *data, int length,
sim->spn_dc = g_memdup(dc, 1);
notify:
if (sim->spn)
ofono_dbus_signal_property_changed(conn, path,
OFONO_SIM_MANAGER_INTERFACE,
"ServiceProviderName",
DBUS_TYPE_STRING, &sim->spn);
spn_watches_notify(sim);
}