Since: API level 19
public class

SPDControlPolicy

extends Object
java.lang.Object
   ↳ com.samsung.android.knox.restriction.SPDControlPolicy

Deprecated in API level 27

Class Overview

This class provides APIs to control Security policy updates on device.

Since
API level 19
MDM 5.6

Summary

Constants
int SPD_ENFORCE_NONE Security policy automatic updates option is ON/OFF(default) and UI is enabled
int SPD_ENFORCE_OFF Security policy automatic updates option is OFF and UI is disabled
int SPD_ENFORCE_ON Security policy automatic updates option is ON and UI is disabled
int SPD_FAILED Denoting that there was an error retrieving the automatic SPD update mode
int SPD_OFF Security policy automatic updates option is OFF and UI is enabled
int SPD_ON Security policy automatic updates option is OFF and UI is disabled.
Public Constructors
SPDControlPolicy()
Public Methods
int getAutoSecurityPolicyUpdateMode()
API to get Security policy automatic updates mode.
boolean setAutoSecurityPolicyUpdateMode(int mode)
API to set Security policy automatic updates mode.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int SPD_ENFORCE_NONE

Since: API level 19

Security policy automatic updates option is ON/OFF(default) and UI is enabled

Since
API level 19
MDM 5.6
Constant Value: 0 (0x00000000)

public static final int SPD_ENFORCE_OFF

Since: API level 19

Security policy automatic updates option is OFF and UI is disabled

Since
API level 19
MDM 5.6
Constant Value: 2 (0x00000002)

public static final int SPD_ENFORCE_ON

Since: API level 19

Security policy automatic updates option is ON and UI is disabled

Since
API level 19
MDM 5.6
Constant Value: 1 (0x00000001)

public static final int SPD_FAILED

Since: API level 19

Denoting that there was an error retrieving the automatic SPD update mode

Since
API level 19
MDM 5.6
Constant Value: -1 (0xffffffff)

public static final int SPD_OFF

Since: API level 19

Security policy automatic updates option is OFF and UI is enabled

Since
API level 19
MDM 5.6
Constant Value: 4 (0x00000004)

public static final int SPD_ON

Since: API level 19

Security policy automatic updates option is OFF and UI is disabled. In addition, Check for updates option UI is disabled.

Since
API level 19
MDM 5.6
Constant Value: 3 (0x00000003)

Public Constructors

public SPDControlPolicy ()

Since: API level 19

Public Methods

public int getAutoSecurityPolicyUpdateMode ()

Since: API level 19

API to get Security policy automatic updates mode.

Usage

 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);

 SPDControlPolicy spdControlPolicy = edm.SPDControlPolicy();

 try {

     int mode = spdControlPolicy.getAutoSecurityPolicyUpdateMode();

 

 } catch (SecurityException e) {

     Log.e(TAG, "SecurityException:" + e);

 }

 
Since
API level 19
MDM 5.6
Multiuser Environment
Global Scope

public boolean setAutoSecurityPolicyUpdateMode (int mode)

Since: API level 19

API to set Security policy automatic updates mode.

Parameters
mode Security policy automatic updates mode
SPD_ENFORCE_NONE
SPD_ENFORCE_ON
SPD_ENFORCE_OFF
Returns
  • true on success otherwise false.
Throws
SecurityException If caller does not have required permissions
Usage

 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);

 SPDControlPolicy spdControlPolicy = edm.SPDControlPolicy();

 try {

     // Enable automatic policy update

     boolean result = spdControlPolicy.setAutoSecurityPolicyUpdateMode(SPD_ENFORCE_ON);

 } catch (SecurityException e) {

     Log.e(TAG, "SecurityException:" + e);

 }

 
Permission
The caller should have the "com.samsung.android.knox.permission.KNOX_SPDCONTROL" permission, which has a protection level of "signature"
Since
API level 19
MDM 5.6
Multiuser Environment
Global Scope