Tizen(Headed) Native API  6.5

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 name of created zones.

Typedefs

typedef bool(* dpm_zone_foreach_name_cb )(const char *name, void *user_data)
 Called to get all the name of created zones.

Typedef Documentation

typedef bool(* dpm_zone_foreach_name_cb)(const char *name, void *user_data)

Called to get all the name of created zones.

Since :
3.0
Parameters:
[in]nameThe zone name
[in]user_dataThe user data passed from dpm_zone_foreach_name()
Returns:
true to continue with the next iteration of the loop, otherwise false to break out out the loop
See also:
dpm_zone_foreach_name()

Enumeration Type Documentation

Enumeration for zone state.

Since :
3.0
Enumerator:
DPM_ZONE_STATE_LOCKED 

Zone has been defined, but it can not start.

DPM_ZONE_STATE_RUNNING 

Zone has been started.

DPM_ZONE_STATE_ALL 

This presents all of the state


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]handleDevice policy manager handle
[in]nameThe zone name to be created
[in]pkgnameAdmin package container ownership will be transferred
Returns:
DPM_ERROR_NONE on success, otherwise a negative value
Return values:
DPM_ERROR_NONESuccessful
DPM_ERROR_INVALID_PARAMETERInvalid parameter
DPM_ERROR_TIMED_OUTTime out
DPM_ERROR_NOT_PERMITTEDOperation not permitted
DPM_ERROR_PERMISSION_DENIEDThe 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()
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]handleDevice policy manager handle
[in]nameThe zone name to be removed
Returns:
DPM_ERROR_NONE on success, otherwise a negative value
Return values:
DPM_ERROR_NONESuccessful
DPM_ERROR_INVALID_PARAMETERInvalid parameter
DPM_ERROR_TIMED_OUTTime out
DPM_ERROR_PERMISSION_DENIEDThe 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()
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 name 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]handleDevice policy manager handle
[in]statea combination of the zone state to look
[in]callbackThe iteration callback function
[in]user_dataThe user data passed to the callback function
Returns:
DPM_ERROR_NONE on success, otherwise a negative value
Return values:
DPM_ERROR_NONESuccessful
DPM_ERROR_TIMED_OUTTime out
DPM_ERROR_INVALID_PARAMETERInvalid parameter
Precondition:
The handle must be created by dpm_manager_create().
See also:
dpm_manager_create()
dpm_zone_create()
dpm_zone_destroy()
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]handleDevice policy manager handle
[in]nameThe zone name
[out]stateThe zone state
Returns:
DPM_ERROR_NONE on success, otherwise a negative value
Return values:
DPM_ERROR_NONESuccessful
DPM_ERROR_NO_DATANo such zone to get state
DPM_ERROR_INVALID_PARAMETERInvalid parameter
DPM_ERROR_TIMED_OUTTime out
Precondition:
The handle must be created by dpm_manager_create().
See also:
dpm_manager_create()
dpm_zone_create()
dpm_zone_destroy()