Back to top

This topic provides examples of how to modify default app behavior on your device with the Knox SDK.

Manage Clipboard

You use allowClipboardShare to enable or disable a global clipboard between applications. If clipboard sharing is disallowed, each application has an individual clipboard.

By default, data sharing is turned not allowed inside the container.

The use of this API requires the com.samsung.android.knox.permission.KNOX_RESTRICTION_MGMT permission

  1. Create the EnterpriseDeviceManager object.

  2. Call the RestrictionPolicy class

  3. Set allowClipboardshare to true or false to allow or deny

    EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
    RestrictionPolicy restrictionPolicy = edm.getRestrictionPolicy();
    restrictionPolicy.allowClipboardShare(false);
    

Change camera state

You use setCameraState to disable the camera without any user input. Users or third-party applications cannot enable the camera once it is disabled. The camera is turned off and disabled if it is turned on when this API is called. The API disables the photo camera, video camera, and video telephony functionality.

The use of this API requires the com.samsung.android.knox.permission.KNOX_HW_CONTROL permission which has a protection level of signature.

  1. Create the EnterpriseDeviceManager object.

  2. Set restrictionPolicy.setCameraState to false.

    EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
    RestrictionPolicy restrictionPolicy = edm.getRestrictionPolicy();
    restrictionPolicy.setCameraState(false);
    
  3. Create the EnterpriseDeviceManager and KnoxContainerManager objects.

  4. Set restrictionPolicy.setCameraState to false.

    EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
    KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID);
    RestrictionPolicy restrictionPolicy = kcm.getRestrictionPolicy();
    restrictionPolicy.setCameraState(false);
    

Looking for more examples?

See the Samsung Knox SDK API reference for full information on methods, classes and implementation.

See Building your first Knox 3.x app tutorial for a step by step walk-through of implementing this policy.

Is this page helpful?