Added in API level 8

DeviceAdminInfo


class DeviceAdminInfo : Parcelable
kotlin.Any
   ↳ android.app.admin.DeviceAdminInfo

This class is used to specify meta information of a device administrator component.

Summary

Constants
static Int

Value for getHeadlessDeviceOwnerMode which indicates that this DPC should be provisioned into "affiliated" mode when on a Headless System User Mode device.

static Int

Value for getHeadlessDeviceOwnerMode which indicates that this DPC should be provisioned into the first secondary user when on a Headless System User Mode device.

static Int

Value for getHeadlessDeviceOwnerMode which indicates that this DPC should not be provisioned into Device Owner mode on a Headless System User Mode device.

static Int

A type of policy that this device admin can use: require encryption of stored data.

static Int

A type of policy that this device admin can use: disables use of all device cameras.

static Int

A type of policy that this device admin can use: disables use of keyguard features.

static Int

A type of policy that this device admin can use: force the user to change their password after an administrator-defined time limit.

static Int

A type of policy that this device admin can use: able to force the device to lock viaandroid.

static Int

A type of policy that this device admin can use: limit the passwords that the user can select, via DevicePolicyManager#setPasswordQuality and DevicePolicyManager#setPasswordMinimumLength.

static Int

A type of policy that this device admin can use: able to reset the user's password via DevicePolicyManager#resetPassword.

static Int

A type of policy that this device admin can use: able to watch login attempts from the user, via DeviceAdminReceiver#ACTION_PASSWORD_FAILED, DeviceAdminReceiver#ACTION_PASSWORD_SUCCEEDED, and DevicePolicyManager#getCurrentFailedPasswordAttempts.

static Int

A type of policy that this device admin can use: able to factory reset the device, erasing all of the user's data, via android.

Inherited constants
Public constructors
DeviceAdminInfo(context: Context!, resolveInfo: ResolveInfo!)

Constructor.

Public methods
Int

Unit
dump(pw: Printer!, prefix: String!)

ActivityInfo!

Return the raw information about the receiver implementing this device admin.

ComponentName

Return the component of the receiver that implements this device admin.

Int

Returns the mode this DeviceAdmin wishes to use if provisioned as a Device Owner on a headless system user mode device.

String!

Return the .

String!

Return the class name of the receiver component that implements this device admin.

String!
getTagForPolicy(policyIdent: Int)

Return the XML tag name for the given policy identifier.

Boolean

Returns whether this device admin would like to be visible to the user, even when it is not enabled.

CharSequence!

Load user-visible description associated with this device admin.

Drawable!

Load the user-displayed icon for this device admin.

CharSequence!

Load the user-displayed label for this device admin.

Boolean

Return true if this administrator can be a target in an ownership transfer.

String

Boolean
usesPolicy(policyIdent: Int)

Return true if the device admin has requested that it be able to use the given policy control.

Unit
writeToParcel(dest: Parcel, flags: Int)

Used to package this object into a Parcel.

Properties
static Parcelable.Creator<DeviceAdminInfo!>

Used to make this class parcelable.

Constants

HEADLESS_DEVICE_OWNER_MODE_AFFILIATED

Added in API level 34
static val HEADLESS_DEVICE_OWNER_MODE_AFFILIATED: Int

Value for getHeadlessDeviceOwnerMode which indicates that this DPC should be provisioned into "affiliated" mode when on a Headless System User Mode device.

This mode adds a Profile Owner to all users other than the user the Device Owner is on.

Starting from Android version android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM, DPCs should set the value of attribute "headless-device-owner-mode" inside the "headless-system-user" tag as "affiliated".

Value: 1

HEADLESS_DEVICE_OWNER_MODE_SINGLE_USER

Added in API level 35
static val HEADLESS_DEVICE_OWNER_MODE_SINGLE_USER: Int

Value for getHeadlessDeviceOwnerMode which indicates that this DPC should be provisioned into the first secondary user when on a Headless System User Mode device.

This mode only allows a single secondary user on the device blocking the creation of additional secondary users.

Starting from Android version android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM, DPCs should set the value of attribute "headless-device-owner-mode" inside the "headless-system-user" tag as "single_user".

Value: 2

HEADLESS_DEVICE_OWNER_MODE_UNSUPPORTED

Added in API level 34
static val HEADLESS_DEVICE_OWNER_MODE_UNSUPPORTED: Int

Value for getHeadlessDeviceOwnerMode which indicates that this DPC should not be provisioned into Device Owner mode on a Headless System User Mode device.

Value: 0

USES_ENCRYPTED_STORAGE

Added in API level 11
static val USES_ENCRYPTED_STORAGE: Int

A type of policy that this device admin can use: require encryption of stored data.

To control this policy, the device admin must have a "encrypted-storage" tag in the "uses-policies" section of its meta-data.

Value: 7

USES_POLICY_DISABLE_CAMERA

Added in API level 14
static val USES_POLICY_DISABLE_CAMERA: Int

A type of policy that this device admin can use: disables use of all device cameras.

To control this policy, the device admin must be a device owner or profile owner, and must have a "disable-camera" tag in the "uses-policies" section of its meta-data. If used by a device owner, the policy affects all users on the device.

Value: 8

USES_POLICY_DISABLE_KEYGUARD_FEATURES

Added in API level 17
static val USES_POLICY_DISABLE_KEYGUARD_FEATURES: Int

A type of policy that this device admin can use: disables use of keyguard features.

To control this policy, the device admin must be a device owner or profile owner, and must have a "disable-keyguard-features" tag in the "uses-policies" section of its meta-data. If used by a device owner, the policy only affects the primary user and its profiles, but not any secondary users on the device.

Value: 9

USES_POLICY_EXPIRE_PASSWORD

Added in API level 11
static val USES_POLICY_EXPIRE_PASSWORD: Int

A type of policy that this device admin can use: force the user to change their password after an administrator-defined time limit.

To control this policy, the device admin must be a device owner or profile owner, and must have an "expire-password" tag in the "uses-policies" section of its meta-data. If used by a device owner, the policy only affects the primary user and its profiles, but not any secondary users on the device.

Value: 6

USES_POLICY_FORCE_LOCK

Added in API level 8
static val USES_POLICY_FORCE_LOCK: Int

A type of policy that this device admin can use: able to force the device to lock viaandroid.app.admin.DevicePolicyManager#lockNow or limit the maximum lock timeout for the device via DevicePolicyManager#setMaximumTimeToLock.

To control this policy, the device admin must have a "force-lock" tag in the "uses-policies" section of its meta-data.

Value: 3

USES_POLICY_LIMIT_PASSWORD

Added in API level 8
static val USES_POLICY_LIMIT_PASSWORD: Int

A type of policy that this device admin can use: limit the passwords that the user can select, via DevicePolicyManager#setPasswordQuality and DevicePolicyManager#setPasswordMinimumLength.

To control this policy, the device admin must be a device owner or profile owner, and must have a "limit-password" tag in the "uses-policies" section of its meta-data. If used by a device owner, the policy only affects the primary user and its profiles, but not any secondary users on the device.

Value: 0

USES_POLICY_RESET_PASSWORD

Added in API level 8
static val USES_POLICY_RESET_PASSWORD: Int

A type of policy that this device admin can use: able to reset the user's password via DevicePolicyManager#resetPassword.

To control this policy, the device admin must have a "reset-password" tag in the "uses-policies" section of its meta-data.

Value: 2

USES_POLICY_WATCH_LOGIN

Added in API level 8
static val USES_POLICY_WATCH_LOGIN: Int

A type of policy that this device admin can use: able to watch login attempts from the user, via DeviceAdminReceiver#ACTION_PASSWORD_FAILED, DeviceAdminReceiver#ACTION_PASSWORD_SUCCEEDED, and DevicePolicyManager#getCurrentFailedPasswordAttempts.

To control this policy, the device admin must have a "watch-login" tag in the "uses-policies" section of its meta-data.

Value: 1

USES_POLICY_WIPE_DATA

Added in API level 8
static val USES_POLICY_WIPE_DATA: Int

A type of policy that this device admin can use: able to factory reset the device, erasing all of the user's data, via android.app.admin.DevicePolicyManager#wipeData.

To control this policy, the device admin must have a "wipe-data" tag in the "uses-policies" section of its meta-data.

Value: 4

Public constructors

DeviceAdminInfo

Added in API level 8
DeviceAdminInfo(
    context: Context!,
    resolveInfo: ResolveInfo!)

Constructor.

Parameters
context Context!: The Context in which we are parsing the device admin.
resolveInfo ResolveInfo!: The ResolveInfo returned from the package manager about this device admin's component.

Public methods

describeContents

Added in API level 8
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

dump

Added in API level 8
fun dump(
    pw: Printer!,
    prefix: String!
): Unit

getActivityInfo

Added in API level 8
fun getActivityInfo(): ActivityInfo!

Return the raw information about the receiver implementing this device admin. Do not modify the returned object.

getComponent

Added in API level 8
fun getComponent(): ComponentName

Return the component of the receiver that implements this device admin.

Return
ComponentName This value cannot be null.

getHeadlessDeviceOwnerMode

Added in API level 34
fun getHeadlessDeviceOwnerMode(): Int

Returns the mode this DeviceAdmin wishes to use if provisioned as a Device Owner on a headless system user mode device.

Return
Int Value is android.app.admin.DeviceAdminInfo#HEADLESS_DEVICE_OWNER_MODE_UNSUPPORTED, android.app.admin.DeviceAdminInfo#HEADLESS_DEVICE_OWNER_MODE_AFFILIATED, or android.app.admin.DeviceAdminInfo#HEADLESS_DEVICE_OWNER_MODE_SINGLE_USER

getPackageName

Added in API level 8
fun getPackageName(): String!

Return the .apk package that implements this device admin.

getReceiverName

Added in API level 8
fun getReceiverName(): String!

Return the class name of the receiver component that implements this device admin.

getTagForPolicy

Added in API level 8
fun getTagForPolicy(policyIdent: Int): String!

Return the XML tag name for the given policy identifier. Valid identifiers are as per usesPolicy(int). If the given identifier is not known, null is returned.

isVisible

Added in API level 8
fun isVisible(): Boolean

Returns whether this device admin would like to be visible to the user, even when it is not enabled.

loadDescription

Added in API level 8
fun loadDescription(pm: PackageManager!): CharSequence!

Load user-visible description associated with this device admin.

Parameters
pm PackageManager!: Supply a PackageManager used to load the device admin's resources.

loadIcon

Added in API level 8
fun loadIcon(pm: PackageManager!): Drawable!

Load the user-displayed icon for this device admin.

Parameters
pm PackageManager!: Supply a PackageManager used to load the device admin's resources.

loadLabel

Added in API level 8
fun loadLabel(pm: PackageManager!): CharSequence!

Load the user-displayed label for this device admin.

Parameters
pm PackageManager!: Supply a PackageManager used to load the device admin's resources.

supportsTransferOwnership

Added in API level 28
fun supportsTransferOwnership(): Boolean

Return true if this administrator can be a target in an ownership transfer.

toString

Added in API level 8
fun toString(): String
Return
String a string representation of the object.

usesPolicy

Added in API level 8
fun usesPolicy(policyIdent: Int): Boolean

Return true if the device admin has requested that it be able to use the given policy control. The possible policy identifier inputs are: USES_POLICY_LIMIT_PASSWORD, USES_POLICY_WATCH_LOGIN, USES_POLICY_RESET_PASSWORD, USES_POLICY_FORCE_LOCK, USES_POLICY_WIPE_DATA, USES_POLICY_EXPIRE_PASSWORD, USES_ENCRYPTED_STORAGE, USES_POLICY_DISABLE_CAMERA.

writeToParcel

Added in API level 8
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Used to package this object into a Parcel.

Parameters
dest Parcel: The Parcel to be written.
flags Int: The flags used for parceling.

Properties

CREATOR

Added in API level 8
static val CREATOR: Parcelable.Creator<DeviceAdminInfo!>

Used to make this class parcelable.