diff options
author | Tommi Kenakkala <tommi.kenakkala@tieto.com> | 2015-06-22 16:37:01 +0300 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2015-06-18 14:56:05 -0500 |
commit | eebe2f3ac29ddc75a5961d74f080825ecf8c67c7 (patch) | |
tree | f64c4dc24b03bd71763440aac17cc01cf608c7e8 /src | |
parent | 4677729502fa2dfb7da1d90e1183df71a51066c2 (diff) | |
download | ofono-eebe2f3ac29ddc75a5961d74f080825ecf8c67c7.tar.bz2 |
Emit LockedPins after pin_type is queried
Fixes property change not being emited when hot-swapping a
PIN-enabled card.
Diffstat (limited to 'src')
-rw-r--r-- | src/sim.c | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -2740,6 +2740,10 @@ static void sim_pin_query_cb(const struct ofono_error *error, DBusConnection *conn = ofono_dbus_get_connection(); const char *path = __ofono_atom_get_path(sim->atom); const char *pin_name; + char **locked_pins; + gboolean lock_changed; + + DBG("sim->pin_type: %d, pin_type: %d", sim->pin_type, pin_type); if (error->type != OFONO_ERROR_TYPE_NO_ERROR) { ofono_error("Querying PIN authentication state failed"); @@ -2754,9 +2758,25 @@ static void sim_pin_query_cb(const struct ofono_error *error, password_is_pin(pin_type) == FALSE) pin_type = puk2pin(pin_type); - if (pin_type != OFONO_SIM_PASSWORD_INVALID) + + if (pin_type != OFONO_SIM_PASSWORD_INVALID + && pin_type != OFONO_SIM_PASSWORD_NONE) { + lock_changed = !sim->locked_pins[pin_type]; + sim->locked_pins[pin_type] = TRUE; + if (lock_changed) { + locked_pins = get_locked_pins(sim); + + ofono_dbus_signal_array_property_changed(conn, + path, + OFONO_SIM_MANAGER_INTERFACE, + "LockedPins", DBUS_TYPE_STRING, + &locked_pins); + + g_strfreev(locked_pins); + } + } ofono_dbus_signal_property_changed(conn, path, OFONO_SIM_MANAGER_INTERFACE, "PinRequired", DBUS_TYPE_STRING, |