}
}
+static gint __convert_sim_facility_type(enum tel_sim_facility_type type)
+{
+ gint f_type = 0;
+
+ switch (type) {
+ case SIM_FACILITY_PS:
+ f_type = 1;
+ break;
+
+ case SIM_FACILITY_SC:
+ f_type = 3;
+ break;
+
+ case SIM_FACILITY_FD:
+ f_type = 4;
+ break;
+
+ case SIM_FACILITY_PN:
+ f_type = 5;
+ break;
+
+ case SIM_FACILITY_PU:
+ f_type = 6;
+ break;
+
+ case SIM_FACILITY_PP:
+ f_type = 7;
+ break;
+
+ case SIM_FACILITY_PC:
+ f_type = 8;
+ break;
+
+ default:
+ err("Unhandled/Unknown Facility type: [0x%x]", type);
+ break;
+ }
+
+ return f_type;
+}
+
static gboolean on_sim_get_init_status(TelephonySim *sim,
GDBusMethodInvocation *invocation, gpointer user_data)
{
FAIL_RESPONSE(invocation, DBUS_SIM_RESPONSE_DATA_ERROR);
} else {
dbg("[%s] IMSI - PLMN: [%s] MSIN: [%cX%cX%cX%cX%cX]", GET_CP_NAME(invocation),
- imsi->plmn, imsi->msin[0],imsi->msin[2],imsi->msin[4],imsi->msin[6],imsi->msin[8]);
+ imsi->plmn, imsi->msin[0], imsi->msin[2], imsi->msin[4], imsi->msin[6], imsi->msin[8]);
telephony_sim_complete_get_imsi(sim,
invocation, imsi->plmn, imsi->msin);
req.cf.cfu_status = cfu_status;
req.cf.ton = ton;
req.cf.npi = npi;
- memcpy(&req.cf.cfu_num, number, (strlen(number) <= SIM_XDN_NUMBER_LEN_MAX ? strlen(number): SIM_XDN_NUMBER_LEN_MAX));
+ memcpy(&req.cf.cfu_num, number, (strlen(number) <= SIM_XDN_NUMBER_LEN_MAX ? strlen(number) : SIM_XDN_NUMBER_LEN_MAX));
req.cf.cc2_id = cc2_id;
req.cf.ext7_id = ext7_id;
req.mb_info.profile_number = profile_number;
req.mb_info.number_info.alpha_id_max_len = alpha_id_max_len;
if (strlen(alpha_id))
- memcpy(&req.mb_info.number_info.alpha_id, alpha_id, (strlen(alpha_id) <= SIM_XDN_ALPHA_ID_LEN_MAX ? strlen(alpha_id): SIM_XDN_ALPHA_ID_LEN_MAX));
+ memcpy(&req.mb_info.number_info.alpha_id, alpha_id, (strlen(alpha_id) <= SIM_XDN_ALPHA_ID_LEN_MAX ? strlen(alpha_id) : SIM_XDN_ALPHA_ID_LEN_MAX));
req.mb_info.number_info.ton = ton;
req.mb_info.number_info.npi = npi;
if (strlen(number))
- memcpy(&req.mb_info.number_info.num, number, (strlen(number) <= SIM_XDN_NUMBER_LEN_MAX ? strlen(number): SIM_XDN_NUMBER_LEN_MAX));
+ memcpy(&req.mb_info.number_info.num, number, (strlen(number) <= SIM_XDN_NUMBER_LEN_MAX ? strlen(number) : SIM_XDN_NUMBER_LEN_MAX));
req.mb_info.number_info.cc_id = cc_id;
req.mb_info.number_info.ext1_id = ext1_id;
memset(&req, 0x0, sizeof(struct treq_sim_verify_pins));
req.pin_type = pin_type;
- req.pin_length = (strlen(pin) <= SIM_PIN_LEN_MAX)? strlen(pin): SIM_PIN_LEN_MAX;
+ req.pin_length = (strlen(pin) <= SIM_PIN_LEN_MAX) ? strlen(pin) : SIM_PIN_LEN_MAX;
memcpy(req.pin, pin, req.pin_length);
dbg("[%s] PIN - type: [0x%02x] len: [%d]",
memset(&req, 0x0, sizeof(struct treq_sim_verify_puks));
req.puk_type = puk_type;
- req.puk_length = (strlen(puk) <= SIM_PIN_LEN_MAX)?strlen(puk):SIM_PIN_LEN_MAX;
+ req.puk_length = (strlen(puk) <= SIM_PIN_LEN_MAX) ? strlen(puk) : SIM_PIN_LEN_MAX;
memcpy(req.puk, puk, req.puk_length);
- req.pin_length = (strlen(new_pin) <= SIM_PIN_LEN_MAX)?strlen(new_pin):SIM_PIN_LEN_MAX;
+ req.pin_length = (strlen(new_pin) <= SIM_PIN_LEN_MAX) ? strlen(new_pin) : SIM_PIN_LEN_MAX;
memcpy(req.pin, new_pin, req.pin_length);
dbg("[%s] PUK - type: [0x%02x] len: [%d] PIN len: [%d]",
memset(&req, 0x0, sizeof(struct treq_sim_change_pins));
req.type = pin_type;
- req.old_pin_length = (strlen(old_pin) <= SIM_PIN_LEN_MAX) ? strlen(old_pin): SIM_PIN_LEN_MAX;
+ req.old_pin_length = (strlen(old_pin) <= SIM_PIN_LEN_MAX) ? strlen(old_pin) : SIM_PIN_LEN_MAX;
memcpy(req.old_pin, old_pin, req.old_pin_length);
- req.new_pin_length = (strlen(new_pin) <= SIM_PIN_LEN_MAX)? strlen(new_pin): SIM_PIN_LEN_MAX;
+ req.new_pin_length = (strlen(new_pin) <= SIM_PIN_LEN_MAX) ? strlen(new_pin) : SIM_PIN_LEN_MAX;
memcpy(req.new_pin, new_pin, req.new_pin_length);
dbg("[%s] PIN - type: [0x%02x] Old PIN len: [%d] New PIN len: [%d]",
return TRUE;
}
- req.password_length = (strlen(password) <= SIM_FACILITY_PW_LEN_MAX) ? strlen(password): SIM_FACILITY_PW_LEN_MAX;
+ req.password_length = (strlen(password) <= SIM_FACILITY_PW_LEN_MAX) ? strlen(password) : SIM_FACILITY_PW_LEN_MAX;
memcpy(req.password, password, req.password_length);
dbg("[%s] Facility - type: [0x%02x] Passowrd len: [%d]",
return TRUE;
}
- req.password_length = (strlen(password) <= SIM_FACILITY_PW_LEN_MAX) ? strlen(password): SIM_FACILITY_PW_LEN_MAX;
+ req.password_length = (strlen(password) <= SIM_FACILITY_PW_LEN_MAX) ? strlen(password) : SIM_FACILITY_PW_LEN_MAX;
memcpy(req.password, password, req.password_length);
dbg("[%s] Facility - type: [0x%02x] Passowrd len: [%d]",
memset(&req, 0x0, sizeof(struct treq_sim_access_rsim_io));
req.field = field;
- req.rec_index= rec_index;
+ req.rec_index = rec_index;
inner_gv = g_variant_get_variant(rsimio);
cpname, (resp_dis_facility->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
resp_dis_facility->type, resp_dis_facility->retry_count);
- switch (resp_dis_facility->type) {
- case SIM_FACILITY_PS:
- f_type = 1;
- break;
-
- case SIM_FACILITY_SC:
- f_type = 3;
- break;
-
- case SIM_FACILITY_FD:
- f_type = 4;
- break;
-
- case SIM_FACILITY_PN:
- f_type = 5;
- break;
-
- case SIM_FACILITY_PU:
- f_type = 6;
- break;
-
- case SIM_FACILITY_PP:
- f_type = 7;
- break;
-
- case SIM_FACILITY_PC:
- f_type = 8;
- break;
-
- default:
- err("Unhandled/Unknown Facility type: [0x%x]", resp_dis_facility->type);
- break;
- }
+ f_type = __convert_sim_facility_type(resp_dis_facility->type);
telephony_sim_complete_disable_facility(dbus_info->interface_object,
dbus_info->invocation, resp_dis_facility->result,
cpname, (resp_en_facility->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
resp_en_facility->type, resp_en_facility->retry_count);
- switch (resp_en_facility->type) {
- case SIM_FACILITY_PS:
- f_type = 1;
- break;
-
- case SIM_FACILITY_SC:
- f_type = 3;
- break;
-
- case SIM_FACILITY_FD:
- f_type = 4;
- break;
-
- case SIM_FACILITY_PN:
- f_type = 5;
- break;
-
- case SIM_FACILITY_PU:
- f_type = 6;
- break;
-
- case SIM_FACILITY_PP:
- f_type = 7;
- break;
-
- case SIM_FACILITY_PC:
- f_type = 8;
- break;
-
- default:
- err("Unhandled/Unknown Facility type: [0x%x]", resp_en_facility->type);
- break;
- }
+ f_type = __convert_sim_facility_type(resp_en_facility->type);
telephony_sim_complete_enable_facility(dbus_info->interface_object,
dbus_info->invocation, resp_en_facility->result,
resp_get_facility->type,
(resp_get_facility->b_enable ? "Yes" : "No"));
- switch (resp_get_facility->type) {
- case SIM_FACILITY_PS:
- f_type = 1;
- break;
-
- case SIM_FACILITY_SC:
- f_type = 3;
- break;
-
- case SIM_FACILITY_FD:
- f_type = 4;
- break;
-
- case SIM_FACILITY_PN:
- f_type = 5;
- break;
-
- case SIM_FACILITY_PU:
- f_type = 6;
- break;
-
- case SIM_FACILITY_PP:
- f_type = 7;
- break;
-
- case SIM_FACILITY_PC:
- f_type = 8;
- break;
-
- default:
- err("Unhandled/Unknown Facility type: [0x%x]", resp_get_facility->type);
- break;
- }
+ f_type = __convert_sim_facility_type(resp_get_facility->type);
telephony_sim_complete_get_facility(dbus_info->interface_object,
dbus_info->invocation, resp_get_facility->result,
cpname, (resp_lock->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
resp_lock->type, resp_lock->retry_count);
- switch (resp_lock->type) {
- case SIM_FACILITY_PS:
- f_type = 1;
- break;
-
- case SIM_FACILITY_SC:
- f_type = 3;
- break;
-
- case SIM_FACILITY_FD:
- f_type = 4;
- break;
-
- case SIM_FACILITY_PN:
- f_type = 5;
- break;
-
- case SIM_FACILITY_PU:
- f_type = 6;
- break;
-
- case SIM_FACILITY_PP:
- f_type = 7;
- break;
-
- case SIM_FACILITY_PC:
- f_type = 8;
- break;
-
- default:
- err("Unhandled/Unknown Lock type: [0x%x]", resp_lock->type);
- break;
- }
+ f_type = __convert_sim_facility_type(resp_lock->type);
telephony_sim_complete_get_lock_info(dbus_info->interface_object,
dbus_info->invocation, resp_lock->result,