Tizen Native API
3.0
|
Zone policy group provides APIs to control containers.
Required Header
#include <dpm/zone.h>
Overview
This module provides APIs to manage application containers. Any API which requires privileges is only available for the registered device policy client which is enrolled to the device by enrollment process.
Functions | |
int | dpm_zone_create (device_policy_manager_h handle, const char *name, const char *pkgname) |
Creates a new zone. | |
int | dpm_zone_destroy (device_policy_manager_h handle, const char *name) |
Removes existing zone. | |
int | dpm_zone_get_state (device_policy_manager_h handle, const char *name, dpm_zone_state_e *state) |
Gets the zone state. | |
int | dpm_zone_foreach_name (device_policy_manager_h handle, dpm_zone_state_e state, dpm_zone_foreach_name_cb callback, void *user_data) |
Retrieves all the names of created zones. | |
Typedefs | |
typedef bool(* | dpm_zone_foreach_name_cb )(const char *name, void *user_data) |
Called to get all the names of created zones. |
Typedef Documentation
typedef bool(* dpm_zone_foreach_name_cb)(const char *name, void *user_data) |
Called to get all the names of created zones.
- Since :
- 3.0
- Parameters:
-
[in] name The zone name [in] user_data The user data passed from dpm_zone_foreach_name
- Returns:
- true to continue with the next iteration of the loop, otherwise false to break out of the loop
- See also:
- dpm_zone_foreach_name()
Enumeration Type Documentation
enum dpm_zone_state_e |
Function Documentation
int dpm_zone_create | ( | device_policy_manager_h | handle, |
const char * | name, | ||
const char * | pkgname | ||
) |
Creates a new zone.
- Warning:
- This is not for use by third-party applications.
An administrator can use this API to create a container. Once the container is created, the admin package given to the parameter will be installed inside the container. Then ownership of the container gets transferred to the admin package from the client which triggered the container creation process.
- Since :
- 3.0
- Privilege Level:
- partner
- Privilege:
- http://tizen.org/privilege/dpm.zone
- Parameters:
-
[in] handle Device policy manager handle [in] name The zone name to be created [in] pkgname Admin package container ownership will be transferred
- Returns:
- DPM_ERROR_NONE on success, otherwise a negative value
- Return values:
-
DPM_ERROR_NONE Successful DPM_ERROR_INVALID_PARAMETER Invalid parameter DPM_ERROR_TIMED_OUT Time out DPM_ERROR_NOT_PERMITTED Operation not permitted DPM_ERROR_PERMISSION_DENIED The application does not have the privilege to call this API
- Precondition:
- The handle must be created by dpm_manager_create().
- See also:
- dpm_manager_create()
- dpm_zone_destroy()
- dpm_zone_create_iterator()
int dpm_zone_destroy | ( | device_policy_manager_h | handle, |
const char * | name | ||
) |
Removes existing zone.
- Warning:
- This is not for use by third-party applications.
Administrator can use this API to remove zone. All file system objects created for the zone will be also erased.
- Since :
- 3.0
- Privilege Level:
- partner
- Privilege:
- http://tizen.org/privilege/dpm.zone
- Parameters:
-
[in] handle Device policy manager handle [in] name The zone name to be removed
- Returns:
- DPM_ERROR_NONE on success, otherwise a negative value
- Return values:
-
DPM_ERROR_NONE Successful DPM_ERROR_INVALID_PARAMETER Invalid parameter DPM_ERROR_TIMED_OUT Time out DPM_ERROR_PERMISSION_DENIED The application does not have the privilege to call this API or the caller is not the owner of the zone
- Precondition:
- The handle must be created by dpm_manager_create().
- The zone corresponding to the given name must be created before use of this API.
- See also:
- dpm_manager_create()
- dpm_zone_create()
- dpm_zone_create_iterator()
int dpm_zone_foreach_name | ( | device_policy_manager_h | handle, |
dpm_zone_state_e | state, | ||
dpm_zone_foreach_name_cb | callback, | ||
void * | user_data | ||
) |
Retrieves all the names of created zones.
This API calls dpm_zone_foreach_cb() once for each zone name with traversing the created zones list.
- Since :
- 3.0
- Parameters:
-
[in] handle Device policy manager handle [in] state A combination of the zone state to look [in] callback The iteration callback function [in] user_data The user data passed to the callback function
- Returns:
- DPM_ERROR_NONE on success, otherwise a negative value
- Return values:
-
DPM_ERROR_NONE Successful DPM_ERROR_TIMED_OUT Time out DPM_ERROR_INVALID_PARAMETER Invalid parameter
- Precondition:
- The handle must be created by dpm_manager_create().
int dpm_zone_get_state | ( | device_policy_manager_h | handle, |
const char * | name, | ||
dpm_zone_state_e * | state | ||
) |
Gets the zone state.
This API can be used to get the state of the zone. The zone can have one of the three states(running, locked).
- Since :
- 3.0
- Parameters:
-
[in] handle Device policy manager handle [in] name The zone name [out] state The zone state
- Returns:
- DPM_ERROR_NONE on success, otherwise a negative value
- Return values:
-
DPM_ERROR_NONE Successful DPM_ERROR_NO_DATA No such zone to get state DPM_ERROR_INVALID_PARAMETER Invalid parameter DPM_ERROR_TIMED_OUT Time out
- Precondition:
- The handle must be created by dpm_manager_create().