gboolean sdn_ready;
enum ofono_sim_state state;
enum ofono_sim_password_type pin_type;
- gboolean locked_pins[OFONO_SIM_PASSWORD_INVALID];
+ gboolean locked_pins[OFONO_SIM_PASSWORD_SIM_PUK]; /* Number of PINs */
char **language_prefs;
GQueue *simop_q;
gint simop_source;
int nelem = 0;
char **ret;
- for (i = 0; i < OFONO_SIM_PASSWORD_INVALID; i++) {
+ for (i = 1; i < OFONO_SIM_PASSWORD_SIM_PUK; i++) {
if (sim->locked_pins[i] == FALSE)
continue;
- if (password_is_pin(i) == FALSE)
- continue;
-
nelem += 1;
}
nelem = 0;
- for (i = 0; i < OFONO_SIM_PASSWORD_INVALID; i++) {
+ for (i = 1; i < OFONO_SIM_PASSWORD_SIM_PUK; i++) {
if (sim->locked_pins[i] == FALSE)
continue;
- if (password_is_pin(i) == FALSE)
- continue;
-
ret[nelem] = g_strdup(sim_passwd_name(i));
nelem += 1;
}
type = sim_string_to_passwd(typestr);
+ /* This is used by lock/unlock pin, no puks allowed */
sim->locked_pins[type] = locked;
__ofono_dbus_pending_reply(&sim->pending, reply);
password_is_pin(pin_type) == FALSE)
pin_type = puk2pin(pin_type);
- sim->locked_pins[pin_type] = TRUE;
+ if (pin_type != OFONO_SIM_PASSWORD_INVALID)
+ sim->locked_pins[pin_type] = TRUE;
ofono_dbus_signal_property_changed(conn, path,
OFONO_SIM_MANAGER_INTERFACE,