sim: new API to check for a UST service only

The existing service check API takes both SST and UST services
and could inadvertently return success on a service if one
(SST or UST) service did not exist. This adds an API specifically
for checking for a UST service, and if the UST dir is not available
it will return FALSE, rather than possibly returning true on some
other SST service.
This commit is contained in:
James Prestwood 2017-10-10 14:36:13 -07:00 committed by Denis Kenzior
parent ee34967a52
commit a8f609727d
2 changed files with 11 additions and 0 deletions

View File

@ -370,6 +370,8 @@ unsigned short __ofono_sms_get_next_ref(struct ofono_sms *sms);
#include <ofono/sim.h>
ofono_bool_t __ofono_sim_ust_service_available(struct ofono_sim *sim,
int ust_service);
ofono_bool_t __ofono_sim_service_available(struct ofono_sim *sim,
int ust_service,
int sst_service);

View File

@ -2289,6 +2289,15 @@ const unsigned char *ofono_sim_get_cphs_service_table(struct ofono_sim *sim)
return sim->cphs_service_table;
}
ofono_bool_t __ofono_sim_ust_service_available(struct ofono_sim *sim,
int ust_service)
{
if (sim->efust)
return sim_ust_is_available(sim->efust, sim->efust_length,
ust_service);
return FALSE;
}
ofono_bool_t __ofono_sim_service_available(struct ofono_sim *sim,
int ust_service,
int sst_service)