Knox Tizen Wearable SDK
Misc policy group

Misc policy group provides policies for miscellaneous control. More...

Data Structures

struct  sim_info_t
 for sim information type More...
 
struct  sim_change_info_t
 for sim change information More...
 

Enumerations

Functions

mdm_result_t mdm_set_allow_location (mdm_status_t state)
 API to enable or disable the location capability. More...
 
mdm_status_t mdm_get_allow_location (void)
 API to check if the location capability is enabled or disabled. More...
 
mdm_result_t mdm_set_allow_text_messaging (mdm_status_t state)
 API to specify whether the device allows the use of SMS or text messaging. More...
 
mdm_status_t mdm_get_allow_text_messaging (void)
 API to check whether the Text Messaging capability is enabled or not. More...
 
mdm_result_t mdm_set_allow_microphone (mdm_status_t state)
 API to enable or disable voice recording capability. More...
 
mdm_status_t mdm_get_allow_microphone (void)
 API to check whether voice recording capability is enabled or not. More...
 
mdm_result_t mdm_set_ringtone (const char *ringtone_path)
 API to change the default ringtone of the device. More...
 

Detailed Description

Misc policy group provides policies for miscellaneous control.

Misc policy group.

Required Header

#include <mdm.h>

Overview

This group provides APIs to control device hardware capability.

Enumeration Type Documentation

Enumerator
MDM_FIRMWARE_UPDATE_FAILURE_REASON_NONE 

No error detected.

MDM_FIRMWARE_UPDATE_FAILURE_REASON_UNABLE_TO_COPY 

Unable to copy update package to update directory.

MDM_FIRMWARE_UPDATE_FAILURE_REASON_SIGNATURE_VERIFICATION 

Signature verification error.

MDM_FIRMWARE_UPDATE_FAILURE_REASON_UNABLE_TO_REBOOT 

Unable to reboot device in update mode.

MDM_FIRMWARE_UPDATE_FAILURE_REASON_OTHER 

Other reason of failure.

Definition at line 754 of file misc.h.

Enumerator
MDM_INTEGRITY_CHECK_STATUS_SUCCESS 

Success.

MDM_INTEGRITY_CHECK_STATUS_ADD_ITEM_ERROR 

Error when adding item to R/W list.

MDM_INTEGRITY_CHECK_STATUS_CHECK_ERROR 

Error when checking item for integrity.

MDM_INTEGRITY_CHECK_STATUS_ADD_ITEM_INVALID_PATH 

Invalid item's path error.

Definition at line 84 of file misc.h.

for sim change information

Since (Tizen):
2.3.1.5
Since (Knox_wearable):
1.0.0
Enumerator
SIM_INSERTED 

SIM card is changed.

SIM_REMOVED 

New SIM card is inserted into the device, which previously had no SIM card.

SIM_NOT_PRESENT 

SIM card is removed from the device. SIM card is not present and no data about previous state is available

Definition at line 45 of file misc.h.

Function Documentation

mdm_status_t mdm_get_allow_location ( void  )

API to check if the location capability is enabled or disabled.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Use this API to check if location capability is enabled or not, and take appropriate actions based on enterprise policy.
if (status == MDM_RESTRICTED) {
}
Returns
mdm_status_t : Whether location is enabled
Return values
MDM_ALLOWEDAllowed
MDM_RESTRICTEDRestricted
See also
mdm_set_allow_location
mdm_status_t mdm_get_allow_microphone ( void  )

API to check whether voice recording capability 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:
Admin can check whether microphone voice recording capability is enabled or not, and take appropriate actions based on enterprise policy.
1 mdm_status_t status = MDM_ALLOWED;
2 status = mdm_get_allow_microphone();
3 if (status == MDM_RESTRICTED) {
4 
5 }
Returns
mdm_status_t : Whether microphone is enabled
Return values
MDM_ALLOWEDAllowed
MDM_RESTRICTEDRestricted
See also
mdm_set_allow_microphone
mdm_status_t mdm_get_allow_text_messaging ( void  )

API to check whether the Text Messaging capability 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:
Admin can check whether Text Messaging capability is enabled or not, and take appropriate actions based on enterprise policy.
if (ret == MDM_ALLOWED) {
// user can send text message.
}
else if (ret == MDM_RESTRICTED) {
// Disabled sending text message
}
Returns
mdm_status_t : Whether Text Messaging is enabled
Return values
MDM_RESTRICTEDRestricted
MDM_ALLOWEDAllowed
See also
mdm_set_allow_text_messaging
mdm_result_t mdm_set_allow_location ( mdm_status_t  state)

API to enable or disable the location capability.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Use this API to enable or disable location capability on behalf of the end user, without any user interaction.
Remarks
Location restriction mdm_status_t is written to MDM_POLICY_ON_LOCATION notification file. You can register a callback for this event using mdm_register_policy_receiver.
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.misc
Parameters
[in]stateMDM_RESTRICTED — Location is disabled, the end user is restricted from modifying the device's location capability. MDM_ALLOWED — Location is allowed, the end user can modify location capability.
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_allow_location
mdm_result_t mdm_set_allow_microphone ( mdm_status_t  state)

API to enable or disable voice recording capability.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can enable or disable usage of microphone for voice recording purposes. Once disabled, user or third party applications cannot enable it. If microphone voice recording capability is enabled when this API is called, it will be disabled. This will not disable microphone in other applications like Phone or Bixby.
Remarks
Microphone restriction mdm_status_t is written to MDM_POLICY_ON_MIC notification file. You can register a callback for this event using mdm_register_policy_receiver.
1 mdm_result_t ret = MDM_RESULT_SUCCESS;
2 ret = mdm_set_allow_microphone(MDM_RESTRICTED);
3 if (ret == MDM_RESULT_SUCCESS) {
4 
5 }
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.misc
Parameters
[in]stateMDM_RESTRICTED: Disables microphone, user cannot enable. MDM_ALLOWED: user control restored but will not enable it
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_allow_microphone
mdm_result_t mdm_set_allow_text_messaging ( mdm_status_t  state)

API to specify whether the device allows the use of SMS or text messaging.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can disable the text Messaging capability without any user interaction.
Remarks
Text messaging restriction mdm_status_t is written to MDM_POLICY_ON_MESSAGE notification file. You can register a callback for this event using mdm_register_policy_receiver.
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.misc
Parameters
[in]stateMDM_RESTRICTED: Disables sending text message, user cannot enable. MDM_ALLOWED: user can send text message.
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_allow_text_messaging
mdm_result_t mdm_set_ringtone ( const char *  ringtone_path)

API to change the default ringtone of the device.

Attention
Deprecated Since Knox_wearable 2.3.0. Use system_settings_set_value_string instead.
Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin is used to set the ringtone silently without user interaction
1 mdm_result_t ret = 0;
2 ret = mdm_set_ringtone("/opt/media/Sounds/ringtone.mp3");
3 if (ret == MDM_RESULT_SUCCESS)
4 {
5  // success
6 }
7 else
8 {
9  // fail
10 }
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.misc
Parameters
[in]ringtone_path: Ringtone file path
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.