sim: Implement ServiceProviderName property

This commit is contained in:
Slava Monich 2016-01-26 17:08:32 +02:00 committed by Denis Kenzior
parent 7d87f8facd
commit 5e4ce76bba
1 changed files with 13 additions and 0 deletions

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);
@ -2551,6 +2555,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;
@ -2592,6 +2599,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);
}