Since: API level
public class

UCMPolicy

extends Object
java.lang.Object
   ↳ com.samsung.android.knox.ucm.policy.UCMPolicy

Class Overview

This class supports MDM(EMM) to create a workspace(container) protected with UCM DAR.

Usage
Following code snippet represents how an MDM Agent shall create a UCM DAR container
     // Create Android For Work manage provisioning intent
     Intent intent = new Intent(DevicePolicyManager.ACTION_PROVISION_MANAGED_PROFILE);
     intent.putExtra(DevicePolicyManager.EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME, EDMAppAdmin.getComponentName(mContext));

     // Create UCM DAR configuration bundle
     PersistableBundle ucmConfig = new PersistableBundle();
     ucmConfig.putBoolean(UCMPolicy.KEY_UCM_CONFIG, true);
     ucmConfig.putString(UCMPolicy.UCM_KEY_CONFIG_CLIENT_PACKAGE, "<plugin_package_name>");
     ucmConfig.putString(UCMPolicy.UCM_KEY_CONFIG_CLIENT_LOCATION, "<plugin_download_location>");
     ucmConfig.putString(UCMPolicy.UCM_KEY_CONFIG_CLIENT_SIGNATURE, "<plugin_signature>");
     intent.putExtra(android.app.admin.DevicePolicyManager.EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE, ucmConfig);

     // Start workspace provisioning
     startActivityForResult(intent, RESULT_PROVISION_MANAGED_PROFILE);
 
UCM_KEY_CONFIG_CLIENT_SIGNATURE is optional.
NOTE: This class is only applicable to UCM DAR enabled workspace.

Since
API level 38
KNOX 3.11

Summary

Constants
String KEY_UCM_CONFIG Used to mark workspace(container) for UCM DAR protection during creation time.
String UCM_KEY_CONFIG_CLIENT_LOCATION Used to set package name of UCM plugin during workspace(container) creation time.
String UCM_KEY_CONFIG_CLIENT_PACKAGE Used to set signature of UCM plugin during workspace(container) creation time.
String UCM_KEY_CONFIG_CLIENT_SIGNATURE Used to set location of UCM plugin during workspace(container) creation time.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String KEY_UCM_CONFIG

Since: API level

Used to mark workspace(container) for UCM DAR protection during creation time.

Usage
Used as a Boolean param field in admin extras bundle DevicePolicyManager#EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE with DevicePolicyManager#ACTION_PROVISION_MANAGED_PROFILE action. If the value is true, marks the container to be protected with UCM DAR during container creation time.
Note: To be used only during container creation time.
Since
API level 38
KNOX 3.11
Constant Value: "ucm-config"

public static final String UCM_KEY_CONFIG_CLIENT_LOCATION

Since: API level

Used to set package name of UCM plugin during workspace(container) creation time.

Usage
Used as a String param field in admin extras bundle DevicePolicyManager#EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE with DevicePolicyManager#ACTION_PROVISION_MANAGED_PROFILE action.
Note: To be used as bundle params key during container creation time.
Since
API level 38
KNOX 3.11
Constant Value: "ucm-config-client-location"

public static final String UCM_KEY_CONFIG_CLIENT_PACKAGE

Since: API level

Used to set signature of UCM plugin during workspace(container) creation time.

Usage
Used as a String param field in admin extras bundle passed as DevicePolicyManager#EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE with DevicePolicyManager#ACTION_PROVISION_MANAGED_PROFILE action.
Note: To be used as bundle params key during container creation time.
Since
API level 38
KNOX 3.11
Constant Value: "ucm-config-client-package"

public static final String UCM_KEY_CONFIG_CLIENT_SIGNATURE

Since: API level

Used to set location of UCM plugin during workspace(container) creation time.

Usage
Used as a String param field in admin extras bundle passed as DevicePolicyManager#EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE with DevicePolicyManager#PROVISIONING_MODE_MANAGED_PROFILE extra value.
Client location should be an external storage(sdcard area) and should be passed with "file://" prefix.
 // Create UCM DAR with configuration bundle
 PersistableBundle adminExtras =  new PersistableBundle();
 adminExtras.putBoolean(UCMPolicy.KEY_UCM_CONFIG, true);
 adminExtras.putString(UCMPolicy.UCM_KEY_CONFIG_CLIENT_PACKAGE, UCM_PLUGIN_PACKAGE_NAME);
 adminExtras.putString(UCMPolicy.UCM_KEY_CONFIG_CLIENT_SIGNATURE, UCM_PLUGIN_SIGNATURE);

 // Set the file path of the client exist location adding with "file://" prefix.
 String UCM_CLIENT_PACKAGE_DOWNLOAD_LOCATION = getExternalFilesDir(null) + "/ucm_plugin.apk";
 adminExtras.putString(UCMPolicy.KEY_CONFIG_CLIENT_LOCATION, "file://" + UCM_CLIENT_PACKAGE_DOWNLOAD_LOCATION);

 // Param field in admin extras bundle passed as DevicePolicyManager.EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE
 Intent intent = new Intent();
 intent.putExtra(DevicePolicyManager.EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE, adminExtras);

 
Note: To be used as bundle params key during container creation time.
Since
API level 38
KNOX 3.11
Constant Value: "ucm-config-client-signature"