Since: API level 11
public class

RCPPolicy

extends Object
java.lang.Object
   ↳ com.samsung.android.knox.container.RCPPolicy

Deprecated in API level 36

Class Overview

This class provides APIs to manage data import/export to/from the container.

Since
API level 11
KNOX 2.0

Summary

Constants
String CALENDAR Deprecated in API level 36
String CONTACTS Deprecated in API level 36
String EXPORT_DATA Deprecated in API level 36
String IMPORT_DATA Deprecated in API level 36
String NOTIFICATIONS Deprecated in API level 36
String SANITIZE_DATA Deprecated in API level 36
Public Constructors
RCPPolicy()
Public Methods
boolean allowMoveAppsToContainer(boolean allow)
Deprecated in API level 30
NOTE: This API is not available since Android 9.
boolean allowMoveFilesToContainer(boolean allow)
Deprecated in API level 35
boolean allowMoveFilesToOwner(boolean allow)
Deprecated in API level 35
boolean allowShareClipboardDataToOwner(boolean allow)
Deprecated in API level 33
boolean getAllowChangeDataSyncPolicy(String appName, String syncProperty)
Deprecated in API level 35
NOTE: This API is not available since Android 12.
List<String> getListFromAllowChangeDataSyncPolicy(String syncProperty, boolean value)
Deprecated in API level 35
NOTE: This API is not available since Android 12.
boolean isMoveAppsToContainerAllowed()
Deprecated in API level 30
NOTE: This API is not available since Android 9.
boolean isMoveFilesToContainerAllowed()
Deprecated in API level 35
boolean isMoveFilesToOwnerAllowed()
Deprecated in API level 35
boolean isShareClipboardDataToOwnerAllowed()
Deprecated in API level 33
boolean setAllowChangeDataSyncPolicy(List<String> appNames, String syncProperty, boolean value)
Deprecated in API level 35
NOTE: This API is not available since Android 12.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String CALENDAR

Since: API level 11

Deprecated in API level 36

Predefined application supports data import/export.It is passed as the application parameter in the following APIs.

Since
API level 11
KNOX 2.0
Constant Value: "Calendar"

public static final String CONTACTS

Since: API level 11

Deprecated in API level 36

Predefined application supports data import/export.It is passed as the application parameter in the following APIs.

Since
API level 11
KNOX 2.0
Constant Value: "Contacts"

public static final String EXPORT_DATA

Since: API level 11

Deprecated in API level 36

This constant is a sync property used to export data out of the container. For the applications it is set to true, will be allowed to sync data out of the container.

Since
API level 11
KNOX 2.0
Constant Value: "knox-export-data"

public static final String IMPORT_DATA

Since: API level 11

Deprecated in API level 36

This constant is a sync property used as a parameter while setting policies. This specifies if data needs to be synced from outside container to inside. Most of the time this gets choosen by user from a user settings. User set value can be overridden by this policy.

Since
API level 11
KNOX 2.0
Constant Value: "knox-import-data"

public static final String NOTIFICATIONS

Since: API level 11

Deprecated in API level 36

Predefined application supports data import/export.It is passed as the application parameter in the following APIs.

Since
API level 11
KNOX 2.0
Constant Value: "Notifications"

public static final String SANITIZE_DATA

Since: API level 11

Deprecated in API level 36

This constant is a sync property used to specify whether all the information needs to be synced across users or the data needs to be filtered. What data gets filtered for which type of app is defined by UX guidelines.

Since
API level 11
KNOX 2.0
Constant Value: "knox-sanitize-data"

Public Constructors

public RCPPolicy ()

Since: API level 11

Public Methods

public boolean allowMoveAppsToContainer (boolean allow)

Since: API level 11

Deprecated in API level 30
NOTE: This API is not available since Android 9.

API to set policy value for moving applications to inside the container.

Parameters
allow A boolean value which either enables or disables moving applications to inside the container.
Returns
  • true If the policy is set properly
Throws
SecurityException If caller does not have required permissions.
Usage
An administrator can use this API to set a policy which either enables/disables moving applications to inside the container.

 EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
 try {
     KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID);
     RCPPolicy rcpPolicy = kcm.getRCPPolicy();
     boolean status = rcpPolicy.allowMoveAppsToContainer(true);
 } catch (SecurityException e) {
     Log.e(TAG, "SecurityException: " + e);
 }
 

Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CONTAINER" permission which has a protection level of signature.

Since
API level 11
KNOX 2.0

public boolean allowMoveFilesToContainer (boolean allow)

Since: API level 11

Deprecated in API level 35

API to set policy value for moving files to inside the container.

Parameters
allow A boolean value which either enables or disables file moving to inside the container.
Returns
  • true If the policy is set properly
Throws
SecurityException If caller does not have required permissions.
Usage
An administrator can use this API to set a policy which either enables/disables moving files to inside the container.

 EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
 try {
     KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID);
     RCPPolicy rcpPolicy = kcm.getRCPPolicy();
     ArrayList packages = rcpPolicy.allowMoveFilesToContainer(true);
 } catch (SecurityException e) {
     Log.e(TAG, "SecurityException: " + e);
 }
 

Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CONTAINER" permission which has a protection level of signature.

Since
API level 11
KNOX 2.0

public boolean allowMoveFilesToOwner (boolean allow)

Since: API level 11

Deprecated in API level 35

API to set policy value for moving files to outside of the container.

Parameters
allow A boolean value which either enables or disables file moving to outside of the container.
Returns
  • true If the policy is set properly
Throws
SecurityException If caller does not have required permissions.
Usage
An administrator can use this API to set a policy which either enables/disables moving files to outside of the container.

 EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
 try {
     KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID);
     RCPPolicy rcpPolicy = kcm.getRCPPolicy();
     ArrayList packages = rcpPolicy.allowMoveFilesToOwner(true);
 } catch (SecurityException e) {
     Log.e(TAG, "SecurityException: " + e);
 }
 

Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CONTAINER" permission which has a protection level of signature.

Since
API level 11
KNOX 2.0

public boolean allowShareClipboardDataToOwner (boolean allow)

Since: API level 19

Deprecated in API level 33

API to set policy value for sharing clipboard to owner from container.

Returns
  • true if successful else false.
Throws
SecurityException If caller does not have required permissions.
Usage
An administrator can use this API to set the policy value of sharing clipboard to owner from container.

NOTE: This API is impacted by changes made to the Workspace container in Knox 3.0. For more information, please see New container architecture overview.

 EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
 try {
     KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID);
     RCPPolicy rcpPolicy = kcm.getRCPSyncPolicy();
     boolean retVal = rcpPolicy.allowShareClipboardDataToOwner(allow);
 } catch (SecurityException e) {
     Log.e(TAG, "SecurityException: " + e);
 } catch (NoSuchFieldException e) {
     Log.e(TAG, "UnsupportedOperationException: " + e);
 }
 

Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CONTAINER_RCP" permission which has a protection level of signatureOrSystem.

Since
API level 19
KNOX 2.6

public boolean getAllowChangeDataSyncPolicy (String appName, String syncProperty)

Since: API level 11

Deprecated in API level 35
NOTE: This API is not available since Android 12.

API to get values set for a particular application's sync property.

Parameters
appName Name of the parameter. Possible values can be any of below or a custom string.

syncProperty The corresponding value for the property, returns true if allowed.
Returns
  • true if user is allowed to change the sync property.
Usage
An administrator can use this API to get value that has been set for a particular application's sync property

 EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
 try {
     KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID);
     RCPPolicy rcpPolicy = kcm.getRCPPolicy();
     String applications = rcpPolicy.geDataSyncPolicy(RCPPolicy.CONTACTS, RCPPolicy.EXPORT_DATA);
 }
 

Since
API level 11
KNOX 2.0

public List<String> getListFromAllowChangeDataSyncPolicy (String syncProperty, boolean value)

Since: API level 11

Deprecated in API level 35
NOTE: This API is not available since Android 12.

API to get list of applications from allow change data sync policy based on property and its value.

Parameters
syncProperty Name of the property. Possible values can be any of below or a custom string.
value The corresponding value for the sync property.
Returns
  • List of applications which are associated with the specified property and value. The list of applications can contain one of the following values.
Throws
SecurityException If caller does not have required permissions.
Usage
An administrator can use this API to get the list of applications which satisfies the given criteria.

 EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
 try {
     KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID);
     RCPPolicy rcpPolicy = kcm.getRCPPolicy();
     ArrayList applications = rcpPolicy.getListFromAllowChangeDataSyncPolicy(RCPPolicy.EXPORT_DATA, true);
 } catch (SecurityException e) {
     Log.e(TAG, "SecurityException: " + e);
 }
 

Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CONTAINER_RCP" permission which has a protection level of signature.

Since
API level 11
KNOX 2.0

public boolean isMoveAppsToContainerAllowed ()

Since: API level 11

Deprecated in API level 30
NOTE: This API is not available since Android 9.

API to get policy value for moving applications to inside the container.

An administrator can use this API to find the policy value of moving applications into the container.

Returns
  • true if moving apps to container allowed else false.
Since
API level 11
KNOX 2.0

public boolean isMoveFilesToContainerAllowed ()

Since: API level 11

Deprecated in API level 35

API to get policy value for moving files to inside the container.

Returns
  • true if moving files to container allowed else false.
Usage
An administrator can use this API to find the policy value of moving files into the container.

Since
API level 11
KNOX 2.0

public boolean isMoveFilesToOwnerAllowed ()

Since: API level 11

Deprecated in API level 35

API to get policy value for moving files to outside of the container.

An administrator can use this API to find the policy value of moving files to outside of the container.

Returns
  • true if moving files to owner allowed else false.
Since
API level 11
KNOX 2.0

public boolean isShareClipboardDataToOwnerAllowed ()

Since: API level 19

Deprecated in API level 33

API to get policy value for sharing clipboard to owner from container.

Returns
  • true if sharing clipboard data to owner allowed else false.
Usage
An administrator can use this API to find the policy value of sharing clipboard to owner from container.

NOTE: This API is impacted by changes made to the Workspace container in Knox 3.0. For more information, please see New container architecture overview.

 EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
 try {
     KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID);
     RCPPolicy rcpPolicy = kcm.getRCPSyncPolicy();
     boolean retVal = rcpPolicy.isShareClipboardDataToOwnerAllowed();
 } catch (SecurityException e) {
     Log.e(TAG, "SecurityException: " + e);
 } catch (NoSuchFieldException e) {
     Log.e(TAG, "UnsupportedOperationException: " + e);
 }
Since
API level 19
KNOX 2.6

public boolean setAllowChangeDataSyncPolicy (List<String> appNames, String syncProperty, boolean value)

Since: API level 11

Deprecated in API level 35
NOTE: This API is not available since Android 12.

API to set whether user can change Data Sync policies specific to applications.

Parameters
appNames A list of predefined applications or custom applications that provide container to user data sync. For a list of predefined applications please look at the below list.
syncProperty Name of the property. Possible values can be any of below or a custom string.
value The corresponding value for the sync property, true for allowing user to change sync policies, otherwise false.
Returns
  • true if the policy gets added successfully.
Throws
SecurityException If caller does not have required permissions.
Usage
This API should be used to allow/disallow User to change applications specific sync policies.

 EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context);
 try {
     KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID);
     RCPPolicy rcpPolicy = kcm.getRCPPolicy();
     boolean success = rcpPolicy.setAllowChangeDataSyncPolicy(RCPPolicy.CONTACTS, RCPPolicy.SANITIZE_DATA, true);
 } catch (SecurityException e) {
     Log.e(TAG, "SecurityException: " + e);
 }
 

NOTE: From KNOX 2.3, in case of MDFPP(Mobile Device Fundamentals Protection Profile) SDP enabled container, notification sanitization is always enabled only for Email app.

NOTE: From KNOX 3.0, DataSyncPolicy will be set to false when setAllowChangeDataSyncPolicy set to false.

NOTE: SANITIZE_DATA only available for notification sanitization

Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CONTAINER_RCP" permission which has a protection level of signature.

Since
API level 11
KNOX 2.0