Added in API level 1
public interface

IDeviceAdminManager

com.ardic.android.managers.deviceadmin.IDeviceAdminManager

Class Overview

Provides a set of APIs for auto activating and deactivating device admin.

Summary

Public Methods
abstract ComponentName getActiveAdmin()
Returns the caller active device admin information.
abstract boolean isActiveAdminLocked()
Returns the caller application's active admin lock state.
abstract boolean isAdminActive()
Returns the caller device admin activation state.
abstract boolean isDeviceAdminLocked(ComponentName adminReceiver)
Returns the given application's device admin lock state.
abstract boolean removeActiveAdmin()
Deactivates the caller device admin.
abstract boolean setActiveAdmin()
Activates the caller device admin.
abstract boolean setActiveAdminLocked(boolean state)
Sets caller application's active admin locking state.

Public Methods

public abstract ComponentName getActiveAdmin ()

Added in API level 1

Returns the caller active device admin information.

Returns
ComponentName ComponentName if caller admin is active else null
Throws
AfexException

public abstract boolean isActiveAdminLocked ()

Added in API level 1

Returns the caller application's active admin lock state.

Returns
boolean true if the active admin is locked else false
Throws
AfexException

public abstract boolean isAdminActive ()

Added in API level 1

Returns the caller device admin activation state.

Warning: Immediate calling this api after setActiveAdmin() and removeActiveAdmin() operations may return wrong result because of set and remove admin apis has asyncronous operation. To get right info about activated and deactivated device admin user should use their own application's receiver class which is derived from DeviceAdminReceiver by using overriden "onEnabled" and "onDisabled" functions.

Returns
boolean true if the caller admin is active else false
Throws
AfexException

public abstract boolean isDeviceAdminLocked (ComponentName adminReceiver)

Added in API level 1

Returns the given application's device admin lock state.

Parameters
adminReceiver ComponentName: Application device admin receiver ComponentName
Returns
boolean true if the active admin is locked else false
Throws
AfexException

public abstract boolean removeActiveAdmin ()

Added in API level 1

Deactivates the caller device admin.

Returns
boolean true if the operation succeeds else false
Throws
AfexException

public abstract boolean setActiveAdmin ()

Added in API level 1

Activates the caller device admin.

Returns
boolean true if the operation succeeds else false
Throws
AfexException

public abstract boolean setActiveAdminLocked (boolean state)

Added in API level 1

Sets caller application's active admin locking state. Locked active admin can not be deactivated by any application instead of itself.

Locking only works while caller application device admin should be activated before trying to lock. To activate user can use setActiveAdmin(). If device admin has not already activated, this api returns false.

Parameters
state boolean: true locks active admin and nothing can remove it's activated admin instead of itself, false unlocks.
Returns
boolean true if the operation succeeds else false
Throws
AfexException