Knox Tizen Wearable SDK
|
Admin policy group provides set of functions that enable using MDM functionality. This includes client's registration, handle of service, notifications, callbacks, basic data types etc. More...
Data Structures | |
struct | mem_header_t |
Place at the front of any structure or block of memory that is intended to be disowned by the allocator, to be discarded by a subsequent owner. More... | |
struct | mdm_data_t |
This structure is used to store GList. More... | |
struct | mdm_privacy_permission_entry_t |
This structure represents entry information about single runtime permission specification. More... | |
Typedefs | |
typedef struct policy_receiver_s | policy_receiver_t |
Policy receiver handle type. More... | |
typedef policy_receiver_t * | policy_receiver_handle |
typedef void(* | on_policy_receiver_callback) (int status, void *p_user_data) |
Policy receiver callback to be called in case of policy change. More... | |
typedef void(* | mdm_client_callback_function) (int oper, void *cb_data, void *user_data) |
Policy callback function pointer. More... | |
typedef void(* | mdm_client_callback_function_ext) (void *cb_data, void *user_data) |
Policy callback function pointer. More... | |
typedef void(* | mdm_client_callback_function_free) (void *data) |
Policy callback user data memory free function. More... | |
Enumerations |
Functions | |
mdm_result_t | mdm_get_service (void) |
API to connect to MDM server daemon, and get caller information. More... | |
int | mdm_get_service_ext (const char *pkg_name) |
API to connect to the MDM server daemon and get caller information. More... | |
mdm_result_t | mdm_release_service (void) |
API to close the connection and release the resources. More... | |
mdm_status_t | mdm_is_client_registered (const char *pkg_name) |
API to check if an MDM client is registered in MDM Server. More... | |
int | mdm_register_client (const char *pkg_name) |
API to register an MDM client. More... | |
int | mdm_deregister_client (const char *pkg_name) |
API to close current session with MDM server. More... | |
policy_receiver_handle | mdm_register_policy_receiver (mdm_policy_noti_t noti, void *user_data, on_policy_receiver_callback callback) |
API to register a callback function that is called when a policy is changed during runtime. More... | |
mdm_result_t | mdm_deregister_policy_receiver (policy_receiver_t *handle) |
API to deregister the policy change callback function. More... | |
void | mdm_free_data (mdm_data_t *data) |
API to free an mdm_data_t structure. More... | |
int | mdm_register_client_callback (mdm_policy_cb_t policy, mdm_client_callback_function cb, mdm_client_callback_function_free free_cb, void *userData) |
API to register a callback function for the given policy. More... | |
mdm_result_t | mdm_get_last_error (void) |
API to get the error code of the last MDM function called in current thread. More... | |
Admin policy group provides set of functions that enable using MDM functionality. This includes client's registration, handle of service, notifications, callbacks, basic data types etc.
Admin policy group.
#include <mdm.h>
typedef void(* mdm_client_callback_function) (int oper, void *cb_data, void *user_data) |
Policy callback function pointer.
Definition at line 81 of file mdm_client_type.h.
typedef void(* mdm_client_callback_function_ext) (void *cb_data, void *user_data) |
Policy callback function pointer.
Definition at line 89 of file mdm_client_type.h.
typedef void(* mdm_client_callback_function_free) (void *data) |
Policy callback user data memory free function.
Definition at line 97 of file mdm_client_type.h.
typedef void(* on_policy_receiver_callback) (int status, void *p_user_data) |
Policy receiver callback to be called in case of policy change.
typedef policy_receiver_t* policy_receiver_handle |
typedef struct policy_receiver_s policy_receiver_t |
Policy receiver handle type.
enum mdm_policy_cb_t |
Enumerate policy callback.
Definition at line 48 of file mdm_client_type.h.
enum mdm_policy_noti_t |
Enumerate policy change notification type.
Enumerator | |
---|---|
MDM_POLICY_ON_PASSWORD |
Password status, refer to #mdm_password_status_t
|
MDM_POLICY_ON_WIFI |
Wi-Fi status, refer to mdm_wifi_status_t |
MDM_POLICY_ON_WIFI_STATE |
Wi-Fi state, refer to wifi_noti_t
|
MDM_POLICY_ON_WIFI_CHANGE |
Change of Wi-Fi state, refer to wifi_noti_t
|
MDM_POLICY_ON_WIFI_PREFERRED_AP_LIST_CHANGE |
List of preferred access points has changed. |
MDM_POLICY_ON_WIFI_ENFORCE_PREFERRED_AP_MODE_CHANGE |
Mode of enforce preferred access points has changed.
|
MDM_POLICY_ON_WIFI_PROTECTED_AP_LIST_CHANGE |
List of protected access points has changed. |
MDM_POLICY_ON_WIFI_TETHERING |
Wi-Fi tethering restriction has changed.
|
MDM_POLICY_ON_WIFI_AUTOCONNECT_CHANGE |
Wi-Fi auto-connect restriction has changed. |
MDM_POLICY_ON_BT |
Bluetooth status, refer to mdm_bt_policy_changed_t
|
MDM_POLICY_ON_BT_CHANGE |
Prevent to change Bluetooth restriction.
|
MDM_POLICY_ON_BT_TETHERING |
Bluetooth tethering restriction has changed. |
MDM_POLICY_ON_CAMERA |
Camera restriction has changed.
|
MDM_POLICY_ON_ROAMING_SYNC |
Roaming sync restriction has changed.
|
MDM_POLICY_ON_ROAMING_PUSH |
Roaming push restriction has changed.
|
MDM_POLICY_ON_DATA_ROAMING_CHANGE |
Prevent to change roaming data restriction.
|
MDM_POLICY_ON_LOCATION |
Location restriction has changed.
|
MDM_POLICY_ON_GPS_CHANGE |
Prevent to change gps.
|
MDM_POLICY_ON_FACTORY_RESET |
Factory reset restriction has changed.
|
MDM_POLICY_ON_MIC |
Microphone restriction has changed.
|
MDM_POLICY_ON_CALL |
Not supported. |
MDM_POLICY_ON_CONTAINER |
Not supported. |
MDM_POLICY_ON_KIOSK |
Not supported. |
MDM_POLICY_ON_LICENSE |
Not supported. |
MDM_POLICY_ON_MOBILE_AP |
Not supported. |
MDM_POLICY_ON_KIES |
Kies restriction has changed.
|
MDM_POLICY_ON_BROWSER |
Browser restriction has changed.
|
MDM_POLICY_ON_MTP |
MTP restriction has changed.
|
MDM_POLICY_ON_NFC |
NFC restriction has changed.
|
MDM_POLICY_ON_CLIPBOARD |
Clipboard restriction has changed.
|
MDM_POLICY_ON_SETTINGS |
Settings restriction has changed.
|
MDM_POLICY_ON_LOC_SETTING |
Not supported. |
MDM_POLICY_ON_BG_SYNC |
Background Sync restriction has changed.
|
MDM_POLICY_ON_MESSAGE |
Message restriction has changed.
|
MDM_POLICY_ON_NETWORK |
Cellular data restriction has changed.
|
MDM_POLICY_ON_EMAIL |
POP/IMAP restriction has changed.
|
MDM_POLICY_ON_SIM_PIN_LOCK |
Not supported. |
MDM_POLICY_ON_DEVICE_LOCK |
Screen has been locked or password has been changed.
|
MDM_POLICY_ON_SMS_LIMIT |
Not supported. |
MDM_POLICY_ON_DATA_LIMIT |
Data limit related action has happened.
|
MDM_POLICY_ON_AIRPLANE |
Airplane mode restriction has changed
|
MDM_POLICY_ON_AIRPLANE_CHANGE |
Prevent to change airplane mode.
|
MDM_POLICY_ON_POWER_SAVING_MODE |
Power saving mode restriction has changed. |
MDM_POLICY_ON_POWER_SAVING_MODE_CHANGE |
Prevent to change power saving mode.
|
MDM_POLICY_ON_USB_TETHERING |
USB tethering restriction has changed.
|
MDM_POLICY_ON_USB_KIES |
Samsung Kies restriction has changed.
|
MDM_POLICY_ON_USB_DEBUG |
USB debug restriction has changed.
|
MDM_POLICY_ON_USB_DEBUGGING_CHANGE |
Prevent to change USB debugging state.
|
MDM_POLICY_ON_WATCHFACE |
Watch face change restriction has changed.
|
MDM_POLICY_ON_APP_NOTI_CHANGED |
Application notifications list has changed. |
MDM_POLICY_ON_MOBILE_DATA_CHANGE |
Prevent to change mobile data settings.
|
MDM_POLICY_NOTI_MAX |
Only preserved for backward compatibility with Tizen 3.0. Usage is highly discouraged. |
MDM_POLICY_ON_LOCKSCREEN_TYPE_CHANGE |
Lock screen type restriction has changed. |
MDM_POLICY_ON_WIDGETS_RESTRICTION_DATA_CHANGE |
Home screen widget board addition/removal restriction has changed.
|
Runtime permission policy value stored in the following states.
Definition at line 200 of file mdm_client_type.h.
enum mdm_result_t |
MDM API result.
Definition at line 104 of file mdm_client_type.h.
enum mdm_status_allowed |
MDM Policy allowed/restricted status.
Definition at line 148 of file mdm_client_type.h.
enum mdm_status_enabled |
MDM Policy enabled/disabled status.
Definition at line 137 of file mdm_client_type.h.
enum mdm_status_t |
MDM Policy status.
Definition at line 119 of file mdm_client_type.h.
enum mdm_status_true |
MDM Policy true/false status.
Definition at line 159 of file mdm_client_type.h.
int mdm_deregister_client | ( | const char * | pkg_name | ) |
API to close current session with MDM server.
[in] | pkg_name | The package name of the client to deregister. |
MDM_RESULT_SUCCESS | Successful. |
MDM_RESULT_FAIL | General failure. |
MDM_RESULT_SERVICE_NOT_ENABLED | Service not enabled. |
MDM_RESULT_INVALID_PARAM | Invalid parameter. |
MDM_RESULT_NOT_SUPPORTED | Not supported. |
mdm_result_t mdm_deregister_policy_receiver | ( | policy_receiver_t * | handle | ) |
API to deregister the policy change callback function.
[in] | handle | The handle returned by mdm_register_policy_receiver . |
MDM_RESULT_SUCCESS | Successful |
MDM_RESULT_FAIL | General failure |
void mdm_free_data | ( | mdm_data_t * | data | ) |
API to free an mdm_data_t
structure.
mdm_data_t
and frees the memory that it used.[in] | data | A pointer to the data to be freed. |
mdm_result_t mdm_get_last_error | ( | void | ) |
API to get the error code of the last MDM function called in current thread.
This function is useful to know the exact reason of failure of functions returning mdm_status_t
.
MDM_RESULT_SUCCESS | Successful. |
MDM_RESULT_FAIL | General failure. |
MDM_RESULT_SERVICE_NOT_ENABLED | Service not enabled. |
MDM_RESULT_INVALID_PARAM | Invalid parameter. |
MDM_RESULT_NOT_SUPPORTED | Not supported. |
mdm_result_t mdm_get_service | ( | void | ) |
API to connect to MDM server daemon, and get caller information.
This API also verifies whether the caller is authorized to get MDM client information to communicate with the MDM server daemon.
MDM_RESULT_SUCCESS
response from the MDM server daemon. It is mandatory to call mdm_release_service()
even if the mdm_get_service()
returns a value other than MDM_RESULT_SUCCESS
.This function creates new connection to the MDM server in the context of calling thread. So it must to call mdm_release_service()
from the same thread that called mdm_get_service()
.
MDM_RESULT_SUCCESS | Successful |
MDM_RESULT_FAIL | General failure |
MDM_RESULT_NOT_SUPPORTED | Not supported |
MDM_RESULT_INVALID_PARAM | Invalid parameter |
MDM_RESULT_ACCESS_DENIED | The application does not have the privilege to call this function. |
int mdm_get_service_ext | ( | const char * | pkg_name | ) |
API to connect to the MDM server daemon and get caller information.
Purpose: to verify whether the caller is authorized to get MDM client information to communicate with the device policy manager daemon. This function must be called before calling any other MDM APIs, unless otherwise stated in documentation of that particular API. After receiving a successful response from the device policy manager daemon the caller can call the other MDM APIs.
[in] | pkg_name | The package name of the caller application. |
MDM_RESULT_SUCCESS | Successful. |
MDM_RESULT_FAIL | General failure. |
MDM_RESULT_SERVICE_NOT_ENABLED | Service not enabled. |
MDM_RESULT_ACCESS_DENIED | Caller is not authorized to access MDM client information. |
MDM_RESULT_INVALID_PARAM | Invalid parameter. |
MDM_RESULT_NOT_SUPPORTED | Not supported. |
mdm_status_t mdm_is_client_registered | ( | const char * | pkg_name | ) |
API to check if an MDM client is registered in MDM Server.
It might happened, that registered client isn't registered anymore. This can be caused, for example, due to file system failure that can happen on power failure. In such case, admin client has to reapply all policies that it requires.
[in] | pkg_name | The package name of the MDM client. |
MDM_TRUE | Client is registered |
MDM_FALSE | Client is not registred |
MDM_STATUS_ERROR | Error |
int mdm_register_client | ( | const char * | pkg_name | ) |
API to register an MDM client.
[in] | pkg_name | The package name of the MDM client. |
MDM_RESULT_SUCCESS | Successful. |
MDM_RESULT_FAIL | General failure. |
MDM_RESULT_SERVICE_NOT_ENABLED | Service not enabled. |
MDM_RESULT_ACCESS_DENIED | Not authorized to access. |
MDM_RESULT_INVALID_PARAM | Invalid parameter. |
MDM_RESULT_NOT_SUPPORTED | Not supported. |
int mdm_register_client_callback | ( | mdm_policy_cb_t | policy, |
mdm_client_callback_function | cb, | ||
mdm_client_callback_function_free | free_cb, | ||
void * | userData | ||
) |
API to register a callback function for the given policy.
cb
for the given policy. You can deregister a callback for a policy by calling this function and passing NULL as the cb
value.[in] | policy | The policy callback ID to set the callback for. One of mdm_policy_cb_t . |
[in] | cb | A pointer to the callback function for policy . Set this to NULL to deregister a callback. |
[in] | free_cb | A pointer to a callback free function. The function frees the user data passed to the callback function. |
[in] | userData | The user data to pass to the callback function. |
policy_receiver_handle mdm_register_policy_receiver | ( | mdm_policy_noti_t | noti, |
void * | user_data, | ||
on_policy_receiver_callback | callback | ||
) |
API to register a callback function that is called when a policy is changed during runtime.
Registers callback which is going to be invoked on policy change.
The function doesn't require one to call mdm_get_service()
.
callback
function with the same user_data
will result in returning the same handle as previously.[in] | noti | Policy change notification type. This is an mdm_policy_noti_t value. |
[in] | user_data | Caller's user data. |
[in] | callback | A pointer to the callback function to call when the policy is changed. |
mdm_get_last_error()
.mdm_result_t mdm_release_service | ( | void | ) |
API to close the connection and release the resources.
mdm_get_service()
was successful.MDM_RESULT_SUCCESS | Successful. |
MDM_RESULT_FAIL | General failure. |