Knox Tizen Wearable SDK
Kiosk policy group

Kiosk policy group provides policies for Kiosk mode. More...

Functions

mdm_result_t knox_mdm_set_allow_hardware_key (const char *key_name, mdm_status_t allow)
 API to disable a specified hardware key. More...
 
mdm_status_t knox_mdm_get_allow_hardware_key (const char *key_name)
 API to check if a specific hardware key is disabled. More...
 

Detailed Description

Kiosk policy group provides policies for Kiosk mode.

Kiosk policy group.

Required Header

#include <mdm.h>

Overview

This group provides APIs to set Kiosk mode.

Function Documentation

mdm_status_t knox_mdm_get_allow_hardware_key ( const char *  key_name)

API to check if a specific hardware key is disabled.

Since (Knox_wearable):
2.2.0
Since (Tizen):
3.0.0.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Use this API to check if a specified hardware key is enabled or disabled.
if ( ret == MDM_RESULT_SUCCESS) {
mdm_status status = knox_mdm_get_allow_hardware_key(“XF86Home”);
if ( status != MDM_STATUS_ERROR ) {
if ( status == MDM_ALLOWED ) {
// key is enabled
} else {
// key is restricted
}
} else {
// error has occurred
}
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.kiosk
Parameters
[in]key_nameSpecifies the name of the hardware key to be checked in the form of strings. Check the Tizen documentation page, under the section " Grabbing Hardware Key Events", to find name definitions. For example, under the description for "eext_win_keygrab_set," the name for home key is “XF86Home”.
Returns
mdm_result_t : MDM_RESULT_SUCCESS upon successfully checking the status of a specified hardware key, or an error code from the values listed below upon failure. The error code MDM_RESULT_INVALID_PARAM indicates that the key name used in the function isn't currently supported on the platform.
NOTE — Using a key name that is supported on the platform, even if the key name doesn't exist on the device will result in a return of MDM_RESULT_SUCCESS. For example, calling "XF86Camera_Full" for camera key name will result in a successful call even if the device doesn't have a camera key.
Return values
MDM_ALLOWEDSpecific hardware key is enabled.
MDM_RESTRICTEDSpecific hardware key is disabled.
MDM_STATUS_ERRORError
Permission:
Usage of this API is restricted to registered clients only.
See also
knox_mdm_set_allow_hardware_key
mdm_result_t knox_mdm_set_allow_hardware_key ( const char *  key_name,
mdm_status_t  allow 
)

API to disable a specified hardware key.

Since (Knox_wearable):
2.2.0
Since (Tizen):
3.0.0.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Use this API to restricts or allow the use of a specified hardware key to send events to applications. The default value is to allow all keys.
if ( ret == MDM_RESULT_SUCCESS) {
// By default all keys are allowed
// All keys are allowed here
// Menu key is restricted here
// All keys are restricted here
// All keys except Home key are restricted here
// All keys are allowed here
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.kiosk
Parameters
[in]key_nameIdentifies the name of the key in the form of a string. Check the Tizen documentation page, under the section "Grabbing Hardware Key Events", to find name definitions. For example, under the description for "eext_win_keygrab_set," the name for home key is “XF86Home”.
NOTE — Key_name can be set to “*” string to indicate “all keys”.
[in]allowMDM_ALLOWED — The specified key is allowed to send an event to an application. This is similar to adding the key to a key white list.
MDM_RESTRICTED — The specified key is restricted from sending an event to an application. This is similar to adding the key to a key black list.

Imagine that there are two lists: black and white. If key name is in black list it is restricted but if it is on white list it is allowed to send events. By default key is allowed (it is not on any list). So below table describes behavior of this policy under different conditions:

| key_name value | allow value | description |

|-----------------------------—|-------------—|-----------------------------------------------------------------------------------------------------—| | "*" | MDM_ALLOWED | Clear black and white list. | | "*" | MDM_RESTRICTED | Clear black and white list. Add "*" to black list. | | < key name>
e.g. "XF86Home" | MDM_ALLOWED | If black list is equal to "*" add key to white list.
If black list is not equal to "*" remove key from black list if it exist there. | |< key name>
e.g. "XF86Home" | MDM_RESTRICTED | If black list is equal to "*" do nothing.
If black list is not equal to "*" add key to black list. |

Returns
mdm_result_t : MDM_RESULT_SUCCESS upon successful configuration of a specified hardware key, or an error code from the values listed below upon failure. The error code MDM_RESULT_INVALID_PARAM indicates that the key name used in the function isn't supported on the platform.
NOTE — Using a key name that is supported on the platform, even if the key name doesn't exist on the device will result in a return of MDM_RESULT_SUCCESS. For example, calling "XF86Camera_Full" for camera key name will result in a successful call even if the device doesn't have a camera key.
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
knox_mdm_get_allow_hardware_key