Languages

Menu
Sites
Language
Mdm APIs not working

I am trying to use public APIs in my Tizen Native Application for wearable. I have tried Call API and GPS API but they are giving error. 

1. Disable call outgoing :// Call MDM APIs to get/set policy
if (mdm_get_service() == MDM_RESULT_SUCCESS) {
mdm_data_t *lp_data = mdm_get_outgoing_call_restriction(FALSE);
if (lp_data) {
char * temp = (char *)lp_data->data; 
_DEBUG_LOG("data : %s", temp);                // this prints 'null '
mdm_free_data(lp_data);
}
ret = mdm_set_outgoing_call_restriction(".*");
if (ret != MDM_RESULT_SUCCESS) {
_DEBUG_LOG("Fail to set call restriction!\n ");               // ret =MDM_RESULT_FAIL
} else {
_DEBUG_LOG("Success to set outgoing call restriction!\n");
}


2.  GPS enable/disable
policy_status = mdm_is_gps_on();
if (policy_status < 0) {
_DEBUG_LOG("Fail to get gps status.\n");
} else {
_DEBUG_LOG("gps on: %d\n",policy_status); // return '0'
}
if ( start ) {
ret = mdm_start_gps(FALSE);
if (ret != MDM_RESULT_SUCCESS) {
_DEBUG_LOG("Fail to control gps!%s\n", get_error_message(ret));         // ret =MDM_RESULT_FAIL
} else {
_DEBUG_LOG("Success to turn on!\n");
}

Note : I have included the below privileges in manifest :

        <privilege>http://developer.samsung.com/tizen/privilege/mdm.misc</privilege>
        <privilege>http://developer.samsung.com/tizen/privilege/mdm.application</privilege>
        <privilege>http://developer.samsung.com/tizen/privilege/mdm.device</privilege>
        <privilege>http://developer.samsung.com/tizen/privilege/mdm.phonerestriction</privilege>
        <privilege>http://developer.samsung.com/tizen/privilege/mdm.bluetooth</privilege>
        <privilege>http://developer.samsung.com/tizen/privilege/mdm.restriction</privilege>
        <privilege>http://developer.samsung.com/tizen/privilege/mdm.admin</privilege>
        <privilege>http://developer.samsung.com/tizen/privilege/mdm.apn</privilege>
        <privilege>http://developer.samsung.com/tizen/privilege/mdm.firewall</privilege>
        <privilege>http://developer.samsung.com/tizen/privilege/mdm.security</privilege>
        <privilege>http://developer.samsung.com/tizen/privilege/knox.attestation</privilege>
        <privilege>http://developer.samsung.com/tizen/privilege/mdm.wifi</privilege>
        <privilege>http://developer.samsung.com/tizen/privilege/mdm.password</privilege>

I have checked with feature support APIs that I have features GPS and Call supported on my Samsung Galaxy watch , Tizen 4.0

Please guide if I am missing some point in calling the API.