Knox Tizen Wearable SDK
Application policy group

Application policy group provides policies for application control. More...

Data Structures

struct  app_usage_t
 Application usage. More...
 
struct  app_data_usage_t
 Application data usage. More...
 
struct  app_network_stats_t
 Application network statistics. More...
 
struct  app_control_info_t
 Application control info. More...
 

Enumerations

Functions

mdm_result_t mdm_install_application (const char *pkg_path)
 API to install an application package on the device. More...
 
mdm_result_t mdm_update_application (const char *pkg_path)
 API to update an application package on the device. More...
 
mdm_result_t mdm_disable_application (const char *pkg_name)
 API to disable an application package without uninstalling it. More...
 
mdm_result_t mdm_enable_application (const char *pkg_name)
 API to enable an application package that was previously disabled. More...
 
mdm_result_t mdm_uninstall_application (const char *pkg_name)
 API to uninstall an application package. More...
 
mdm_status_t mdm_get_application_state (const char *pkg_name)
 API to check whether a given application package is enabled or disabled. More...
 
mdm_data_tmdm_uninstall_applications (GList *pkg_list)
 API for bulk uninstallation of application packages. More...
 
mdm_result_t mdm_set_application_installation_disabled (const char *pkg_name)
 API to disable the installation of application package. More...
 
mdm_result_t mdm_set_application_installation_enabled (const char *pkg_name)
 API to enable the installation of application package, that was previously disabled. More...
 
mdm_status_t mdm_get_application_installation_disabled (const char *pkg_name)
 API to check whether a particular application package can be installed. More...
 
mdm_result_t mdm_set_application_uninstallation_disabled (const char *pkg_name)
 API to disable the uninstallation of an application package. More...
 
mdm_result_t mdm_set_application_uninstallation_enabled (const char *pkg_name)
 API to enable the uninstallation of an application package. More...
 
mdm_status_t mdm_get_application_uninstallation_disabled (const char *pkg_name)
 API to check if an application can be uninstalled. More...
 
mdm_result_t mdm_set_application_state (const char *pkg_name, mdm_app_status_t state)
 API to set the state of an application. More...
 
mdm_status_t mdm_is_application_installed (const char *pkg_name)
 API to check if an application package is installed. More...
 
mdm_status_t mdm_is_application_running (const char *app_id)
 API to check if an application is currently running. More...
 
mdm_data_tmdm_get_application_name (const char *pkg_name)
 API to get the name of an application. More...
 
mdm_data_tmdm_get_application_version (const char *pkg_name)
 API to get the application version. More...
 
mdm_data_tmdm_get_installed_applications_list (void)
 API to get a list of all installed application packages. More...
 
mdm_result_t mdm_start_application (const char *app_id)
 API to launch an application. More...
 
mdm_result_t mdm_stop_application (const char *app_id)
 API to stop an application. More...
 
mdm_data_tmdm_set_application_state_list (GList *pkg_list, mdm_app_status_t state)
 API to set the state of a list of applications. More...
 
mdm_data_tmdm_get_application_state_list (mdm_app_status_t state)
 API to get the list of applications on the device that have the specified state. More...
 
mdm_result_t mdm_set_application_installation_mode (mdm_status_t state)
 API to set the default application installation mode. More...
 
mdm_status_t mdm_get_application_installation_mode (void)
 API to get the current installation mode for all applications. More...
 
mdm_data_tmdm_get_application_code_size (const char *pkg_name)
 API to get the code size of an application. More...
 
mdm_data_tmdm_get_application_data_size (const char *pkg_name)
 API to get the data size of an application. More...
 
mdm_data_tmdm_get_application_total_size (const char *pkg_name)
 API to get the total size of an application, which includes both code and data. More...
 
mdm_result_t mdm_get_application_memory_usage (const char *app_id, unsigned int *usage)
 API to get the RAM memory usage of an application. More...
 
mdm_result_t mdm_get_application_cpu_usage (const char *app_id, unsigned long *usage)
 API to get the CPU usage of an application. More...
 
mdm_data_tmdm_get_most_cpu_usage_apps (int appCount, mdm_status_t showAllProcess)
 API to get a list of running applications or processes that have the highest CPU usage. More...
 
mdm_data_tmdm_get_most_memory_usage_apps (int appCount, mdm_status_t showAllProcess)
 API to get a list of running applications or processes that have the highest memory usage. More...
 
mdm_data_tmdm_get_most_data_usage_apps (int appCount)
 API to get a list of application packages that have the highest data usage. More...
 
mdm_data_tmdm_get_application_network_status_list (void)
 API to get a list of applications and their corresponding network traffic usage. More...
 
mdm_result_t mdm_add_app_package_name_to_whitelist (const char *pkg_name)
 API to add an application package name to the application package name whitelist. More...
 
mdm_data_tmdm_get_app_package_names_all_whitelist (void)
 API to get whitelist of application package names for all admins. More...
 
mdm_result_t mdm_remove_app_package_name_from_whitelist (const char *pkg_name)
 API to remove an application package name from the application package name whitelist. More...
 
mdm_result_t mdm_clear_all_app_package_names_from_installation_whitelist (void)
 API to remove all application package names from the installation whitelist. More...
 
mdm_result_t mdm_clear_all_app_package_names_from_uninstallation_whitelist (void)
 API to remove all application package names from the uninstallation whitelist. More...
 
mdm_result_t mdm_add_app_package_name_to_blacklist (const char *pkg_name)
 Add an application package name to the application package name blacklist. More...
 
mdm_data_tmdm_get_app_package_names_all_blacklist (void)
 API to get the list of blacklisted application package names for all admins. More...
 
mdm_result_t mdm_remove_app_package_name_from_blacklist (const char *pkg_name)
 API to remove an application package name from the application package name blacklist. More...
 
mdm_result_t mdm_clear_all_app_package_names_from_installation_blacklist (void)
 API to remove all application package names from the installation blacklist. More...
 
mdm_result_t mdm_clear_all_app_package_names_from_uninstallation_blacklist (void)
 API to remove all application package names from the uninstallation blacklist. More...
 
mdm_result_t mdm_set_application_uninstallation_mode (mdm_status_t value)
 API to set the default mode for application uninstallation. More...
 
mdm_status_t mdm_get_application_uninstallation_mode (void)
 API to get the current uninstallation mode for all applications. More...
 
mdm_result_t knox_mdm_add_privacy_permission_state_for_package (const char *package_name, const char *privilege, mdm_privacy_permission_state_t state)
 API to set runtime permission state for specified application package. More...
 
mdm_result_t knox_mdm_remove_privacy_permissions_from_packages (const char *package_name_pattern, const char *privilege_pattern)
 API to remove the state of a particular permission for specific application packages. More...
 
mdm_result_t knox_mdm_get_privacy_permission_state_for_package (const char *package_name, const char *privilege, bool all_admins, mdm_privacy_permission_state_t *state)
 API to get current state of a particular runtime permission for selected package name. More...
 
mdm_data_tknox_mdm_get_privacy_permission_data (const char *package_name_pattern, const char *privilege_pattern, bool all_admins, mdm_privacy_permission_state_t state_pattern)
 API to get current state of a particular runtime privacy permission for selected packages and privileges. More...
 
mdm_status_t knox_mdm_widget_board_get_edit_permission (bool all_admins)
 API to get information about whether any widget board edition is allowed. For more about widgets, see Widgets. More...
 
mdm_result_t knox_mdm_widget_board_set_edit_permission (mdm_status_t status)
 API to set whether the widget board can be edited. More...
 

Detailed Description

Application policy group provides policies for application control.

Application policy group.

Required Header

#include <mdm.h>

Overview

This group provides APIs to control application related functionality and restrictions. This API provides the following functions:

Note: All the APIs parameters in this class are case sensitive.

Enumeration Type Documentation

Possible MDM application statuses.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
See also
mdm_set_application_state
Enumerator
MDM_APP_ENABLE 

application enable

MDM_APP_DISABLE 

application disable

Definition at line 35 of file application.h.

Function Documentation

mdm_result_t knox_mdm_add_privacy_permission_state_for_package ( const char *  package_name,
const char *  privilege,
mdm_privacy_permission_state_t  state 
)

API to set runtime permission state for specified application package.

Since (Knox_wearable):
2.3.0
Since (Tizen):
4.0.0.0
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can call this API to set a runtime permission state of specified privilege for a selected application package.
Note
This function is not supported by Korean devices due to legal issue.
gchar *pkg_name = "moviesAlbum";
gchar *privilege = "cameraPrivilege";
int ret = knox_mdm_add_privacy_permission_state_for_package(pkg_name, privilege, perm_state);
if (ret == MDM_RESULT_SUCCESS) {
//ok
} else {
//error
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]package_nameapplication installation package name
[in]privilegename of selected privilege for example to camera or gps location
[in]stateUse MDM_PRIVACY_PERMISSION_STATE_ALLOW to give permission MDM_PRIVACY_PERMISSION_STATE_DENY to restrict permission.
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
knox_mdm_remove_privacy_permissions_from_packages
mdm_data_t* knox_mdm_get_privacy_permission_data ( const char *  package_name_pattern,
const char *  privilege_pattern,
bool  all_admins,
mdm_privacy_permission_state_t  state_pattern 
)

API to get current state of a particular runtime privacy permission for selected packages and privileges.

Since (Knox_wearable):
2.3.0
Since (Tizen):
4.0.0.0
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can call this API in order to query informations about runtime privacy permissions for selected packages and privileges.
gchar *pkg_name_pattern = ".*";
gchar *privilege_pattern = ".*";
int all_admins = false; // to get states set previously by this admin which is calling below function
mdm_privacy_permission_state_t perm_state_pattern = MDM_PRIVACY_PERMISSION_STATE_ANY; // Works similarly to ".*" reg. exp.
// to get for both MDM_PRIVACY_PERMISSION_STATE_ALLOW and MDM_PRIVACY_PERMISSION_STATE_DENY.
mdm_data_t *lp_data = knox_mdm_get_privacy_permission_data(pkg_name_pattern, privilege_pattern, all_admins, perm_state_pattern);
if (lp_data) {
if (current) {
while (current && current->data) {
// One can use the following entry data:
std::string pkg_name{p_entry->package_name};
std::string privilege{p_entry->privilege};
mdm_privacy_permission_state_t current_privilege_state = p_entry->state;
int admin_id = p_entry->uid;
current = g_list_next(current);
}
}
mdm_free_data(lp_data);
} else {
}
Parameters
[in]package_name_patternApplication installation package name pattern with perl like regular expressions
[in]privilege_patternName pattern of selected privilege for example to camera or calendar with perl regular expressions
[in]all_adminsSpecifies whether final policy value for all admins is returned (for true) or the value set by current calling admin (for false).
[in]state_patternUse MDM_PRIVACY_PERMISSION_STATE_ALLOW or MDM_PRIVACY_PERMISSION_STATE_DENY or MDM_PRIVACY_PERMISSION_STATE_ANY to query both options at once.
Returns
List of mdm_privacy_permission_entry_t structures.
See also
knox_mdm_add_privacy_permission_state_for_package
mdm_result_t knox_mdm_get_privacy_permission_state_for_package ( const char *  package_name,
const char *  privilege,
bool  all_admins,
mdm_privacy_permission_state_t state 
)

API to get current state of a particular runtime permission for selected package name.

Since (Knox_wearable):
2.3.0
Since (Tizen):
4.0.0.0
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can call this API in order to get information whether a given privilege is set to always allow state MDM_PRIVACY_PERMISSION_STATE_ALLOW or always deny state MDM_PRIVACY_PERMISSION_STATE_DENY. In case of no information MDM_PRIVACY_PERMISSION_STATE_ANY is going to be returned.
bool all_admins = true;
int ret = knox_mdm_get_privacy_permission_state_for_package(pkg_name, privilege, all_admins, &state);
if (ret == MDM_RESULT_SUCCESS) {
switch(state) {
p_mdm_tool->resultdata = g_strdup("Allow");
break;
p_mdm_tool->resultdata = g_strdup("Deny");
break;
default:
p_mdm_tool->resultdata = g_strdup_printf("Unknown: (%d)", state);
break;
}
}
Parameters
[in]package_nameApplication installation package name
[in]privilegeName of selected privilege for example to camera or calendar
[in]all_adminsSpecifies whether final policy value for all admins is returned (for true) or the value set by current calling admin (for false).
[out]statecurrent permission state: MDM_PRIVACY_PERMISSION_STATE_ALLOW given runtime privilege will be always granted MDM_PRIVACY_PERMISSION_STATE_DENY given runtime privilege will be always rejected without asking user. MDM_PRIVACY_PERMISSION_STATE_ANY as unknown.
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
knox_mdm_add_privacy_permission_state_for_pkg_name
mdm_result_t knox_mdm_remove_privacy_permissions_from_packages ( const char *  package_name_pattern,
const char *  privilege_pattern 
)

API to remove the state of a particular permission for specific application packages.

Since (Knox_wearable):
2.3.0
Since (Tizen):
4.0.0.0
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can call this API in order to remove runtime permissions of specified privilege for selected application package names. One can use perl like regular expressions for multiple operations
gchar *pkg_name_pattern = ".*";
gchar *privilege_pattern = "camera*";
int ret = knox_mdm_remove_privacy_permissions_from_packages(pkg_name_pattern, privilege_pattern);
if (ret == MDM_RESULT_SUCCESS) {
//ok
} else {
//error
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]package_name_patternapplication installation package name pattern
[in]privilege_patternpattern for selected privileges for example to camera or gps location
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
knox_mdm_add_privacy_permission_state_for_package
mdm_status_t knox_mdm_widget_board_get_edit_permission ( bool  all_admins)

API to get information about whether any widget board edition is allowed. For more about widgets, see Widgets.

Since (Knox_wearable):
2.4.0
Since (Tizen):
4.0.0.6
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Use this API to check whether the specified admins can add or remove a widget from the board.
bool all_admins = true;
if (status == MDM_ALLOWED) {
// one is allowed to add/remove widget to/from the widget board
} else {
// any current widget set edition is prohibited
}
Parameters
[in]all_adminsSpecifies whether final policy value for all admins is returned or the value set by current calling admin. Use #true to get final policy value computed based on input from all administrators, or #false to get policy value specified by current calling admin.
Returns
mdm_status_t: Whether widget board edition is allowed
Return values
MDM_ALLOWEDAllowed
MDM_RESTRICTEDRestricted
See also
knox_mdm_widget_board_set_edit_permission
mdm_result_t knox_mdm_widget_board_set_edit_permission ( mdm_status_t  status)

API to set whether the widget board can be edited.

Since (Knox_wearable):
2.4.0
Since (Tizen):
4.0.0.6
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Use this API to allow or restrict widget board edition.
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]statusThe edit mode to set to widget board. Use MDM_ALLOWED to allow to be edited, or MDM_RESTRICTED to prevent being edited.
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_DENIEDApplication does not have privilege to call this function.
See also
knox_mdm_widget_board_get_edit_permission
mdm_result_t mdm_add_app_package_name_to_blacklist ( const char *  pkg_name)

Add an application package name to the application package name blacklist.

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 blacklist third party applications based on their application package name. Applications that have matching application package names are prevented from being installed. If the application package is already installed, this API doesn't affect the existing installation. However, if the application package is uninstalled, it can't be reinstalled until the application package name is removed from the blacklist or is added to the whitelist.
Remarks
The package name is added to the installation blacklist and treated as Perl-compatible regular expression (refer to http://www.pcre.org for more details).
mdm_result_t ret = 0;
if (ret == MDM_RESULT_SUCCESS) {
// success
} else {
// fail
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]pkg_nameThe application package name to add to the blacklist.
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_app_package_name_from_blacklist
mdm_result_t mdm_add_app_package_name_to_whitelist ( const char *  pkg_name)

API to add an application package name to the application package name whitelist.

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 whitelist third party applications based on the application package name. Applications that have a matching package name in the whitelist are exceptions to the configured blacklist and are allowed to be installed.
Remarks
The package name is added to the installation whitelist and treated as Perl-compatible regular expression (refer to http://www.pcre.org for more details). An application with a matching package name in the whitelist is an exception to the configured blacklist and therefore will be allowed to be installed. Installation is not forbidden as long as the application package name (matching regex-pattern) is not added to the blacklist.
mdm_result_t ret = 0;
if (ret == MDM_RESULT_SUCCESS) {
// Successfully added to whitelist
} else {
// Failed to add to whitelist
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]pkg_nameThe application package name to add to the whitelist.
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_app_package_name_from_whitelist
mdm_result_t mdm_clear_all_app_package_names_from_installation_blacklist ( void  )

API to remove all application package names from the installation blacklist.

Since (Tizen):
2.3.2.3
Since (Knox_wearable):
1.1.0
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Use this API to clear the blacklist of package names that are restricted from installation. The enabled package names are free to be installed.
if (ret == MDM_RESULT_SUCCESS){
// Blacklist cleared.
} else {
// Call failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
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_app_package_name_from_blacklist
mdm_get_app_package_names_all_blacklist
mdm_result_t mdm_clear_all_app_package_names_from_installation_whitelist ( void  )

API to remove all application package names from the installation whitelist.

Since (Tizen):
2.3.2.3
Since (Knox_wearable):
1.1.0
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Use this API to clear the entire whitelist of package names that can be installed. The disabled package names are restricted from being installed.
if (ret == MDM_RESULT_SUCCESS){
// Whitelist cleared.
} else {
// Call failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
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_app_package_name_from_whitelist
mdm_get_app_package_names_all_whitelist
mdm_result_t mdm_clear_all_app_package_names_from_uninstallation_blacklist ( void  )

API to remove all application package names from the uninstallation blacklist.

Since (Tizen):
2.3.2.3
Since (Knox_wearable):
1.1.0
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Use this API to clear the blacklist of package names that are restricted from uninstallation. The enabled package names are free to be uninstalled.
if (ret == MDM_RESULT_SUCCESS){
// Blacklist cleared.
} else {
// Call failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
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_app_package_name_from_blacklist
mdm_get_app_package_names_all_blacklist
mdm_result_t mdm_clear_all_app_package_names_from_uninstallation_whitelist ( void  )

API to remove all application package names from the uninstallation whitelist.

Since (Tizen):
2.3.2.3
Since (Knox_wearable):
1.1.0
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Use this API to clear the entire whitelist of package names that are enabled for uninstallation. The disabled package names are restricted from being uninstalled.
if (ret == MDM_RESULT_SUCCESS){
// Whitelist cleared.
} else {
// Call failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
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_app_package_name_from_whitelist
mdm_get_app_package_names_all_whitelist
mdm_result_t mdm_disable_application ( const char *  pkg_name)

API to disable an application package without uninstalling it.

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 silently disable an app without user interaction. The disabled app remains installed, but user cannot use it. The app to be disabled must be installed, otherwise MDM_RESULT_FAIL is returned. If the disabled app is uninstalled and installed again, it will be enabled again. To prevent such a case, it is recommended to disable uninstallation using mdm_set_application_uninstallation_disabled.
mdm_result_t ret = mdm_disable_application("com.samsung.ebook");
if (ret == MDM_RESULT_SUCCESS)
{
// Disabling application package has been completed successfully.
}
else
{
// Disabling application package has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]pkg_nameThe name of the application package to disable.
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_enable_application
mdm_result_t mdm_enable_application ( const char *  pkg_name)

API to enable an application package that was previously disabled.

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 silently enable an app without user interaction. It can be used to enable apps that were previously disabled using mdm_disable_application. The enabled apps can be accessed by the user.
mdm_result_t ret = mdm_enable_application("com.samsung.ebook");
if (ret == MDM_RESULT_SUCCESS)
{
// Enabling application package has been completed successfully.
}
else
{
// Enabling application package has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]pkg_nameThe name of the application package to enable.
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_disable_application
mdm_data_t* mdm_get_app_package_names_all_blacklist ( void  )

API to get the list of blacklisted application package names for all admins.

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 get the list of application package names that are blacklisted. Applications that have matching application package names are prevented from being installed.
if (lp_data){
// success
GList *blacklist = (GList *)lp_data->data;
// Free after use
mdm_free_data(lp_data);
} else {
// fail
}
Returns
A blacklist that contains all of the blacklisted application package names for all admins on the device, if successful. Otherwise, return NULL.
See also
mdm_add_app_package_name_to_blacklist, mdm_remove_app_package_name_from_blacklist
mdm_data_t* mdm_get_app_package_names_all_whitelist ( void  )

API to get whitelist of application package names for all admins.

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 get the application package names that are whitelisted. Applications with matching application package names are exempted from the blacklist and are allowed to be installed.
if (lp_data){
// Successfully got list
GList *whitelist = (GList *)lp_data->data;
GList *current = NULL;
if(whitelist) {
current = g_list_first(whitelist);
while(current && current->data) {
// Package name in whitelist
char *pkg_name = (char *)current->data;
current = g_list_next(current);
}
} else {
// No packages in the whitelist
}
// Free after use
mdm_free_data(lp_data);
} else {
// Failed to get list
}
Returns
A whitelist that contains all of the whitelisted application package names for all admins on the device, if successful. Otherwise, return NULL.
See also
mdm_add_app_package_name_to_whitelist, mdm_remove_app_package_name_from_whitelist
mdm_data_t* mdm_get_application_code_size ( const char *  pkg_name)

API to get the code size of an application.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
An admin can get the code size of an application.
if (lp_data)
{
// Successfully got size of data
char *data_size = (char *)lp_data->data;
mdm_free_data(lp_data);
} else {
// Failed to get size of data
}
Parameters
[in]pkg_nameThe package name of the application.
Returns
On success, a pointer to mdm_data_t that contains the code size of the application; otherwise returns NULL.
See also
mdm_get_application_data_size, mdm_get_application_total_size
mdm_result_t mdm_get_application_cpu_usage ( const char *  app_id,
unsigned long *  usage 
)

API to get the CPU usage of an application.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin gets the CPU usage of an application.
unsigned long usage = 0;
ret = mdm_get_application_cpu_usage("com.samsung.ebook.Main", &usage);
if(ret == MDM_RESULT_SUCCESS) {
printf("cpu usage : %lu s", usage);
}
Parameters
[in]app_idThe application ID.
[out]usageThe amount of CPU being used by the application.
Returns
mdm_result_t MDM_RESULT_SUCCESS on success, MDM_RESULT_FAIL on failure.
Return values
MDM_RESULT_SUCCESSSuccess.
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_get_application_memory_usage
mdm_data_t* mdm_get_application_data_size ( const char *  pkg_name)

API to get the data size of an application.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin gets the data size of an application.
if (lp_data)
{
// Successfully got data size
char *data_size = (char *)lp_data->data;
mdm_free_data(lp_data);
} else {
// Failed to get data size
}
Parameters
[in]pkg_nameThe package name of the application.
Returns
On success, a pointer to mdm_data_t that contains the data size of the application; otherwise returns NULL.
See also
mdm_get_application_code_size, mdm_get_application_total_size
mdm_status_t mdm_get_application_installation_disabled ( const char *  pkg_name)

API to check whether a particular application package can be installed.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
An administrator can use this API to check whether a particular application package can be installed. If the return value is MDM_DISABLED, the user cannot install the application package.
Remarks
The given package name is checked if matches any of the Perl-compatible regular expression (refer to http://www.pcre.org for more details), when iterating through the installation whitelist. If the package name is on the whitelist, installation is allowed. If the package name matches any of the installation blacklist pattern and is not on the whitelist, the installation is restricted. If the package name is neighter on the white nor on the blacklist, the installation is allowed by default.
if (ret == MDM_DISABLED)
{
// Installation is disabled.
}
else if (ret == MDM_ENABLED)
{
// Installation is enabled.
}
else if (ret == MDM_STATUS_ERROR)
{
// Fail during checking.
}
Parameters
[in]pkg_nameThe name of the application package to check.
Returns
mdm_status_t : Whether installation of package is enabled
Return values
MDM_DISABLEDInstallation of the package is disabled.
MDM_ENABLEDInstallation of the package is enabled.
MDM_STATUS_ERRORFail to check whether the application can be installed.
See also
mdm_set_application_installation_disabled
mdm_set_application_installation_enabled
mdm_status_t mdm_get_application_installation_mode ( void  )

API to get the current installation mode for all applications.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
An admin can get the current default installation mode for all applications. You can set the default installation mode with mdm_set_application_installation_mode().
if (ret == MDM_ALLOWED) {
// allowed
} else if (ret == MDM_RESTRICTED) {
// restricted
} else (ret == MDM_STATUS_ERROR){
// error
}
Returns
mdm_status_t : The current application installation mode
Return values
MDM_ALLOWEDAllowed
MDM_RESTRICTEDRestricted
See also
mdm_set_application_installation_mode
mdm_result_t mdm_get_application_memory_usage ( const char *  app_id,
unsigned int *  usage 
)

API to get the RAM memory usage of an application.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin gets the RAM memory usage of an application.
unsigned int usage = 0;
ret = mdm_get_application_memory_usage("com.samsung.ebook.Main", &usage);
if(ret == MDM_RESULT_SUCCESS) {
printf("memory usage : %u KB", usage);
}
Parameters
[in]app_idThe application ID.
[out]usageThe application's memory usage (in KB).
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_get_application_cpu_usage
mdm_data_t* mdm_get_application_name ( const char *  pkg_name)

API to get the name of an application.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
An admin can call this function to get a user-readable version of the application name. This is the name that the application information screen displays.
mdm_data_t *lp_data = mdm_get_application_name("com.samsung.ebook");
if (lp_data != NULL)
{
char *name = (char *)lp_data->data;
if (name != NULL)
{
// Successfully retrieved the application name.
}
// Free resources.
mdm_free_data(lp_data);
}
else
{
// Failed to get the application name.
}
Parameters
[in]pkg_nameThe package name of the application.
Returns
The application name on success; NULL otherwise.
mdm_data_t* mdm_get_application_network_status_list ( void  )

API to get a list of applications and their corresponding network traffic usage.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
The network stats list contains the package name, received and transmitted mobile bytes, and received and transmitted Wi-Fi bytes.
int ret = 0;
if(lp_data) {
GList *ret_list = (GList *)lp_data->data;
GList *current = NULL;
if(ret_list) {
current = g_list_first(ret_list);
while(current && current->data) {
app_network_stats_t *app_usage = (app_network_stats_t *)current->data;
char *data_usage;
if(app_usage->type == 0)
data_usage = g_strdup_printf("[Data]%s(%ld)", app_usage->pkg_name, app_usage->bytes);
else
data_usage = g_strdup_printf("[Wi-Fi]%s(%ld)", app_usage->pkg_name, app_usage->bytes);
current = g_list_next(current);
g_free(data_usage);
}
} else {
// No network usage
}
mdm_free_data(lp_data);
} else {
}
Returns
List of NetworkStats objects.
mdm_status_t mdm_get_application_state ( const char *  pkg_name)

API to check whether a given application package is enabled or disabled.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
mdm_status_t ret = mdm_get_application_state("com.samsung.ebook");
if (ret == MDM_RESTRICTED)
{
// The given package is disabled.
}
else
{
// The given package is enabled.
}
Parameters
[in]pkg_nameThe name of the application package to verify.
Returns
mdm_status_t : Whether application package is enabled
Return values
MDM_ALLOWEDApplication package is enabled
MDM_RESTRICTEDApplicaiton package is disabled.
See also
mdm_set_application_state
mdm_data_t* mdm_get_application_state_list ( mdm_app_status_t  state)

API to get the list of applications on the device that have the specified state.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
An admin can call this API to get the list of applications on the device based on state.
if (lp_data)
{
GList *pkg_list = (GList *)lp_data->data;
// Successfully retrieved list
mdm_free_data(lp_data);
} else {
// Failed to retrieve list
}
Parameters
[in]statevalue that will mention whether to get the list of disabled or enabled apps. If the state value is MDM_APP_DISABLE, it will return list of all disabled applications while if the state value is MDM_APP_ENABLE, it will return the list of all enabled apps.
Returns
A pointer to mdm_data_t that includes a list of applications with enabled or disabled state, or NULL if there are not applications with such state.
See also
mdm_set_application_state_list
mdm_data_t* mdm_get_application_total_size ( const char *  pkg_name)

API to get the total size of an application, which includes both code and data.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin gets the total size of an application.
if (lp_data)
{
// Successfully got size
char *data_size = (char *)lp_data->data;
mdm_free_data(lp_data);
} else {
// Failed to get size
}
Parameters
[in]pkg_nameThe package name of the application.
Returns
On success, a pointer to mdm_data_t that contains the total size of the application; otherwise returns NULL.
See also
mdm_get_application_code_size, mdm_get_application_code_size
mdm_status_t mdm_get_application_uninstallation_disabled ( const char *  pkg_name)

API to check if an application can be uninstalled.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
An admin can call this API to verify whether a particular application package can be uninstalled.

This function returns MDM_DISABLED if the user cannot uninstall the application.

if (ret == MDM_DISABLED)
{
// Uninstallation is disabled
}
else if (ret == MDM_ENABLED)
{
// Uninstallation is enabled
}
else if (ret == MDM_STATUS_ERROR)
{
// Fail during checking
}
Parameters
[in]pkg_nameThe package name of application to check.
Returns
mdm_status_t : Whether uninstallation of package is enabled
Return values
MDM_DISABLEDUninstallation of the package is disabled.
MDM_ENABLEDUninstallation of the package is enabled.
MDM_STATUS_ERRORFail to check whether the application can be uninstalled.
See also
mdm_set_application_uninstallation_enabled
mdm_set_application_uninstallation_disabled
mdm_status_t mdm_get_application_uninstallation_mode ( void  )

API to get the current uninstallation mode for all applications.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can get the current uninstallation mode for all applications. You can set the uninstallation mode with mdm_set_application_uninstallation_mode().
if (ret == MDM_ALLOWED) {
// app uninstallation is allowed
} else if (ret == MDM_RESTRICTED) {
// app uninstallation is restricted
} else if (ret == MDM_STATUS_ERROR){
// error
}
Returns
mdm_status_t : The current application uninstallation mode
Return values
MDM_ALLOWEDAllowed
MDM_RESTRICTEDRestricted
See also
mdm_set_application_uninstallation_mode
mdm_data_t* mdm_get_application_version ( const char *  pkg_name)

API to get the application version.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
An admin can call this API to get the application version. This is the same version displayed when the application information is viewed.
mdm_data_t *lp_data = mdm_get_application_version("com.samsung.ebook");
if (lp_data != NULL)
{
char *version = (char *)lp_data->data;
if(version != NULL)
{
// Successfully retrieved the application version.
}
// Free resources.
mdm_free_data(lp_data);
}
else
{
// Failed to get the application version.
}
Parameters
[in]pkg_nameThe package name of the application.
Returns
The application version on success; NULL otherwise.
mdm_data_t* mdm_get_installed_applications_list ( void  )

API to get a list of all installed application packages.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
The admin can call this API to get a list of all the application packages that are installed on the device, including system applications and uninstalled application packages whose data has not yet been cleared. This list includes managed and non-managed applications.
if (lp_data)
{
GList *current = (GList *)lp_data->data;
while (current)
{
char *pkg_name = (char *)current->data;
if (pkg_name != NULL)
{
// Getting the list has been completed successfully.
}
current = g_list_next(current);
}
// Free resources.
mdm_free_data(lp_data);
}
else
{
// Getting the list has failed.
}
Returns
The list of application packages on success; NULL otherwise.
See also
mdm_is_application_installed
mdm_data_t* mdm_get_most_cpu_usage_apps ( int  appCount,
mdm_status_t  showAllProcess 
)

API to get a list of running applications or processes that have the highest CPU usage.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin gets a list of running applications or processes with the highest CPU usage.
Note
In terms of applications only installed by the user are considered.
int appCount = 10;
if(lp_data) {
ret_list = (GList *)lp_data->data;
if(ret_list) {
current = g_list_first(ret_list);
while(current && current->data) {
app_usage_t *app_usage = (app_usage_t *)current->data;
printf("pkg : %s, usage : %u", app_usage->pkg_name, app_usage->usage);
current = g_list_next(current);
}
} else {
// Nothing in the list
}
mdm_free_data(lp_data);
} else {
}
Parameters
[in]appCountThe number of applications to include in the list. If this is set to less than 0 or greater than the number of running applications, then the list size will be equal to the total number of running applications.
[in]showAllProcessSet this to MDM_TRUE to include system processes when building the list. Otherwise, only installed application processes will be used when building the list.
Returns
A list of applications sorted by CPU usage on success. The usage field contains the percentage of CPU used by the application. NULL is returned on error.
See also
mdm_get_most_memory_usage_apps, mdm_get_most_data_usage_apps
mdm_data_t* mdm_get_most_data_usage_apps ( int  appCount)

API to get a list of application packages that have the highest data usage.

Attention
Deprecated Since Knox_wearable 2.3.0.
Note
Due to RAM limitation, this function cannot be supported from Tizen 3.0.
Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin gets list of application packages with most data size.
Note
This API only considers applications installed by the user. System processes are ignored.
This call is very time consuming.
if (lp_data) {
GList *current = (GList *) lp_data->data;
if (current) {
current = g_list_first(ret_list);
while (current && current->data) {
app_data_usage_t *app_usage = (app_data_usage_t *) current->data;
printf("%s(%u B)", app_usage->pkg_name, app_usage->usage);
current = g_list_next(current);
}
} else {
// Nothing in the list
}
mdm_free_data(lp_data);
} else {
// fail
}
Parameters
[in]appCountThe number of applications to include in the list. If this is set to less than 0 or greater than the number of available applications, then the list size will be equal to the total number of available applications.
Returns
A list of applications sorted by data amount on success. The usage field contains the amount of data (in bytes) used by the application. NULL is returned on error.
See also
mdm_get_most_cpu_usage_apps, mdm_get_most_memory_usage_apps
mdm_data_t* mdm_get_most_memory_usage_apps ( int  appCount,
mdm_status_t  showAllProcess 
)

API to get a list of running applications or processes that have the highest memory usage.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin gets the list of running applications or processes with the highest memory usage.
Note
In terms of applications only installed by the user are considered.
if(lp_data) {
GList *ret_list = (GList *)lp_data->data;
GList *current = NULL;
if(ret_list) {
current = g_list_first(ret_list);
while(current && current->data) {
app_usage_t *app_usage = (app_usage_t *)current->data;
printf("%s(%u KB)", app_usage->pkg_name, app_usage->usage);
current = g_list_next(current);
}
} else {
// Nothing in the list
}
mdm_free_data(lp_data);
} else {
// fail
}
Parameters
[in]appCountThe number of running applications to include in the list. If this is set to less than 0 or greater than the number of running applications, then the list size will be equal to the total number of running applications.
[in]showAllProcessSet this to MDM_TRUE to include system processes when building the list. Otherwise, only installed application processes will be used when building the list.
Returns
A list of applications sorted by memory usage on success. The usage field contains the amount of memory (in bytes) used by the application. NULL is returned on error.
See also
mdm_get_most_cpu_usage_apps, mdm_get_most_data_usage_apps
mdm_result_t mdm_install_application ( const char *  pkg_path)

API to install an application package on the device.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
The admin can call this API to silently install an application package without user interaction.
mdm_result_t ret = mdm_install_application("/opt/apps/sample_app.tpk");
if (ret == MDM_RESULT_SUCCESS)
{
// Installation has been completed successfully.
}
else
{
// Installation has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]pkg_pathThe path to the application package to install.
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_uninstall_application
mdm_uninstall_applications
mdm_status_t mdm_is_application_installed ( const char *  pkg_name)

API to check if an application package is installed.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This function checks whether a particular application is currently installed on the device. It does not indicate if the application is currently enabled, disabled, or running.
mdm_status_t ret = mdm_is_application_installed("com.samsung.ebook");
if (ret == MDM_TRUE)
{
// Application package is installed.
}
else
{
// Application package is not installed.
}
Parameters
[in]pkg_nameThe application package name to check.
Returns
mdm_status_t : Whether an installation has succeeded
Return values
MDM_TRUEThe package is installed
MDM_FALSEOtherwise
See also
mdm_install_application
mdm_uninstall_application
mdm_status_t mdm_is_application_running ( const char *  app_id)

API to check if an application is currently running.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.1.5
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Check if a particular application process with the given application id is currently running on the device.
mdm_status_t ret = mdm_is_application_running("com.samsung.ebook.Main");
if (ret == MDM_TRUE)
{
// The "com.samsung.ebook.Main" app is running.
}
else
{
// The "com.samsung.ebook.Main" app is not running.
}
Parameters
[in]app_idThe application id inside application package to be verified.
Returns
mdm_status_t : Whether given application is running
Return values
MDM_TRUEThe application is running
MDM_FALSEOtherwise
See also
mdm_is_application_installed
mdm_result_t mdm_remove_app_package_name_from_blacklist ( const char *  pkg_name)

API to remove an application package name from the application package name blacklist.

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 remove an application package name from the blacklist. Applications with matching application package names are allowed to be installed.
if (ret == MDM_RESULT_SUCCESS){
// success
} else {
// fail
}
Parameters
[in]pkg_nameThe application package name to remove from the blacklist.
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
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_app_package_name_to_blacklist, mdm_get_app_package_names_all_blacklist
mdm_result_t mdm_remove_app_package_name_from_whitelist ( const char *  pkg_name)

API to remove an application package name from the application package name whitelist.

Since (Tizen):
2.3.2.3
Since (Knox_wearable):
1.0.0
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Use this API to remove an application package name from the whitelist.
if (ret == MDM_RESULT_SUCCESS){
// Successfully removed
} else {
// Failed to remove
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]pkg_nameThe application package name to remove from the whitelist.
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_app_package_name_to_whitelist, mdm_get_app_package_names_all_whitelist
mdm_result_t mdm_set_application_installation_disabled ( const char *  pkg_name)

API to disable the installation of application package.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
An administrator can use this function to silently disable the installation of application package without user interaction. This API might be useful when disabling the installation of malware or unauthorized application packages. The user not allowed to install blacklisted application packages, e.g. by Tizen Store. By default, all application packages are in a whitelist. This API creates a blacklist.
if (ret == MDM_RESULT_SUCCESS)
{
// Disabling installation has been completed successfully.
}
else
{
// Disabling installation has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]pkg_nameThe name of the application package to disable the installation of.
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_application_installation_enabled
mdm_get_application_installation_disabled
mdm_result_t mdm_set_application_installation_enabled ( const char *  pkg_name)

API to enable the installation of application package, that was previously disabled.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
An administrator can use this API to silently enable the installation of an application package, that was previously disabled using mdm_set_application_installation_disabled.
if (ret == MDM_RESULT_SUCCESS)
{
// Enabling installation has been completed successfully.
}
else
{
// Enabling installation has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]pkg_nameThe name of the application package to enable the installation of.
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_application_installation_disabled
mdm_get_application_installation_disabled
mdm_result_t mdm_set_application_installation_mode ( mdm_status_t  state)

API to set the default application installation mode.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
If you set the default mode to MDM_RESTRICTED, then no applications can be installed on the device, except for those that the admin allows to be installed by calling mdm_set_application_installation_enabled().

If you set the default mode to MDM_ALLOWED, then all applications can be installed on the device, except for those that the admin blocks from being installed by calling mdm_set_application_installation_disabled().

The default mode is MDM_ALLOWED, which allows any application package to be installed.

if (ret == MDM_RESULT_SUCCESS){
// Successfully set installation mode.
}
else{
// Failed to set installation mode.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]stateThe default installation mode to set. Use MDM_ALLOWED to allow all apps to be installed, or MDM_RESTRICTED to prevent any apps from being installed.
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_application_installation_mode
mdm_result_t mdm_set_application_state ( const char *  pkg_name,
mdm_app_status_t  state 
)

API to set the state of an application.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
The admin can call this API to silently enable or disable an application without user interaction. This function can be used instead of calling mdm_enable_application or mdm_disable_application.
if (ret == MDM_RESULT_SUCCESS)
{
// Successfully set the application package state to disabled.
}
else
{
// Failed to set the application package state.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]pkg_nameThe application package name to be enabled/disabled.
[in]stateSet to MDM_APP_ENABLE to enable the application; set to MDM_APP_DISABLE to disable the application.
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_get_application_state
mdm_enable_application
mdm_disable_application
mdm_data_t* mdm_set_application_state_list ( GList *  pkg_list,
mdm_app_status_t  state 
)

API to set the state of a list of applications.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
The admin can call this API to silently enable or disable a set of applications without user interaction. It can be used to disable malware, unauthorized applications, or system applications not required by enterprises.

It can also be used to enable previously disabled applications when a user leaves the enterprise.

The state of an application determines whether the user can use the app (MDM_APP_ENABLE), or cannot use the app (MDM_APP_DISABLE).

mdm_result_t ret = 0;
GList *pkg_list = NULL;
pkg_list = g_list_append(pkg_list, "com.samsung.ebook");
pkg_list = g_list_append(pkg_list, "com.samsung.contact");
if (lp_data)
{
// Success
GList *current = (GList *)lp_data->data;
while(current) {
char *pkg = (char *)current->data;
//check disabled pkg name
current = g_list_next(current);
}
}
else
{
// Fail
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]pkg_listThe list of applications whose state is to be set.
[in]stateSet to MDM_APP_ENABLE to enable the apps, and set to MDM_APP_DISABLE to disable the apps.
Returns
A pointer to mdm_data_t that includes a list of applications whose states were set successfully.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_application_state_list
mdm_result_t mdm_set_application_uninstallation_disabled ( const char *  pkg_name)

API to disable the uninstallation of an application package.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
By default, the user is allowed to uninstall any app on the device. An admin can call this API to remove the ability of the user to uninstall an app that has the specified package name.
if (ret == MDM_RESULT_SUCCESS)
{
// Disabling deinstallation has been completed successfully.
}
else
{
// Disabling deinstallation has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]pkg_nameThe name of the application package to remove the ability of the user to uninstall.
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_application_uninstallation_enabled
mdm_get_application_uninstallation_disabled
mdm_result_t mdm_set_application_uninstallation_enabled ( const char *  pkg_name)

API to enable the uninstallation of an application package.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
An admin can call this API to silently allow the user to uninstall the app with the specified package name, which may have been previously restricted.
if (ret == MDM_RESULT_SUCCESS)
{
// Successfully enabled uninstallation.
}
else
{
// Failed to enable uninstallation.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]pkg_nameThe package name of the app to allow the user to uninstall.
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_application_uninstallation_disabled
mdm_get_application_uninstallation_disabled
mdm_result_t mdm_set_application_uninstallation_mode ( mdm_status_t  value)

API to set the default mode for application uninstallation.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
If you set the default mode to MDM_RESTRICTED, then no applications can be uninstalled from the device, except for those that the admin allows to be uninstalled by calling mdm_set_application_uninstallation_enabled().

If you set the default mode to MDM_ALLOWED, then all applications can be uninstalled from the device, except for those that the admin blocks from being uninstalled by calling mdm_set_application_uninstallation_disabled().

The default mode is MDM_ALLOWED, which allows any application package to be uninstalled.

Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]valueThe default installation mode to set. Use MDM_ALLOWED to allow all apps to be uninstalled, or MDM_RESTRICTED to prevent any apps from being uninstalled.
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_application_uninstallation_mode
mdm_result_t mdm_start_application ( const char *  app_id)

API to launch an application.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage: Launch an application provided it's not disabled by a security
policy.
mdm_result_t ret = mdm_start_application("com.samsung.ebook.Main");
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]app_idThe ID of the application to start.
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_stop_application
mdm_result_t mdm_stop_application ( const char *  app_id)

API to stop an application.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage: Stop a running application.
mdm_result_t ret = mdm_stop_application("com.samsung.ebook.Main");
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]app_idThe ID of the application to stop.
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_start_application
mdm_result_t mdm_uninstall_application ( const char *  pkg_name)

API to uninstall an application package.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can silently uninstall a non-system application that was installed.
mdm_result_t ret = mdm_uninstall_application("com.samsung.ebook");
if (ret == MDM_RESULT_SUCCESS)
{
// Uninstallation has been completed successfully.
}
else
{
// Uninstallation has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]pkg_nameThe name of the application package to uninstall.
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_install_application
mdm_uninstall_applications
mdm_data_t* mdm_uninstall_applications ( GList *  pkg_list)

API for bulk uninstallation of application packages.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can perform bulk silent uninstallation of a list of non-system applications. The application package cache and data are also uninstalled. The uninstallation of application packages will take place in the background with no user interaction. In order to ensure the best UI performance this operation should be called from a worker rather than from a main UI thread.
// Adding application(s) into pkg_list.
if (lp_data != NULL)
{
GList *pkg_list = (GList *)lp_data->data;
if (pkg_list != NULL)
{
// Deinstallation has been completed successfully.
}
// Free resources.
mdm_free_data(lp_data);
}
else
{
// Deinstallation has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]pkg_listThe list of application packages to uninstall.
Returns
List of the uninstalled application packages on success or NULL on failure.
See also
mdm_install_application
mdm_uninstall_application
mdm_result_t mdm_update_application ( const char *  pkg_path)

API to update an application package on the device.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
The admin can call this API to silently update an application without any user interaction. This API does not remove any existing data from the application package.
mdm_result_t ret = mdm_update_application("/opt/apps/sample_app.tpk");
if (ret == MDM_RESULT_SUCCESS)
{
// Updating application package has been completed successfully.
}
else
{
// Updating application package has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.application
Parameters
[in]pkg_pathThe path to the application package to update.
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_install_application
mdm_uninstall_application