diff options
author | Slava Monich <slava.monich@jolla.com> | 2016-01-26 17:08:32 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2016-01-27 10:42:09 -0600 |
commit | 5e4ce76bba92f66b9a723c8a80efd3713c210652 (patch) | |
tree | 3dd348ae8691c17636e591c510413a1247059400 | |
parent | 7d87f8facd7fb1a5585085b24ec94b12e1d261bf (diff) | |
download | ofono-5e4ce76bba92f66b9a723c8a80efd3713c210652.tar.bz2 |
sim: Implement ServiceProviderName property
-rw-r--r-- | src/sim.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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); } |