From 88d499d96e29563cb200222f92650380b1db99bb Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 17 Dec 2010 15:59:53 -0600 Subject: call-forwarding: Get rid of cfis_indicator There's no need to track this information, since if we pick a record with cfis_indicator for something besides Voice only, then when we set the record again, the number we set is no longer applicable to those services. --- src/call-forwarding.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/call-forwarding.c') diff --git a/src/call-forwarding.c b/src/call-forwarding.c index ccbd7596..ce58de65 100644 --- a/src/call-forwarding.c +++ b/src/call-forwarding.c @@ -61,7 +61,6 @@ struct ofono_call_forwarding { struct cf_ss_request *ss_req; struct ofono_sim *sim; unsigned char cfis_record_id; - unsigned char cfis_indicator; ofono_bool_t cphs_cff_present; ofono_bool_t status_on_sim; struct ofono_ussd *ussd; @@ -257,15 +256,18 @@ static void sim_set_cf_indicator(struct ofono_call_forwarding *cf) number_len = strlen(cond->phone_number.number); /* CFU indicator Status - Voice */ - data[1] = (cf->cfis_indicator |= 0x01); + data[1] = 0x01; number_len = (number_len + 1) / 2; data[2] = number_len + 1; data[3] = cond->phone_number.type; sim_encode_bcd_number(cond->phone_number.number, data + 4); - } else - data[1] = (cf->cfis_indicator &= 0xFE); + } else { + data[1] = 0x00; + data[2] = 1; + data[3] = 128; + } ofono_sim_write(cf->sim, SIM_EFCFIS_FILEID, sim_cfis_update_cb, @@ -1228,7 +1230,6 @@ static void sim_cfis_read_cb(int ok, int total_length, int record, const char *path = __ofono_atom_get_path(cf->atom); if (!ok || record_length < 16 || total_length < record_length) { - cf->cfis_indicator = 0; cf->cfis_record_id = 0; return; } @@ -1242,14 +1243,11 @@ static void sim_cfis_read_cb(int ok, int total_length, int record, cf->cfis_record_id = record; - /* CFU indicator status */ - cf->cfis_indicator = data[1]; - /* * For now we only support Voice, although Fax & all Data * basic services are applicable as well. */ - if (cf->cfis_indicator & 0x01) { + if (data[1] & 0x01) { int ton_npi; int number_len; const char *number; -- cgit v1.2.3