Device Policy Management

The Device Policy Management (DPM) framework supports enterprise applications by providing IT administrator functions to create security-aware applications. These applications are useful in scenarios where IT administrators require rich control over employee devices.

Note

Since Tizen 8.0, all Device Policy Manager APIs are deprecated and will be removed without any alternative.

The DPM framework consists of the following tools:

  • Device policy client library: This contains all the device administration functions that a client application can call. The device policy client library communicates with the device policy manager using a built-in remote method invocation (RMI) engine.
  • Device policy manager: This manages all the device policies. It also provides interfaces for the device policy client library.

The main features of the Tizen.Security.DevicePolicyManager namespace are as follows:

The following figure illustrates the DPM framework process:

Figure: DPM framework process

DPM framework process

Prerequisites

To use the methods and properties of the Tizen.Security.DevicePolicyManager namespace, include it in your application:

C#
Copy
using Tizen.Security.DevicePolicyManager;

Manage device policies

To manage device policies, follow the steps below:

  1. Create a DevicePolicyManager instance:

    C#
    Copy
    DevicePolicyManager dpm = new DevicePolicyManager();
  2. Get the policy instance using getPolicy<T>() of the DevicePolicyManager instance:

    C#
    Copy
    MediaPolicy mediaPolicy = dpm.getPolicy<MediaPolicy>();
    Note

    The DevicePolicyManager instance must exist when you use the policy instance.

  3. Register an event handler to manage the policies of the policy instance:

    C#
    Copy
    try { DevicePolicyManager dpm = new DevicePolicyManager(); MediaPolicy mediaPolicy = dpm.getPolicy<MediaPolicy>(); /// Register the event handler mediaPolicy.CameraPolicyChanged += onCameraPolicyChanged; } catch (Exception e) { /// Handle exception } /// Create the event handler void onCameraPolicyChanged(Object Sender, PolicyChangedEventArgs args) { Console.WriteLine("PolicyName: " + args.PolicyName + ", Current policy state: " + args.IsAllowed); }
  4. Check the device restriction state:

    C#
    Copy
    /// Check the restriction state of the camera /// false: using the camera is not allowed /// true: using the camera is allowed bool cameraPolicyState = mediaPolicy.IsCameraAllowed;
  5. When no longer needed, destroy the policy instance and DPM instance:

    C#
    Copy
    mediaPolicy.Dispose(); dpm.Dispose();
    Note

    The policy instance must be destroyed before the DPM instance.

  • Dependencies
    • Tizen 5.5 and Higher
TEE Communication
Next Sensors
Submit your feedback to GitHub