Since: API level 11
public class

RCPPolicy

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

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 BOOKMARKS Predefined application supports data import/export.It is passed as the application parameter in the following APIs.
String CALENDAR Predefined application supports data import/export.It is passed as the application parameter in the following APIs.
String CALL_LOG Predefined application supports data import/export.It is passed as the application parameter in the following APIs.
String CLIPBOARD Predefined application supports data import/export.It is passed as the application parameter in the following APIs.
String CONTACTS Predefined application supports data import/export.It is passed as the application parameter in the following APIs.
String DEFAULT_APPS Refers to all applications other than predefined applications, which supports data import/export.Its passed as the application parameter in the following APIs.
String EXPORT_DATA This constant is a sync property used to export data out of the container.
String IMPORT_DATA This constant is a sync property used as a parameter while setting policies.
String NOTIFICATIONS Predefined application supports data import/export.It is passed as the application parameter in the following APIs.
String SANITIZE_DATA 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.
String SHORTCUTS Predefined application supports data import/export.Its passed as the application parameter in the following APIs.
String SMS Predefined application supports data import/export.It is passed as the application parameter in the following APIs.
Public Constructors
RCPPolicy()
Public Methods
boolean allowMoveAppsToContainer(boolean allow)
API to set policy value for moving applications to inside the container.
boolean allowMoveFilesToContainer(boolean allow)
API to set policy value for moving files to inside the container.
boolean allowMoveFilesToOwner(boolean allow)
API to set policy value for moving files to outside of the container.
boolean allowShareClipboardDataToOwner(boolean allow)
API to set policy value for sharing clipboard to owner from container.
boolean getAllowChangeDataSyncPolicy(String appName, String syncProperty)
API to get values set for a particular application's sync property.
List<String> getListFromAllowChangeDataSyncPolicy(String syncProperty, boolean value)
API to get list of applications from allow change data sync policy based on property and its value.
boolean isMoveAppsToContainerAllowed()
API to get policy value for moving applications to inside the container.
boolean isMoveFilesToContainerAllowed()
API to get policy value for moving files to inside the container.
boolean isMoveFilesToOwnerAllowed()
API to get policy value for moving files to outside of the container.
boolean isShareClipboardDataToOwnerAllowed()
API to get policy value for sharing clipboard to owner from container.
boolean setAllowChangeDataSyncPolicy(List<String> appNames, String syncProperty, boolean value)
API to set whether user can change Data Sync policies specific to applications.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String BOOKMARKS

Since: API level 11

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: "Bookmarks"

public static final String CALENDAR

Since: API level 11

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 CALL_LOG

Since: API level 11

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: "CallLog"

public static final String CLIPBOARD

Since: API level 11

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: "Clipboard"

public static final String CONTACTS

Since: API level 11

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 DEFAULT_APPS

Since: API level 11

Refers to all applications other than predefined applications, which supports data import/export.Its passed as the application parameter in the following APIs.

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

public static final String EXPORT_DATA

Since: API level 11

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

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

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

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 static final String SHORTCUTS

Since: API level 11

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

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

public static final String SMS

Since: API level 11

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: "Sms"

Public Constructors

public RCPPolicy ()

Since: API level 11

Public Methods

public boolean allowMoveAppsToContainer (boolean allow)

Since: API level 11

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

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

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

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

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

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
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

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

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

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

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

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