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 |
static Int |
Value for |
static Int |
Value for |
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 |
static Int |
A type of policy that this device admin can use: able to reset the user's password via |
static Int |
A type of policy that this device admin can use: able to watch login attempts from the user, via |
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 | |
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! |
loadIcon(pm: PackageManager!) Load the user-displayed icon for this device admin. |
CharSequence! |
loadLabel(pm: PackageManager!) Load the user-displayed label for this device admin. |
Boolean |
Return true if this administrator can be a target in an ownership transfer. |
String |
toString() |
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 |
Properties | |
---|---|
static Parcelable.Creator<DeviceAdminInfo!> |
Used to make this class parcelable. |
Constants
HEADLESS_DEVICE_OWNER_MODE_AFFILIATED
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
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
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
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
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
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
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
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
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
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
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
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
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
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 |
getActivityInfo
fun getActivityInfo(): ActivityInfo!
Return the raw information about the receiver implementing this device admin. Do not modify the returned object.
getComponent
fun getComponent(): ComponentName
Return the component of the receiver that implements this device admin.
Return | |
---|---|
ComponentName |
This value cannot be null . |
getHeadlessDeviceOwnerMode
fun getHeadlessDeviceOwnerMode(): Int
Returns the mode this DeviceAdmin wishes to use if provisioned as a Device Owner on a headless system user mode device.
getPackageName
fun getPackageName(): String!
Return the .apk package that implements this device admin.
getReceiverName
fun getReceiverName(): String!
Return the class name of the receiver component that implements this device admin.
getTagForPolicy
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
fun isVisible(): Boolean
Returns whether this device admin would like to be visible to the user, even when it is not enabled.
loadDescription
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
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
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
fun supportsTransferOwnership(): Boolean
Return true if this administrator can be a target in an ownership transfer.
toString
fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |
usesPolicy
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
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
static val CREATOR: Parcelable.Creator<DeviceAdminInfo!>
Used to make this class parcelable.