--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
+<head>\r
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>\r
+ <meta http-equiv="X-UA-Compatible" content="IE=9" />\r
+ <link rel="stylesheet" type="text/css" href="../../css/styles.css" />\r
+ <link rel="stylesheet" type="text/css" href="../../css/snippet.css" />\r
+ <script type="text/javascript" src="../../scripts/snippet.js"></script>\r
+ <script type="text/javascript" src="../../scripts/jquery.util.js" charset="utf-8"></script>\r
+ <script type="text/javascript" src="../../scripts/common.js" charset="utf-8"></script>\r
+ <script type="text/javascript" src="../../scripts/core.js" charset="utf-8"></script>\r
+ <script type="text/javascript" src="../../scripts/search.js" charset="utf-8"></script>\r
+ <title>Device Policy Management</title>\r
+ </head>\r
+ <body onload="prettyPrint()" style="overflow: auto;">\r
+\r
+ <div id="toc-navigation">\r
+ <div id="profile">\r
+ <p><img alt="Mobile native" src="../../images/mobile_s_n.png"/> <img alt="Wearable native" src="../../images/wearable_s_n.png"/></p>\r
+ </div>\r
+\r
+ <div id="toc_border"><div id="toc">\r
+ <p class="toc-title">Dependencies</p>\r
+ <ul class="toc">\r
+ <li>Tizen 3.0 and Higher for Mobile</li>\r
+ <li>Tizen 3.0 and Higher for Wearable</li>\r
+ </ul>\r
+ <p class="toc-title">Content</p>\r
+ <ul class="toc">\r
+ <li><a href="#prerequisites">Prerequisites</a></li>\r
+ <li><a href="#client_application">Managing Device Policies</a></li> \r
+ </ul>\r
+ <p class="toc-title">Related Info</p>\r
+ <ul class="toc">\r
+ <li><a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SECURITY__DPM__MODULE.html">Device Policy Manager API for Mobile Native</a></li>\r
+ <li><a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__SECURITY__DPM__MODULE.html">Device Policy Manager API for Wearable Native</a></li>\r
+ </ul>\r
+ </div></div>\r
+</div>\r
+\r
+<div id="container"><div id="contents"><div class="content">\r
+<h1>Device Policy Management</h1>\r
+\r
+<p>The Device Policy Management (DPM) framework supports enterprise applications by providing IT administrators means to create security-aware applications. They are useful in situations where IT administrators require rich control over employee devices.</p>\r
+<p>DPM consists of a device policy client library and a device policy manager. The device policy manager manages all device policies and provides interfaces for the device policy client library. The device policy client library contains the device administration functions the client application can call. Internally, the device policy client library communicates with the device policy manager using a built-in remote method invocation engine.</p>\r
+\r
+<p>The main features of the Device Policy Manager API include:</p>\r
+ <ul>\r
+ <li>Managing policies\r
+<p>You can <a href="#client_application">track the state between the device admin client and the device policy manager</a> with a device policy manager handle, provided by the Policy Manager Interface API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__DPM__MANAGER__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__DPM__MANAGER__MODULE.html">wearable</a> applications).</p></li>\r
+ </ul>\r
+ <ul>\r
+ <li>Checking restrictions\r
+<p>You can <a href="#client_application">check the restriction states of the device</a>, such as camera, microphone, Wi-Fi, Bluetooth, and USB, using the getter functions of the Restriction policy group API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__DPM__RESTRICTION__POLICY__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__DPM__RESTRICTION__POLICY__MODULE.html">wearable</a> applications).</p>\r
+<p>You can also check the external and internal storage encryption state using the Security policy group API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__DPM__SECURITY__POLICY__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__DPM__SECURITY__POLICY__MODULE.html">wearable</a> applications) and get the name of the created zone and the zone state using the Zone policy group API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__DPM__ZONE__POLICY__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__DPM__ZONE__POLICY__MODULE.html">wearable</a> applications).</p></li>\r
+ </ul>\r
+\r
+<p>The following figure illustrates the DPM framework process.</p>\r
+ \r
+ <p class="figure">Figure: DPM framework process</p>\r
+ <p align="center"><img alt="DPM framework process" src="../../images/dpm-framework.png" /></p>\r
+\r
+<h2 id="warm-up" name="warm-up">Warm-up</h2>\r
+ <p>\r
+ Become familiar with the Device Policy Manager API basics by learning about:</p>\r
+ <ul>\r
+ <li><a href="#prerequisites">Prerequisites</a>\r
+ <p>Prepare your application to use the DPM framework functionality.</p></li>\r
+ <li><a href="#client_application">Managing Device Policies</a>\r
+ <p>Create a DPM handle, track policy changes, and check the device restriction state.</p></li>\r
+ </ul>\r
+\r
+<h2 id="prerequisites">Prerequisites</h2>\r
+\r
+<p>To use the functions and data types of the Device Policy Manager API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SECURITY__DPM__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__SECURITY__DPM__MODULE.html">wearable</a> applications), include the <span style="font-family: Courier New,Courier,monospace"><dpm/device-policy-manager.h></span> header file in your application:</p>\r
+<pre class="prettyprint">\r
+#include <dpm/device-policy-manager.h>\r
+</pre>\r
+\r
+<h2 id="client_application" name="client_application">Managing Device Policies</h2>\r
+\r
+<p>To manage device policies:</p>\r
+<ol>\r
+\r
+<li>Create a DPM handle:\r
+<pre class="prettyprint">\r
+device_policy_manager_h dpm;\r
+\r
+/* Create a DPM handle */\r
+dpm = dpm_manager_create();\r
+</pre>\r
+</li>\r
+\r
+<li>Add a policy change callback to the device policy manager:\r
+<pre class="prettyprint">\r
+int callback_id;\r
+\r
+/* Create the policy change callback function */\r
+void\r
+on_policy_changed(const char* name, const char* value, void* data)\r
+{\r
+ int state = strcmp(value, "allowed") ? 0 : 1;\r
+\r
+ if (strcmp(name, "camera") == 0) {\r
+ if (state)\r
+ /* Using the camera is allowed */\r
+ else\r
+ /* Using the camera is not allowed */\r
+ } \r
+}\r
+\r
+/* Add the policy change callback to the device policy manager */\r
+int\r
+dpm_init()\r
+{\r
+ int ret = dpm_add_policy_changed_cb(dpm, "camera", on_policy_changed, user_data, &callback_id);\r
+ if (ret < 0)\r
+ /* Error handling */ \r
+}\r
+</pre>\r
+</li>\r
+\r
+<li>Check the device restriction state:\r
+<pre class="prettyprint">\r
+#include <dpm/restriction.h>\r
+\r
+int state;\r
+\r
+/* Check the restriction state of the camera */\r
+if (dpm_restriction_get_camera_state(dpm, &state) == DPM_ERROR_NONE) {\r
+ /* state: 0: using the camera is not allowed */\r
+ /* state: 1: using the camera is allowed */\r
+}\r
+</pre>\r
+</li>\r
+\r
+<li>When no longer needed, remove the policy change callback from the device policy manager and destroy the DPM handle:\r
+<pre class="prettyprint">\r
+void\r
+dpm_finalize()\r
+{\r
+ /* Remove the policy change callback from the device policy manager */\r
+ dpm_remove_policy_changed_cb(dpm, callback_id);\r
+ /* Destroy the DPM handle */\r
+ dpm_manager_destroy(dpm);\r
+}\r
+</pre>\r
+</li>\r
+</ol>\r
+\r
+\r
+<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>\r
+<script type="text/javascript" src="../../scripts/showhide.js"></script>\r
+</div></div></div>\r
+\r
+<a class="top sms" href="#"><img src="../../images/btn_top.gif" alt="Go to top" /></a>\r
+\r
+<div id="footer">\r
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>\r
+</div>\r
+\r
+<script type="text/javascript">\r
+var _gaq = _gaq || [];\r
+_gaq.push(['_setAccount', 'UA-25976949-1']);\r
+_gaq.push(['_trackPageview']);\r
+(function() {\r
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\r
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\r
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\r
+})();\r
+</script>\r
+\r
+</body>\r
+</html>\r