Tizen Native API
4.0
|
Restriction policy group provides APIs to control restriction functionality.
#include <dpm/restriction.h>
Restriction policy group provides APIs to restrict functions of the device such as Camera, Microphone, Wi-Fi, bluetooth, USB and so on. Any API which requires privileges is only available for the registered device admin client which is enrolled to the device by enrollment process.
Functions | |
int | dpm_restriction_set_camera_state (device_policy_manager_h handle, int allow) |
Allows or disallows the use of camera. | |
int | dpm_restriction_get_camera_state (device_policy_manager_h handle, int *is_allowed) |
Check whether the use of camera is allowed or not. | |
int | dpm_restriction_set_microphone_state (device_policy_manager_h handle, int allow) |
Allows or disallows the use of microphone. | |
int | dpm_restriction_get_microphone_state (device_policy_manager_h handle, int *is_allowed) |
Checks whether the use of microphone is allowed or not. | |
int | dpm_restriction_set_location_state (device_policy_manager_h handle, int allow) |
Allows or disallows user to change the location state. | |
int | dpm_restriction_get_location_state (device_policy_manager_h handle, int *is_allowed) |
Check whether user is allowed to change location state or not. | |
int | dpm_restriction_set_external_storage_state (device_policy_manager_h handle, int allow) |
Allows or disallows user to use usb mass storage. | |
int | dpm_restriction_get_external_storage_state (device_policy_manager_h handle, int *is_allowed) |
Checks whether the use of external storage is allowed or not. | |
int | dpm_restriction_set_clipboard_state (device_policy_manager_h handle, int allow) |
Allows or disallows user to access the clipboard. | |
int | dpm_restriction_get_clipboard_state (device_policy_manager_h handle, int *is_allowed) |
Checks whether the clipboard access is allowed or not. | |
int | dpm_restriction_set_usb_debugging_state (device_policy_manager_h handle, int allow) |
Allows or disallows the usb debugging. | |
int | dpm_restriction_get_usb_debugging_state (device_policy_manager_h handle, int *is_allowed) |
Checks whether the usb debugging is allowed or not. | |
int | dpm_restriction_set_wifi_state (device_policy_manager_h handle, int allow) |
Allows or disallows user to change the Wi-Fi state. | |
int | dpm_restriction_get_wifi_state (device_policy_manager_h handle, int *is_allowed) |
Checks whether the Wi-Fi state change is allowed or not. | |
int | dpm_restriction_set_wifi_hotspot_state (device_policy_manager_h handle, int allow) |
Allows or disallows user to change Wi-Fi hotspot state change. | |
int | dpm_restriction_get_wifi_hotspot_state (device_policy_manager_h handle, int *is_allowed) |
Checks whether the the Wi-Fi hotspot state change is allowed or not. | |
int | dpm_restriction_set_bluetooth_tethering_state (device_policy_manager_h handle, int allow) |
Allows or disallows user to change the bluetooth tethering state. | |
int | dpm_restriction_get_bluetooth_tethering_state (device_policy_manager_h handle, int *is_allowed) |
Checks whether the bluetooth tethering state change is allowed. | |
int | dpm_restriction_set_usb_tethering_state (device_policy_manager_h handle, int allow) |
Allows or disallows user to change USB tethering settings. | |
int | dpm_restriction_get_usb_tethering_state (device_policy_manager_h handle, int *is_allowed) |
Checks whether the USB tethering state change is allowed. | |
int | dpm_restriction_set_bluetooth_mode_change_state (device_policy_manager_h handle, int allow) |
Allows or disallows user to change the bluetooth state. | |
int | dpm_restriction_get_bluetooth_mode_change_state (device_policy_manager_h handle, int *is_allowed) |
Checks whether the the bluetooth state change is allowed of not. | |
int | dpm_restriction_set_bluetooth_desktop_connectivity_state (device_policy_manager_h handle, int allow) |
Allows or disallows the bluetooth desktop connectivity. | |
int | dpm_restriction_get_bluetooth_desktop_connectivity_state (device_policy_manager_h handle, int *is_allowed) |
Checks whether the the Bluetooth desktop connectivity is allowed or not. | |
int | dpm_restriction_set_bluetooth_pairing_state (device_policy_manager_h handle, int allow) |
Allows or disallows user to change the bluetooth pairing. | |
int | dpm_restriction_get_bluetooth_pairing_state (device_policy_manager_h handle, int *is_allowed) |
Checks whether the the bluetooth pairing is allowed or not. | |
int | dpm_restriction_set_messaging_state (device_policy_manager_h handle, const char *sim_id, int allow) |
Allows or disallows user to use of SMS or text messaging. | |
int | dpm_restriction_get_messaging_state (device_policy_manager_h handle, const char *sim_id, int *is_allowed) |
Checks whether the text messaging is allowed or not. | |
int | dpm_restriction_set_popimap_email_state (device_policy_manager_h handle, int allow) |
Allows or disallows the access to POP or IMAP email. | |
int | dpm_restriction_get_popimap_email_state (device_policy_manager_h handle, int *is_allowed) |
Checks whether the access to POP or IMAP email is allowed or not. | |
int | dpm_restriction_set_browser_state (device_policy_manager_h handle, int allow) |
Allows or disallows the use of web browser. | |
int | dpm_restriction_get_browser_state (device_policy_manager_h handle, int *is_allowed) |
Checks whether the use of web browser is allowed or not. |
int dpm_restriction_get_bluetooth_desktop_connectivity_state | ( | device_policy_manager_h | handle, |
int * | is_allowed | ||
) |
Checks whether the the Bluetooth desktop connectivity is allowed or not.
An administrator can use this API to check whether the Bluetooth desktop connectivity is allowed or not. If the Bluetooth desktop connectivity is disallowed, the UI is grayed out so user can not change its state.
[in] | handle | Device policy manager handle |
[out] | is_allowed | true if the connectivity is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
int dpm_restriction_get_bluetooth_mode_change_state | ( | device_policy_manager_h | handle, |
int * | is_allowed | ||
) |
Checks whether the the bluetooth state change is allowed of not.
An administrator can use this API to check whether the bluetooth state change is allowed or not. If the bluetooth state change is disallowed, the UI is grayed out so user can not change its state.
[in] | handle | Device policy manager handle |
[out] | is_allowed | true if the change is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
int dpm_restriction_get_bluetooth_pairing_state | ( | device_policy_manager_h | handle, |
int * | is_allowed | ||
) |
Checks whether the the bluetooth pairing is allowed or not.
An administrator can use this API to check whether the bluetooth pairing is allowed or not. If the bluetooth pairing is disallowed, the UI is grayed out so user can not change its state.
[in] | handle | Device policy manager handle |
[out] | is_allowed | true if the pairing is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
int dpm_restriction_get_bluetooth_tethering_state | ( | device_policy_manager_h | handle, |
int * | is_allowed | ||
) |
Checks whether the bluetooth tethering state change is allowed.
An administrator can use this API to check whether user is allowed to change bluetooth tethering state. is allowed or not. If the bluetooth tethering state change is disallowed, the UI is grayed out so user can not change its state.
[in] | handle | Device policy manager handle |
[out] | is_allowed | true if the change is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
int dpm_restriction_get_browser_state | ( | device_policy_manager_h | handle, |
int * | is_allowed | ||
) |
Checks whether the use of web browser is allowed or not.
An administrator can use this API to check whether the use of web browser is allowed or not.
[in] | handle | Device policy manager handle |
[out] | is_allowed | true if the use of web browser is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
int dpm_restriction_get_camera_state | ( | device_policy_manager_h | handle, |
int * | is_allowed | ||
) |
Check whether the use of camera is allowed or not.
An administrator can use this API to check whether the use of camera is allowed or not.
[in] | handle | Device policy manager handle |
[out] | is_allowed | true if the use of camera is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
int dpm_restriction_get_clipboard_state | ( | device_policy_manager_h | handle, |
int * | is_allowed | ||
) |
Checks whether the clipboard access is allowed or not.
An administrator can use this API to check whether the clipboard access is allowed or not.
[in] | handle | Device policy manager handle |
[out] | is_allowed | true if the access is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
int dpm_restriction_get_external_storage_state | ( | device_policy_manager_h | handle, |
int * | is_allowed | ||
) |
Checks whether the use of external storage is allowed or not.
An administrator can use this API to check whether the use of external storage is allowed or not.
[in] | handle | Device policy manager handle |
[out] | is_allowed | true if the use of external storage is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
int dpm_restriction_get_location_state | ( | device_policy_manager_h | handle, |
int * | is_allowed | ||
) |
Check whether user is allowed to change location state or not.
An administrator can use this API to check whether user is allowed to change the location state or not.
[in] | handle | Device policy manager handle |
[out] | is_allowed | true if the location state change is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
int dpm_restriction_get_messaging_state | ( | device_policy_manager_h | handle, |
const char * | sim_id, | ||
int * | is_allowed | ||
) |
Checks whether the text messaging is allowed or not.
An administrator can use this API to check whether text messaging capability is enabled or not.
[in] | handle | Device policy manager handle |
[in] | sim_id | SIM identifier |
[out] | is_allowed | true if the messaging is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
int dpm_restriction_get_microphone_state | ( | device_policy_manager_h | handle, |
int * | is_allowed | ||
) |
Checks whether the use of microphone is allowed or not.
An administrator can use this API to check whether the use of microphone is allowed of not.
[in] | handle | Device policy manager handle |
[out] | is_allowed | true if the use of microphone is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
int dpm_restriction_get_popimap_email_state | ( | device_policy_manager_h | handle, |
int * | is_allowed | ||
) |
Checks whether the access to POP or IMAP email is allowed or not.
An administrator can use this API to check the access to POP or IMAP email is allowed or not.
[in] | handle | Device policy manager handle |
[out] | is_allowed | true if the POP or IMAP email is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
int dpm_restriction_get_usb_debugging_state | ( | device_policy_manager_h | handle, |
int * | is_allowed | ||
) |
Checks whether the usb debugging is allowed or not.
An administrator can use this API to check whether the usb debugging is allowed or not.
[in] | handle | Device policy manager handle |
[out] | is_allowed | true if the usb debugging is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
int dpm_restriction_get_usb_tethering_state | ( | device_policy_manager_h | handle, |
int * | is_allowed | ||
) |
Checks whether the USB tethering state change is allowed.
An administrator can use this API to check whether the USB tethering state change is allowed or not. If the USB tethering state change is disallowed, the UI is grayed out so user can not change its state.
[in] | handle | Device policy manager handle |
[out] | is_allowed | true if the change is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
int dpm_restriction_get_wifi_hotspot_state | ( | device_policy_manager_h | handle, |
int * | is_allowed | ||
) |
Checks whether the the Wi-Fi hotspot state change is allowed or not.
An administrator can use this API to check whether user is allowed to change Wi-Fi hotspot state or not. If the Wi-Fi hotspot state change is disallowed, the UI is grayed out so user can not change its state.
[in] | handle | Device policy manager handle |
[out] | is_allowed | true if the state change is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
int dpm_restriction_get_wifi_state | ( | device_policy_manager_h | handle, |
int * | is_allowed | ||
) |
Checks whether the Wi-Fi state change is allowed or not.
An administrator can use this API to check whether user is allowed to change Wi-Fi state or not.
[in] | handle | Device policy manager handle |
[out] | is_allowed | true if the change is allowed, false otherwise. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
int dpm_restriction_set_bluetooth_desktop_connectivity_state | ( | device_policy_manager_h | handle, |
int | allow | ||
) |
Allows or disallows the bluetooth desktop connectivity.
An administrator can use this API to allow or disallow the bluetooth desktop connectivity. If the bluetooth desktop connectivity is disallowed, the UI is grayed out so user can not change its state.
[in] | handle | Device policy manager handle |
[out] | allow | If true, allow the bluetooth desktop connectivity, if false, disallow the bluetooth desktop connectivity |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_restriction_set_bluetooth_mode_change_state | ( | device_policy_manager_h | handle, |
int | allow | ||
) |
Allows or disallows user to change the bluetooth state.
An administrator can use this API to allow or disallow user to change the bluetooth state. When disallowed, the UI is grayed out so user cannot change the state.
[in] | handle | Device policy manager handle |
[in] | allow | If true, allow user to change bluetooth state, if false, disallow user to change bluetooth state. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_restriction_set_bluetooth_pairing_state | ( | device_policy_manager_h | handle, |
int | allow | ||
) |
Allows or disallows user to change the bluetooth pairing.
An administrator can use this API to allow or disallow the bluetooth pairing. If the bluetooth pairing is disallowed, the UI is grayed out so user can not change its state.
[in] | handle | Device policy manager handle |
[out] | allow | If true, allow the bluetooth pairing, if false, disallow the bluetooth pairing. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_restriction_set_bluetooth_tethering_state | ( | device_policy_manager_h | handle, |
int | allow | ||
) |
Allows or disallows user to change the bluetooth tethering state.
An administrator can use this API to allow of disallow user to chanage the bluetooth tethering state. When disallowed, the UI is grayed out so user cannot change the state.
[in] | handle | Device policy manager handle |
[in] | allow | If true, allow user to change the bluetooth tethering state, if false, disallow user to change the bluetooth tethering state. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_restriction_set_browser_state | ( | device_policy_manager_h | handle, |
int | allow | ||
) |
Allows or disallows the use of web browser.
An administrator can allows or disallow the use of web browser without any user interaction
[in] | handle | Device policy manager handle |
[in] | allow | If true, allow the use of web browser, if false, disallow the use of web browser. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_restriction_set_camera_state | ( | device_policy_manager_h | handle, |
int | allow | ||
) |
Allows or disallows the use of camera.
An administrator can use this API to set whether the use of camera is allowed or not.
[in] | handle | Device policy manager handle |
[in] | allow | If true, allow the use of camera, if false, disallow the use of camera |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_restriction_set_clipboard_state | ( | device_policy_manager_h | handle, |
int | allow | ||
) |
Allows or disallows user to access the clipboard.
An administrator can use this API to set whether the clipboard access. is allowed or not
[in] | handle | Device policy manager handle |
[in] | allow | If true, allow the clipboard access, if false, disallow the clipboard access. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_restriction_set_external_storage_state | ( | device_policy_manager_h | handle, |
int | allow | ||
) |
Allows or disallows user to use usb mass storage.
An administrator can use this API to set whether the usb mass storage is allowed or not.
[in] | handle | Device policy manager handle |
[in] | allow | If true, allow user to use the external storages, if false, disallow the external storage |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_restriction_set_location_state | ( | device_policy_manager_h | handle, |
int | allow | ||
) |
Allows or disallows user to change the location state.
An administrator can use this API to allow or disallow user to change the location state.
[in] | handle | Device policy manager handle |
[in] | allow | If true, allow user to change the location state, if false, disallow |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_restriction_set_messaging_state | ( | device_policy_manager_h | handle, |
const char * | sim_id, | ||
int | allow | ||
) |
Allows or disallows user to use of SMS or text messaging.
An administrator can disable the text messaging capability without any user interaction
[in] | handle | Device policy manager handle |
[in] | sim_id | SIM identifier |
[in] | allow | If true, allow the use of SMS or text messaging, if false, disallow the use of SMS or text messaging. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_restriction_set_microphone_state | ( | device_policy_manager_h | handle, |
int | allow | ||
) |
Allows or disallows the use of microphone.
An administrator can use this API to set whether the use of microphone is allowed or not.
[in] | handle | Device policy manager handle |
[in] | allow | If true, allow the use of microphone, if false, disallow the use of microphone |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_restriction_set_popimap_email_state | ( | device_policy_manager_h | handle, |
int | allow | ||
) |
Allows or disallows the access to POP or IMAP email.
An administrator can disable the email capability without any user interaction
[in] | handle | Device policy manager handle |
[in] | allow | If true, allow POP or IMAP email, if false, disallow POP or IMAP email. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_restriction_set_usb_debugging_state | ( | device_policy_manager_h | handle, |
int | allow | ||
) |
Allows or disallows the usb debugging.
An administrator can use this API to set whether the usb debugging is allowed or not.
[in] | handle | Device policy manager handle |
[in] | allow | If true, allow the usb debugging, if false, disallow the usb debugging |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_restriction_set_usb_tethering_state | ( | device_policy_manager_h | handle, |
int | allow | ||
) |
Allows or disallows user to change USB tethering settings.
An administrator can use this API to allow or disallow user to change USB tethering settings. When disallowed, the UI is grayed out so user cannot change the state.
[in] | handle | Device policy manager handle |
[in] | allow | If true, allow USB tethering state change, if false, disallow USB tethering state change. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_restriction_set_wifi_hotspot_state | ( | device_policy_manager_h | handle, |
int | allow | ||
) |
Allows or disallows user to change Wi-Fi hotspot state change.
An administrator can use this API to allow or disallow user to change Wi-Fi hotspot state. When it is disallowed, the UI is grayed out so user cannot change Wi-Fi hotspot state.
[in] | handle | Device policy manager handle |
[in] | allow | If true, allow user to change Wi-Fi hostspot state, if false, disallow user to change Wi-Fi hotspot state. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_restriction_set_wifi_state | ( | device_policy_manager_h | handle, |
int | allow | ||
) |
Allows or disallows user to change the Wi-Fi state.
An administrator can use this API to allow or disallow user to change the Wi-Fi state. If it is disallowed, user does not have UI access to change the state.
[in] | handle | Device policy manager handle |
[in] | allow | If true, allow user to change Wi-Fi state, if false, disallow user to change Wi-Fi state. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |