Since: API level 29
public class

KPCCManager

extends Object
java.lang.Object
   ↳ com.samsung.android.knox.kpcc.KPCCManager

Class Overview

This class provides APIs to control the behavior of Knox Platform for Critical Communication (KPCC). KPCC capabilities only work with pre-approved PS-LTE devices.

Since
API level 29
KNOX 3.4

Summary

Constants
int DRX_1280_MSEC 1280ms DRX interval.
int DRX_2560_MSEC 2560ms DRX interval.
int DRX_320_MSEC 320ms DRX interval.
int DRX_640_MSEC 640ms DRX interval.
int DRX_DEFAULT Default DRX interval.
int ERROR_ADMIN_ALREADY_SET Indicates that another admin has already set the policy.
int ERROR_FAIL Indicates that the operation failed.
int ERROR_INVALID_VALUE Indicates that one of the values for the operation is invalid.
int ERROR_NOT_SUPPORTED Indicates that this operation is not supported on this device.
int KEYCODE_EMERGENCY Key code for EMERGENCY button, used in setHardKeyIntentState(int, int, int, int).
int KEYCODE_PTT Key code for PTT button, used in setHardKeyIntentState(int, int, int, int).
int OFF The feature is off.
int ON The feature is on.
int SUCCESS Indicates that the operation was successful.
Public Methods
int allowRestrictedNetworkCapability(int state, String packageName, int networkType)
This method allows a package to use restricted network capabilities.
int getDrxValue()
This method gets DRX value which was set by admin via setDrxValue(int).
int getTelephonyDrxValue()
This method gets the DRX value in the Telephony (RIL).
List<Integer> getUnrestrictedNetworkCapabilities(String packageName)
This method returns a list of restricted network capabilities that were allowed via allowRestrictedNetworkCapability, to a given package.
int setDrxValue(int drxValue)
This method sets the DRX interval in the RIL.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int DRX_1280_MSEC

Since: API level 29

1280ms DRX interval.

Since
API level 29
KNOX 3.4
Constant Value: 3 (0x00000003)

public static final int DRX_2560_MSEC

Since: API level 29

2560ms DRX interval.

Since
API level 29
KNOX 3.4
Constant Value: 4 (0x00000004)

public static final int DRX_320_MSEC

Since: API level 29

320ms DRX interval.

Since
API level 29
KNOX 3.4
Constant Value: 1 (0x00000001)

public static final int DRX_640_MSEC

Since: API level 29

640ms DRX interval.

Since
API level 29
KNOX 3.4
Constant Value: 2 (0x00000002)

public static final int DRX_DEFAULT

Since: API level 29

Default DRX interval.

Since
API level 29
KNOX 3.4
Constant Value: 0 (0x00000000)

public static final int ERROR_ADMIN_ALREADY_SET

Since: API level 29

Indicates that another admin has already set the policy.

Since
API level 29
KNOX 3.4
Constant Value: -3 (0xfffffffd)

public static final int ERROR_FAIL

Since: API level 29

Indicates that the operation failed.

Since
API level 29
KNOX 3.4
Constant Value: -1 (0xffffffff)

public static final int ERROR_INVALID_VALUE

Since: API level 29

Indicates that one of the values for the operation is invalid.

Since
API level 29
KNOX 3.4
Constant Value: -4 (0xfffffffc)

public static final int ERROR_NOT_SUPPORTED

Since: API level 29

Indicates that this operation is not supported on this device.

Since
API level 29
KNOX 3.4
Constant Value: -2 (0xfffffffe)

public static final int KEYCODE_EMERGENCY

Since: API level 29

Key code for EMERGENCY button, used in setHardKeyIntentState(int, int, int, int).

Since
API level 29
KNOX 3.4
Constant Value: 1079 (0x00000437)

public static final int KEYCODE_PTT

Since: API level 29

Key code for PTT button, used in setHardKeyIntentState(int, int, int, int).

Since
API level 29
KNOX 3.4
Constant Value: 1015 (0x000003f7)

public static final int OFF

Since: API level 29

The feature is off.

Since
API level 29
KNOX 3.4
Constant Value: 0 (0x00000000)

public static final int ON

Since: API level 29

The feature is on.

Since
API level 29
KNOX 3.4
Constant Value: 1 (0x00000001)

public static final int SUCCESS

Since: API level 29

Indicates that the operation was successful.

Since
API level 29
KNOX 3.4
Constant Value: 0 (0x00000000)

Public Methods

public int allowRestrictedNetworkCapability (int state, String packageName, int networkType)

Since: API level 29

This method allows a package to use restricted network capabilities.

Parameters
state ON to allow access, OFF to prevent access.
packageName The package name that will be allowed to access the restricted network
networkType The restricted network capability being requested. Currently, only NetworkCapabilities.NET_CAPABILITY_CBS is allowed
Returns
Throws
SecurityException The calling application does not have the required permission.
Usage
 try {
     EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
     KPCCManager kpcc = edm.getKPCCManager();
     kpcc.allowRestrictedNetworkCapability(KPCCManager.ON, "com.example.application", NetworkCapabilities.NET_CAPABILITY_CBS);
 } catch(SecurityException e) {
     Log.w(TAG, "SecurityException:" + e);
 }
 
Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CRITICAL_COMMUNICATIONS" permission.
Since
API level 29
KNOX 3.4

public int getDrxValue ()

Since: API level 29

This method gets DRX value which was set by admin via setDrxValue(int).

Returns
Usage
     EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
     KPCCManager kpcc = edm.getKPCCManager();
     if(kpcc.getDrxValue() == KPCCManager.DRX_DEFAULT) {
      Log.d(TAG, "Default DRX value is being used");
     }
 
Since
API level 29
KNOX 3.4

public int getTelephonyDrxValue ()

Since: API level 29

This method gets the DRX value in the Telephony (RIL).
This value may or may not be the same of getDrxValue(), as Telephony can change it depending on network parameters.

Returns
Usage
     EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
     KPCCManager kpcc = edm.getKPCCManager();
 Log.d(TAG, "Current DRX value is " + kpcc.getTelephonyDrxValue());
 
Since
API level 29
KNOX 3.4

public List<Integer> getUnrestrictedNetworkCapabilities (String packageName)

Since: API level 29

This method returns a list of restricted network capabilities that were allowed via allowRestrictedNetworkCapability, to a given package.

Parameters
packageName The name of the package to fetch restricted network capabilities that were previously allowed.
Returns
  • List of allowed network capabilities to a given package.
    null if some error occurs
Throws
SecurityException The calling application does not have the required permission.
Usage
 try {
     EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
     KPCCManager kpcc = edm.getKPCCManager();
     List list = kpcc.getUnrestrictedNetworkCapabilities("com.example.application");
     if( list.contains(NetworkCapabilities.NET_CAPABILITY_CBS)) {
         Log.d(TAG, "The package has unrestricted access to CBS");
     }
 } catch(SecurityException e) {
     Log.w(TAG, "SecurityException:" + e);
 }
 
Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CRITICAL_COMMUNICATIONS" permission.
Since
API level 29
KNOX 3.4

public int setDrxValue (int drxValue)

Since: API level 29

This method sets the DRX interval in the RIL. This changes the DRX cycle so that the device can be more or less responsive when PTT calls are active.

Parameters
drxValue The interval for the DRX cycle:
DRX_DEFAULT Default RIL interval.
DRX_320_MSEC 320ms interval.
DRX_640_MSEC 640ms interval.
DRX_1280_MSEC 1280ms interval.
DRX_2560_MSEC 2560ms interval.
Returns
Throws
SecurityException The calling application does not have the required permission.
Usage
 try {
     EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
     KPCCManager kpcc = edm.getKPCCManager();
     kpcc.setDrxValue(KPCCManager.DRX_320_MSEC);
 } catch(SecurityException e) {
     Log.w(TAG, "SecurityException:" + e);
 }
 
Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_CRITICAL_COMMUNICATIONS" permission.
Since
API level 29
KNOX 3.4