Knox Tizen Wearable SDK
phone_restriction.h
1 /*
2  * Copyright (c) 2000-2017 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * PROPRIETARY/CONFIDENTIAL
5  *
6  * This software is the confidential and proprietary information of
7  * SAMSUNG ELECTRONICS ("Confidential Information").
8  * You shall not disclose such Confidential Information and shall
9  * use it only in accordance with the terms of the license agreement
10  * you entered into with SAMSUNG ELECTRONICS.
11  * SAMSUNG make no representations or warranties about the suitability
12  * of the software, either express or implied, including but not
13  * limited to the implied warranties of merchantability, fitness for
14  * a particular purpose, or non-infringement.
15  * SAMSUNG shall not be liable for any damages suffered by licensee as
16  * a result of using, modifying or distributing this software or its derivatives.
17  */
18 
19 #ifndef LIBMDM_MDM_PHONE_RESTRICTION_H
20 #define LIBMDM_MDM_PHONE_RESTRICTION_H
21 
22 #include <time.h>
23 
24 #include "mdm_client_type.h"
25 #include "device_inventory.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 
42 typedef enum {
44  0x00000000,
46  0x00000001,
48  0x00000002
50 
57 typedef enum {
59  0x00000000,
61  0x00000001,
63  0x00000002
65 
72 typedef enum {
77 
114 
156 
189 
222 
253 
284 
315 
346 
347 /*
348  * @brief API to get the allowed pattern for incoming Call
349  *
350  * @since_mdm 1.1.0
351  *
352  * @since_tizen 2.3.2.3
353  *
354  * @feature %http://developer.samsung.com/tizen/feature/mdm
355  *
356  * @par Usage:
357  * Admin can use this API to retrieve the current pattern being used to allowed incoming Call.
358  *
359  * @code{.c}
360  lp_data = mdm_msim_get_sim_ids();
361  if (lp_data && lp_data->data) {
362  GList *sim_ids_list = g_list_first(lp_data->data);
363  for(; sim_ids_list; sim_ids_list = g_list_next(sim_ids_list)){
364  mdm_data_t *lp_data = mdm_msim_get_allowed_incoming_call(sim_ids_list->data, FALSE);
365  if (lp_data) {
366  printf("data : %s", (char *)lp_data->data);
367  mdm_free_data(lp_data);
368  }
369  }
370  }
371  *
372  * @endcode
373  *
374  * @param[in] simid Sim identifier
375  * @param[in] n_all_admin True to get a composition of all allows from all admins, false to get a allows pattern from
376  the calling admin
377  *
378  * @return #mdm_data_t * on success, NULL on error
379  *
380  * @see mdm_msim_add_allowed_incoming_call
381  *
382  */
383 mdm_data_t *mdm_msim_get_allowed_incoming_call(const char *simid, int n_all_admin);
384 
385 /*
386  * @brief API to get the allowed pattern for outgoing calls.
387  *
388  * @since_mdm 1.1.0
389  *
390  * @since_tizen 2.3.2.3
391  *
392  * @feature %http://developer.samsung.com/tizen/feature/mdm
393  *
394  * @par Usage:
395  * Admin can use this API to retrieve the current pattern being used to allowed outgoing Call.
396  *
397  * @code{.c}
398  lp_data = mdm_msim_get_sim_ids();
399  if (lp_data && lp_data->data) {
400  GList *sim_ids_list = g_list_first(lp_data->data);
401  for(; sim_ids_list; sim_ids_list = g_list_next(sim_ids_list)){
402  mdm_data_t *lp_data = mdm_msim_get_allowed_outgoing_call(sim_ids_list->data, FALSE);
403  if (lp_data) {
404  printf("data : %s", (char *)lp_data->data);
405  mdm_free_data(lp_data);
406  }
407  }
408  }
409  *
410  * @endcode
411  *
412  * @param[in] simid Sim card id
413  * @param[in] n_all_admin True to get a composition of all allows from all admins, false to get a allows pattern from
414  the calling admin
415  *
416  * @return #mdm_data_t * on success, NULL on error
417  *
418  * @see mdm_msim_add_allowed_outgoing_call
419  *
420  */
421 mdm_data_t *mdm_msim_get_allowed_outgoing_call(const char *simid, int n_all_admin);
422 
423 /*
424  * @brief API to get the allowed pattern for incoming SMS.
425  *
426  * @since_mdm 1.1.0
427  *
428  * @since_tizen 2.3.2.3
429  *
430  * @feature %http://developer.samsung.com/tizen/feature/mdm
431  *
432  * @par Usage:
433  * Admin can use this API to retrieve the current pattern being used to allowed incoming SMS.
434  *
435  * @code{.c}
436  lp_data = mdm_msim_get_sim_ids();
437  if (lp_data && lp_data->data) {
438  GList *sim_ids_list = g_list_first(lp_data->data);
439  for(; sim_ids_list; sim_ids_list = g_list_next(sim_ids_list)){
440  mdm_data_t *lp_data = mdm_msim_get_allowed_incoming_sms(sim_ids_list->data, FALSE);
441  if (lp_data) {
442  printf("data : %s", (char *)lp_data->data);
443  mdm_free_data(lp_data);
444  }
445  }
446  }
447  *
448  * @endcode
449  * @param[in] simid Sim card id
450  * @param[in] n_all_admin True to get a composition of all allows from all admins, false to get a allows pattern from
451  the calling admin.
452  *
453  * @return #mdm_data_t * on success, NULL on error
454  *
455  * @see mdm_msim_add_allowed_incoming_sms
456  *
457  */
458 mdm_data_t *mdm_msim_get_allowed_incoming_sms(const char *simid, int n_all_admin);
459 
460 /*
461  * @brief API to get the allowed pattern for outgoing SMS
462  *
463  * @since_mdm 1.1.0
464  *
465  * @since_tizen 2.3.2.3
466  *
467  * @feature %http://developer.samsung.com/tizen/feature/mdm
468  *
469  * @par Usage:
470  * Admin can use this API to retrieve the current pattern being used to allowed outgoing SMS.
471  *
472  * @code{.c}
473  lp_data = mdm_msim_get_sim_ids();
474  if (lp_data && lp_data->data) {
475  GList *sim_ids_list = g_list_first(lp_data->data);
476  for(; sim_ids_list; sim_ids_list = g_list_next(sim_ids_list)){
477  mdm_data_t *lp_data = mdm_msim_get_allowed_outgoing_sms(sim_ids_list->data, FALSE);
478  if (lp_data) {
479  printf("data : %s", (char *)lp_data->data);
480  mdm_free_data(lp_data);
481  }
482  }
483  }
484  *
485  * @endcode
486  *
487  * @param[in] simid Sim card id
488  * @param[in] n_all_admin True to get a composition of all allows from all admins, false to get a allows pattern from
489  the calling admin.
490  *
491  * @return #mdm_data_t * on success, NULL on error
492  *
493  * @see mdm_msim_add_allowed_outgoing_sms
494  *
495  */
496 mdm_data_t *mdm_msim_get_allowed_outgoing_sms(const char *simid, int n_all_admin);
497 
557 mdm_result_t mdm_get_limit_of_data_calls(time_t *p_date_set, time_t *p_period, size_t *p_send_limit,
558  size_t *p_recv_limit);
559 
599 
639 mdm_result_t mdm_get_limit_of_incoming_sms(mdm_sms_limit_t type, unsigned int *p_value);
640 
680 
719 mdm_result_t mdm_get_limit_of_outgoing_sms(mdm_sms_limit_t type, unsigned int *p_value);
720 
764 
809 
869 
912 
957 
1002 
1047 
1092 
1093 /*
1094  * @brief API to add a restriction pattern to the admin restriction pattern set for incoming calls
1095  *
1096  * @since_mdm 1.0.0
1097  *
1098  * @since_tizen 2.3.2.3
1099  *
1100  * @feature %http://developer.samsung.com/tizen/feature/mdm
1101  *
1102  * @par Usage:
1103  * This API adds (concatenates) the provided allowed pattern to the allowed pattern set of the admin for incoming calls.
1104  *
1105  * @code{.c}
1106  // previous patterns will remain and the new pattern will be added
1107  lp_data = mdm_msim_get_sim_ids();
1108  if (lp_data && lp_data->data) {
1109  GList *sim_ids_list = g_list_first(lp_data->data);
1110  for(; sim_ids_list; sim_ids_list = g_list_next(sim_ids_list)){
1111  mdm_result_t ret = mdm_msim_add_allowed_incoming_call(sim_ids_list->data, ".*");
1112  if (ret != MDM_RESULT_SUCCESS) {
1113  // function error
1114  } else {
1115  // function success
1116  }
1117  }
1118  }
1119  *
1120  * @endcode
1121  *
1122  * @privlevel public
1123  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
1124  *
1125  * @param[in] id SIM card id
1126  * @param[in] p_pattern The allowed pattern to be matched against the incoming call number
1127  *
1128  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
1129  *
1130  * @retval #MDM_RESULT_SUCCESS Successful
1131  * @retval #MDM_RESULT_FAIL General failure
1132  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1133  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1134  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1135  *
1136  * @par Permission:
1137  * Usage of this API is restricted to registered clients only.
1138  *
1139  * @see mdm_msim_remove_allowed_incoming_call
1140  *
1141  */
1142 mdm_result_t mdm_msim_add_allowed_incoming_call(const char *id, const char *p_pattern);
1143 
1144 /*
1145  * @brief API to add a restriction pattern to the admin restriction pattern set for incoming calls
1146  *
1147  * @since_mdm 1.1.0
1148  *
1149  * @since_tizen 2.3.2.3
1150  *
1151  * @feature %http://developer.samsung.com/tizen/feature/mdm
1152  *
1153  * @par Usage:
1154  * This API adds (concatenates) the provided allowed pattern to the allowed pattern set of the admin for incoming calls.
1155  *
1156  * @code{.c}
1157  // previous patterns will remain and the new pattern will be added
1158  lp_data = mdm_msim_get_sim_ids();
1159  if (lp_data && lp_data->data) {
1160  GList *sim_ids_list = g_list_first(lp_data->data);
1161  for(; sim_ids_list; sim_ids_list = g_list_next(sim_ids_list)){
1162  mdm_result_t ret = mdm_msim_add_allowed_outgoing_call(sim_ids_list->data, ".*");
1163  if (ret != MDM_RESULT_SUCCESS) {
1164  // function error
1165  } else {
1166  // function success
1167  }
1168  }
1169  }
1170  *
1171  * @endcode
1172  *
1173  * @privlevel public
1174  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
1175  *
1176  * @param[in] id SIM card id
1177  * @param[in] p_pattern The allowed pattern to be matched against the incoming call number
1178  *
1179  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
1180  *
1181  * @retval #MDM_RESULT_SUCCESS Successful
1182  * @retval #MDM_RESULT_FAIL General failure
1183  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1184  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1185  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1186  *
1187  * @par Permission:
1188  * Usage of this API is restricted to registered clients only.
1189  *
1190  * @see mdm_msim_remove_allowed_outgoing_call
1191  *
1192  */
1193 mdm_result_t mdm_msim_add_allowed_outgoing_call(const char *id, const char *p_pattern);
1194 
1195 /*
1196  * @brief API to add a restriction pattern to the admin restriction pattern set for incoming calls
1197  *
1198  * @since_mdm 1.1.0
1199  *
1200  * @since_tizen 2.3.2.3
1201  *
1202  * @feature %http://developer.samsung.com/tizen/feature/mdm
1203  *
1204  * @par Usage:
1205  * This API adds (concatenates) the provided allowed pattern to the allowed pattern set of the admin for incoming calls.
1206  *
1207  * @code{.c}
1208  // previous patterns will remain and the new pattern will be added
1209  lp_data = mdm_msim_get_sim_ids();
1210  if (lp_data && lp_data->data) {
1211  GList *sim_ids_list = g_list_first(lp_data->data);
1212  for(; sim_ids_list; sim_ids_list = g_list_next(sim_ids_list)){
1213  mdm_result_t ret = mdm_msim_add_allowed_incoming_sms(sim_ids_list->data, ".*");
1214  if (ret != MDM_RESULT_SUCCESS) {
1215  // function error
1216  } else {
1217  // function success
1218  }
1219  }
1220  }
1221  *
1222  * @endcode
1223  *
1224  * @privlevel public
1225  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
1226  *
1227  * @param[in] id SIM card id
1228  * @param[in] p_pattern The allowed pattern to be matched against the incoming call number
1229  *
1230  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
1231  *
1232  * @retval #MDM_RESULT_SUCCESS Successful
1233  * @retval #MDM_RESULT_FAIL General failure
1234  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1235  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1236  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1237  *
1238  * @par Permission:
1239  * Usage of this API is restricted to registered clients only.
1240  *
1241  * @see mdm_msim_remove_allowed_outgoing_call
1242  *
1243  */
1244 mdm_result_t mdm_msim_add_allowed_incoming_sms(const char *id, const char *p_pattern);
1245 
1246 /*
1247  * @brief API to add a restriction pattern to the admin restriction pattern set for incoming calls
1248  *
1249  * @since_mdm 1.1.0
1250  *
1251  * @since_tizen 2.3.2.3
1252  *
1253  * @feature %http://developer.samsung.com/tizen/feature/mdm
1254  *
1255  * @par Usage:
1256  * This API adds (concatenates) the provided allowed pattern to the allowed pattern set of the admin for incoming calls.
1257  *
1258  * @code{.c}
1259  // previous patterns will remain and the new pattern will be added
1260  lp_data = mdm_msim_get_sim_ids();
1261  if (lp_data && lp_data->data) {
1262  GList *sim_ids_list = g_list_first(lp_data->data);
1263  for(; sim_ids_list; sim_ids_list = g_list_next(sim_ids_list)){
1264  mdm_result_t ret = mdm_msim_add_allowed_outgoing_sms(sim_ids_list->data, ".*");
1265  if (ret != MDM_RESULT_SUCCESS) {
1266  // function error
1267  } else {
1268  // function success
1269  }
1270  }
1271  }
1272  *
1273  * @endcode
1274  *
1275  * @privlevel public
1276  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
1277  *
1278  * @param[in] id SIM card id
1279  * @param[in] p_pattern The allowed pattern to be matched against the incoming call number
1280  *
1281  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
1282  *
1283  * @retval #MDM_RESULT_SUCCESS Successful
1284  * @retval #MDM_RESULT_FAIL General failure
1285  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1286  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1287  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1288  *
1289  * @par Permission:
1290  * Usage of this API is restricted to registered clients only.
1291  *
1292  * @see mdm_msim_remove_allowed_outgoing_call
1293  *
1294  */
1295 mdm_result_t mdm_msim_add_allowed_outgoing_sms(const char *id, const char *p_pattern);
1296 
1337 
1378 
1419 
1460 
1502 
1503 /*
1504  * @brief API to check if phone number is restricted in sms/call/data
1505  *
1506  * @since_mdm 1.1.0
1507  *
1508  * @since_tizen 2.3.2.3
1509  *
1510  * @feature %http://developer.samsung.com/tizen/feature/mdm
1511  *
1512  * @par Usage:
1513  * This method checks if phone number is on white list and if not then on black list.
1514  *
1515  * @code{.c}
1516  * lp_data = mdm_msim_get_sim_ids();
1517  if (lp_data && lp_data->data) {
1518  GList *sim_ids_list = g_list_first(lp_data->data);
1519  for(; sim_ids_list; sim_ids_list = g_list_next(sim_ids_list)){
1520  mdm_status_t ret = mdm_msim_is_number_restricted(sim_ids_list->data, MDM_DIRECTION_INCOMING,
1521  MDM_CALL_TYPE_SMS, "666000666");
1522  if (ret == MDM_ENABLED) {
1523  // enabled
1524  } else {
1525  // disabled
1526  }
1527  }
1528  *
1529  * @endcode
1530  *
1531  * @privlevel public
1532  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
1533  *
1534  * @param[in] sim_id Sim identifier
1535  * @param[in] direction @see mdm_direction_t
1536  * @param[in] call_type @see mdm_call_type_t
1537  * @param[in] msisdn phone number to check
1538  *
1539  * @return #mdm_status_t : Whether phone number is restricred
1540  *
1541  * @retval #MDM_RESTRICTED Phone number is restricted
1542  * @retval #MDM_ALLOWED Phone number is allowed
1543  * @retval #MDM_STATUS_ERROR On Fail
1544  *
1545  * @par Permission:
1546  * Usage of this API is restricted to registered clients only.
1547  *
1548  * @see
1549  *
1550  */
1551 mdm_status_t mdm_msim_is_number_restricted(const char *sim_id, mdm_direction_t direction, mdm_call_type_t call_type,
1552  const char *msisdn);
1553 
1595 
1636 
1679 
1722 
1788 mdm_result_t mdm_set_limit_of_data_calls(time_t period, size_t sent_limit, size_t recv_limit);
1789 
1835 mdm_result_t mdm_set_limit_of_incoming_calls(unsigned int limitbyday, unsigned int limitbyweek,
1836  unsigned int limitbymonth);
1837 
1883 mdm_result_t mdm_set_limit_of_incoming_sms(unsigned int limitbyday, unsigned int limitbyweek,
1884  unsigned int limitbymonth);
1885 
1931 mdm_result_t mdm_set_limit_of_outgoing_calls(unsigned int limitbyday, unsigned int limitbyweek,
1932  unsigned int limitbymonth);
1933 
1979 mdm_result_t mdm_set_limit_of_outgoing_sms(unsigned int limitbyday, unsigned int limitbyweek,
1980  unsigned int limitbymonth);
1981 
2024 
2067 
2068 /* For dual sim begin */
2069 
2070 /*
2071  * @brief API to add a restriction pattern to the admin restriction pattern set for incoming calls
2072  *
2073  * @since_mdm 1.1.0
2074  *
2075  * @since_tizen 2.3.2.3
2076  *
2077  * @feature %http://developer.samsung.com/tizen/feature/mdm
2078  *
2079  * @par Usage:
2080  * This API adds (concatenates) the provided restriction pattern to the restriction pattern set of the admin for
2081  incoming calls.
2082  *
2083  * @code{.c}
2084  // previous patterns will remain and the new pattern will be added
2085  mdm_result_t ret = mdm_msim_add_incoming_call_restriction("SIM1", ".*");
2086  if (ret != MDM_RESULT_SUCCESS) {
2087  // function error
2088  } else {
2089  // function success
2090  }
2091  *
2092  * @endcode
2093  *
2094  * @privlevel public
2095  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2096  *
2097  * @param[in] id Id that pattern is applied for.
2098  * @param[in] p_pattern The restriction pattern to be matched against the incoming call number.
2099  *
2100  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2101  *
2102  * @retval #MDM_RESULT_SUCCESS Successful
2103  * @retval #MDM_RESULT_FAIL General failure
2104  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2105  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2106  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2107  *
2108  * @par Permission:
2109  * Usage of this API is restricted to registered clients only.
2110  *
2111  * @see mdm_msim_remove_incoming_call_restriction
2112  *
2113  */
2114 mdm_result_t mdm_msim_add_incoming_call_restriction(const char *id, char *p_pattern);
2115 
2116 /*
2117  * @brief API to add a restriction pattern to the admin restriction pattern set for incoming SMSs
2118  *
2119  * @since_mdm 1.1.0
2120  *
2121  * @since_tizen 2.3.2.3
2122  *
2123  * @feature %http://developer.samsung.com/tizen/feature/mdm
2124  *
2125  * @par Usage:
2126  * This API adds (concatenates) the provided restriction pattern to the restriction pattern set of the admin for
2127  incoming SMSs.
2128  *
2129  * @code{.c}
2130  // previous patterns will remain and the new pattern will be added
2131  mdm_result_t ret = mdm_msim_add_incoming_sms_restriction("SIM1", ".*");
2132  if (ret != MDM_RESULT_SUCCESS) {
2133  // function error
2134  } else {
2135  // function success
2136  }
2137  *
2138  * @endcode
2139  *
2140  * @privlevel public
2141  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2142  *
2143  * @param[in] id Id that pattern is applied for.
2144  * @param[in] p_pattern The restriction pattern to be matched against the incoming sms number.
2145  *
2146  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2147  *
2148  * @retval #MDM_RESULT_SUCCESS Successful
2149  * @retval #MDM_RESULT_FAIL General failure
2150  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2151  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2152  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2153  *
2154  * @par Permission:
2155  * Usage of this API is restricted to registered clients only.
2156  *
2157  * @see mdm_msim_remove_incoming_sms_restriction
2158  *
2159  */
2160 mdm_result_t mdm_msim_add_incoming_sms_restriction(const char *id, char *p_pattern);
2161 
2162 /*
2163  * @brief API to add a restriction pattern to the admin restriction pattern set for outgoing calls
2164  *
2165  * @since_mdm 1.1.0
2166  *
2167  * @since_tizen 2.3.2.3
2168  *
2169  * @feature %http://developer.samsung.com/tizen/feature/mdm
2170  *
2171  * @par Usage:
2172  * This API adds (concatenates) the provided restriction pattern to the restriction pattern set of the admin for
2173  outgoing calls.
2174  *
2175  * @code{.c}
2176  // previous patterns will remain and the new pattern will be added
2177  mdm_result_t ret = mdm_msim_add_outgoing_call_restriction("SIM1", ".*");
2178  if (ret != MDM_RESULT_SUCCESS) {
2179  // function error
2180  } else {
2181  // function success
2182  }
2183  *
2184  * @endcode
2185  *
2186  * @privlevel public
2187  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2188  *
2189  * @param[in] id Id that pattern is applied for.
2190  * @param[in] p_pattern The restriction pattern to be matched against the outgoing call number.
2191  *
2192  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2193  *
2194  * @retval #MDM_RESULT_SUCCESS Successful
2195  * @retval #MDM_RESULT_FAIL General failure
2196  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2197  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2198  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2199  *
2200  * @par Permission:
2201  * Usage of this API is restricted to registered clients only.
2202  *
2203  * @see mdm_msim_remove_outgoing_call_restriction
2204  *
2205  */
2206 mdm_result_t mdm_msim_add_outgoing_call_restriction(const char *id, char *p_pattern);
2207 
2208 /*
2209  * @brief API to add a restriction pattern to the admin restriction pattern set for outgoing SMSs
2210  *
2211  * @since_mdm 1.1.0
2212  *
2213  * @since_tizen 2.3.2.3
2214  *
2215  * @feature %http://developer.samsung.com/tizen/feature/mdm
2216  *
2217  * @par Usage:
2218  * This API adds (concatenates) the provided restriction pattern to the restriction pattern set of the admin for
2219  outgoing SMSs.
2220  *
2221  * @code{.c}
2222  // previous patterns will remain and the new pattern will be added
2223  mdm_result_t ret = mdm_msim_add_outgoing_sms_restriction("SIM1", ".*");
2224  if (ret != MDM_RESULT_SUCCESS) {
2225  // function error
2226  } else {
2227  // function success
2228  }
2229  *
2230  * @endcode
2231  *
2232  * @privlevel public
2233  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2234  *
2235  * @param[in] id Id that pattern is applied for
2236  * @param[in] p_pattern The restriction pattern to be matched against the outgoing sms number
2237  *
2238  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2239  *
2240  * @retval #MDM_RESULT_SUCCESS Successful
2241  * @retval #MDM_RESULT_FAIL General failure
2242  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2243  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2244  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2245  *
2246  * @par Permission:
2247  * Usage of this API is restricted to registered clients only.
2248  *
2249  * @see mdm_msim_remove_incoming_call_restriction
2250  *
2251  */
2252 mdm_result_t mdm_msim_add_outgoing_sms_restriction(const char *id, char *p_pattern);
2253 
2254 /*
2255  * @brief API to set a restriction pattern to be matched by incoming call numbers
2256  *
2257  * @since_mdm 1.1.0
2258  *
2259  * @since_tizen 2.3.2.3
2260  *
2261  * @feature %http://developer.samsung.com/tizen/feature/mdm
2262  *
2263  * @par Usage:
2264  * This API overrides any pattern previously set by the admin for incoming calls.
2265  *
2266  * @code{.c}
2267  mdm_result_t ret = mdm_msim_set_incoming_call_restriction("SIM1", ".*");
2268  if (ret != MDM_RESULT_SUCCESS) {
2269  // failed setting count
2270  } else {
2271  // success setting count
2272  }
2273  *
2274  * @endcode
2275  *
2276  * @privlevel public
2277  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2278  *
2279  * @param[in] id Id that pattern is applied for.
2280  * @param[in] p_pattern The restriction pattern to be matched against the incoming call number.
2281  *
2282  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2283  *
2284  * @retval #MDM_RESULT_SUCCESS Successful
2285  * @retval #MDM_RESULT_FAIL General failure
2286  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2287  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2288  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2289  *
2290  * @par Permission:
2291  * Usage of this API is restricted to registered clients only.
2292  *
2293  * @see mdm_msim_get_incoming_call_restriction
2294  *
2295  */
2296 mdm_result_t mdm_msim_set_incoming_call_restriction(const char *id, char *p_pattern);
2297 
2298 /*
2299  * @brief API to set a restriction pattern to be matched by incoming SMSs numbers
2300  *
2301  * @since_mdm 1.1.0
2302  *
2303  * @since_tizen 2.3.2.3
2304  *
2305  * @feature %http://developer.samsung.com/tizen/feature/mdm
2306  *
2307  * @par Usage:
2308  * This API overrides any pattern previously set by the admin for incoming SMSs.
2309  *
2310  * @code{.c}
2311  mdm_result_t ret = mdm_msim_set_incoming_sms_restriction("SIM1", ".*");
2312  if (ret != MDM_RESULT_SUCCESS) {
2313  // failed setting count
2314  } else {
2315  // success setting count
2316  }
2317  *
2318  * @endcode
2319  *
2320  * @privlevel public
2321  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2322  *
2323  * @param[in] id Id that pattern is applied for.
2324  * @param[in] p_pattern The restriction pattern to be matched against the incoming sms number.
2325  *
2326  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2327  *
2328  * @retval #MDM_RESULT_SUCCESS Successful
2329  * @retval #MDM_RESULT_FAIL General failure
2330  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2331  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2332  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2333  *
2334  * @par Permission:
2335  * Usage of this API is restricted to registered clients only.
2336  *
2337  * @see mdm_msim_get_incoming_sms_restriction
2338  *
2339  */
2340 MDM_DEPRECATED_API mdm_result_t mdm_msim_set_incoming_sms_restriction(const char *id, char *p_pattern);
2341 
2342 /*
2343  * @brief API to set a restriction pattern to be matched by outgoing call numbers
2344  *
2345  * @since_mdm 1.1.0
2346  *
2347  * @since_tizen 2.3.2.3
2348  *
2349  * @feature %http://developer.samsung.com/tizen/feature/mdm
2350  *
2351  * @par Usage:
2352  * This API overrides any pattern previously set by the admin for outgoing calls.
2353  *
2354  * @code{.c}
2355  mdm_result_t ret = mdm_msim_set_outgoing_call_restriction("SIM1",
2356  "(?![1]?[\\-]?800[\\-]?[0-9]{3}[\\-]?[0-9]{4}$).*");
2357  if (ret != MDM_RESULT_SUCCESS) {
2358  // failed setting count
2359  } else {
2360  // success setting count
2361  }
2362  *
2363  * @endcode
2364  *
2365  * @privlevel public
2366  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2367  *
2368  * @param[in] id Id that pattern is applied for.
2369  * @param[in] p_pattern The restriction pattern to be matched against the outgoing call number.
2370  *
2371  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2372  *
2373  * @retval #MDM_RESULT_SUCCESS Successful
2374  * @retval #MDM_RESULT_FAIL General failure
2375  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2376  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2377  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2378  *
2379  * @par Permission:
2380  * Usage of this API is restricted to registered clients only.
2381  *
2382  * @see mdm_msim_get_outgoing_call_restriction
2383  *
2384  */
2385 mdm_result_t mdm_msim_set_outgoing_call_restriction(const char *id, char *p_pattern);
2386 
2387 /*
2388  * @brief API to set a restriction pattern to be matched by outgoing sms numbers
2389  *
2390  * @since_mdm 1.1.0
2391  *
2392  * @since_tizen 2.3.2.3
2393  *
2394  * @feature %http://developer.samsung.com/tizen/feature/mdm
2395  *
2396  * @par Usage:
2397  * This method overrides any previously set pattern in database or add a new one if none exist
2398  *
2399  * @code{.c}
2400  mdm_result_t ret = mdm_msim_set_outgoing_sms_restriction("SIM1",
2401  "(?![1]?[\\-]?800[\\-]?[0-9]{3}[\\-]?[0-9]{4}$).*");
2402  if (ret != MDM_RESULT_SUCCESS) {
2403  // failed setting count
2404  } else {
2405  // success setting count
2406  }
2407  *
2408  * @endcode
2409  *
2410  * @privlevel public
2411  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2412  *
2413  * @param[in] id Id that pattern is applied for.
2414  * @param[in] p_pattern The restriction pattern to be matched against the outgoing sms number.
2415  *
2416  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2417  *
2418  * @retval #MDM_RESULT_SUCCESS Successful
2419  * @retval #MDM_RESULT_FAIL General failure
2420  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2421  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2422  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2423  *
2424  * @par Permission:
2425  * Usage of this API is restricted to registered clients only.
2426  *
2427  * @see mdm_msim_get_outgoing_sms_restriction2
2428  *
2429  */
2430 MDM_DEPRECATED_API mdm_result_t mdm_msim_set_outgoing_sms_restriction(const char *id, char *p_pattern);
2431 
2432 /*
2433  * @brief API to get the restriction pattern for incoming calls
2434  *
2435  * @since_mdm 1.1.0
2436  *
2437  * @since_tizen 2.3.2.3
2438  *
2439  * @feature %http://developer.samsung.com/tizen/feature/mdm
2440  *
2441  * @par Usage:
2442  * Admin can use this API to retrieve the current pattern being used to restrict incoming calls.
2443  *
2444  * @code{.c}
2445  mdm_data_t *lp_data = mdm_msim_get_incoming_call_restriction("SIM1", FALSE);
2446  if (lp_data) {
2447  printf("data : %s", (char *)lp_data->data);
2448  mdm_free_data(lp_data);
2449  }
2450  *
2451  * @endcode
2452  *
2453  * @param[in] id SIM card id. Check mdm_msim_get_sim_ids() for available SIM card ids.
2454  * @param[in] n_all_admin True to get a composition of all restrictions from all admins, false to get a restriction
2455  pattern from the calling admin.
2456  *
2457  * @return #mdm_status_t : Current mode of operation, one of #MDM_ALLOWED or #MDM_RESTRICTED
2458  *
2459  * @see mdm_msim_set_incoming_call_restriction
2460  *
2461  */
2462 mdm_data_t *mdm_msim_get_incoming_call_restriction(const char *id, int n_all_admin);
2463 
2464 /*
2465  * @brief API to get the restriction pattern for incoming SMS
2466  *
2467  * @since_mdm 1.1.0
2468  *
2469  * @since_tizen 2.3.2.3
2470  *
2471  * @feature %http://developer.samsung.com/tizen/feature/mdm
2472  *
2473  * @par Usage:
2474  * Admin can use this API to retrieve the current pattern being used to restrict incoming SMS.
2475  *
2476  * @code{.c}
2477  mdm_data_t *lp_data = mdm_msim_get_incoming_call_restriction("SIM1", FALSE);
2478  if (lp_data) {
2479  printf("data : %s", (char *)lp_data->data);
2480  mdm_free_data(lp_data);
2481  }
2482  *
2483  * @endcode
2484  *
2485  * @param[in] id Id of sim
2486  * @param[in] n_all_admin True to get a composition of all restrictions from all admins, false to get a
2487  restriction pattern from the calling admin
2488  *
2489  * @return #mdm_data_t * on success, NULL on error
2490  *
2491  * @see mdm_msim_set_incoming_sms_restriction
2492  *
2493  */
2494 mdm_data_t *mdm_msim_get_incoming_sms_restriction(const char *id, int n_all_admin);
2495 
2496 /*
2497  * @brief API to get the restriction pattern for outgoing calls
2498  *
2499  * @since_mdm 1.1.0
2500  *
2501  * @since_tizen 2.3.2.3
2502  *
2503  * @feature %http://developer.samsung.com/tizen/feature/mdm
2504  *
2505  * @par Usage:
2506  * Admin can use this API to retrieve the current pattern being used to restrict outgoing calls.
2507  *
2508  * @code{.c}
2509  mdm_data_t *lp_data = mdm_msim_get_outgoing_call_restriction("SIM1", FALSE);
2510  if (lp_data) {
2511  printf("data : %s", (char *)lp_data->data);
2512  mdm_free_data(lp_data);
2513  }
2514  *
2515  * @endcode
2516  *
2517  * @param[in] id Id of sim
2518  * @param[in] n_all_admin True to get a composition of all restrictions from all admins, false to get a
2519  restriction pattern from the calling admin.
2520  *
2521  * @return #mdm_data_t * on success, NULL on error
2522  *
2523  * @see mdm_msim_set_outgoing_call_restriction
2524  *
2525  */
2526 mdm_data_t *mdm_msim_get_outgoing_call_restriction(const char *id, int n_all_admin);
2527 
2528 /*
2529  * @brief API to get the restriction pattern for outgoing SMS
2530  *
2531  * @since_mdm 1.1.0
2532  *
2533  * @since_tizen 2.3.2.3
2534  *
2535  * @feature %http://developer.samsung.com/tizen/feature/mdm
2536  *
2537  * @par Usage:
2538  * Admin can use this API to retrieve the current pattern being used to restrict outgoing SMS.
2539  *
2540  * @code{.c}
2541  mdm_data_t *lp_data = mdm_msim_get_outgoing_sms_restriction("SIM1", FALSE);
2542  if (lp_data) {
2543  printf("data : %s", (char *)lp_data->data);
2544  mdm_free_data(lp_data);
2545  }
2546  *
2547  * @endcode
2548  *
2549  * @param[in] id Id of sim
2550  * @param[in] n_all_admin True to get a composition of all restrictions from all admins, false to get a
2551  restriction pattern from the calling admin.
2552  *
2553  * @return #mdm_data_t * on success, NULL on error
2554  *
2555  * @see mdm_msim_set_outgoing_sms_restriction
2556  *
2557  */
2558 mdm_data_t *mdm_msim_get_outgoing_sms_restriction(const char *id, int n_all_admin);
2559 
2560 /*
2561  * @brief API to remove the restriction pattern for incoming calls set by the calling admin
2562  *
2563  * @since_mdm 1.1.0
2564  *
2565  * @since_tizen 2.3.2.3
2566  *
2567  * @feature %http://developer.samsung.com/tizen/feature/mdm
2568  *
2569  * @par Usage:
2570  * This method removes the pattern set by the caller admin for incoming calls restriction
2571  *
2572  * @code{.c}
2573  mdm_result_t ret = mdm_msim_remove_incoming_call_restriction("SIM1");
2574  if (ret != MDM_RESULT_SUCCESS) {
2575  // failed setting count
2576  } else {
2577  // success setting count
2578  }
2579  *
2580  * @endcode
2581  *
2582  * @privlevel public
2583  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2584  *
2585  * @param[in] id id of sim restrictions are deleted for
2586  *
2587  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2588  *
2589  * @retval #MDM_RESULT_SUCCESS Successful
2590  * @retval #MDM_RESULT_FAIL General failure
2591  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2592  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2593  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2594  *
2595  * @par Permission:
2596  * Usage of this API is restricted to registered clients only.
2597  *
2598  * @see mdm_msim_add_incoming_call_restriction
2599  *
2600  */
2601 mdm_result_t mdm_msim_remove_incoming_call_restriction(const char *id);
2602 
2603 /*
2604  * @brief API to remove the restriction pattern for incoming SMSs set by the calling admin
2605  *
2606  * @since_mdm 1.1.0
2607  *
2608  * @since_tizen 2.3.2.3
2609  *
2610  * @feature %http://developer.samsung.com/tizen/feature/mdm
2611  *
2612  * @par Usage:
2613  * This method removes the pattern set by the caller admin for incoming SMS restriction
2614  *
2615  * @code{.c}
2616  mdm_result_t ret = mdm_msim_remove_incoming_sms_restriction("SIM1");
2617  if (ret != MDM_RESULT_SUCCESS) {
2618  // failed setting count
2619  } else {
2620  // success setting count
2621  }
2622  *
2623  * @endcode
2624  *
2625  * @privlevel public
2626  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2627  *
2628  * @param[in] id Id of sim restrictions are deleted for
2629  *
2630  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2631  *
2632  * @retval #MDM_RESULT_SUCCESS Successful
2633  * @retval #MDM_RESULT_FAIL General failure
2634  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2635  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2636  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2637  *
2638  * @par Permission:
2639  * Usage of this API is restricted to registered clients only.
2640  *
2641  * @see mdm_msim_add_incoming_sms_restriction
2642  *
2643  */
2644 mdm_result_t mdm_msim_remove_incoming_sms_restriction(const char *id);
2645 
2646 /*
2647  * @brief API to remove the restriction pattern for outgoing calls set by the calling admin
2648  *
2649  * @since_mdm 1.1.0
2650  *
2651  * @since_tizen 2.3.2.3
2652  *
2653  * @feature %http://developer.samsung.com/tizen/feature/mdm
2654  *
2655  * @par Usage:
2656  * This method removes the pattern set by the caller admin for outgoing calls restriction
2657  *
2658  * @code{.c}
2659  mdm_result_t ret = mdm_msim_remove_outgoing_call_restriction("SIM1");
2660  if (ret != MDM_RESULT_SUCCESS) {
2661  // failed setting count
2662  } else {
2663  // success setting count
2664  }
2665  *
2666  * @endcode
2667  *
2668  * @privlevel public
2669  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2670  *
2671  * @param[in] id SIM card id. Check mdm_msim_get_sim_ids() for available SIM card ids.
2672  *
2673  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2674  *
2675  * @retval #MDM_RESULT_SUCCESS Successful
2676  * @retval #MDM_RESULT_FAIL General failure
2677  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2678  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2679  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2680  *
2681  * @par Permission:
2682  * Usage of this API is restricted to registered clients only.
2683  *
2684  * @see mdm_msim_add_outgoing_call_restriction
2685  *
2686  */
2687 mdm_result_t mdm_msim_remove_outgoing_call_restriction(const char *id);
2688 
2689 /*
2690  * @brief API to remove the allowing pattern for incoming Calls set by the calling admin
2691  *
2692  * @since_mdm 1.1.0
2693  *
2694  * @since_tizen 2.3.2.3
2695  *
2696  * @feature %http://developer.samsung.com/tizen/feature/mdm
2697  *
2698  * @par Usage:
2699  * This method removes the pattern set by the caller admin for incoming Calls allowed
2700  *
2701  * @code{.c}
2702  mdm_result_t ret = mdm_msim_remove_allowed_incoming_call("SIM1");
2703  if (ret != MDM_RESULT_SUCCESS) {
2704  // failed setting count
2705  } else {
2706  // success setting count
2707  }
2708  *
2709  * @endcode
2710  *
2711  * @privlevel public
2712  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2713  *
2714  * @param[in] id SIM card id. Check mdm_msim_get_sim_ids() for available SIM card ids.
2715  *
2716  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2717  *
2718  * @retval #MDM_RESULT_SUCCESS Successful
2719  * @retval #MDM_RESULT_FAIL General failure
2720  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2721  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2722  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2723  *
2724  * @par Permission:
2725  * Usage of this API is restricted to registered clients only.
2726  *
2727  * @see mdm_msim_add_outgoing_sms_restriction
2728  *
2729  */
2730 mdm_result_t mdm_msim_remove_allowed_incoming_call(const char *id);
2731 
2732 /*
2733  * @brief API to remove the restriction pattern for outgoing SMSs set by the calling admin
2734  *
2735  * @since_mdm 1.1.0
2736  *
2737  * @since_tizen 2.3.2.3
2738  *
2739  * @feature %http://developer.samsung.com/tizen/feature/mdm
2740  *
2741  * @par Usage:
2742  * This method removes the pattern set by the caller admin for outgoing SMSs restriction
2743  *
2744  * @code{.c}
2745  mdm_result_t ret = mdm_msim_remove_outgoing_sms_restriction("SIM1");
2746  if (ret != MDM_RESULT_SUCCESS) {
2747  // failed setting count
2748  } else {
2749  // success setting count
2750  }
2751  *
2752  * @endcode
2753  *
2754  * @privlevel public
2755  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2756  *
2757  * @param[in] id SIM card id. Check mdm_msim_get_sim_ids() for available SIM card ids.
2758  *
2759  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2760  *
2761  * @retval #MDM_RESULT_SUCCESS Successful
2762  * @retval #MDM_RESULT_FAIL General failure
2763  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2764  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2765  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2766  *
2767  * @par Permission:
2768  * Usage of this API is restricted to registered clients only.
2769  *
2770  * @see mdm_msim_add_outgoing_sms_restriction
2771  *
2772  */
2773 mdm_result_t mdm_msim_remove_outgoing_sms_restriction(const char *id);
2774 
2775 /*
2776  * @brief API to remove the allowing pattern for outgoing Calls set by the calling admin
2777  *
2778  * @since_mdm 1.1.0
2779  *
2780  * @since_tizen 2.3.2.3
2781  *
2782  * @feature %http://developer.samsung.com/tizen/feature/mdm
2783  *
2784  * @par Usage:
2785  * This method removes the pattern set by the caller admin for outgoing Calls allowed
2786  *
2787  * @code{.c}
2788  mdm_result_t ret = mdm_msim_remove_allowed_outgoing_call("SIM1");
2789  if (ret != MDM_RESULT_SUCCESS) {
2790  // failed setting count
2791  } else {
2792  // success setting count
2793  }
2794  *
2795  * @endcode
2796  *
2797  * @privlevel public
2798  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2799  *
2800  * @param[in] id SIM card id. Check mdm_msim_get_sim_ids() for available SIM card ids.
2801  *
2802  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2803  *
2804  * @retval #MDM_RESULT_SUCCESS Successful
2805  * @retval #MDM_RESULT_FAIL General failure
2806  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2807  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2808  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2809  *
2810  * @par Permission:
2811  * Usage of this API is restricted to registered clients only.
2812  *
2813  * @see mdm_msim_add_outgoing_sms_restriction
2814  *
2815  */
2816 mdm_result_t mdm_msim_remove_allowed_outgoing_call(const char *id);
2817 
2818 /*
2819  * @brief API to remove the allowing pattern for incoming SMSs set by the calling admin
2820  *
2821  * @since_mdm 1.1.0
2822  *
2823  * @since_tizen 2.3.2.3
2824  *
2825  * @feature %http://developer.samsung.com/tizen/feature/mdm
2826  *
2827  * @par Usage:
2828  * This method removes the pattern set by the caller admin for incoming SMSs allowed
2829  *
2830  * @code{.c}
2831  mdm_result_t ret = mdm_msim_remove_allowed_incoming_sms("SIM1");
2832  if (ret != MDM_RESULT_SUCCESS) {
2833  // failed setting count
2834  } else {
2835  // success setting count
2836  }
2837  *
2838  * @endcode
2839  *
2840  * @privlevel public
2841  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2842  *
2843  * @param[in] id SIM card id. Check mdm_msim_get_sim_ids() for available SIM card ids.
2844  *
2845  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2846  *
2847  * @retval #MDM_RESULT_SUCCESS Successful
2848  * @retval #MDM_RESULT_FAIL General failure
2849  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2850  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2851  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2852  *
2853  * @par Permission:
2854  * Usage of this API is restricted to registered clients only.
2855  *
2856  * @see mdm_msim_add_outgoing_sms_restriction
2857  *
2858  */
2859 mdm_result_t mdm_msim_remove_allowed_incoming_sms(const char *id);
2860 
2861 /*
2862  * @brief API to remove the allowing pattern for outgoing SMSs set by the calling admin
2863  *
2864  * @since_mdm 1.1.0
2865  *
2866  * @since_tizen 2.3.2.3
2867  *
2868  * @feature %http://developer.samsung.com/tizen/feature/mdm
2869  *
2870  * @par Usage:
2871  * This method removes the pattern set by the caller admin for outgoing SMSs allowed
2872  *
2873  * @code{.c}
2874  mdm_result_t ret = mdm_msim_remove_allowed_outgoing_sms("SIM1");
2875  if (ret != MDM_RESULT_SUCCESS) {
2876  // failed setting count
2877  } else {
2878  // success setting count
2879  }
2880  *
2881  * @endcode
2882  *
2883  * @privlevel public
2884  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
2885  *
2886  * @param[in] id SIM card id. Check mdm_msim_get_sim_ids() for available SIM card ids.
2887  *
2888  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2889  *
2890  * @retval #MDM_RESULT_SUCCESS Successful
2891  * @retval #MDM_RESULT_FAIL General failure
2892  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2893  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2894  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2895  *
2896  * @par Permission:
2897  * Usage of this API is restricted to registered clients only.
2898  *
2899  * @see mdm_msim_add_outgoing_sms_restriction
2900  *
2901  */
2902 mdm_result_t mdm_msim_remove_allowed_outgoing_sms(const char *id);
2903 
2904 /*
2905  * @brief API to get the restriction pattern for incoming calls
2906  *
2907  * @since_mdm 1.1.0
2908  *
2909  * @since_tizen 2.3.2.3
2910  *
2911  * @feature %http://developer.samsung.com/tizen/feature/mdm
2912  *
2913  * @par Usage:
2914  * Admin can use this API to retrieve the current pattern being used to restrict incoming calls.
2915  *
2916  * @code{.c}
2917  mdm_data_t *lp_data = mdm_msim_get_incoming_call_restriction("SIM1", FALSE);
2918  if (lp_data) {
2919  printf("data : %s", (char *)lp_data->data);
2920  mdm_free_data(lp_data);
2921  }
2922  *
2923  * @endcode
2924  *
2925  * @param[in] id SIM card id. Check mdm_msim_get_sim_ids() for available SIM card ids.
2926  * @param[in] n_all_admin true to get a composition of all restrictions from all admins, false to get a restriction
2927  pattern from the calling admin
2928  *
2929  * @return #mdm_status_t : Current mode of operation, one of #MDM_ALLOWED or #MDM_RESTRICTED
2930  *
2931  * @see mdm_msim_set_incoming_call_restriction
2932  *
2933  */
2934 mdm_data_t *mdm_msim_get_incoming_call_restriction(const char *id, int n_all_admin);
2935 
2936 /*
2937  * @brief API to get the restriction pattern for incoming SMS
2938  *
2939  * @since_mdm 1.1.0
2940  *
2941  * @since_tizen 2.3.2.3
2942  *
2943  * @feature %http://developer.samsung.com/tizen/feature/mdm
2944  *
2945  * @par Usage:
2946  * Admin can use this API to retrieve the current pattern being used to restrict incoming SMS.
2947  *
2948  * @code{.c}
2949  mdm_data_t *lp_data = mdm_msim_get_incoming_call_restriction("SIM1", FALSE);
2950  if (lp_data) {
2951  printf("data : %s", (char *)lp_data->data);
2952  mdm_free_data(lp_data);
2953  }
2954  *
2955  * @endcode
2956  *
2957  * @param[in] id Id of sim
2958  * @param[in] n_all_admin True to get a composition of all restrictions from all admins, false to get a
2959  restriction pattern from the calling admin
2960  *
2961  * @return #mdm_data_t * on success, NULL on error
2962  *
2963  * @see mdm_msim_set_incoming_sms_restriction
2964  *
2965  */
2966 mdm_data_t *mdm_msim_get_incoming_sms_restriction(const char *id, int n_all_admin);
2967 
2968 /*
2969  * @brief API to get the restriction pattern for outgoing calls
2970  *
2971  * @since_mdm 1.1.0
2972  *
2973  * @since_tizen 2.3.2.3
2974  *
2975  * @feature %http://developer.samsung.com/tizen/feature/mdm
2976  *
2977  * @par Usage:
2978  * Admin can use this API to retrieve the current pattern being used to restrict outgoing calls.
2979  *
2980  * @code{.c}
2981  mdm_data_t *lp_data = mdm_msim_get_outgoing_call_restriction("SIM1", FALSE);
2982  if (lp_data) {
2983  printf("data : %s", (char *)lp_data->data);
2984  mdm_free_data(lp_data);
2985  }
2986  *
2987  * @endcode
2988  *
2989  * @param[in] id Id of sim
2990  * @param[in] n_all_admin True to get a composition of all restrictions from all admins, false to get a
2991  restriction pattern from the calling admin.
2992  *
2993  * @return #mdm_data_t * on success, NULL on error
2994  *
2995  * @see mdm_msim_set_outgoing_call_restriction
2996  *
2997  */
2998 mdm_data_t *mdm_msim_get_outgoing_call_restriction(const char *id, int n_all_admin);
2999 
3000 /*
3001  * @brief API to get the restriction pattern for outgoing SMS
3002  *
3003  * @since_mdm 1.1.0
3004  *
3005  * @since_tizen 2.3.2.3
3006  *
3007  * @feature %http://developer.samsung.com/tizen/feature/mdm
3008  *
3009  * @par Usage:
3010  * Admin can use this API to retrieve the current pattern being used to restrict outgoing SMS.
3011  *
3012  * @code{.c}
3013  mdm_data_t *lp_data = mdm_msim_get_outgoing_sms_restriction("SIM1", FALSE);
3014  if (lp_data) {
3015  printf("data : %s", (char *)lp_data->data);
3016  mdm_free_data(lp_data);
3017  }
3018  *
3019  * @endcode
3020  *
3021  * @param[in] id Id of sim
3022  * @param[in] n_all_admin True to get a composition of all restrictions from all admins, false to get a
3023  restriction pattern from the calling admin.
3024  *
3025  * @return #mdm_data_t * on success, NULL on error
3026  *
3027  * @see mdm_msim_set_outgoing_sms_restriction
3028  *
3029  */
3030 mdm_data_t *mdm_msim_get_outgoing_sms_restriction(const char *id, int n_all_admin);
3031 
3032 /*
3033  * @brief API to remove the restriction pattern for incoming calls set by the calling admin
3034  *
3035  * @since_mdm 1.1.0
3036  *
3037  * @since_tizen 2.3.2.3
3038  *
3039  * @feature %http://developer.samsung.com/tizen/feature/mdm
3040  *
3041  * @par Usage:
3042  * This method removes the pattern set by the caller admin for incoming calls restriction
3043  *
3044  * @code{.c}
3045  mdm_result_t ret = mdm_msim_remove_incoming_call_restriction("SIM1");
3046  if (ret != MDM_RESULT_SUCCESS) {
3047  // failed setting count
3048  } else {
3049  // success setting count
3050  }
3051  *
3052  * @endcode
3053  *
3054  * @param[in] id Id of sim restrictions are deleted for
3055  *
3056  * @privlevel public
3057  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
3058  *
3059  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3060  *
3061  * @retval #MDM_RESULT_SUCCESS Successful
3062  * @retval #MDM_RESULT_FAIL General failure
3063  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3064  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3065  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3066  *
3067  * @par Permission:
3068  * Usage of this API is restricted to registered clients only.
3069  *
3070  * @see mdm_msim_add_incoming_call_restriction
3071  *
3072  */
3073 mdm_result_t mdm_msim_remove_incoming_call_restriction(const char *id);
3074 
3075 /*
3076  * @brief API to remove the restriction pattern for incoming SMSs set by the calling admin
3077  *
3078  * @since_mdm 1.1.0
3079  *
3080  * @since_tizen 2.3.2.3
3081  *
3082  * @feature %http://developer.samsung.com/tizen/feature/mdm
3083  *
3084  * @par Usage:
3085  * This method removes the pattern set by the caller admin for incoming SMS restriction
3086  *
3087  * @code{.c}
3088  mdm_result_t ret = mdm_msim_remove_incoming_sms_restriction("SIM1");
3089  if (ret != MDM_RESULT_SUCCESS) {
3090  // failed setting count
3091  } else {
3092  // success setting count
3093  }
3094  *
3095  * @endcode
3096  *
3097  * @privlevel public
3098  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
3099  *
3100  * @param[in] id id of sim restrictions are deleted for
3101  *
3102  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3103  *
3104  * @retval #MDM_RESULT_SUCCESS Successful
3105  * @retval #MDM_RESULT_FAIL General failure
3106  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3107  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3108  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3109  *
3110  * @par Permission:
3111  * Usage of this API is restricted to registered clients only.
3112  *
3113  * @see mdm_msim_add_incoming_sms_restriction
3114  *
3115  */
3116 mdm_result_t mdm_msim_remove_incoming_sms_restriction(const char *id);
3117 
3118 /*
3119  * @brief API to remove the restriction pattern for outgoing calls set by the calling admin.
3120  *
3121  * @since_mdm 1.1.0
3122  *
3123  * @since_tizen 2.3.2.3
3124  *
3125  * @feature %http://developer.samsung.com/tizen/feature/mdm
3126  *
3127  * @par Usage:
3128  * This method removes the pattern set by the caller admin for outgoing calls restriction
3129  *
3130  * @code{.c}
3131  mdm_result_t ret = mdm_msim_remove_outgoing_call_restriction("SIM1");
3132  if (ret != MDM_RESULT_SUCCESS) {
3133  // failed setting count
3134  } else {
3135  // success setting count
3136  }
3137  *
3138  * @endcode
3139  *
3140  * @privlevel public
3141  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
3142  *
3143  * @param[in] id Id of sim restrictions are deleted for
3144  *
3145  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3146  *
3147  * @retval #MDM_RESULT_SUCCESS Successful
3148  * @retval #MDM_RESULT_FAIL General failure
3149  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3150  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3151  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3152  *
3153  * @par Permission:
3154  * Usage of this API is restricted to registered clients only.
3155  *
3156  * @see mdm_msim_add_outgoing_call_restriction
3157  *
3158  */
3159 mdm_result_t mdm_msim_remove_outgoing_call_restriction(const char *id);
3160 
3161 /*
3162  * @brief API to remove the restriction pattern for outgoing SMSs set by the calling admin
3163  *
3164  * @since_mdm 1.1.0
3165  *
3166  * @since_tizen 2.3.2.3
3167  *
3168  * @feature %http://developer.samsung.com/tizen/feature/mdm
3169  *
3170  * @par Usage:
3171  * This method removes the pattern set by the caller admin for outgoing SMSs restriction
3172  *
3173  * @code{.c}
3174  mdm_result_t ret = mdm_msim_remove_outgoing_sms_restriction("SIM1");
3175  if (ret != MDM_RESULT_SUCCESS) {
3176  // failed setting count
3177  } else {
3178  // success setting count
3179  }
3180  *
3181  * @endcode
3182  *
3183  * @privlevel public
3184  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
3185  *
3186  * @param[in] id SIM card id. Check mdm_msim_get_sim_ids() for available SIM card ids.
3187  *
3188  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3189  *
3190  * @retval #MDM_RESULT_SUCCESS Successful
3191  * @retval #MDM_RESULT_FAIL General failure
3192  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3193  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3194  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3195  *
3196  * @par Permission:
3197  * Usage of this API is restricted to registered clients only.
3198  *
3199  * @see mdm_msim_add_outgoing_sms_restriction
3200  *
3201  */
3202 mdm_result_t mdm_msim_remove_outgoing_sms_restriction(const char *id);
3203 
3204 /*
3205  * @brief API to enable or disable emergency calls only on device
3206  *
3207  * @since_mdm 1.1.0
3208  *
3209  * @since_tizen 2.3.2.3
3210  *
3211  * @feature %http://developer.samsung.com/tizen/feature/mdm
3212  *
3213  * @par Usage:
3214  * If enabled, only emergency will be allowed on device. All other calls will be blocked.
3215  *
3216  * @code{.c}
3217  mdm_result_t ret = mdm_msim_enable_emergency_call_only("SIM1", TRUE);
3218  if (ret != MDM_RESULT_SUCCESS) {
3219  // function error
3220  } else {
3221  // function success
3222  }
3223  *
3224  * @endcode
3225  *
3226  * @privlevel public
3227  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
3228  *
3229  * @param[in] id SIM id.
3230  * @param[in] status Only emergency calls
3231  *
3232  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3233  *
3234  * @retval #MDM_RESULT_SUCCESS Successful
3235  * @retval #MDM_RESULT_FAIL General failure
3236  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3237  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3238  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3239  *
3240  * @par Permission:
3241  * Usage of this API is restricted to registered clients only.
3242  *
3243  * @see mdm_msim_get_emergency_call_only_enabled
3244  *
3245  */
3246 mdm_result_t mdm_msim_enable_emergency_call_only(const char *id, mdm_status_t status);
3247 
3248 /*
3249  * @brief API to check if only emergency calls are allowed on device
3250  *
3251  * @since_mdm 1.1.0
3252  *
3253  * @since_tizen 2.3.2.3
3254  *
3255  * @feature %http://developer.samsung.com/tizen/feature/mdm
3256  *
3257  * @par Usage:
3258  * Admin can check if the emergency call is enabled on the device. If enabled, only emergency will be allowed. All other
3259  calls will be blocked.
3260  *
3261  * @code{.c}
3262  mdm_status_t ret = mdm_msim_get_emergency_call_only_enabled("SIM1");
3263  if (ret != MDM_STATUS_ERROR) {
3264  if (ret == MDM_TRUE) {
3265  // feature enabled
3266  } else {
3267  // feature disabled
3268  }
3269  } else {
3270  // function error
3271  }
3272  *
3273  * @endcode
3274  *
3275  * @return #mdm_status_t : Current mode of operation, one of #MDM_TRUE or #MDM_FALSE
3276  *
3277  * @see mdm_enable_emergency_call_only
3278  *
3279  */
3280 mdm_status_t mdm_msim_get_emergency_call_only_enabled(const char *id);
3281 
3282 /*
3283  * @brief API to enable/disable user's possibility to change voice calls and messages assignment to the specified SIM slot.
3284  *
3285  * @since_mdm 1.1.0
3286  *
3287  * @since_tizen 2.3.2.3
3288  *
3289  * @feature %http://developer.samsung.com/tizen/feature/mdm
3290  *
3291  * @par Usage:
3292  * This function can be called by an admin to enable/disable possibility of change the assignment of voice calls and
3293  messages.
3294  * When restricted user is disallowed to change this assignment to the specified SIM slot.
3295  *
3296  * @code{.c}
3297  *
3298  mdm_result_t ret = mdm_msim_allow_user_assign_voice_calls_and_messages_to_sim("SIM1", MDM_RESTRICTED);
3299 
3300  if (ret == MDM_RESULT_SUCCESS) {
3301  // user is disallowed to set assignment to the specified SIM slot
3302  } else {
3303  // function error
3304  }
3305  *
3306  * @endcode
3307  *
3308  * @param[in] id SIM slot ID
3309  * @param[in] status
3310  * #MDM_ALLOWED = 0,
3311  * #MDM_RESTRICTED = 1,
3312  *
3313  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3314  *
3315  * @retval #MDM_RESULT_SUCCESS Successful
3316  * @retval #MDM_RESULT_FAIL General failure
3317  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3318  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3319  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3320  *
3321  * @see mdm_msim_is_user_allowed_assign_voice_calls_and_messages_to_sim
3322  *
3323  */
3324 mdm_result_t mdm_msim_allow_user_assign_voice_calls_and_messages_to_sim(const char *id, mdm_status_t status);
3325 
3326 /*
3327  * @brief API to assign voice calls and messages to SIM1, SIM2 or to deassign voice calls and sms.
3328  *
3329  * @since_mdm 1.1.0
3330  *
3331  * @since_tizen 2.3.2.3
3332  *
3333  * @feature %http://developer.samsung.com/tizen/feature/mdm
3334  *
3335  * @par Usage:
3336  * This function can be called to change or clear actual assignment of voice calls and messages.
3337  * - If SIM slot ID passed as argument is not an empty string it represents preferred assignment: SIM1 or SIM2.
3338  * - If NULL argument is passed it clears the current assignment, which corresponds to the ALWAYS ASK option in Tizen.
3339  * - If argument does not stand for a valid device name - #MDM_RESULT_INVALID_PARAM error is returned.
3340  * - If restrictions introduced by #mdm_msim_allow_user_assign_voice_calls_and_messages_to_sim are active admin is
3341  still able to change the assignment.
3342  * - If the assignment to first slot is done by admin with this function and then the service goes down, 3 use cases
3343  can be considered:
3344  * 1. If user assigns voice calls/messages to the second slot that was previously restricted by admin, the second
3345  assignment is valid until service is restarted.
3346  * After the service starts again the assignment value is reset to the last value estabilished by
3347  #mdm_msim_set_assign_voice_calls_and_messages_to_sim.
3348  * 2. If user assigns voice calls/messages to the second slot that was previously allowed by admin, the second
3349  assignment remains valid even after service restart.
3350  * 3. If user clears the assignment to ALWAYS ASK option, it remains valid after service restart, no matter if the
3351  assignment to SIM1 and SIM2 slot was restricted or not.
3352  * - If voice calls and messages are unassigned (ALWAYS ASK option is active) any client can assign SIM slot ID to
3353  capture voice calls and messages.
3354  * - If voice calls and messages are assigned to SIM1 or SIM2, only the same admin is authorized to change this
3355  assignment.
3356  * - If the assignment estabilished by one admin is attempted to be changed by the other admin - #MDM_NOT_AN_OWNER
3357  value is returned.
3358  * - If the admin that assigned voice calls and messages to SIM ID is removed the Tizen's assignment is cleared.
3359  * - If one admin set a new assignment to e.g. SIM1 slot and the second admin tries to change this to SIM2
3360  (#MDM_NOT_AN_OWNER is returned),
3361  * then if the first one is deregistered - Tizen's assignment is cleared and the second assignment is ignored.
3362  * Finally, the system voice calls and messages are unassigned in this case.
3363  *
3364  * @code{.c}
3365  *
3366  mdm_result_t ret = mdm_msim_set_assign_voice_calls_and_messages_to_sim("SIM1");
3367 
3368  if (ret == MDM_RESULT_SUCCESS) {
3369  // voice assignment succeeded
3370  } else {
3371  // function error
3372  }
3373  *
3374  * @endcode
3375  *
3376  * @param[in] id SIM slot id.
3377  *
3378  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3379  *
3380  * @retval #MDM_RESULT_SUCCESS Successful call.
3381  * @retval #MDM_RESULT_FAIL General failure.
3382  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported.
3383  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter.
3384  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3385  * @retval #MDM_NOT_AN_OWNER Current client is not allowed to change a value estabilished by other admin.
3386  *
3387  * @see mdm_msim_allow_user_assign_voice_calls_and_messages_to_sim
3388  * @see mdm_msim_get_assign_voice_calls_and_messages_to_sim
3389  *
3390  */
3391 mdm_result_t mdm_msim_set_assign_voice_calls_and_messages_to_sim(const char *id);
3392 
3393 /*
3394  * @brief API to get current assignment of voice calls and messages.
3395  *
3396  * @since_mdm 1.1.0
3397  *
3398  * @since_tizen 2.3.2.3
3399  *
3400  * @feature %http://developer.samsung.com/tizen/feature/mdm
3401  *
3402  * @par Usage:
3403  * This function can be called to get the actual subscription of voice calls and messages from the system.
3404  * If (mdm_data_t *)->data contains "SIM1" string it indicates that SIM1 slot is assigned to capture voice calls and
3405  messages.
3406  * If (mdm_data_t *)->data contains "SIM2" string it indicates that SIM2 slot is assigned to capture voice calls and
3407  messages.
3408  * If (mdm_data_t *)->data points to NULL it indicates that no SIM slot is assigned to capture voice calls and messages
3409  which
3410  * corresponds to ALWAYS ASK option in SIM card manager.
3411  *
3412  * @code{.c}
3413  *
3414  mdm_data_t *res = mdm_msim_get_assign_voice_calls_and_messages_to_sim();
3415 
3416  if (res->ret == MDM_RESULT_SUCCESS) {
3417  // call succeeded
3418 
3419  if (g_strcmp0((const char*)res->data, NULL) == 0) {
3420  // no SIM slot is assigned for voice calls
3421  } else {
3422  if (g_strcmp0((const char*)res->data, "SIM1") == 0) {
3423  // SIM1 slot is assigned for voice calls
3424  } else {
3425  if (g_strcmp0((const char*)res->data, "SIM2") == 0) {
3426  // SIM2 slot is assigned for voice calls
3427  } else {
3428  // unknown voice calls assignment
3429  }
3430  }
3431  }
3432  } else {
3433  // error occured
3434  }
3435  *
3436  * @endcode
3437  *
3438  * @return (mdm_data_t *)->data contains "SIM1", "SIM2" or points to NULL.
3439  * @return (mdm_data_t *)->ret is one of the below result codes:
3440  *
3441  * @retval #MDM_RESULT_SUCCESS Successful call.
3442  * @retval #MDM_RESULT_FAIL General failure.
3443  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported.
3444  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter.
3445  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3446  *
3447  * @see mdm_msim_set_assign_voice_calls_and_messages_to_sim
3448  *
3449  */
3450 mdm_data_t *mdm_msim_get_assign_voice_calls_and_messages_to_sim(void);
3451 
3452 /*
3453  * @brief API to assign data calls to SIM1 or SIM2.
3454  *
3455  * @since_mdm 1.1.0
3456  *
3457  * @since_tizen 2.3.2.3
3458  *
3459  * @feature %http://developer.samsung.com/tizen/feature/mdm
3460  *
3461  * @par Usage:
3462  * This function can be invoked to change the actual assignment of data calls.
3463  * If SIM ID passed as an argument is not an empty string it represents a preferred data assignment: SIM1 or SIM2.
3464  * If it doesn't stand for a valid device name - MDM_RESULT_INVALID_PARAM error is returned.
3465  * If SIM ID points to NULL - MDM_RESULT_INVALID_PARAM error is returned as well.
3466  * Setting data assignment can be performed when it's not restricted by mdm_msim_allow_user_assign_data_calls_to_sim.
3467  * If data calls are unassigned any client can assign SIM ID to capture data calls.
3468  * If data calls are assigned to SIM1 or SIM2, only the same admin is authorized to change this assignment.
3469  * If the current assignment is attempted to be changed by the other admin - MDM_NOT_AN_OWNER error is returned.
3470  * If the admin that assigned data calls to SIM ID is removed the Tizen's assignment is not cleared.
3471  * E.g. if one client set a new assignment to SIM1 and the second client tried to change this to SIM2 -
3472  * MDM_NOT_AN_OWNER is returned. Then, if the first one is deregistered - Tizen's assignment remains the same
3473  * and the second assignment is ignored. In this case, the data calls in system are assigned to SIM1, but
3474  * data calls become free to be assigned by the second admin (MDM_NOT_AN_OWNER will not be returned).
3475  *
3476  * @code{.c}
3477  *
3478  mdm_result_t ret = mdm_msim_set_assign_data_calls_to_sim("SIM1");
3479 
3480  if (ret == MDM_RESULT_SUCCESS) {
3481  // data assignment succeeded
3482  } else {
3483  // function error
3484  }
3485  *
3486  * @endcode
3487  *
3488  * @param[in] id SIM id.
3489  *
3490  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error *
3491  * @retval #MDM_RESULT_SUCCESS Successful call.
3492  * @retval #MDM_RESULT_FAIL General failure.
3493  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported.
3494  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter.
3495  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3496  * @retval #MDM_NOT_AN_OWNER Current client is not allowed to change a value estabilished by other client.
3497  *
3498  * @see mdm_msim_is_user_allowed_assign_data_calls_to_sim
3499  * @see mdm_msim_get_assign_data_calls_to_sim
3500  *
3501  */
3502 mdm_result_t mdm_msim_set_assign_data_calls_to_sim(const char *id);
3503 
3504 /*
3505  * @brief API to get current data calls assignment.
3506  *
3507  * @since_mdm 1.1.0
3508  *
3509  * @since_tizen 2.3.2.3
3510  *
3511  * @feature %http://developer.samsung.com/tizen/feature/mdm
3512  *
3513  * @par Usage:
3514  * This function can be called to get the actual subscription of data calls.
3515  * If (mdm_data_t *)->data contains "SIM1" string it indicates that SIM1 ID is assigned to capture data calls.
3516  * If (mdm_data_t *)->data contains "SIM2" string it indicates that SIM2 ID is assigned to capture data calls.
3517  * If (mdm_data_t *)->data points to NULL it indicates that no SIM card is assigned to capture data calls.
3518  *
3519  * @code{.c}
3520  *
3521  mdm_data_t *res = mdm_msim_get_assign_data_calls_to_sim();
3522 
3523  if (res->ret == MDM_RESULT_SUCCESS) {
3524  // call succeeded
3525 
3526  if (g_strcmp0((const char*)res->data, NULL) == 0) {
3527  // no SIM card is assigned for data calls
3528  } else {
3529  if (g_strcmp0((const char*)res->data, "SIM1") == 0) {
3530  // SIM1 is assigned for data calls
3531  } else {
3532  if (g_strcmp0((const char*)res->data, "SIM2") == 0) {
3533  // SIM2 is assigned for data calls
3534  } else {
3535  // unknown data calls assignment
3536  }
3537  }
3538  }
3539  } else {
3540  // error occured
3541  }
3542  *
3543  * @endcode
3544  *
3545  * @return (mdm_data_t *)->data contains "SIM1", "SIM2" or points to NULL.
3546  * @return (mdm_data_t *)->ret is one of the below result codes:
3547  *
3548  * @retval #MDM_RESULT_SUCCESS Successful call.
3549  * @retval #MDM_RESULT_FAIL General failure.
3550  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported.
3551  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter.
3552  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3553  *
3554  * @see mdm_msim_set_assign_data_calls_to_sim
3555  *
3556  */
3557 mdm_data_t *mdm_msim_get_assign_data_calls_to_sim(void);
3558 
3559 /*
3560  * @brief API to allow/restrict user possibility to change data call assignment to specified sim card.
3561  *
3562  * @since_mdm 1.1.0
3563  *
3564  * @since_tizen 2.3.2.3
3565  *
3566  * @feature %http://developer.samsung.com/tizen/feature/mdm
3567  *
3568  * @par Usage:
3569  * This function can be called to enable/disable possibility to change data call assignment to specified sim card.
3570  * When restricted, user is disallowed to change data call assignment to the specified sim card.
3571  *
3572  * @code{.c}
3573 
3574  mdm_result_t ret = mdm_msim_allow_user_assign_data_calls_to_sim("SIM1", MDM_RESTRICTED);
3575 
3576  if (ret != MDM_RESULT_SUCCESS) {
3577  // user is disallowed to set voice call assignment to the specified sim card
3578  } else {
3579  // function error
3580  }
3581  *
3582  * @endcode
3583  *
3584  * @param[in] id SIM id.
3585  * @param[in] allow
3586  * #MDM_ALLOWED = 0,
3587  * #MDM_RESTRICTED = 1,
3588  *
3589  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3590  *
3591  * @retval #MDM_RESULT_SUCCESS Successful
3592  * @retval #MDM_RESULT_FAIL General failure
3593  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3594  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3595  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3596  *
3597  * @see mdm_msim_is_user_allowed_assign_data_calls_to_sim
3598  *
3599  */
3600 mdm_result_t mdm_msim_allow_user_assign_data_calls_to_sim(const char *id, mdm_status_t allow);
3601 
3602 /*
3603  * @brief API to check whether user has possibility to change voice call/sms assignment.
3604  *
3605  * @since_mdm 1.1.0
3606  *
3607  * @since_tizen 2.3.2.3
3608  *
3609  * @feature %http://developer.samsung.com/tizen/feature/mdm
3610  *
3611  * @par Usage:
3612  * This function can be called to check for possibility to change voice call and messages assignment to specified sim
3613  slot.
3614  * When restricted, user is disallowed to change voice call/sms assignment to the specified sim slot.
3615  *
3616  * @code{.c}
3617  mdm_status_t ret = mdm_msim_is_user_allowed_assign_voice_calls_and_messages_to_sim("SIM1");
3618 
3619  if (ret == MDM_ALLOWED) {
3620  // user is allowed to set voice call/sms assignment
3621  } else {
3622  if (ret == MDM_RESTRICTED) {
3623  // user is not allowed to set voice call/sms assignment
3624  } else {
3625  // error occured
3626  }
3627  }
3628  *
3629  * @endcode
3630  *
3631  * @param[in] id SIM slot ID
3632  *
3633  * @return #mdm_status_t : Current mode of operation, one of #MDM_ALLOWED, #MDM_RESTRICTED or #MDM_STATUS_ERROR.
3634  *
3635  * @see mdm_msim_allow_user_assign_voice_calls_and_messages_to_sim
3636  *
3637  */
3638 mdm_status_t mdm_msim_is_user_allowed_assign_voice_calls_and_messages_to_sim(const char *id);
3639 
3640 /*
3641  * @brief API to check whether user have possibility to change data call assignment to specified sim card.
3642  *
3643  * @since_mdm 1.1.0
3644  *
3645  * @since_tizen 2.3.2.3
3646  *
3647  * @feature %http://developer.samsung.com/tizen/feature/mdm
3648  *
3649  * @par Usage:
3650  * This function can be called to check for possibility to change data call assignment to specified sim card.
3651  * When restricted, user is disallowed to change voice call assignment to the specified sim card.
3652  *
3653  * @code{.c}
3654  mdm_status_t ret = mdm_msim_is_user_allowed_assign_data_calls_to_sim("SIM1");
3655 
3656  if (ret == MDM_ALLOWED) {
3657  // user is allowed to set voice call assignment to the specified sim card
3658  } else {
3659  // user is not allowed (or error, check for MDM_STATUS_ERROR).
3660  }
3661  *
3662  * @endcode
3663  *
3664  * @param[in] id SIM id.
3665  *
3666  * @return #mdm_status_t : Current mode of operation, one of #MDM_ALLOWED or #MDM_RESTRICTED (or MDM_STATUS_ERROR).
3667  *
3668  * @see mdm_msim_allow_user_assign_data_calls_to_sim
3669  *
3670  */
3671 mdm_status_t mdm_msim_is_user_allowed_assign_data_calls_to_sim(const char *id);
3672 
3673 /*
3674  * @brief Function to check if given SIM card is allowed.
3675  *
3676  * @since_mdm 1.1.0
3677  *
3678  * @since_tizen 2.3.2.3
3679  *
3680  * @feature %http://developer.samsung.com/tizen/feature/mdm
3681  *
3682  * @par Usage:
3683  * Admin can check if given SIM card is allowed or restricted. If a SIM card is
3684  * restricted, user can't use the SIM card (e.g. for calls, messaging or data
3685  * transfer).
3686  * By default all SIM cards are allowed.
3687  *
3688  * @code{.c}
3689  mdm_status_t ret = mdm_msim_get_allow_sim();
3690  if (ret != MDM_STATUS_ERROR) {
3691  if (ret == MDM_ALLOWED) {
3692  // SIM card allowed.
3693 
3694  } else {
3695  // SIM card restricted.
3696  }
3697  } else {
3698  // Function error.
3699  }
3700  * @endcode
3701  *
3702  * @param[in] id SIM card id. Check #mdm_msim_get_sim_ids() for available SIM card ids.
3703  *
3704  * @return #mdm_status_t : #MDM_ALLOWED if user is allowed to use given SIM card, #MDM_RESTRICTED otherwise.
3705  * On error functions returns #MDM_STATUS_ERROR, function will fail on incorrect SIM card id.
3706  *
3707  * @see mdm_msim_set_allow_sim
3708  */
3709 mdm_status_t mdm_msim_get_allow_sim(const char *id);
3710 
3711 /*
3712  * @brief Function to allow or restrict given SIM card.
3713  *
3714  * @since_mdm 1.1.0
3715  *
3716  * @since_tizen 2.3.2.3
3717  *
3718  * @feature %http://developer.samsung.com/tizen/feature/mdm
3719  *
3720  * @par Usage:
3721  * Admin can restrict or allow given SIM card. If a SIM card is restricted, user
3722  * can't use the SIM card (e.g. for calls, messaging or data transfer).
3723  * By default all SIM cards are allowed.
3724  *
3725  * @code{.c}
3726  mdm_result_t ret = mdm_msim_set_allow_sim("SIM1", MDM_RESTRICTED);
3727  if (ret != MDM_RESULT_SUCCESS) {
3728  // Operation failed.
3729 
3730  } else {
3731  // Usage of SIM card is restricted.
3732  }
3733  * @endcode
3734  *
3735  * @param[in] id SIM card id. Check mdm_msim_get_sim_ids() for available SIM card ids.
3736  * @param[in] allow Either #MDM_ALLOWED to allow SIM card or #MDM_RESTRICTED to restrict it.
3737  *
3738  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3739  *
3740  * @retval #MDM_RESULT_SUCCESS Successful
3741  * @retval #MDM_RESULT_FAIL General failure
3742  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3743  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3744  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3745  *
3746  * @see mdm_msim_get_allow_sim
3747  */
3748 mdm_result_t mdm_msim_set_allow_sim(const char *id, mdm_status_t allow);
3749 
3750 /* For dual sim end */
3751 
3752 /*
3753  * @brief API function to change a PIN code for the current SIM card.
3754  *
3755  * @since_mdm 1.1.0
3756  *
3757  * @since_tizen 2.3.2.3
3758  *
3759  * @feature %http://developer.samsung.com/tizen/feature/mdm
3760  *
3761  * @par Usage:
3762  * This function changes SIM PIN code (if possible) for the current SIM card.
3763  * It uses asynchronous Tizen's function to send a DBUS request to telephony server.
3764  * Current PIN code must be correctly typed, otherwise MDM_RESULT_FAIL is returned.
3765  * If SIM card is not inserted MDM_RESULT_FAIL is returned.
3766  * If a new PIN code is not valid MDM_RESULT_FAIL is returned.
3767  *
3768  * @code{.c}
3769  *
3770  mdm_result_t ret = mdm_change_sim_pin_code("0000", "6666");
3771  if (ret != MDM_RESULT_SUCCESS) {
3772  // changing password failed
3773  } else {
3774  // PIN changed successfully
3775  }
3776  *
3777  * @endcode
3778  *
3779  * @privlevel public
3780  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
3781  *
3782  * @param[in] current_pin_code Current PIN code.
3783  * @param[in] new_pin_code PIN code to be set.
3784  *
3785  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3786  *
3787  * @retval #MDM_RESULT_SUCCESS Successful
3788  * @retval #MDM_RESULT_FAIL General failure
3789  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3790  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3791  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3792  *
3793  * @par Permission:
3794  * Usage of this API is restricted to registered clients only.
3795  *
3796  */
3797 mdm_result_t mdm_change_sim_pin_code(const char *current_pin_code, const char *new_pin_code);
3798 
3799 /*
3800  * @brief API function to enable a PIN code locking for the current SIM card.
3801  *
3802  * @since_mdm 1.1.0
3803  *
3804  * @since_tizen 2.3.2.3
3805  *
3806  * @feature %http://developer.samsung.com/tizen/feature/mdm
3807  *
3808  * @par Usage:
3809  * API to enable SIM card's PIN lock. The user is prevented from using the SIM card in other devices,
3810  * since a PIN code is required to use the SIM. It uses PH-SIM (phone-SIM) facility type and locks phone
3811  * to SIM/UICC card. MT asks for the password when a SIM/UICC card other than current SIM/UICC cardis inserted.
3812  * MT may remember a certain amount of previously used cards, thus not requiring the password,
3813  * when they are inserted. If SIM card is not inserted MDM_RESULT_FAIL is returned.
3814  * An administrator can use this API to enable the SIM card's PIN lock. The lock is transparent to the user:
3815  * whenever the device is powered on, it automatically unlocks the SIM card for that session. However, if
3816  * the SIM card is moved to another device, it remains locked.
3817  *
3818  * @remark
3819  * PIN lock restriction #mdm_status_t is written to #MDM_POLICY_ON_SIM_PIN_LOCK notification file.
3820  * You can register a callback for this event using #mdm_register_policy_receiver.
3821  *
3822  * @code{.c}
3823  *
3824  mdm_result_t ret = mdm_enable_sim_pin_lock("0000");
3825  if (ret != MDM_RESULT_SUCCESS) {
3826  // failed
3827  } else {
3828  // succeeded
3829  }
3830  *
3831  * @endcode
3832  *
3833  * @privlevel public
3834  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
3835  *
3836  * @param[in] pin_code current SIM card's PIN code
3837  *
3838  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3839  *
3840  * @retval #MDM_RESULT_SUCCESS Successful
3841  * @retval #MDM_RESULT_FAIL General failure
3842  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3843  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3844  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3845  *
3846  * @par Permission:
3847  * Usage of this API is restricted to registered clients only.
3848  *
3849  * @see mdm_disable_sim_pin_lock
3850  * @see mdm_is_sim_pin_lock_enabled
3851  */
3852 mdm_result_t mdm_enable_sim_pin_lock(const char *pin_code);
3853 
3854 /*
3855  * @brief API function to disable a PIN code locking for the current SIM card.
3856  *
3857  * @since_mdm 1.1.0
3858  *
3859  * @since_tizen 2.3.2.3
3860  *
3861  * @feature %http://developer.samsung.com/tizen/feature/mdm
3862  *
3863  * @par Usage:
3864  * API to disable SIM card's PIN lock. User is able to use SIM card on other devices and no PIN codeis required.
3865  * This function disables the PH-SIM (phone-SIM) facility. If SIM card is not inserted MDM_RESULT_FAIL is returned.
3866  * To disable the SIM PIN lock, the administrator must provide the current PIN code,
3867  * which is a numeric code of 4 to 8 digits.
3868  *
3869  * @remark
3870  * PIN lock restriction #mdm_status_t is written to #MDM_POLICY_ON_SIM_PIN_LOCK notification file.
3871  * You can register a callback for this event using #mdm_register_policy_receiver.
3872  *
3873  * @code{.c}
3874  *
3875  mdm_result_t ret = mdm_disable_sim_pin_lock("0000");
3876  if (ret != MDM_RESULT_SUCCESS) {
3877  // failed
3878  } else {
3879  // succeeded
3880  }
3881  *
3882  * @endcode
3883  *
3884  * @privlevel public
3885  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
3886  *
3887  * @param[in] pin_code Current SIM card's PIN code
3888  *
3889  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3890  *
3891  * @retval #MDM_RESULT_SUCCESS Successful
3892  * @retval #MDM_RESULT_FAIL General failure
3893  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3894  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3895  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3896  *
3897  * @par Permission:
3898  * Usage of this API is restricted to registered clients only.
3899  *
3900  * @see mdm_enable_sim_pin_lock
3901  * @see mdm_is_sim_pin_lock_enabled
3902  */
3903 mdm_result_t mdm_disable_sim_pin_lock(const char *pin_code);
3904 
3905 /*
3906  * @brief API function to check if the SIM facility is locked.
3907  *
3908  * @since_mdm 1.1.0
3909  *
3910  * @since_tizen 2.3.2.3
3911  *
3912  * @feature %http://developer.samsung.com/tizen/feature/mdm
3913  *
3914  * @par Usage:
3915  * This API might be used to check if PIN locking was done by mdm_enable_sim_pin_lock or
3916  * undone by mdm_disable_sim_pin_lock.
3917  *
3918  * @code{.c}
3919  *
3920  mdm_status_t ret = mdm_is_sim_pin_lock_enabled();
3921  if (ret == MDM_TRUE) {
3922  // SIM facility is locked
3923  } else if (ret == MDM_FALSE) {
3924  // SIM facility is unlocked
3925  }
3926  *
3927  * @endcode
3928  *
3929  * @privlevel public
3930  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
3931  *
3932  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3933  *
3934  * @retval #MDM_RESULT_SUCCESS Successful
3935  * @retval #MDM_RESULT_FAIL General failure
3936  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3937  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3938  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3939  *
3940  * @par Permission:
3941  * Usage of this API is restricted to registered clients only.
3942  *
3943  * @see mdm_enable_sim_pin_lock
3944  * @see mdm_disable_sim_pin_lock
3945  */
3946 mdm_status_t mdm_is_sim_pin_lock_enabled(void);
3947 
3948 /*
3949  * @brief Function to restrict end users from changing mobile data settings.
3950  *
3951  * @since_mdm 2.2.0
3952  *
3953  * @since_tizen 3.0.0.1
3954  *
3955  * @feature %http://developer.samsung.com/tizen/feature/mdm
3956  *
3957  * @par Usage:
3958  * Use this API to restrict end users from modifying mobile data settings.
3959  * \n NOTE — This API call will block changes from any sources.
3960  *
3961  * @remark
3962  * This action is signalized by writing #mdm_status_t to #MDM_POLICY_ON_MOBILE_DATA_CHANGE notification file.
3963  * You can register a callback for this event using #mdm_register_policy_receiver.
3964  *
3965  * @code{.c}
3966  mdm_result_t result = knox_mdm_set_allow_mobile_data_change("SIM1", MDM_ALLOWED);
3967  if(result == MDM_RESULT_SUCCESS) {
3968  // Success
3969  ...
3970  } else {
3971  // Error
3972  ...
3973  }
3974  * @endcode
3975  * @param[in] status #MDM_RESTRICTED — The end user is restricted from modifying mobile data settings.
3976  * \n #MDM_ALLOWED — The end user is allowed to modify mobile data settings.
3977  *
3978  * @privlevel public
3979  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
3980  *
3981  * @return #mdm_result_t : MDM_RESULT_SUCCESS upon successful configuration of end user permission to change mobile data
3982  settings, or an
3983  error code from the values listed below upon failure.
3984  *
3985  * @retval #MDM_RESULT_SUCCESS Successful
3986  * @retval #MDM_RESULT_FAIL General failure
3987  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3988  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3989  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3990  *
3991  * @see knox_mdm_get_allow_mobile_data_change
3992  */
3993 mdm_result_t knox_mdm_set_allow_mobile_data_change(const char *sim_id, const mdm_status_t status);
3994 
3995 /*
3996  * @brief Function to check if end users are allowed to make modifications to mobile data settings.
3997  *
3998  * @since_mdm 2.2.0
3999  *
4000  * @since_tizen 3.0.0.1
4001  *
4002  * @feature %http://developer.samsung.com/tizen/feature/mdm
4003  *
4004  * @par Usage:
4005  * Use this API to check end user permission to make changes to the mobile data settings.
4006  *
4007  * @code{.c}
4008  mdm_status_t status = knox_mdm_get_allow_mobile_data_change("SIM1");
4009  if(result == MDM_RESTRICTED) {
4010  // Changes are blocked
4011  ...
4012  } else if(result == MDM_ALLOWED) {
4013  // Changes are allowed
4014  ...
4015  }
4016  else
4017  {
4018  // ERROR
4019  ...
4020  }
4021  * @endcode
4022  *
4023  * @return #mdm_status_t : The current prevention status.
4024  * @retval #MDM_ALLOWED Mobile Data is prevented
4025  * @retval #MDM_RESTRICTED the end user is granted to modify Mobile Data.
4026  * @retval #MDM_STATUS_ERROR – on any error.
4027  *
4028  * @see knox_mdm_set_allow_mobile_data_change
4029  */
4030 mdm_status_t knox_mdm_get_allow_mobile_data_change(const char *sim_id);
4031 
4032 /* --------------------------------------------------------------------------------------------------------
4033  * HIDDEN DOCUMENTATION
4034  * --------------------------------------------------------------------------------------------------------
4035  *
4036  * Hidden documentation won't be generated by doxygen unless
4037  * PHONE_RESTRICTION_HIDDEN_API section is added to the ENABLED_SECTIONS
4038  * in the Doxygen configuration file.
4039  */
4041 
4042 /*
4043  * @brief API to get the limit of incoming calls for day, week or month
4044  *
4045  * @since_mdm 1.1.0
4046  *
4047  * @since_tizen 2.3.2.3
4048  *
4049  * @feature %http://developer.samsung.com/tizen/feature/mdm
4050  *
4051  * @par Usage:
4052  * This method returns the restricted limit of number of incoming calls based on the parameter passed to it
4053  *
4054  * @code{.c}
4055  int value = 0;
4056  mdm_result_t ret = mdm_msim_get_limit_of_incoming_calls("SIM1", MDM_LIMIT_NUMBER_OF_CALLS_BY_DAY, &value);
4057  if (ret == MDM_RESULT_SUCCESS) {
4058  printf("%d", value);
4059  }
4060  *
4061  * @endcode
4062  *
4063  * @param[in] id id of sim limit is applied
4064  * @param[in] type Must be one of the these values
4065  * #MDM_LIMIT_NUMBER_OF_CALLS_BY_DAY,
4066  * #MDM_LIMIT_NUMBER_OF_CALLS_BY_WEEK,
4067  * #MDM_LIMIT_NUMBER_OF_CALLS_BY_MONTH
4068  * @param[in] p_value Get information of call
4069  *
4070  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
4071  *
4072  * @retval #MDM_RESULT_SUCCESS Successful
4073  * @retval #MDM_RESULT_FAIL General failure
4074  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
4075  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
4076  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
4077  *
4078  * @see mdm_msim_set_limit_of_incoming_calls
4079  *
4080  */
4081 mdm_result_t mdm_msim_get_limit_of_incoming_calls(const char *id, mdm_call_limit_t type, unsigned int *p_value);
4082 
4083 /*
4084  * @brief API to get the limit of incoming SMSs for day, week or month
4085  *
4086  * @since_mdm 1.1.0
4087  *
4088  * @since_tizen 2.3.2.3
4089  *
4090  * @feature %http://developer.samsung.com/tizen/feature/mdm
4091  *
4092  * @par Usage:
4093  * This method returns the restricted limit of number of incoming SMSs based on the parameter passed to it
4094  *
4095  * @code{.c}
4096  int value = 0;
4097  mdm_result_t ret = mdm_msim_get_limit_of_incoming_sms("SIM1", MDM_LIMIT_NUMBER_OF_SMS_BY_DAY, &value);
4098  if (ret == MDM_RESULT_SUCCESS) {
4099  printf("%d", value);
4100  }
4101  *
4102  * @endcode
4103  *
4104  * @param[in] id id of sim limit is applied
4105  * @param[in] type Must be one of the these values
4106  * #MDM_LIMIT_NUMBER_OF_SMS_BY_DAY,
4107  * #MDM_LIMIT_NUMBER_OF_SMS_BY_WEEK,
4108  * #MDM_LIMIT_NUMBER_OF_SMS_BY_MONTH
4109  * @param[in] p_value Get information of sms
4110  *
4111  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
4112  *
4113  * @retval #MDM_RESULT_SUCCESS Successful
4114  * @retval #MDM_RESULT_FAIL General failure
4115  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
4116  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
4117  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
4118  *
4119  * @see mdm_msim_set_limit_of_incoming_sms
4120  *
4121  */
4122 mdm_result_t mdm_msim_get_limit_of_incoming_sms(const char *id, mdm_sms_limit_t type, unsigned int *p_value);
4123 
4124 /*
4125  * @brief API to get the limit of outgoing calls for day, week or month
4126  *
4127  * @since_mdm 1.1.0
4128  *
4129  * @since_tizen 2.3.2.3
4130  *
4131  * @feature %http://developer.samsung.com/tizen/feature/mdm
4132  *
4133  * @par Usage:
4134  * This method returns the restricted limit of number of outgoing calls based on the parameter passed to it
4135  *
4136  * @code{.c}
4137  int value = 0;
4138  mdm_result_t ret = mdm_msim_get_limit_of_outgoing_calls("SIM1", MDM_LIMIT_NUMBER_OF_CALLS_BY_DAY, &value);
4139  if (ret == MDM_RESULT_SUCCESS) {
4140  printf("%d", value);
4141  }
4142  *
4143  * @endcode
4144  *
4145  * @param[in] id Id of sim limit is applied
4146  * @param[in] type Must be one of the these values
4147  * #MDM_LIMIT_NUMBER_OF_CALLS_BY_DAY,
4148  * #MDM_LIMIT_NUMBER_OF_CALLS_BY_WEEK,
4149  * #MDM_LIMIT_NUMBER_OF_CALLS_BY_MONTH
4150  * @param[in] p_value Get information of call
4151  *
4152  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
4153  *
4154  * @retval #MDM_RESULT_SUCCESS Successful
4155  * @retval #MDM_RESULT_FAIL General failure
4156  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
4157  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
4158  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
4159  *
4160  * @see mdm_msim_set_limit_of_outgoing_calls
4161  *
4162  */
4163 mdm_result_t mdm_msim_get_limit_of_outgoing_calls(const char *id, mdm_call_limit_t type, unsigned int *p_value);
4164 
4165 /*
4166  * @brief API to get the limit of outgoing SMSs for day, week or month
4167  *
4168  * @since_mdm 1.1.0
4169  *
4170  * @since_tizen 2.3.2.3
4171  *
4172  * @feature %http://developer.samsung.com/tizen/feature/mdm
4173  *
4174  * @par Usage:
4175  * This method returns the restricted limit of number of outgoing SMSs based on the parameter passed to it
4176  *
4177  * @code{.c}
4178  int value = 0;
4179  mdm_result_t ret = mdm_msim_get_limit_of_outgoing_sms("SIM1", MDM_LIMIT_NUMBER_OF_SMS_BY_DAY, &value);
4180  if (ret == MDM_RESULT_SUCCESS) {
4181  printf("%d", value);
4182  }
4183  *
4184  * @endcode
4185  *
4186  * @param[in] id Id of sim limit is applied
4187  * @param[in] type Must be one of the these values
4188  * #MDM_LIMIT_NUMBER_OF_SMS_BY_DAY,
4189  * #MDM_LIMIT_NUMBER_OF_SMS_BY_WEEK,
4190  * #MDM_LIMIT_NUMBER_OF_SMS_BY_MONTH
4191  * @param[in] p_value Get information of sms
4192  *
4193  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
4194  *
4195  * @retval #MDM_RESULT_SUCCESS Successful
4196  * @retval #MDM_RESULT_FAIL General failure
4197  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
4198  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
4199  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
4200  *
4201  * @see mdm_msim_set_limit_of_outgoing_sms
4202  *
4203  */
4204 mdm_result_t mdm_msim_get_limit_of_outgoing_sms(const char *id, mdm_sms_limit_t type, unsigned int *p_value);
4205 
4206 /*
4207  * @brief API to set the limit of number of incoming calls per day, week and month
4208  *
4209  * @since_mdm 1.1.0
4210  *
4211  * @since_tizen 2.3.2.3
4212  *
4213  * @feature %http://developer.samsung.com/tizen/feature/mdm
4214  *
4215  * @par Usage:
4216  * Admin can set a limit to the number of incoming calls by day, week or month. Passing "0" as a parameter means that
4217  there is no limit on the number of calls to what it is related (day, week or month).
4218  *
4219  * @code{.c}
4220  // Set the incoming call limit to 5 by day, no limit by week, 100 by month
4221  mdm_result_t ret = mdm_msim_set_limit_of_incoming_calls("SIM1", 5, 0, 100);
4222  if (ret != MDM_RESULT_SUCCESS) {
4223  // failed setting count
4224  } else {
4225  // success setting count
4226  }
4227  *
4228  * @endcode
4229  *
4230  * @privlevel public
4231  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
4232  *
4233  * @param[in] id Id of sim limit is applied
4234  * @param[in] limitbyday The maximum number of bytes for a day.
4235  * @param[in] limitbyweek The maximum number of bytes for a week.
4236  * @param[in] limitbymonth The maximum number of bytes for a month.
4237  *
4238  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
4239  *
4240  * @retval #MDM_RESULT_SUCCESS Successful
4241  * @retval #MDM_RESULT_FAIL General failure
4242  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
4243  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
4244  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
4245  *
4246  * @par Permission:
4247  * Usage of this API is restricted to registered clients only.
4248  *
4249  * @see mdm_msim_get_limit_of_incoming_calls
4250  *
4251  */
4252 mdm_result_t mdm_msim_set_limit_of_incoming_calls(const char *id, unsigned int limitbyday, unsigned int limitbyweek,
4253  unsigned int limitbymonth);
4254 
4255 /*
4256  * @brief API to set the limit of number of incoming SMSs per day, week and month
4257  *
4258  * @since_mdm 1.1.0
4259  *
4260  * @since_tizen 2.3.2.3
4261  *
4262  * @feature %http://developer.samsung.com/tizen/feature/mdm
4263  *
4264  * @par Usage:
4265  * Admin can set a limit to the number of incoming SMSs by day, week or month. Passing "0" as a parameter means that
4266  there is no limit on the number of SMSs to what it is related (day, week or month).
4267  *
4268  * @code{.c}
4269  // Set the incoming sms limit to 5 by day, no limit by week, 100 by month
4270  mdm_result_t ret = mdm_msim_set_limit_of_incoming_sms("SIM1", 5, 0, 100);
4271  if (ret != MDM_RESULT_SUCCESS) {
4272  // failed setting count
4273  } else {
4274  // success setting count
4275  }
4276  *
4277  * @endcode
4278  *
4279  * @privlevel public
4280  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
4281  *
4282  * @param[in] id Id of sim limit is applied
4283  * @param[in] limitbyday The maximum number of bytes for a day.
4284  * @param[in] limitbyweek The maximum number of bytes for a week.
4285  * @param[in] limitbymonth The maximum number of bytes for a month.
4286  *
4287  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
4288  *
4289  * @retval #MDM_RESULT_SUCCESS Successful
4290  * @retval #MDM_RESULT_FAIL General failure
4291  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
4292  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
4293  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
4294  *
4295  * @par Permission:
4296  * Usage of this API is restricted to registered clients only.
4297  *
4298  * @see mdm_msim_get_limit_of_incoming_sms
4299  *
4300  */
4301 mdm_result_t mdm_msim_set_limit_of_incoming_sms(const char *id, unsigned int limitbyday, unsigned int limitbyweek,
4302  unsigned int limitbymonth);
4303 
4304 /*
4305  * @brief API to set the limit of number of outgoing calls per day, week and month
4306  *
4307  * @since_mdm 1.1.0
4308  *
4309  * @since_tizen 2.3.2.3
4310  *
4311  * @feature %http://developer.samsung.com/tizen/feature/mdm
4312  *
4313  * @par Usage:
4314  * Admin can set a limit to the number of outgoing calls by day, week or month. Passing "0" as a parameter means that
4315  there is no limit on the number of calls to what it is related (day, week or month).
4316  *
4317  * @code{.c}
4318  // Set the outgoing calls limit to 5 by day, no limit by week, 100 by month
4319  mdm_result_t ret = mdm_msim_set_limit_of_outgoing_calls2("SIM1", 5, 0, 100);
4320  if (ret != MDM_RESULT_SUCCESS) {
4321  // failed setting count
4322  } else {
4323  // success setting count
4324  }
4325  *
4326  * @endcode
4327  *
4328  * @privlevel public
4329  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
4330  *
4331  * @param[in] id Id of sim limit is applied
4332  * @param[in] limitbyday The maximum number of bytes for a day.
4333  * @param[in] limitbyweek The maximum number of bytes for a week.
4334  * @param[in] limitbymonth The maximum number of bytes for a month.
4335  *
4336  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
4337  *
4338  * @retval #MDM_RESULT_SUCCESS Successful
4339  * @retval #MDM_RESULT_FAIL General failure
4340  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
4341  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
4342  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
4343  *
4344  * @par Permission:
4345  * Usage of this API is restricted to registered clients only.
4346  *
4347  * @see mdm_msim_get_limit_of_outgoing_calls
4348  *
4349  */
4350 mdm_result_t mdm_msim_set_limit_of_outgoing_calls(const char *id, unsigned int limitbyday, unsigned int limitbyweek,
4351  unsigned int limitbymonth);
4352 
4353 /*
4354  * @brief API to set the limit of number of outgoing SMSs per day, week and month
4355  *
4356  * @since_mdm 1.1.0
4357  *
4358  * @since_tizen 2.3.2.3
4359  *
4360  * @feature %http://developer.samsung.com/tizen/feature/mdm
4361  *
4362  * @par Usage:
4363  * Admin can set a limit to the number of outgoing SMSs by day, week or month. Passing "0" as a parameter means that
4364  there is no limit on the number of SMSs to what it is related (day, week or month).
4365  *
4366  * @code{.c}
4367  // Set the outgoing SMS limit to 5 by day, no limit by week, 100 by month
4368  mdm_result_t ret = mdm_msim_set_limit_of_outgoing_sms("SIM1", 5, 0, 100);
4369  if (ret != MDM_RESULT_SUCCESS) {
4370  // failed setting count
4371  } else {
4372  // success setting count
4373  }
4374  *
4375  * @endcode
4376  *
4377  * @privlevel public
4378  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
4379  *
4380  * @param[in] id Id of sim limit is applied
4381  * @param[in] limitbyday The maximum number of bytes for a day.
4382  * @param[in] limitbyweek The maximum number of bytes for a week.
4383  * @param[in] limitbymonth The maximum number of bytes for a month.
4384  *
4385  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
4386  *
4387  * @retval #MDM_RESULT_SUCCESS Successful
4388  * @retval #MDM_RESULT_FAIL General failure
4389  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
4390  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
4391  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
4392  *
4393  * @par Permission:
4394  * Usage of this API is restricted to registered clients only.
4395  *
4396  * @see mdm_msim_get_limit_of_outgoing_sms
4397  *
4398  */
4399 mdm_result_t mdm_msim_set_limit_of_outgoing_sms(const char *id, unsigned int limitbyday, unsigned int limitbyweek,
4400  unsigned int limitbymonth);
4401 
4402 /*
4403  * @brief API to check whether data carrier network usage limit is enabled or not per SIM.
4404  *
4405  * @since_mdm 1.1.0
4406  *
4407  * @since_tizen 2.3.2.3
4408  *
4409  * @feature %http://developer.samsung.com/tizen/feature/mdm
4410  *
4411  * @par Usage:
4412  * Applications, services and admin client can use this interface to verify if data call limiting policy is enabled on
4413  * the device.
4414  * @note If the limit of data has been enabled by admin client no other application shall allow alerting this limit.
4415  *
4416  * @code{.c}
4417  *
4418  * // Sample code that demonstrates how setting application can decide whether enable or disable data call limit
4419  * // submenu.
4420  * mdm_status_t ret = mdm_msim_get_data_call_limit_enabled(id, n_all_admin);
4421  * if (ret != MDM_STATUS_ERROR) {
4422  * if (ret == MDM_ENABLED) {
4423  * // Admin client controls data call limits. Disable the data call limit submenu.
4424  * _set_enabled(submenu_data_call_limit, FALSE);
4425  *
4426  * } else {
4427  * // Admin client doesn't control data call limits - control is left for user. Enable the data call limit
4428  * submenu.
4429  * _set_enabled(submenu_data_call_limit, TRUE);
4430  * }
4431  * } else {
4432  * // function error
4433  * }
4434  *
4435  * @endcode
4436  *
4437  * @param[in] id SIM id.
4438  *
4439  * @return #mdm_status_t : Current mode of operation, one of #MDM_ENABLED or #MDM_DISABLED
4440  *
4441  * @see mdm_msim_enable_data_call_limit
4442  * @see mdm_msim_get_limit_of_data_calls
4443  */
4444 mdm_status_t mdm_msim_get_data_call_limit_enabled(const char *id);
4445 
4446 /*
4447  * @brief API to check if number of calls are limited per SIM.
4448  *
4449  * @since_mdm 1.1.0
4450  *
4451  * @since_tizen 2.3.2.3
4452  *
4453  * @feature %http://developer.samsung.com/tizen/feature/mdm
4454  *
4455  * @par Usage:
4456  * Admin can use this method to verify if there is a limitation on the number of calls on device per sim card.
4457  *
4458  * @code{.c}
4459  mdm_status_t ret = mdm_msim_get_limit_number_of_calls_enabled(id, n_all_admin);
4460  if (ret != MDM_STATUS_ERROR) {
4461  if (ret == MDM_TRUE) {
4462  // feature enabled
4463  } else {
4464  // feature disabled
4465  }
4466  } else {
4467  // function error
4468  }
4469  *
4470  * @endcode
4471  *
4472  * @param[in] id SIM id.
4473  *
4474  * @return #mdm_status_t : Current mode of operation, one of #MDM_ALLOWED or #MDM_RESTRICTED
4475  *
4476  * @see mdm_msim_enable_limit_number_of_calls
4477  *
4478  */
4479 mdm_status_t mdm_msim_get_limit_number_of_calls_enabled(const char *id);
4480 
4481 /*
4482  * @brief API to check if number of SMSs are limited per SIM.
4483  *
4484  * @since_mdm 1.1.0
4485  *
4486  * @since_tizen 2.3.2.3
4487  *
4488  * @feature %http://developer.samsung.com/tizen/feature/mdm
4489  *
4490  * @par Usage:
4491  * Admin can use this method to verify if there is a limitation on the number of SMSs on device per sim card.
4492  *
4493  * @code{.c}
4494  mdm_status_t ret = mdm_msim_get_limit_number_of_sms_enabled(id, n_all_admin);
4495  if (ret != MDM_STATUS_ERROR) {
4496  if (ret == MDM_TRUE) {
4497  // feature enabled
4498  } else {
4499  // feature disabled
4500  }
4501  } else {
4502  // function error
4503  }
4504  *
4505  * @endcode
4506  *
4507  * @param[in] id SIM id.
4508  *
4509  * @return #mdm_status_t : Current mode of operation, one of #MDM_ALLOWED or #MDM_RESTRICTED
4510  *
4511  * @see mdm_msim_enable_limit_number_of_sms
4512  *
4513  */
4514 mdm_status_t mdm_msim_get_limit_number_of_sms_enabled(const char *id);
4515 
4516 /*
4517  * @brief API to get the limits of sent and received data for mobile carriers per SIM.
4518  *
4519  * @since_mdm 1.1.0
4520  *
4521  * @since_tizen 2.3.2.3
4522  *
4523  * @feature %http://developer.samsung.com/tizen/feature/mdm
4524  *
4525  * @par Usage:
4526  * The API can be used by admin clients to get information about the limit of received and sent data, date the limit was
4527  * set and the period of time when the limit was set.
4528  *
4529  * @note If limit is disabled, the result of this call will fail - check with #mdm_msim_get_data_call_limit_enabled().
4530  * @note The API returns only limits set by mdm_msim_set_limit_of_data_calls(). It doesn't return how many bytes left.
4531  *
4532  * @code{.c}
4533  *
4534  * // Sample code that demonstrates how setting application can decide whether enable or disable data call limit
4535  * // submenu.
4536  *
4537  * mdm_status_t ret = mdm_msim_get_data_call_limit_enabled(id, n_all_admin);
4538  * if (ret == MDM_ENABLED) {
4539  * // Admin client controls data call limits.
4540  *
4541  * time_t date_set, period;
4542  * time_t send_limit, recv_limit;
4543  *
4544  * mdm_result_t ret = mdm_msim_get_limit_of_data_calls(id, n_all_admin, &date_set, &period, &send_limit,
4545  * &recv_limit);
4546  * if (ret == MDM_RESULT_SUCCESS) {
4547  * // Call successful, continue.
4548  *
4549  * } else {
4550  * // Call failed.
4551  * }
4552  *
4553  * } else {
4554  * // Policy is either disabled or we've got an error - check.
4555  * }
4556  *
4557  * @endcode
4558  *
4559  * @param[in] id SIM card id. Check mdm_msim_get_sim_ids() for available SIM card ids.
4560  * @param[in,out] p_date_set Date when limit has been set.
4561  * @param[in,out] p_period Period for which data call limit has been set.
4562  * @param[in,out] p_send_limit Amount of data device can send in given period in megabytes.
4563  * @param[in,out] p_recv_limit Amount of data device can receive in given period in megabytes.
4564  *
4565  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
4566  *
4567  * @retval #MDM_RESULT_SUCCESS Successful
4568  * @retval #MDM_RESULT_FAIL General failure
4569  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
4570  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
4571  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
4572  *
4573  * @see mdm_msim_set_limit_of_data_calls
4574  * @see mdm_msim_get_data_call_limit_enabled
4575  *
4576  */
4577 mdm_result_t mdm_msim_get_limit_of_data_calls(const char *id, time_t *p_date_set, time_t *p_period,
4578  size_t *p_send_limit, size_t *p_recv_limit);
4579 
4580 /*
4581  * @brief API to enable or disable limit of number of calls
4582  *
4583  * @since_mdm 1.1.0
4584  *
4585  * @since_tizen 2.3.2.3
4586  *
4587  * @feature %http://developer.samsung.com/tizen/feature/mdm
4588  *
4589  * @par Usage:
4590  * Admin can use this policy to enable or disable the limit of number of calls allowed on the device.
4591  * This policy is complemented by: #mdm_msim_set_limit_of_incoming_calls() and #mdm_msim_set_limit_of_outgoing_calls().
4592  *
4593  * @code{.c}
4594  mdm_result_t ret = mdm_msim_enable_limit_number_of_calls(id, TRUE);
4595  if (ret != MDM_RESULT_SUCCESS) {
4596  // function error
4597  } else {
4598  // function success
4599  }
4600  *
4601  * @endcode
4602  *
4603  * @privlevel public
4604  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
4605  *
4606  * @param[in] id SIM id.
4607  * @param[in] status True to enable limit number of calls, false to disable limit number of calls.
4608  *
4609  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
4610  *
4611  * @retval #MDM_RESULT_SUCCESS Successful
4612  * @retval #MDM_RESULT_FAIL General failure
4613  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
4614  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
4615  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
4616  *
4617  * @par Permission:
4618  * Usage of this API is restricted to registered clients only.
4619  *
4620  * @see mdm_msim_set_limit_of_incoming_calls
4621  * @see mdm_msim_set_limit_of_outgoing_calls
4622  */
4623 mdm_result_t mdm_msim_enable_limit_number_of_calls(const char *id, mdm_status_t status);
4624 
4625 /*
4626  * @brief API to enable or disable limit of number of SMSs
4627  *
4628  * @since_mdm 1.1.0
4629  *
4630  * @since_tizen 2.3.2.3
4631  *
4632  * @feature %http://developer.samsung.com/tizen/feature/mdm
4633  *
4634  * @par Usage:
4635  * Admin can use this policy to enable or disable the limit of number of calls allowed on the device.
4636  * This policy is complemented by: #mdm_msim_set_limit_of_incoming_sms and #mdm_msim_set_limit_of_outgoing_sms.
4637  *
4638  * @code{.c}
4639  mdm_result_t ret = mdm_msim_enable_limit_number_of_sms(id, TRUE);
4640  if (ret != MDM_RESULT_SUCCESS) {
4641  // function error
4642  } else {
4643  // function success
4644  }
4645  *
4646  * @endcode
4647  *
4648  * @privlevel public
4649  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
4650  *
4651  * @param[in] id SIM id.
4652  * @param[in] status True to enable limit number of SMSs, false to disable limit number of SMSs.
4653  *
4654  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
4655  *
4656  * @retval #MDM_RESULT_SUCCESS Successful
4657  * @retval #MDM_RESULT_FAIL General failure
4658  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
4659  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
4660  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
4661  *
4662  * @par Permission:
4663  * Usage of this API is restricted to registered clients only.
4664  *
4665  * @see mdm_msim_set_limit_of_incoming_sms, mdm_msim_set_limit_of_outgoing_sms
4666  *
4667  */
4668 mdm_result_t mdm_msim_enable_limit_number_of_sms(const char *id, mdm_status_t status);
4669 
4670 /*
4671  * @brief API to enable limit of data packet on the device
4672  *
4673  * @since_mdm 1.1.0
4674  *
4675  * @since_tizen 2.3.2.3
4676  *
4677  * @feature %http://developer.samsung.com/tizen/feature/mdm
4678  *
4679  * @par Usage:
4680  * Using this API admin client can enable the limit on data packet traffic. The default value for this policy is
4681  * MDM_DISABLED (it is disabled by default).
4682  *
4683  * @remark
4684  * Restriction #mdm_status_t is written to #MDM_POLICY_ON_DATA_LIMIT notification file.
4685  * You can register a callback for this event using #mdm_register_policy_receiver.
4686  *
4687  * @note To enforce a limit one must call #mdm_set_limit_of_data_calls().
4688  *
4689  * @code{.c}
4690  *
4691  * mdm_result_t ret = mdm_msim_enable_data_call_limit(id, MDM_ENABLED);
4692  * if (ret != MDM_RESULT_SUCCESS) {
4693  * // Handle error.
4694  *
4695  * } else {
4696  * // Limit enabled. Now enforce specific limit: for a week we set 100 MB of sent and received data.
4697  * time_t WEEK = (time_t)7*24*60*60
4698  * ret = mdm_msim_set_limit_of_data_calls(WEEK, 100, 100);
4699  * if (ret != MDM_RESULT_SUCCESS) {
4700  * // Handle error
4701  * }
4702  * }
4703  *
4704  * @endcode
4705  *
4706  * @privlevel public
4707  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
4708  *
4709  * @param[in] id SIM id.
4710  * @param[in] status #MDM_ENABLED if the device shall limit the data call statistics (count amount of data) No
4711  * limit will be set unless #mdm_set_limit_of_data_calls() is called after this function. When
4712  * #MDM_DISABLED is passed, all limits set are removed.
4713  *
4714  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
4715  *
4716  * @retval #MDM_RESULT_SUCCESS Successful
4717  * @retval #MDM_RESULT_FAIL General failure
4718  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
4719  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
4720  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
4721  *
4722  * @par Permission:
4723  * Usage of this API is restricted to registered clients only.
4724  *
4725  * @see mdm_msim_set_limit_of_data_calls
4726  * @see mdm_msim_get_data_call_limit_enabled
4727  *
4728  */
4729 mdm_result_t mdm_msim_enable_data_call_limit(const char *id, mdm_status_t status);
4730 
4731 /*
4732  * @brief API to set the limit of data packet for given period.
4733  *
4734  * @since_mdm 1.1.0
4735  *
4736  * @since_tizen 2.3.2.3
4737  *
4738  * @feature %http://developer.samsung.com/tizen/feature/mdm
4739  *
4740  * @par Usage:
4741  * Admin client can use this interface to limit the amount of data sent and received through carriers network for given
4742  * period of time. Counting of the time period starts at the moment of calling this function.
4743  *
4744  * @remark
4745  * Set limit is signalized by #MDM_POLICY_ON_DATA_LIMIT notification.
4746  * You can register a callback for this event using #mdm_register_policy_receiver.
4747  *
4748  * @note - Before calling this function, data call limit has to be enbled with #mdm_enable_data_call_limit(). Otherwise
4749  * this function will fail and no limit will be enforced.
4750  * - The total limit size set by this API is a combination of the #sent_limit and #recv_limit.
4751  * - It is only possible to set limits for daily, weekly and monthly periods in seconds.
4752  * - Passing #period with different values than the specified before follows the rule below:
4753  * Daily period will be set if period >= 0 or period <= 86400.
4754  * Weekly period will be set if period > 86400 or period <= 604800.
4755  * Montly period will be set if period > 604800.
4756  *
4757  * @code{.c}
4758 
4759  * mdm_result_t ret = mdm_msim_enable_data_call_limit(id, MDM_ENABLED);
4760  * if (ret != MDM_RESULT_SUCCESS) {
4761  * // Handle error.
4762  *
4763  * } else {
4764  * // Limit enabled. Now enforce specific limit: for a week we set 100 MB of sent and received data.
4765  * time_t WEEK = (time_t)7*24*60*60
4766  * ret = mdm_msim_set_limit_of_data_calls(id, WEEK, 100, 100);
4767  * if (ret != MDM_RESULT_SUCCESS) {
4768  * // Handle error
4769  * }
4770  * }
4771  *
4772  * @endcode
4773  *
4774  * @privlevel public
4775  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
4776  *
4777  * @param[in] id SIM id.
4778  * @param[in] period Time period in seconds.
4779  * @param[in] sent_limit Limit in megabytes for sent data.
4780  * @param[in] recv_limit Limit in megabytes for received data.
4781  *
4782  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
4783  *
4784  * @retval #MDM_RESULT_SUCCESS Successful
4785  * @retval #MDM_RESULT_FAIL General failure
4786  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
4787  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
4788  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
4789  *
4790  * @par Permission:
4791  * Usage of this API is restricted to registered clients only.
4792  *
4793  * @see mdm_msim_enable_data_call_limit
4794  * @see mdm_msim_get_data_call_limit_enabled
4795  * @see mdm_msim_get_limit_of_data_calls
4796  */
4797 mdm_result_t mdm_msim_set_limit_of_data_calls(const char *id, time_t period, size_t sent_limit, size_t recv_limit);
4798 
4799 /*
4800  * @brief API to reset the counters for incoming and outgoing calls
4801  *
4802  * @since_mdm 1.1.0
4803  *
4804  * @since_tizen 2.3.2.3
4805  *
4806  * @feature %http://developer.samsung.com/tizen/feature/mdm
4807  *
4808  * @par Usage:
4809  * This method resets all the counters for incoming and outgoing calls for each date type (day, week and month). The
4810  limits set for each kind of call will not be changed.
4811  *
4812  * @code{.c}
4813 
4814  mdm_result_t ret = mdm_reset_call_limit_count("SIM1");
4815  if (ret != MDM_RESULT_SUCCESS) {
4816 
4817  } else {
4818 
4819  }
4820  *
4821  * @endcode
4822  *
4823  * @privlevel public
4824  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
4825  *
4826  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
4827  *
4828  * @retval #MDM_RESULT_SUCCESS Successful
4829  * @retval #MDM_RESULT_FAIL General failure
4830  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
4831  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
4832  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
4833  *
4834  * @par Permission:
4835  * Usage of this API is restricted to registered clients only.
4836  *
4837  * @see
4838  *
4839  */
4840 extern mdm_result_t mdm_msim_reset_call_limit_count(const char *id);
4841 
4842 /*
4843  * @brief API to reset the counters for incoming and outgoing sms
4844  *
4845  * @since_mdm 1.1.0
4846  *
4847  * @since_tizen 2.3.2.3
4848  *
4849  * @feature %http://developer.samsung.com/tizen/feature/mdm
4850  *
4851  * @par Usage:
4852  * This method resets all the counters for incoming and outgoing smses for each date type (day, week and month). The
4853  limits set for each kind of sms will not be changed.
4854  *
4855  * @code{.c}
4856 
4857  mdm_result_t ret = mdm_reset_sms_limit_count("SIM1");
4858  if (ret != MDM_RESULT_SUCCESS) {
4859 
4860  } else {
4861 
4862  }
4863  *
4864  * @endcode
4865  *
4866  * @privlevel public
4867  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
4868  *
4869  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
4870  *
4871  * @retval #MDM_RESULT_SUCCESS Successful
4872  * @retval #MDM_RESULT_FAIL General failure
4873  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
4874  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
4875  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
4876  *
4877  * @par Permission:
4878  * Usage of this API is restricted to registered clients only.
4879  *
4880  * @see
4881  *
4882  */
4883 extern mdm_result_t mdm_msim_reset_sms_limit_count(const char *id);
4884 
4885 /*
4886  * @remark
4887  * Reset counter is signalized by #MDM_POLICY_ON_DATA_LIMIT notification.
4888  * You can register a callback for this event using #mdm_register_policy_receiver.
4889  */
4890 extern mdm_result_t mdm_msim_reset_data_call_limit_count(const char *id);
4891 
4892 
4894 /* -----------------------------------------------------------------------------------------------------------------
4895  * END OF HIDDEN DOCUMENTATION
4896  * -----------------------------------------------------------------------------------------------------------------
4897  */
4898 
4903 #ifdef __cplusplus
4904 }
4905 #endif
4906 
4907 #endif // LIBMDM_MDM_PHONE_RESTRICTION_H
mdm_result_t mdm_add_incoming_call_restriction(char *p_pattern)
API to add a restriction pattern to the admin restriction pattern set for incoming calls...
mdm_status_t mdm_get_limit_number_of_calls_enabled(void)
API to check if number of calls are limited.
mdm_data_t * mdm_get_incoming_call_restriction(int n_all_admin)
API to get the restriction pattern for incoming calls.
This structure is used to store GList.
mdm_status_t mdm_get_data_call_limit_enabled(void)
API to check whether data carrier network usage limit is enabled or not.
mdm_result_t mdm_set_incoming_sms_restriction(char *p_pattern)
API to set a restriction pattern to be matched by incoming SMSs numbers.
mdm_result_t mdm_set_limit_of_data_calls(time_t period, size_t sent_limit, size_t recv_limit)
API to set the combined limit of data packet for given period.
mdm_call_limit_t
The the number of call limit by day/week/month.
mdm_result_t mdm_enable_limit_number_of_calls(mdm_status_t status)
API to enable or disable limit of number of calls.
mdm_data_t * mdm_get_incoming_sms_restriction(int n_all_admin)
API to get the restriction pattern for incoming SMS.
mdm_result_t mdm_set_limit_of_outgoing_calls(unsigned int limitbyday, unsigned int limitbyweek, unsigned int limitbymonth)
API to set the limit of number of outgoing calls per day, week and month.
mdm_result_t mdm_enable_emergency_call_only(mdm_status_t status)
API to enable or disable emergency calls only on device.
mdm_status_t
MDM Policy status.
mdm_result_t mdm_remove_incoming_call_restriction(void)
API to remove the restriction pattern for incoming calls set by the calling admin.
mdm_result_t mdm_set_limit_of_outgoing_sms(unsigned int limitbyday, unsigned int limitbyweek, unsigned int limitbymonth)
API to set the limit of number of outgoing SMSs per day, week and month.
mdm_result_t mdm_set_outgoing_sms_restriction(char *p_pattern)
API to set a restriction pattern to be matched by outgoing sms numbers.
mdm_call_type_t
The the call types for operations.
mdm_result_t mdm_set_incoming_call_restriction(char *p_pattern)
API to set a restriction pattern to be matched by incoming call numbers.
mdm_result_t mdm_add_incoming_sms_restriction(char *p_pattern)
API to add a restriction pattern to the admin restriction pattern set for incoming SMSs...
mdm_result_t mdm_reset_sms_limit_count(void)
API to reset the counters for incoming or outgoing SMSs.
mdm_result_t mdm_reset_call_limit_count(void)
API to reset the counters for incoming and outgoing calls.
mdm_result_t mdm_enable_data_call_limit(mdm_status_t status)
API to enable limit of data packet on the device.
mdm_result_t mdm_set_limit_of_incoming_calls(unsigned int limitbyday, unsigned int limitbyweek, unsigned int limitbymonth)
API to set the limit of number of incoming calls per day, week and month.
mdm_result_t mdm_set_limit_of_incoming_sms(unsigned int limitbyday, unsigned int limitbyweek, unsigned int limitbymonth)
API to set the limit of number of incoming SMSs per day, week and month.
mdm_result_t mdm_get_limit_of_outgoing_calls(mdm_call_limit_t type, unsigned int *p_value)
API to get the limit of outgoing calls for day, week or month.
mdm_data_t * mdm_get_outgoing_call_restriction(int n_all_admin)
API to get the restriction pattern for outgoing calls.
mdm_result_t mdm_get_limit_of_incoming_calls(mdm_call_limit_t type, unsigned int *p_value)
API to get the limit of incoming calls for day, week or month.
mdm_result_t mdm_get_limit_of_data_calls(time_t *p_date_set, time_t *p_period, size_t *p_send_limit, size_t *p_recv_limit)
API to get the limits of sent and received data for mobile carriers.
mdm_result_t mdm_get_limit_of_incoming_sms(mdm_sms_limit_t type, unsigned int *p_value)
API to get the limit of incoming SMSs for day, week or month.
mdm_result_t mdm_add_outgoing_call_restriction(char *p_pattern)
API to add a restriction pattern to the admin restriction pattern set for outgoing calls...
mdm_result_t mdm_remove_outgoing_call_restriction(void)
API to remove the restriction pattern for outgoing calls set by the calling admin.
mdm_result_t
MDM API result.
mdm_result_t mdm_add_outgoing_sms_restriction(char *p_pattern)
API to add a restriction pattern to the admin restriction pattern set for outgoing SMSs...
mdm_sms_limit_t
The the number of sms limit by day/week/month.
mdm_result_t mdm_set_outgoing_call_restriction(char *p_pattern)
API to set a restriction pattern to be matched by outgoing call numbers.
mdm_result_t mdm_get_limit_of_outgoing_sms(mdm_sms_limit_t type, unsigned int *p_value)
API to get the limit of outgoing SMSs for day, week or month.
mdm_status_t mdm_get_emergency_call_only_enabled(void)
API to check if only emergency calls are allowed on device.
mdm_result_t mdm_remove_incoming_sms_restriction(void)
API to remove the restriction pattern for incoming SMSs set by the calling admin. ...
mdm_status_t mdm_get_limit_number_of_sms_enabled(void)
API to check if number of SMSs are limited.
mdm_data_t * mdm_get_outgoing_sms_restriction(int n_all_admin)
API to get the restriction pattern for outgoing SMS.
mdm_result_t mdm_enable_limit_number_of_sms(mdm_status_t status)
API to enable or disable limit of number of SMSs.
mdm_result_t mdm_reset_data_call_limit_count(void)
API to reset the counters of amount of data packet sent and received on device.
mdm_result_t mdm_remove_outgoing_sms_restriction(void)
API to remove the restriction pattern for outgoing SMSs set by the calling admin. ...
mdm_direction_t
Defines direction of call and SMS events.