com.lenovo.android.app.admin
Class LenovoDevicePolicyManager

java.lang.Object
  extended by com.lenovo.android.app.admin.LenovoManagementBase
      extended by com.lenovo.android.app.admin.LenovoDevicePolicyManager

public final class LenovoDevicePolicyManager
extends com.lenovo.android.app.admin.LenovoManagementBase

The Class LenovoDevicePolicyManager.


Nested Class Summary
static class LenovoDevicePolicyManager.LenovoADServerInfo
          The Class LenovoADServerInfo.
static class LenovoDevicePolicyManager.LenovoDevicePolicyInfo
          The Class LenovoDevicePolicyInfo
static class LenovoDevicePolicyManager.LenovoEmailServerInfo
          The Class LenovoEmailServerInfo.
 
Field Summary
static java.lang.String LenovoManagementJarFile
           
 
Fields inherited from class com.lenovo.android.app.admin.LenovoManagementBase
Location
 
Constructor Summary
LenovoDevicePolicyManager(android.content.Context context)
          Constructor.
LenovoDevicePolicyManager(android.content.Context context, java.lang.String tempDir)
          Constructor.
 
Method Summary
 boolean applyProfile(android.content.ComponentName admin, byte[] is)
          Apply XML configuration profile.
 boolean applyProfileFromFile(android.content.ComponentName admin, java.lang.String xmlFile)
          Apply XML configuration profile.
 LenovoDevicePolicyManager.LenovoADServerInfo getADServerInfo()
          Gets the AD server info.
 LenovoDevicePolicyManager.LenovoDevicePolicyInfo getAppliedProfileInfo()
          Gets the "master profile" that is currently applied to the device
 LenovoDevicePolicyManager.LenovoDevicePolicyInfo getAppliedProfileInfo(java.util.UUID uuid)
          Gets the installed profile info for the given uuid
 LenovoDevicePolicyManager.LenovoEmailServerInfo getEmailServerInfo()
          Gets the Email server info.
 int getInstalledAPIVersion()
          Gets the API version supported by the service that is installed on this device.
 LenovoDevicePolicyManager.LenovoDevicePolicyInfo[] getInstalledProfiles()
          Gets an array of profile currently installed on the device Note: Maybe be null
 LenovoDevicePolicyManager.LenovoDevicePolicyInfo getProfileInfo(byte[] is)
          Gets XML configuration profile information
 LenovoDevicePolicyManager.LenovoDevicePolicyInfo getProfileInfoFromFile(java.lang.String xmlFile)
          Gets XML configuration profile information
 int getSupportedAPIVersion()
          Gets the API version supported by this interface.
 boolean isADScreenLockEnabled()
          Checks if AD credentials are enabled to unlock the device.
 boolean isADScreenLockRequired()
          Checks if AD credentials are required to unlock the device
 boolean isADScreenLockRequired(java.util.UUID uuid)
          Checks if AD credentials are required to unlock the device.
 boolean isBluetoothBlocked()
          Checks if Bluetooth is blocked by policy.
 boolean isBluetoothBlocked(java.util.UUID uuid)
          Checks if Bluetooth is blocked by policy.
 boolean isCameraBlocked()
          Checks if camera is blocked by policy.
 boolean isCameraBlocked(java.util.UUID uuid)
          Checks if camera is blocked by policy.
 boolean isDataRoamingBlocked()
          Checks if data services while roaming is blocked by policy.
 boolean isDataRoamingBlocked(java.util.UUID uuid)
          Checks if data services while roaming is blocked by policy.
 boolean isDeviceRooted()
          Checks if the device is currently rooted
 boolean isHDMIBlocked()
          Checks if the HDMI port is blocked by policy.
 boolean isHDMIBlocked(java.util.UUID uuid)
          Checks if the HDMI port is blocked by policy.
 boolean isHotspotBlocked()
          Checks if hotspot is currently blocked
 boolean isHotspotBlocked(java.util.UUID uuid)
          Checks if hotspot is currently blocked by policy
 boolean isMicBlocked()
          Checks if microphone is blocked by policy.
 boolean isMicBlocked(java.util.UUID uuid)
          Checks if microphone is blocked by policy.
 boolean isMicroUSBBlocked()
          Checks if micro-USB port is blocked by policy.
 boolean isMicroUSBBlocked(java.util.UUID uuid)
          Checks if micro-USB port is blocked by policy.
 boolean isSDCardEncryptionEnabled()
          Checks if SD card is encrypted
 boolean isSDCardEncryptionRequired()
          Checks if SD card encryption is required
 boolean isSDCardEncryptionRequired(java.util.UUID uuid)
          Checks if SD card encryption is required.
 boolean isSDCardSlotBlocked()
          Checks if SD card slot is blocked by policy.
 boolean isSDCardSlotBlocked(java.util.UUID uuid)
          Checks if SD card slot is blocked by policy.
 boolean isTetheringBlocked()
          Checks if tethering is currently blocked
 boolean isTetheringBlocked(java.util.UUID uuid)
          Checks if tethering is currently blocked by policy
 boolean isUnknownSourcesBlocked()
          Checks if install from unknown sources is blocked by policy.
 boolean isUnknownSourcesBlocked(java.util.UUID uuid)
          Checks if install from unknown sources is blocked by policy.
 boolean isUSBBlocked()
          Checks if USB port is blocked by policy.
 boolean isUSBBlocked(java.util.UUID uuid)
          Checks if USB port is blocked by policy.
 boolean isUSBDebuggingBlocked()
          Checks if USB debugging is blocked by policy.
 boolean isUSBDebuggingBlocked(java.util.UUID uuid)
          Checks if USB debugging is blocked by policy.
 boolean isWifiBlocked()
          Checks if WiFi is blocked by policy.
 boolean isWifiBlocked(java.util.UUID uuid)
          Checks if WiFi is blocked by policy.
 boolean removeProfile(android.content.ComponentName admin, java.util.UUID uuid)
          Remove XML configuration profile.
 boolean setBlockBluetooth(android.content.ComponentName admin, java.util.UUID uuid, boolean bBlock)
          Blocks use of Bluetooth.
 boolean setBlockCamera(android.content.ComponentName admin, java.util.UUID uuid, boolean bBlock)
          Blocks use of the camera.
 boolean setBlockDataRoaming(android.content.ComponentName admin, java.util.UUID uuid, boolean bBlock)
          Blocks data services while roaming.
 boolean setBlockHDMI(android.content.ComponentName admin, java.util.UUID uuid, boolean bBlock)
          Blocks use of the HDMI port.
 boolean setBlockHotspot(android.content.ComponentName admin, java.util.UUID uuid, boolean bBlock)
          Blocks use of device becoming a hotspot.
 boolean setBlockMic(android.content.ComponentName admin, java.util.UUID uuid, boolean bBlock)
          Blocks use of microphone.
 boolean setBlockMicroUSB(android.content.ComponentName admin, java.util.UUID uuid, boolean bBlock)
          Blocks use of micro-USB port.
 boolean setBlockSDCardSlot(android.content.ComponentName admin, java.util.UUID uuid, boolean bBlock)
          Blocks use of the SD card slot.
 boolean setBlockTethering(android.content.ComponentName admin, java.util.UUID uuid, boolean bBlock)
          Blocks use of tethering the device.
 boolean setBlockUnknownSources(android.content.ComponentName admin, java.util.UUID uuid, boolean bBlock)
          Blocks installation from unknown sources.
 boolean setBlockUSB(android.content.ComponentName admin, java.util.UUID uuid, boolean bBlock)
          Blocks use of full-size USB port.
 boolean setBlockUSBDebugging(android.content.ComponentName admin, java.util.UUID uuid, boolean bBlock)
          Blocks USB debugging.
 boolean setBlockWifi(android.content.ComponentName admin, java.util.UUID uuid, boolean bBlock)
          Blocks use of WiFi.
 boolean setRequireADScreenLock(android.content.ComponentName admin, java.util.UUID uuid, boolean bRequire)
          Requires the user to use Active Directory credentials to unlock the device.
 boolean setRequireSDCardEncryption(android.content.ComponentName admin, java.util.UUID uuid, boolean bRequire)
          Requires the user to encrypt the SD card.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LenovoManagementJarFile

public static final java.lang.String LenovoManagementJarFile
See Also:
Constant Field Values
Constructor Detail

LenovoDevicePolicyManager

public LenovoDevicePolicyManager(android.content.Context context)
                          throws java.lang.ClassNotFoundException,
                                 java.lang.NoSuchMethodException
Constructor.

Parameters:
context - The Context in which we are creating the device admin.
Throws:
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
Since:
API v1

LenovoDevicePolicyManager

public LenovoDevicePolicyManager(android.content.Context context,
                                 java.lang.String tempDir)
                          throws java.lang.ClassNotFoundException,
                                 java.lang.NoSuchMethodException
Constructor.

Parameters:
context - The Context in which we are creating the device admin.
tempDir - Temporary directory used for loading classes. This may be null.
Throws:
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
Since:
API v1
Method Detail

applyProfile

public boolean applyProfile(android.content.ComponentName admin,
                            byte[] is)
Apply XML configuration profile.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
is - The XML input data itself.
Returns:
true, if successful
Since:
API v1

applyProfileFromFile

public boolean applyProfileFromFile(android.content.ComponentName admin,
                                    java.lang.String xmlFile)
Apply XML configuration profile.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
xmlFile - The filename of the XML input data file. Note: This must be readable by the Android "system" user.
Returns:
true, if successful
Since:
API v1

getADServerInfo

public LenovoDevicePolicyManager.LenovoADServerInfo getADServerInfo()
Gets the AD server info.

Returns:
The AD server info

getAppliedProfileInfo

public LenovoDevicePolicyManager.LenovoDevicePolicyInfo getAppliedProfileInfo()
Gets the "master profile" that is currently applied to the device

Returns:
LenovoDevicePolicyInfo containing profile information
Since:
API v1

getAppliedProfileInfo

public LenovoDevicePolicyManager.LenovoDevicePolicyInfo getAppliedProfileInfo(java.util.UUID uuid)
Gets the installed profile info for the given uuid

Parameters:
uuid - the uuid
Returns:
LenovoDevicePolicyInfo containing profile information
Since:
API v1

getEmailServerInfo

public LenovoDevicePolicyManager.LenovoEmailServerInfo getEmailServerInfo()
Gets the Email server info.

Returns:
The Email server info

getInstalledAPIVersion

public int getInstalledAPIVersion()
Gets the API version supported by the service that is installed on this device.

Returns:
The supported API version
Since:
API v1

getInstalledProfiles

public LenovoDevicePolicyManager.LenovoDevicePolicyInfo[] getInstalledProfiles()
Gets an array of profile currently installed on the device Note: Maybe be null

Returns:
LenovoDevicePolicyInfo array containing installed profiles
Since:
API v1

getProfileInfo

public LenovoDevicePolicyManager.LenovoDevicePolicyInfo getProfileInfo(byte[] is)
Gets XML configuration profile information

Parameters:
is - The XML input data itself.
Returns:
LenovoDevicePolicyInfo containing profile information
Since:
API v1

getProfileInfoFromFile

public LenovoDevicePolicyManager.LenovoDevicePolicyInfo getProfileInfoFromFile(java.lang.String xmlFile)
Gets XML configuration profile information

Parameters:
xmlFile - The filename of the XML input data file. Note: This must be readable by the Android "system" user.
Returns:
LenovoDevicePolicyInfo containing profile information
Since:
API v1

getSupportedAPIVersion

public int getSupportedAPIVersion()
Gets the API version supported by this interface.

Returns:
The supported API version
Since:
API v1

isADScreenLockEnabled

public boolean isADScreenLockEnabled()
Checks if AD credentials are enabled to unlock the device.

Returns:
true, if AD credentials are enabled to unlock the device
Since:
API v1

isADScreenLockRequired

public boolean isADScreenLockRequired()
Checks if AD credentials are required to unlock the device

Returns:
true, if AD credentials are required to unlock the device
Since:
API v1

isADScreenLockRequired

public boolean isADScreenLockRequired(java.util.UUID uuid)
Checks if AD credentials are required to unlock the device.

Parameters:
uuid - the uuid
Returns:
true, if AD credentials are required to unlock the device
Since:
API v1

isBluetoothBlocked

public boolean isBluetoothBlocked()
Checks if Bluetooth is blocked by policy.

Returns:
true, if Bluetooth is blocked
Since:
API v1

isBluetoothBlocked

public boolean isBluetoothBlocked(java.util.UUID uuid)
Checks if Bluetooth is blocked by policy.

Parameters:
uuid - the uuid
Returns:
true, if Bluetooth is blocked
Since:
API v1

isCameraBlocked

public boolean isCameraBlocked()
Checks if camera is blocked by policy.

Returns:
true, if camera is blocked
Since:
API v1

isCameraBlocked

public boolean isCameraBlocked(java.util.UUID uuid)
Checks if camera is blocked by policy.

Parameters:
uuid - the uuid
Returns:
true, if camera is blocked
Since:
API v1

isDataRoamingBlocked

public boolean isDataRoamingBlocked()
Checks if data services while roaming is blocked by policy.

Returns:
true, if data services while roaming is blocked
Since:
API v1

isDataRoamingBlocked

public boolean isDataRoamingBlocked(java.util.UUID uuid)
Checks if data services while roaming is blocked by policy.

Parameters:
uuid - the uuid
Returns:
true, if data services while roaming is blocked
Since:
API v1

isDeviceRooted

public boolean isDeviceRooted()
Checks if the device is currently rooted

Returns:
true, if device is rooted
Since:
API v1

isHDMIBlocked

public boolean isHDMIBlocked()
Checks if the HDMI port is blocked by policy.

Returns:
true, if the HDMI port is blocked
Since:
API v1

isHDMIBlocked

public boolean isHDMIBlocked(java.util.UUID uuid)
Checks if the HDMI port is blocked by policy.

Parameters:
uuid - the uuid
Returns:
true, if the HDMI port is blocked
Since:
API v1

isHotspotBlocked

public boolean isHotspotBlocked()
Checks if hotspot is currently blocked

Returns:
true, if hotspot is blocked
Since:
API v1

isHotspotBlocked

public boolean isHotspotBlocked(java.util.UUID uuid)
Checks if hotspot is currently blocked by policy

Parameters:
uuid - the uuid
Returns:
true, if hotspot is blocked
Since:
API v1

isMicBlocked

public boolean isMicBlocked()
Checks if microphone is blocked by policy.

Returns:
true, if microphone is blocked
Since:
API v1

isMicBlocked

public boolean isMicBlocked(java.util.UUID uuid)
Checks if microphone is blocked by policy.

Parameters:
uuid - the uuid
Returns:
true, if microphone is blocked
Since:
API v1

isMicroUSBBlocked

public boolean isMicroUSBBlocked()
Checks if micro-USB port is blocked by policy.

Returns:
true, if USB port is blocked
Since:
API v1

isMicroUSBBlocked

public boolean isMicroUSBBlocked(java.util.UUID uuid)
Checks if micro-USB port is blocked by policy.

Parameters:
uuid - the uuid
Returns:
true, if USB port is blocked
Since:
API v1

isSDCardEncryptionEnabled

public boolean isSDCardEncryptionEnabled()
Checks if SD card is encrypted

Returns:
true, if SD card is currently encrypted
Since:
API v1

isSDCardEncryptionRequired

public boolean isSDCardEncryptionRequired()
Checks if SD card encryption is required

Returns:
true, if SD card encryption is required
Since:
API v1

isSDCardEncryptionRequired

public boolean isSDCardEncryptionRequired(java.util.UUID uuid)
Checks if SD card encryption is required.

Parameters:
uuid - the uuid
Returns:
true, if SD card encryption is required
Since:
API v1

isSDCardSlotBlocked

public boolean isSDCardSlotBlocked()
Checks if SD card slot is blocked by policy.

Returns:
true, if camera is blocked
Since:
API v1

isSDCardSlotBlocked

public boolean isSDCardSlotBlocked(java.util.UUID uuid)
Checks if SD card slot is blocked by policy.

Parameters:
uuid - the uuid
Returns:
true, if camera is blocked
Since:
API v1

isTetheringBlocked

public boolean isTetheringBlocked()
Checks if tethering is currently blocked

Returns:
true, if tethering is blocked
Since:
API v1

isTetheringBlocked

public boolean isTetheringBlocked(java.util.UUID uuid)
Checks if tethering is currently blocked by policy

Parameters:
uuid - the uuid
Returns:
true, if tethering is blocked
Since:
API v1

isUnknownSourcesBlocked

public boolean isUnknownSourcesBlocked()
Checks if install from unknown sources is blocked by policy.

Returns:
true, if install of non-Market applications is blocked
Since:
API v1

isUnknownSourcesBlocked

public boolean isUnknownSourcesBlocked(java.util.UUID uuid)
Checks if install from unknown sources is blocked by policy.

Parameters:
uuid - the uuid
Returns:
true, if install of non-Market applications is blocked
Since:
API v1

isUSBBlocked

public boolean isUSBBlocked()
Checks if USB port is blocked by policy.

Returns:
true, if USB port is blocked
Since:
API v1

isUSBBlocked

public boolean isUSBBlocked(java.util.UUID uuid)
Checks if USB port is blocked by policy.

Parameters:
uuid - the uuid
Returns:
true, if USB port is blocked
Since:
API v1

isUSBDebuggingBlocked

public boolean isUSBDebuggingBlocked()
Checks if USB debugging is blocked by policy.

Returns:
true, if USB debugging is blocked
Since:
API v1

isUSBDebuggingBlocked

public boolean isUSBDebuggingBlocked(java.util.UUID uuid)
Checks if USB debugging is blocked by policy.

Parameters:
uuid - the uuid
Returns:
true, if USB debugging is blocked
Since:
API v1

isWifiBlocked

public boolean isWifiBlocked()
Checks if WiFi is blocked by policy.

Returns:
true, if WiFi is blocked
Since:
API v1

isWifiBlocked

public boolean isWifiBlocked(java.util.UUID uuid)
Checks if WiFi is blocked by policy.

Parameters:
uuid - the uuid
Returns:
true, if WiFi is blocked
Since:
API v1

removeProfile

public boolean removeProfile(android.content.ComponentName admin,
                             java.util.UUID uuid)
Remove XML configuration profile.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - ID of the policy to remove
Returns:
true, if successful
Since:
API v1

setBlockBluetooth

public boolean setBlockBluetooth(android.content.ComponentName admin,
                                 java.util.UUID uuid,
                                 boolean bBlock)
Blocks use of Bluetooth.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - Unique ID for the policy
bBlock - Set to true to block use of Bluetooth
Returns:
true, if successful
Since:
API v1

setBlockCamera

public boolean setBlockCamera(android.content.ComponentName admin,
                              java.util.UUID uuid,
                              boolean bBlock)
Blocks use of the camera.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - Unique ID for the policy
bBlock - Set to true to block use of the camera
Returns:
true, if successful
Since:
API v1

setBlockDataRoaming

public boolean setBlockDataRoaming(android.content.ComponentName admin,
                                   java.util.UUID uuid,
                                   boolean bBlock)
Blocks data services while roaming.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - the uuid
bBlock - Set to true to block data services while roaming
Returns:
true, if successful
Since:
API v1

setBlockHDMI

public boolean setBlockHDMI(android.content.ComponentName admin,
                            java.util.UUID uuid,
                            boolean bBlock)
Blocks use of the HDMI port.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - Unique ID for the policy
bBlock - Set to true to block use of the hdmi port
Returns:
true, if successful
Since:
API v1

setBlockHotspot

public boolean setBlockHotspot(android.content.ComponentName admin,
                               java.util.UUID uuid,
                               boolean bBlock)
Blocks use of device becoming a hotspot.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - Unique ID for the policy
bBlock - Set to true to block use of device becoming a hotspot
Returns:
true, if successful
Since:
API v1

setBlockMic

public boolean setBlockMic(android.content.ComponentName admin,
                           java.util.UUID uuid,
                           boolean bBlock)
Blocks use of microphone.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - Unique ID for the policy
bBlock - Set to true to block use of the microphone
Returns:
true, if successful
Since:
API v1

setBlockMicroUSB

public boolean setBlockMicroUSB(android.content.ComponentName admin,
                                java.util.UUID uuid,
                                boolean bBlock)
Blocks use of micro-USB port.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - Unique ID for the policy
bBlock - Set to true to block use of the micro-USB port
Returns:
true, if successful
Since:
API v1

setBlockSDCardSlot

public boolean setBlockSDCardSlot(android.content.ComponentName admin,
                                  java.util.UUID uuid,
                                  boolean bBlock)
Blocks use of the SD card slot.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - Unique ID for the policy
bBlock - Set to true to block use of the SD card slot
Returns:
true, if successful
Since:
API v1

setBlockTethering

public boolean setBlockTethering(android.content.ComponentName admin,
                                 java.util.UUID uuid,
                                 boolean bBlock)
Blocks use of tethering the device.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - Unique ID for the policy
bBlock - Set to true to block use of tethering the device
Returns:
true, if successful
Since:
API v1

setBlockUnknownSources

public boolean setBlockUnknownSources(android.content.ComponentName admin,
                                      java.util.UUID uuid,
                                      boolean bBlock)
Blocks installation from unknown sources.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - the uuid
bBlock - Set to true to block install of non-Market applications
Returns:
true, if successful
Since:
API v1

setBlockUSB

public boolean setBlockUSB(android.content.ComponentName admin,
                           java.util.UUID uuid,
                           boolean bBlock)
Blocks use of full-size USB port.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - Unique ID for the policy
bBlock - Set to true to block use of the USB port
Returns:
true, if successful
Since:
API v1

setBlockUSBDebugging

public boolean setBlockUSBDebugging(android.content.ComponentName admin,
                                    java.util.UUID uuid,
                                    boolean bBlock)
Blocks USB debugging.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - the uuid
bBlock - Set to true to block USB debugging
Returns:
true, if successful
Since:
API v1

setBlockWifi

public boolean setBlockWifi(android.content.ComponentName admin,
                            java.util.UUID uuid,
                            boolean bBlock)
Blocks use of WiFi.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - Unique ID for the policy
bBlock - Set to true to block use of the SD card slot
Returns:
true, if successful
Since:
API v1

setRequireADScreenLock

public boolean setRequireADScreenLock(android.content.ComponentName admin,
                                      java.util.UUID uuid,
                                      boolean bRequire)
Requires the user to use Active Directory credentials to unlock the device.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - Unique ID for the policy
bRequire - Set to true to require use of domain credentials for unlock
Returns:
true, if successful
Since:
API v1

setRequireSDCardEncryption

public boolean setRequireSDCardEncryption(android.content.ComponentName admin,
                                          java.util.UUID uuid,
                                          boolean bRequire)
Requires the user to encrypt the SD card.

Parameters:
admin - Which DeviceAdminReceiver this request is associated with.
uuid - the uuid
bRequire - Set to true to require use the user encrypt the SD card
Returns:
true, if successful
Since:
API v1