App behavior
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
-
Create the
EnterpriseDeviceManager
object. -
Call the RestrictionPolicy class
-
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.
-
Create the
EnterpriseDeviceManager
object. -
Set restrictionPolicy.setCameraState to false.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); RestrictionPolicy restrictionPolicy = edm.getRestrictionPolicy(); restrictionPolicy.setCameraState(false);
-
Create the
EnterpriseDeviceManager
andKnoxContainerManager
objects. -
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.
On this page
Is this page helpful?