mirror of
https://github.com/sailfishos/ofono
synced 2025-12-01 23:21:04 +08:00
Compare commits
4 Commits
mer/1.17+g
...
mer/1.17+g
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7f007a122 | ||
|
|
5769656848 | ||
|
|
bbc276b4c7 | ||
|
|
4b79de53fe |
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user