Knox Tizen Wearable SDK
Phone Restriction policy group

Phone Restriction policy group provides policies for phone setting control. More...

Enumerations

Functions

mdm_status_t mdm_get_emergency_call_only_enabled (void)
 API to check if only emergency calls are allowed on device. More...
 
mdm_status_t mdm_get_data_call_limit_enabled (void)
 API to check whether data carrier network usage limit is enabled or not. More...
 
mdm_status_t mdm_get_limit_number_of_calls_enabled (void)
 API to check if number of calls are limited. More...
 
mdm_status_t mdm_get_limit_number_of_sms_enabled (void)
 API to check if number of SMSs are limited. More...
 
mdm_data_tmdm_get_incoming_call_restriction (int n_all_admin)
 API to get the restriction pattern for incoming calls. More...
 
mdm_data_tmdm_get_incoming_sms_restriction (int n_all_admin)
 API to get the restriction pattern for incoming SMS. More...
 
mdm_data_tmdm_get_outgoing_call_restriction (int n_all_admin)
 API to get the restriction pattern for outgoing calls. More...
 
mdm_data_tmdm_get_outgoing_sms_restriction (int n_all_admin)
 API to get the restriction pattern for outgoing SMS. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
mdm_result_t mdm_enable_limit_number_of_calls (mdm_status_t status)
 API to enable or disable limit of number of calls. More...
 
mdm_result_t mdm_enable_limit_number_of_sms (mdm_status_t status)
 API to enable or disable limit of number of SMSs. More...
 
mdm_result_t mdm_enable_data_call_limit (mdm_status_t status)
 API to enable limit of data packet on the device. More...
 
mdm_result_t mdm_enable_emergency_call_only (mdm_status_t status)
 API to enable or disable emergency calls only on device. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
mdm_result_t mdm_remove_incoming_call_restriction (void)
 API to remove the restriction pattern for incoming calls set by the calling admin. More...
 
mdm_result_t mdm_remove_incoming_sms_restriction (void)
 API to remove the restriction pattern for incoming SMSs set by the calling admin. More...
 
mdm_result_t mdm_remove_outgoing_call_restriction (void)
 API to remove the restriction pattern for outgoing calls set by the calling admin. More...
 
mdm_result_t mdm_remove_outgoing_sms_restriction (void)
 API to remove the restriction pattern for outgoing SMSs set by the calling admin. More...
 
mdm_result_t mdm_reset_call_limit_count (void)
 API to reset the counters for incoming and outgoing calls. More...
 
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. More...
 
mdm_result_t mdm_reset_sms_limit_count (void)
 API to reset the counters for incoming or outgoing SMSs. More...
 
mdm_result_t mdm_set_incoming_call_restriction (char *p_pattern)
 API to set a restriction pattern to be matched by incoming call numbers. More...
 
mdm_result_t mdm_set_incoming_sms_restriction (char *p_pattern)
 API to set a restriction pattern to be matched by incoming SMSs numbers. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
mdm_result_t mdm_set_outgoing_call_restriction (char *p_pattern)
 API to set a restriction pattern to be matched by outgoing call numbers. More...
 
mdm_result_t mdm_set_outgoing_sms_restriction (char *p_pattern)
 API to set a restriction pattern to be matched by outgoing sms numbers. More...
 
mdm_result_t knox_mdm_allowed_incoming_calls_add (const char *sim_id, const char *pattern)
 API to add an allowed pattern for incoming calls. More...
 
mdm_result_t knox_mdm_allowed_incoming_calls_remove (const char *sim_id)
 API to remove all allowed patterns of incoming calls set by the calling admin. More...
 
mdm_data_tknox_mdm_allowed_incoming_calls_get (const char *sim_id, bool all_admins)
 API to get the list of allowed patterns for incoming calls. More...
 

Detailed Description

Phone Restriction policy group provides policies for phone setting control.

Phone Restriction policy group.

Required Header

#include <mdm.h>

Overview

This group provides APIs to control the various settings related to telephony functionality.

Pattern matching considerations

It is important to note that APIs that receive a regex pattern as an argument must be aligned to the ‘posix-extended’ regular expression syntax.

Examples of some valid expressions are as follows:

.* matches ALL phone numbers.

011.* matches all phone numbers started with 011 (international code) E.g. numbers NOT matched: 8001234567, 8005557890, 18001234567, 800-123-4567, 1-800-1234-567, 800123456, 80012345678, 5551234567, 8015557890; numbers matched: 011551912345678

(900[0-9]{7}$).* matches phone numbers started with 900 followed by exactly seven digits. E.g. numbers matched: 9001234567, 9005557890

(900[-]?[0-9]{3}[-]?[0-9]{4}$).* same as above, plus optional dashes. E.g. numbers matched: 9001234567, 900-555-7890, 900-9001234, 900123-4567

NOTE: The backslash before hyphen indicates to treat the hyphen as literal, not as regex symbol.

(?!800[0-9]{7}$).* matches all numbers EXCEPT numbers started with 800 followed by exactly seven digits. E.g. numbers NOT matched: 8001234567, 8005557890; numbers matched: 800123456, 80012345678, 800-123-4567, 18001234567, 1-800-1234-567, 5551234567, 8015557890, 011551912345678

(?![1]?800[0-9]{7}$).* matches all numbers EXCEPT numbers started with [optional "1" digit]800 followed by exactly seven digits. E.g. numbers NOT matched: 8001234567, 8005557890, 18001234567; numbers matched: 800123456, 80012345678, 800-123-4567, 1-800-1234-567, 5551234567, 8015557890, 011551912345678

NOTE: The international code may be sent by cellular carrier or not. Some of the possibilities: 1[number], 1-[number], +1[number], +1-[number].

(?![1]?[-]?800[-]?[0-9]{3}[-]?[0-9]{4}$).* same as above, plus optional dashes E.g. numbers NOT matched: 8001234567, 8005557890, 18001234567, 800-123-4567, 1-800-1234-567; numbers matched: 800123456, 80012345678, 5551234567, 8015557890, 011551912345678

Enumeration Type Documentation

The the number of call limit by day/week/month.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
See also
Enumerator
MDM_LIMIT_NUMBER_OF_CALLS_BY_DAY 

Flag to be used to retrieve the number of incoming or outgoing calls allowed by day.

MDM_LIMIT_NUMBER_OF_CALLS_BY_WEEK 

Flag to be used to retrieve the number of incoming or outgoing calls allowed by week.

MDM_LIMIT_NUMBER_OF_CALLS_BY_MONTH 

Flag to be used to retrieve the number of incoming or outgoing calls allowed by month.

Definition at line 42 of file phone_restriction.h.

The the call types for operations.

Since (Knox_wearable):
1.1.0
Since (Tizen):
2.3.2.3
See also
Enumerator
MDM_CALL_TYPE_SMS 

Enum to search in sms restriction

MDM_CALL_TYPE_CALL 

Enum to search in call restriction

MDM_CALL_TYPE_DATA_CALL 

Enum to search in data call restriction

Definition at line 72 of file phone_restriction.h.

The the number of sms limit by day/week/month.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
See also
Enumerator
MDM_LIMIT_NUMBER_OF_SMS_BY_DAY 

Flag to be used to retrieve the number of sent or received sms allowed by day.

MDM_LIMIT_NUMBER_OF_SMS_BY_WEEK 

Flag to be used to retrieve the number of sent or received sms allowed by week.

MDM_LIMIT_NUMBER_OF_SMS_BY_MONTH 

Flag to be used to retrieve the number of sent or received sms allowed by month.

Definition at line 57 of file phone_restriction.h.

Function Documentation

mdm_result_t knox_mdm_allowed_incoming_calls_add ( const char *  sim_id,
const char *  pattern 
)

API to add an allowed pattern for incoming calls.

Since (Knox_wearable):
2.4.0
Since (Tizen):
4.0.0.6
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This API adds (concatenates) the provided allowed pattern to the allowed pattern set for incoming calls.
// previous patterns will remain and the new pattern will be added,
// .* matches an arbitrary string
if (ret != MDM_RESULT_SUCCESS) {
// function error
} else {
// function success
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]sim_idSIM card id
[in]patternThe allowed pattern to be matched against the incoming call number
Returns
MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
See also
knox_mdm_allowed_incoming_calls_remove
mdm_data_t* knox_mdm_allowed_incoming_calls_get ( const char *  sim_id,
bool  all_admins 
)

API to get the list of allowed patterns for incoming calls.

Since (Knox_wearable):
2.4.0
Since (Tizen):
4.0.0.6
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can use this API to retrieve the current patterns being used to allowed in incoming calls.
if (lp_data) {
printf("data : %s", (char *)lp_data->data);
mdm_free_data(lp_data);
}
Parameters
[in]sim_idSIM card id
[in]all_adminsTrue to get a composition of all allowed pattern from all admins, false to get allowed pattern from the calling admin
Returns
mdm_data_t: A list of allowed patterns for incoming call and a return error code
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
See also
knox_mdm_allowed_incoming_calls_add
knox_mdm_allowed_incoming_calls_remove
mdm_result_t knox_mdm_allowed_incoming_calls_remove ( const char *  sim_id)

API to remove all allowed patterns of incoming calls set by the calling admin.

Since (Knox_wearable):
2.4.0
Since (Tizen):
4.0.0.6
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This method removes the pattern set by the caller admin for allowed incoming calls
if (ret != MDM_RESULT_SUCCESS) {
// function error
} else {
// function success
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]sim_idSIM card id
Returns
MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
See also
knox_mdm_allowed_incoming_calls_add
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.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This API adds (concatenates) the provided restriction pattern to the restriction pattern set of the admin for incoming calls.
// previous patterns will remain and the new pattern will be added
if (ret != MDM_RESULT_SUCCESS) {
// function error
} else {
// function success
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]p_patternThe restriction pattern to be matched against the incoming call number
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_remove_incoming_call_restriction
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.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This API adds (concatenates) the provided restriction pattern to the restriction pattern set of the admin for incoming SMSs.
// previous patterns will remain and the new pattern will be added
if (ret != MDM_RESULT_SUCCESS) {
// function error
} else {
// function success
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]p_patternThe restriction pattern to be matched against the incoming sms number
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_remove_incoming_sms_restriction
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.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This API adds (concatenates) the provided restriction pattern to the restriction pattern set of the admin for outgoing calls.
// previous patterns will remain and the new pattern will be added
if (ret != MDM_RESULT_SUCCESS) {
// function error
} else {
// function success
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]p_patternThe restriction pattern to be matched against the outgoing call number
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_remove_outgoing_call_restriction
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.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This API adds (concatenates) the provided restriction pattern to the restriction pattern set of the admin for outgoing SMSs.
// previous patterns will remain and the new pattern will be added
if (ret != MDM_RESULT_SUCCESS) {
// function error
} else {
// function success
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]p_patternThe restriction pattern to be matched against the outgoing sms number
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_remove_outgoing_sms_restriction
mdm_result_t mdm_enable_data_call_limit ( mdm_status_t  status)

API to enable limit of data packet on the device.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Using this API admin client can enable the limit on data packet traffic. The default value for this policy is MDM_DISABLED (it is disabled by default).
Remarks
Restriction mdm_status_t is written to MDM_POLICY_ON_DATA_LIMIT notification file. You can register a callback for this event using mdm_register_policy_receiver.
Note
To enforce a limit one must call mdm_set_limit_of_data_calls().
if (ret != MDM_RESULT_SUCCESS) {
// Handle error.
} else {
// Limit enabled. Now enforce specific limit: for a week we set 100 MB of sent and received data.
time_t WEEK = (time_t)7*24*60*60
ret = mdm_set_limit_of_data_calls(WEEK, 100, 100);
if (ret != MDM_RESULT_SUCCESS) {
// Handle error
}
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]statusMDM_ENABLED if the device shall limit the data call statistics (count amount of data) No limit will be set unless mdm_set_limit_of_data_calls() is called after this function. When MDM_DISABLED is passed, all limits set are removed.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_set_limit_of_data_calls
mdm_get_data_call_limit_enabled
mdm_result_t mdm_enable_emergency_call_only ( mdm_status_t  status)

API to enable or disable emergency calls only on device.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
If enabled, only emergency will be allowed on device. All other calls will be blocked.
if (ret != MDM_RESULT_SUCCESS) {
// function error
} else {
// function success
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]statusOnly emergency calls
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_emergency_call_only_enabled
mdm_result_t mdm_enable_limit_number_of_calls ( mdm_status_t  status)

API to enable or disable limit of number of calls.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can use this policy to enable or disable the limit of number of calls allowed on the device. This policy is complemented by: mdm_set_limit_of_incoming_calls() and mdm_set_limit_of_outgoing_calls().
if (ret != MDM_RESULT_SUCCESS) {
// function error
} else {
// function success
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]statusTrue to enable limit number of calls , false to disable limit number of calls.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_set_limit_of_incoming_calls
mdm_set_limit_of_outgoing_calls
mdm_result_t mdm_enable_limit_number_of_sms ( mdm_status_t  status)

API to enable or disable limit of number of SMSs.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can use this policy to enable or disable the limit of number of calls allowed on the device. This policy is complemented by: mdm_set_limit_of_incoming_sms(int, int, int) and mdm_set_limit_of_outgoing_sms(int, int, int).
if (ret != MDM_RESULT_SUCCESS) {
// function error
} else {
// function success
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]statusTrue to enable limit number of SMSs, false to disable limit number of SMSs.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_limit_number_of_sms_enabled
mdm_status_t mdm_get_data_call_limit_enabled ( void  )

API to check whether data carrier network usage limit is enabled or not.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Applications, services and admin client can use this interface to verify if data call limiting policy is enabled on the device.
Note
If the limit of data has been enabled by admin client no other application shall allow alerting this limit.
// Sample code that demonstrates how setting application can decide whether enable or disable data call limit
// submenu.
if (ret != MDM_STATUS_ERROR) {
if (ret == MDM_ENABLED) {
// Admin client controls data call limits. Disable the data call limit submenu.
_set_enabled(submenu_data_call_limit, FALSE);
} else {
// Admin client doesn't control data call limits - control is left for user. Enable the data call limit
submenu.
_set_enabled(submenu_data_call_limit, TRUE);
}
} else {
// function error
}
Returns
mdm_status_t : Current mode of operation, one of MDM_ENABLED or MDM_DISABLED
See also
mdm_enable_data_call_limit
mdm_get_limit_of_data_calls
mdm_status_t mdm_get_emergency_call_only_enabled ( void  )

API to check if only emergency calls are allowed on device.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can check if the emergency call is enabled on the device. If enabled, only emergency will be allowed. All other calls will be blocked.
if (ret != MDM_STATUS_ERROR) {
if (ret == MDM_TRUE) {
// feature enabled
} else {
// feature disabled
}
} else {
// function error
}
Returns
mdm_status_t : Current mode of operation
Return values
MDM_TRUEOnly emergency call is enabled
MDM_FALSEOtherwise
See also
mdm_enable_emergency_call_only
mdm_data_t* mdm_get_incoming_call_restriction ( int  n_all_admin)

API to get the restriction pattern for incoming calls.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can use this API to retrieve the current pattern being used to restrict incoming calls.
if (lp_data) {
printf("data : %s", (char *)lp_data->data);
mdm_free_data(lp_data);
}
Parameters
[in]n_all_adminTrue to get a composition of all restrictions from all admins, false to get a restriction pattern from the calling admin
Returns
mdm_status_t : Current mode of operation, one of MDM_ALLOWED or MDM_RESTRICTED
See also
mdm_set_incoming_call_restriction
mdm_data_t* mdm_get_incoming_sms_restriction ( int  n_all_admin)

API to get the restriction pattern for incoming SMS.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can use this API to retrieve the current pattern being used to restrict incoming SMS.
if (lp_data) {
printf("data : %s", (char *)lp_data->data);
mdm_free_data(lp_data);
}
Parameters
[in]n_all_adminTrue to get a composition of all restrictions from all admins, false to get a restriction pattern from the calling admin
Returns
mdm_data_t * on success, NULL on error
See also
mdm_set_incoming_sms_restriction
mdm_status_t mdm_get_limit_number_of_calls_enabled ( void  )

API to check if number of calls are limited.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can use this method to verify if there is a limitation on the number of calls on device
if (ret != MDM_STATUS_ERROR) {
if (ret == MDM_TRUE) {
// feature enabled
} else {
// feature disabled
}
} else {
// function error
}
Returns
mdm_status_t : Current mode of operation, one of MDM_ALLOWED or MDM_RESTRICTED
See also
mdm_enable_limit_number_of_calls
mdm_status_t mdm_get_limit_number_of_sms_enabled ( void  )

API to check if number of SMSs are limited.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can use this method to verify if there is a limitation on the number of SMSs on device
if (ret != MDM_STATUS_ERROR) {
if (ret == MDM_TRUE) {
// feature enabled
} else {
// feature disabled
}
} else {
// function error
}
Returns
mdm_status_t : Current mode of operation, one of MDM_ALLOWED or MDM_RESTRICTED
See also
mdm_enable_limit_number_of_sms
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.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
The API can be used by admin clients to get information about the limit of received and sent data, date the limit was set and the period of time when the limit was set.
Note
If limit is disabled, the result of this call will fail - check with mdm_get_data_call_limit_enabled().
The API returns only limits set by mdm_set_limit_of_data_calls(). It doesn't return how many bytes left.
// Sample code that demonstrates how setting application can decide whether enable or disable data call limit
// submenu.
if (ret == MDM_ENABLED) {
// Admin client controls data call limits.
time_t date_set, period;
time_t send_limit, recv_limit;
mdm_result_t ret = mdm_get_limit_of_data_calls(&date_set, &period, &send_limit, &recv_limit);
if (ret == MDM_RESULT_SUCCESS) {
// Call successful, continue.
} else {
// Call failed.
}
} else {
// Policy is either disabled or we've got an error - check.
}
Parameters
[in,out]p_date_setDate when limit has been set.
[in,out]p_periodPeriod for which data call limit has been set.
[in,out]p_send_limitAmount of data device can send in given period in megabytes.
[in,out]p_recv_limitAmount of data device can receive in given period in megabytes.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
See also
mdm_set_limit_of_data_calls
mdm_get_data_call_limit_enabled
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.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This method returns the restricted limit of number of incoming calls based on the parameter passed to it
int value = 0;
if (ret == MDM_RESULT_SUCCESS) {
printf("%d", value);
}
Parameters
[in]typeMust be one of the these values: MDM_LIMIT_NUMBER_OF_CALLS_BY_DAY, MDM_LIMIT_NUMBER_OF_CALLS_BY_WEEK, MDM_LIMIT_NUMBER_OF_CALLS_BY_MONTH
[in]p_valueGet information of call
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
See also
mdm_set_limit_of_incoming_calls
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.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This method returns the restricted limit of number of incoming SMSs based on the parameter passed to it
int value = 0;
if (ret == MDM_RESULT_SUCCESS) {
printf("%d", value);
}
Parameters
[in]typeMust be one of the these values MDM_LIMIT_NUMBER_OF_SMS_BY_DAY, MDM_LIMIT_NUMBER_OF_SMS_BY_WEEK, MDM_LIMIT_NUMBER_OF_SMS_BY_MONTH
[in]p_valueGet information of sms
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
See also
mdm_set_limit_of_incoming_sms
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.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This method returns the restricted limit of number of outgoing calls based on the parameter passed to it
int value = 0;
if (ret == MDM_RESULT_SUCCESS) {
printf("%d", value);
}
Parameters
[in]typeMust be one of the these values MDM_LIMIT_NUMBER_OF_CALLS_BY_DAY, MDM_LIMIT_NUMBER_OF_CALLS_BY_WEEK, MDM_LIMIT_NUMBER_OF_CALLS_BY_MONTH
[in]p_valueGet information of call
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
See also
mdm_set_limit_of_outgoing_calls
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.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This method returns the restricted limit of number of outgoing SMSs based on the parameter passed to it
int value = 0;
if (ret == MDM_RESULT_SUCCESS) {
printf("%d", value);
}
Parameters
[in]typeMust be one of the these values MDM_LIMIT_NUMBER_OF_SMS_BY_DAY, MDM_LIMIT_NUMBER_OF_SMS_BY_WEEK, MDM_LIMIT_NUMBER_OF_SMS_BY_MONTH
[in]p_valueGet information of sms
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
See also
mdm_set_limit_of_outgoing_sms
mdm_data_t* mdm_get_outgoing_call_restriction ( int  n_all_admin)

API to get the restriction pattern for outgoing calls.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can use this API to retrieve the current pattern being used to restrict outgoing calls.
if (lp_data) {
printf("data : %s", (char *)lp_data->data);
mdm_free_data(lp_data);
}
Parameters
[in]n_all_adminTrue to get a composition of all restrictions from all admins, false to get a restriction pattern from the calling admin
Returns
mdm_data_t * on success, NULL on error
See also
mdm_set_outgoing_call_restriction
mdm_data_t* mdm_get_outgoing_sms_restriction ( int  n_all_admin)

API to get the restriction pattern for outgoing SMS.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can use this API to retrieve the current pattern being used to restrict outgoing SMS.
if (lp_data) {
printf("data : %s", (char *)lp_data->data);
mdm_free_data(lp_data);
}
Parameters
[in]n_all_adminTrue to get a composition of all restrictions from all admins, false to get a restriction pattern from the calling admin.
Returns
mdm_data_t * on success, NULL on error
See also
mdm_set_outgoing_sms_restriction
mdm_result_t mdm_remove_incoming_call_restriction ( void  )

API to remove the restriction pattern for incoming calls set by the calling admin.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This method removes the pattern set by the caller admin for incoming calls restriction
if (ret != MDM_RESULT_SUCCESS) {
// failed setting count
} else {
// success setting count
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_add_incoming_call_restriction
mdm_result_t mdm_remove_incoming_sms_restriction ( void  )

API to remove the restriction pattern for incoming SMSs set by the calling admin.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This method removes the pattern set by the caller admin for incoming SMS restriction
if (ret != MDM_RESULT_SUCCESS) {
// failed setting count
} else {
// success setting count
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_add_incoming_sms_restriction
mdm_result_t mdm_remove_outgoing_call_restriction ( void  )

API to remove the restriction pattern for outgoing calls set by the calling admin.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This method removes the pattern set by the caller admin for outgoing calls restriction
if (ret != MDM_RESULT_SUCCESS) {
// failed setting count
} else {
// success setting count
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_add_outgoing_call_restriction
mdm_result_t mdm_remove_outgoing_sms_restriction ( void  )

API to remove the restriction pattern for outgoing SMSs set by the calling admin.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This method removes the pattern set by the caller admin for outgoing SMSs restriction
if (ret != MDM_RESULT_SUCCESS) {
// failed setting count
} else {
// success setting count
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_add_outgoing_sms_restriction
mdm_result_t mdm_reset_call_limit_count ( void  )

API to reset the counters for incoming and outgoing calls.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This method resets all the counters for incoming and outgoing calls for each date type (day, week and month). The limits set for each kind of call will not be changed.
if (ret != MDM_RESULT_SUCCESS) {
// failed setting count
} else {
// success setting count
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
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.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This method resets the counters for data usage limits for each date type (received and sent). The limits set for each data type won't be changed.
Remarks
Reset counter is signalized by MDM_POLICY_ON_DATA_LIMIT notification. You can register a callback for this event using mdm_register_policy_receiver.
if (ret != MDM_RESULT_SUCCESS) {
// failed setting count
} else {
// success setting count
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
See also
mdm_result_t mdm_reset_sms_limit_count ( void  )

API to reset the counters for incoming or outgoing SMSs.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This method resets all the counters for incoming or outgoing SMSs for each date type (day, week and month)
if (ret != MDM_RESULT_SUCCESS) {
// failed setting count
} else {
// success setting count
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_result_t mdm_set_incoming_call_restriction ( char *  p_pattern)

API to set a restriction pattern to be matched by incoming call numbers.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This API overrides any pattern previously set by the admin for incoming calls.
if (ret != MDM_RESULT_SUCCESS) {
// failed setting count
} else {
// success setting count
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]p_patternThe restriction pattern to be matched against the incoming call number
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_incoming_call_restriction
mdm_result_t mdm_set_incoming_sms_restriction ( char *  p_pattern)

API to set a restriction pattern to be matched by incoming SMSs numbers.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This API overrides any pattern previously set by the admin for incoming SMSs.
if (ret != MDM_RESULT_SUCCESS) {
// failed setting count
} else {
// success setting count
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]p_patternThe restriction pattern to be matched against the incoming sms number
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_incoming_sms_restriction
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.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin client can use this interface to limit the amount of data sent and received through carriers network for given period of time. Counting of the time period starts at the moment of calling this function.
Remarks
Set limit is signalized by MDM_POLICY_ON_DATA_LIMIT notification. You can register a callback for this event using mdm_register_policy_receiver.
Note
- Before calling this function, data call limit has to be enbled with mdm_enable_data_call_limit. Otherwise this function will fail and no limit will be enforced.
  • The total limit size set by this API is a combination of the sent_limit and recv_limit.
  • It is only possible to set limits for daily, weekly and monthly periods in seconds.
  • Passing period with different values than the specified before follows the rule below: Daily period will be set if period >= 0 or period <= 86400. Weekly period will be set if period > 86400 or period <= 604800. Montly period will be set if period > 604800.
if (ret != MDM_RESULT_SUCCESS) {
// Handle error.
} else {
// Limit enabled. Now enforce specific limit: for a week we set 100 MB of sent and received data.
time_t WEEK = (time_t)7*24*60*60
ret = mdm_set_limit_of_data_calls(WEEK, 100, 100);
if (ret != MDM_RESULT_SUCCESS) {
// Handle error
}
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]periodTime period in seconds.
[in]sent_limitLimit in megabytes for sent data.
[in]recv_limitLimit in megabytes for received data.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_enable_data_call_limit
mdm_get_data_call_limit_enabled
mdm_get_limit_of_data_calls
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.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can set a limit to the number of incoming calls by day, week or month. Passing "0" as a parameter means that there is no limit on the number of calls to what it is related (day, week or month).
// Set the incoming call limit to 5 by day, no limit by week, 100 by month
if (ret != MDM_RESULT_SUCCESS) {
// failed setting count
} else {
// success setting count
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]limitbydayThe maximum number of bytes for a day.
[in]limitbyweekThe maximum number of bytes for a week.
[in]limitbymonthThe maximum number of bytes for a month.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_limit_of_incoming_calls
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.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can set a limit to the number of incoming SMSs by day, week or month. Passing "0" as a parameter means that there is no limit on the number of SMSs to what it is related (day, week or month).
// Set the incoming sms limit to 5 by day, no limit by week, 100 by month
if (ret != MDM_RESULT_SUCCESS) {
// failed setting count
} else {
// success setting count
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]limitbydayThe maximum number of bytes for a day.
[in]limitbyweekThe maximum number of bytes for a week.
[in]limitbymonthThe maximum number of bytes for a month.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_limit_of_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.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can set a limit to the number of outgoing calls by day, week or month. Passing "0" as a parameter means that there is no limit on the number of calls to what it is related (day, week or month).
// Set the outgoing calls limit to 5 by day, no limit by week, 100 by month
if (ret != MDM_RESULT_SUCCESS) {
// failed setting count
} else {
// success setting count
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]limitbydayThe maximum number of bytes for a day.
[in]limitbyweekThe maximum number of bytes for a week.
[in]limitbymonthThe maximum number of bytes for a month.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_limit_of_outgoing_calls
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.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can set a limit to the number of outgoing SMSs by day, week or month. Passing "0" as a parameter means that there is no limit on the number of SMSs to what it is related (day, week or month).
// Set the outgoing SMS limit to 5 by day, no limit by week, 100 by month
if (ret != MDM_RESULT_SUCCESS) {
// failed setting count
} else {
// success setting count
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]limitbydayThe maximum number of bytes for a day.
[in]limitbyweekThe maximum number of bytes for a week.
[in]limitbymonthThe maximum number of bytes for a month.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_limit_of_outgoing_sms
mdm_result_t mdm_set_outgoing_call_restriction ( char *  p_pattern)

API to set a restriction pattern to be matched by outgoing call numbers.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This API overrides any pattern previously set by the admin for outgoing calls.
mdm_result_t ret = mdm_set_outgoing_call_restriction("(?![1]?[\\-]?800[\\-]?[0-9]{3}[\\-]?[0-9]{4}$).*");
if (ret != MDM_RESULT_SUCCESS) {
// failed setting count
} else {
// success setting count
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]p_patternThe restriction pattern to be matched against the outgoing call number
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_outgoing_call_restriction
mdm_result_t mdm_set_outgoing_sms_restriction ( char *  p_pattern)

API to set a restriction pattern to be matched by outgoing sms numbers.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This method overrides any previously set pattern in database or add a new one if none exist
mdm_result_t ret = mdm_set_outgoing_sms_restriction("(?![1]?[\\-]?800[\\-]?[0-9]{3}[\\-]?[0-9]{4}$).*");
if (ret != MDM_RESULT_SUCCESS) {
// failed setting count
} else {
// success setting count
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.phonerestriction
Parameters
[in]p_patternThe restriction pattern to be matched against the outgoing sms number
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_outgoing_sms_restriction