Since: API level 1
public class

EnterpriseDeviceManager

extends Object
java.lang.Object
   ↳ com.samsung.android.knox.EnterpriseDeviceManager

Class Overview

Public interface for managing policies enforced on a device. Most clients of this class must have published a DeviceAdminReceiver that the user has currently enabled.

Since
API level 1
MDM 1.0

Summary

Nested Classes
class EnterpriseDeviceManager.KNOX_VERSION_CODES Enumeration of the currently known SDK version codes. 
Constants
String ACTION_USER_STATE_CHANGED Broadcast Action: Sent to inform the owner of DO/PO/Legacy Container about user state change.
String EXTRA_USER_ID Used as int extra field with ACTION_USER_STATE_CHANGED.
String EXTRA_USER_STATE Used as int extra field with ACTION_USER_STATE_CHANGED.
int USER_ACTIVE This status is returned by getUserStatus(int) API when user is active.
int USER_CREATION_IN_PROGRESS This status is returned by getUserStatus(int) API when user creation is in progress.
int USER_DOESNT_EXIST This status is returned by getUserStatus(int) API when user doesn't exist.
int USER_LOCKED This status is returned by getUserStatus(int) API when user is locked.
Public Methods
static int getAPILevel()
API to retrieve the Knox SDK version supported on the device.
APMPolicy getAPMPolicy()
Get the object to access 'App Permission Monitor' Policy.
boolean getAdminRemovable()
Deprecated in API level 35
boolean getAdminRemovable(String packageName)
Deprecated in API level 35
ApnSettingsPolicy getApnSettingsPolicy()
API that gets the object that accesses the APN Settings Policy.
ApplicationPolicy getApplicationPolicy()
API to get the object that accesses the Application policy.
BasePasswordPolicy getBasePasswordPolicy()
Deprecated in API level 35
BluetoothPolicy getBluetoothPolicy()
API that gets the object that accesses the Bluetooth Policy.
BluetoothSecureModePolicy getBluetoothSecureModePolicy()
API that gets the object that accesses the Bluetooth Secure Mode Policy.
BootBanner getBootBanner()
API to get the object that accesses the BootBanner APIs.
BrowserPolicy getBrowserPolicy()
API that gets the object that accesses the Browser Policy.
CertificateProvisioning getCertificateProvisioning()
API that gets the object that accesses the Certificate Provisioning.
DateTimePolicy getDateTimePolicy()
API that gets the object that accesses the Date Time Policy.
DeviceAccountPolicy getDeviceAccountPolicy()
API that gets the object that accesses the Device Account Policy.
DeviceInventory getDeviceInventory()
API that gets the object that accesses the Device Inventory.
DeviceSecurityPolicy getDeviceSecurityPolicy()
API that gets the object that accesses the Device Security Policy.
DexManager getDexManager()
API that gets the object that accesses the Dex Manager.
DualDARPolicy getDualDARPolicy()
API that gets the object that accesses the Dual DAR Policy.
EmailAccountPolicy getEmailAccountPolicy()
API that gets the object that accesses the Email Account Policy.
EmailPolicy getEmailPolicy()
API that gets the object that accesses the Email Policy.
ExchangeAccountPolicy getExchangeAccountPolicy()
API that gets the object that accesses the Microsoft Exchange Account policy
Firewall getFirewall()
API that gets the object that accesses the Firewall.
Font getFont()
API to get the object that accesses the Font APIs.
Geofencing getGeofencing()
API to get the object that accesses the Geofencing module.
GlobalProxy getGlobalProxy()
Deprecated in API level 35
static EnterpriseDeviceManager getInstance(Context context)
API to create an instance of EnterpriseDeviceManager class.
KPCCManager getKPCCManager()
API to get the object that accesses the KPCC Manager.
KioskMode getKioskMode()
API to get the object that accesses the KioskMode module.
LDAPAccountPolicy getLDAPAccountPolicy()
API that gets the object that accesses the LDAP Account Policy.
LocationPolicy getLocationPolicy()
API that gets the object that accesses the Location Policy.
LockscreenOverlay getLockscreenOverlay()
API to get the object that accesses the Lockscreen Overlay.
MultiUserManager getMultiUserManager()
API to get the object that accesses the MultiUserManager.
NfcPolicy getNfcPolicy()
API that gets the object that accesses the Nfc Policy.
static EnterpriseDeviceManager getParentInstance(Context context)
API to create an parent instance of EnterpriseDeviceManager class.
PasswordPolicy getPasswordPolicy()
API that gets the object that accesses the Password Policy.
PhoneRestrictionPolicy getPhoneRestrictionPolicy()
API that gets the object that accesses the Phone Restriction Policy.
PhoneRestrictionPolicy getPhoneRestrictionPolicy(String iccId)
API that gets the object that accesses the Phone Restriction policy for the SIM Card with the given iccId

ProfilePolicy getProfilePolicy()
API to get the object that accesses the ProfilePolicy

RemoteInjection getRemoteInjection()
API to get the object that accesses the RemoteInjection module.
RestrictionPolicy getRestrictionPolicy()
API that gets the object that accesses the Restriction Policy.
RoamingPolicy getRoamingPolicy()
API that gets the object that accesses the Roaming policy.
SPDControlPolicy getSPDControlPolicy()
API that gets the object that accesses the SPD Control Policy.
static int getUserId(UserHandle handle)
API to get the user id in integer for given UserHandle.
int getUserStatus(int userId)
API to get the user status.
VpnPolicy getVpnPolicy()
API that gets the object that accesses the VPN Policy.
WifiPolicy getWifiPolicy()
API that gets the object that accesses the WiFi Policy.
boolean isAdminActive(ComponentName who)
Return true if the given administrator component is currently active (enabled) in the system, else false.
boolean setAdminRemovable(boolean removable, String packageName)
Deprecated in API level 35
boolean setAdminRemovable(boolean removable)
Deprecated in API level 35
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String ACTION_USER_STATE_CHANGED

Since: API level 24

Broadcast Action: Sent to inform the owner of DO/PO/Legacy Container about user state change. This targeted broadcast is sent only to owner of DO/PO/Legacy Container. The intent will have the following extra value:

EXTRA_USER_ID:
"0", "10" etc.

EXTRA_USER_STATE:
USER_ACTIVE
USER_LOCKED
USER_CREATION_IN_PROGRESS

Since
API level 24
KNOX 3.0
Constant Value: "com.samsung.android.knox.intent.action.USER_STATE_CHANGED"

public static final String EXTRA_USER_ID

Since: API level 24

Used as int extra field with ACTION_USER_STATE_CHANGED. Contains the user id information.

Since
API level 24
KNOX 3.0
Constant Value: "com.samsung.android.knox.intent.extra.USER_ID"

public static final String EXTRA_USER_STATE

Since: API level 24

Used as int extra field with ACTION_USER_STATE_CHANGED. Contains the user current state information.

Since
API level 24
KNOX 3.0
Constant Value: "com.samsung.android.knox.intent.extra.USER_STATE"

public static final int USER_ACTIVE

Since: API level 24

This status is returned by getUserStatus(int) API when user is active.

Since
API level 24
KNOX 3.0
Constant Value: 91 (0x0000005b)

public static final int USER_CREATION_IN_PROGRESS

Since: API level 24

This status is returned by getUserStatus(int) API when user creation is in progress.

Since
API level 24
KNOX 3.0
Constant Value: 93 (0x0000005d)

public static final int USER_DOESNT_EXIST

Since: API level 24

This status is returned by getUserStatus(int) API when user doesn't exist.

Since
API level 24
KNOX 3.0
Constant Value: -1 (0xffffffff)

public static final int USER_LOCKED

Since: API level 24

This status is returned by getUserStatus(int) API when user is locked.

Since
API level 24
KNOX 3.0
Constant Value: 95 (0x0000005f)

Public Methods

public static int getAPILevel ()

Since: API level 24

API to retrieve the Knox SDK version supported on the device. See EnterpriseDeviceManager.KNOX_VERSION_CODES for possible values.

Returns
  • an int corresponding to the Knox version, KNOX_NOT_SUPPORTED if Knox is not supported on the device
Since
API level 24
KNOX 3.0

public APMPolicy getAPMPolicy ()

Since: API level 25

Get the object to access 'App Permission Monitor' Policy.

Returns
  • 'App Permission Monitor' policy object
Usage
Administrator can get the object to access the 'App Permission Monitor' Policy.

Since
API level 25
KNOX 3.1

public boolean getAdminRemovable ()

Since: API level 2

Deprecated in API level 35

API to get the removable status of the calling administrator.

Returns
  • true if the administrator can be removed, false if the administrator cannot be removed.
Usage
An administrator can determine its removable status to check whether a user can remove that administrator from the Settings application. If false, the user cannot remove the administrator.

Since
API level 2
MDM 2.0
Multiuser Environment
User Scope

public boolean getAdminRemovable (String packageName)

Since: API level 6

Deprecated in API level 35

API to get the administrator removable status of another administrator application.

Parameters
packageName Name of the administrator whose removable status is queried
Returns
  • true if the administrator can be removed, false if the administrator cannot be removed
Usage
An administrator can use this API to get the removable status of another administrator application. If false, an administrator cannot remove the administrator being checked.

Since
API level 6
MDM 4.0
Multiuser Environment
User Scope

public ApnSettingsPolicy getApnSettingsPolicy ()

Since: API level 2

API that gets the object that accesses the APN Settings Policy.

Returns
  • The APN Settings Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the APN Settings Policy.

Since
API level 2
MDM 2.0

public ApplicationPolicy getApplicationPolicy ()

Since: API level 1

API to get the object that accesses the Application policy.

Returns
  • The Application policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Application policy.

Since
API level 1
MDM 1.0

public BasePasswordPolicy getBasePasswordPolicy ()

Since: API level 27

Deprecated in API level 35

Get the object to access the Base Password Policy

Returns
  • BasePasswordPolicy object
Since
API level 27
KNOX 3.2.1

public BluetoothPolicy getBluetoothPolicy ()

Since: API level 2

API that gets the object that accesses the Bluetooth Policy.

Returns
  • The Bluetooth Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Bluetooth Policy.

Since
API level 2
MDM 2.0

public BluetoothSecureModePolicy getBluetoothSecureModePolicy ()

Since: API level 6

API that gets the object that accesses the Bluetooth Secure Mode Policy.

Returns
  • The Bluetooth Secure Mode Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Bluetooth Secure Mode Policy.

Since
API level 6
MDM 4.0

public BootBanner getBootBanner ()

Since: API level 6

API to get the object that accesses the BootBanner APIs.

Returns
  • The BootBanner object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the BootBanner APIs.

Since
API level 6
MDM 4.0

public BrowserPolicy getBrowserPolicy ()

Since: API level 2

API that gets the object that accesses the Browser Policy.

Returns
  • The Browser Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Browser Policy.

Since
API level 2
MDM 2.0

public CertificateProvisioning getCertificateProvisioning ()

Since: API level 2

API that gets the object that accesses the Certificate Provisioning.

Returns
  • The Certificate Provisioning object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Certificate Provisioning.

Since
API level 2
MDM 2.0

public DateTimePolicy getDateTimePolicy ()

Since: API level 2

API that gets the object that accesses the Date Time Policy.

Returns
  • The Date Time Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Date Time Policy.

Since
API level 2
MDM 2.0

public DeviceAccountPolicy getDeviceAccountPolicy ()

Since: API level 6

API that gets the object that accesses the Device Account Policy.

Returns
  • The Device Account Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Device Account Policy.

Since
API level 6
MDM 4.0

public DeviceInventory getDeviceInventory ()

Since: API level 2

API that gets the object that accesses the Device Inventory.

Returns
  • The Device Inventory object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Device Inventory.

Since
API level 2
MDM 2.0

public DeviceSecurityPolicy getDeviceSecurityPolicy ()

Since: API level 2

API that gets the object that accesses the Device Security Policy.

Returns
  • The Device Security Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Device Security Policy.

Since
API level 2
MDM 2.0

public DexManager getDexManager ()

Since: API level 25

API that gets the object that accesses the Dex Manager.

Returns
  • The Dex Manager object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Dex Manager.

Since
API level 25
KNOX 3.1

public DualDARPolicy getDualDARPolicy ()

Since: API level 35

API that gets the object that accesses the Dual DAR Policy.

Returns
  • The Dual DAR Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the DualDAR Policy.

Since
API level 35
KNOX 3.8

public EmailAccountPolicy getEmailAccountPolicy ()

Since: API level 2

API that gets the object that accesses the Email Account Policy.

Returns
  • The Email Account Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Email Account Policy.

Since
API level 2
MDM 2.0

public EmailPolicy getEmailPolicy ()

Since: API level 5

API that gets the object that accesses the Email Policy.

Returns
  • The Email Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Email Policy.

Since
API level 5
MDM 3.0

public ExchangeAccountPolicy getExchangeAccountPolicy ()

Since: API level 1

API that gets the object that accesses the Microsoft Exchange Account policy

Returns
  • The Microsoft Exchange Account policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Microsoft Exchange Account policy.

Since
API level 1
MDM 1.0

public Firewall getFirewall ()

Since: API level 17

API that gets the object that accesses the Firewall.

Returns
  • The Firewall object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Firewall.

Since
API level 17
MDM 5.5

public Font getFont ()

Since: API level 1

API to get the object that accesses the Font APIs.

Returns
  • The Font object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Font APIs.

Since
API level 1
MDM 1.0

public Geofencing getGeofencing ()

Since: API level 6

API to get the object that accesses the Geofencing module.

Returns
  • The Geofencing object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Geofencing module.

Since
API level 6
MDM 4.0

public GlobalProxy getGlobalProxy ()

Since: API level 17

Deprecated in API level 35

API that gets the object that accesses the Global Proxy.

Returns
  • The Global Proxy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Global Proxy.

Since
API level 17
MDM 5.5

public static EnterpriseDeviceManager getInstance (Context context)

Since: API level 24

API to create an instance of EnterpriseDeviceManager class.

Parameters
context context of the application or service using this class
Returns
  • Returns the EnterpriseDeviceManager object, else null
Usage
Used to get access to EnterpriseDeviceManager object

 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
        
Since
API level 24

public KPCCManager getKPCCManager ()

Since: API level 29

API to get the object that accesses the KPCC Manager.

Returns
  • The KPCC Manager object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the KPCC Manager.

Since
API level 29
KNOX 3.4

public KioskMode getKioskMode ()

Since: API level 5

API to get the object that accesses the KioskMode module.

Returns
  • The KioskMode object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the KioskMode module.

Since
API level 5
MDM 3.0

public LDAPAccountPolicy getLDAPAccountPolicy ()

Since: API level 6

API that gets the object that accesses the LDAP Account Policy.

Returns
  • The LDAP Account Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the LDAP Account Policy.

Since
API level 6
MDM 4.0

public LocationPolicy getLocationPolicy ()

Since: API level 2

API that gets the object that accesses the Location Policy.

Returns
  • The Location Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Location Policy.

Since
API level 2
MDM 2.0

public LockscreenOverlay getLockscreenOverlay ()

Since: API level 6

API to get the object that accesses the Lockscreen Overlay.

Returns
  • The LockscreenOverlay object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Lockscreen Overlay.

Since
API level 6
MDM 4.0

public MultiUserManager getMultiUserManager ()

Since: API level 6

API to get the object that accesses the MultiUserManager.

Returns
  • The MultiUserManager object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the MultiUserManager.

Since
API level 6
MDM 4.0

public NfcPolicy getNfcPolicy ()

Since: API level 24

API that gets the object that accesses the Nfc Policy.

Returns
  • The Nfc policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Nfc policy.

Since
API level 24

public static EnterpriseDeviceManager getParentInstance (Context context)

Since: API level 33

API to create an parent instance of EnterpriseDeviceManager class.

Parameters
context context of the application or service using this class
Returns
  • Returns the parent EnterpriseDeviceManager object, else null
Usage
Used to get access to parent EnterpriseDeviceManager object

 EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
        
Since
API level 33
KNOX 3.7

public PasswordPolicy getPasswordPolicy ()

Since: API level 2

API that gets the object that accesses the Password Policy.

Returns
  • The Password Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Password Policy.

Since
API level 2
MDM 2.0

public PhoneRestrictionPolicy getPhoneRestrictionPolicy ()

Since: API level 2

API that gets the object that accesses the Phone Restriction Policy.

Returns
  • The Phone Restriction Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Phone Restriction Policy.

Since
API level 2
MDM 2.0

public PhoneRestrictionPolicy getPhoneRestrictionPolicy (String iccId)

Since: API level 22

API that gets the object that accesses the Phone Restriction policy for the SIM Card with the given iccId

Returns
Usage
An administrator can use this API to get the object that accesses the Phone Restriction policy.

Since
API level 22
MDM 5.8
Multiuser Environment
Global Scope

public ProfilePolicy getProfilePolicy ()

Since: API level 35

API to get the object that accesses the ProfilePolicy

Returns
  • The ProfilePolicy instance if successful, else null.
Usage
profile owner or device owner can use this API to get the object that accesses the ProfilePolicy

Since
API level 35
MDM 3.8

public RemoteInjection getRemoteInjection ()

Since: API level 3

API to get the object that accesses the RemoteInjection module.

Returns
  • The RemoteInjection object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the RemoteInjection module.

Since
API level 3
MDM 2.1

public RestrictionPolicy getRestrictionPolicy ()

Since: API level 2

API that gets the object that accesses the Restriction Policy.

Returns
  • The Restriction Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Restriction Policy.

Since
API level 2
MDM 2.0

public RoamingPolicy getRoamingPolicy ()

Since: API level 1

API that gets the object that accesses the Roaming policy.

Returns
  • The Roaming policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the Roaming policy.

Since
API level 1
MDM 1.0

public SPDControlPolicy getSPDControlPolicy ()

Since: API level 19

API that gets the object that accesses the SPD Control Policy.

Returns
  • The SPD Control Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the SPD Control Policy.

Since
API level 19
MDM 5.6

public static int getUserId (UserHandle handle)

Since: API level 26

API to get the user id in integer for given UserHandle.

Returns
  • an int corresponding to UserHandle.
Since
API level 26
KNOX 3.2
Multiuser Environment
User Scope

public int getUserStatus (int userId)

Since: API level 24

API to get the user status. USER_LOCKED, USER_ACTIVE, USER_DOESNT_EXIST and USER_CREATION_IN_PROGRESS are the possible values.

Returns
  • an int corresponding to User status.
Since
API level 24
KNOX 3.0
Multiuser Environment
User Scope

public VpnPolicy getVpnPolicy ()

Since: API level 2

API that gets the object that accesses the VPN Policy.

Returns
  • The VPN Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the VPN Policy.

Since
API level 2
MDM 2.0

public WifiPolicy getWifiPolicy ()

Since: API level 2

API that gets the object that accesses the WiFi Policy.

Returns
  • The WiFi Policy object if successful, else null.
Usage
An administrator can use this API to get the object that accesses the WiFi Policy.

Since
API level 2
MDM 2.0

public boolean isAdminActive (ComponentName who)

Since: API level 2

Return true if the given administrator component is currently active (enabled) in the system, else false.

Returns
  • true if the given administrator component is currently active (enabled) in the system, else false.
Since
API level 2
MDM 2.0
Multiuser Environment
Global Scope

public boolean setAdminRemovable (boolean removable, String packageName)

Since: API level 6

Deprecated in API level 35

API to set the removable status of another administrator application.

Parameters
removable true enables administrator removal, false disables administrator removal
packageName Name of administrator whose removable status is set
Returns
  • true on success, false on failure
Usage
An administrator can set the removable status of another administrator application. If set to true, the user can remove the administrator through the Settings application. If set to false, the user cannot remove the administrator through the Settings application.

Note: Currently this API does not support rollback so it is administrator responsibility to revoke this policy before de-registering itself.

Permission
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_ENTERPRISE_DEVICE_ADMIN" permission which has a protection level of signature.
Since
API level 6
MDM 4.0
Multiuser Environment
User Scope

public boolean setAdminRemovable (boolean removable)

Since: API level 2

Deprecated in API level 35

API to set the administrator removable status.

Parameters
removable true enables administrator removal, false disables administrator removal
Returns
  • true on success, else false.
Throws
SecurityException If caller does not have required permissions
Usage
An administrator can set their removable status. If set to true, the user can remove the administrator through the Settings application. If set to false, the user cannot remove the administrator through the Settings application.

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

Since
API level 2
MDM 2.0
Multiuser Environment
User Scope