DevicePolicyManager Class

Definition

Public interface for managing policies enforced on a device.

[Android.Runtime.Register("android/app/admin/DevicePolicyManager", DoNotGenerateAcw=true)]
public class DevicePolicyManager : Java.Lang.Object
[<Android.Runtime.Register("android/app/admin/DevicePolicyManager", DoNotGenerateAcw=true)>]
type DevicePolicyManager = class
    inherit Object
Inheritance
DevicePolicyManager
Attributes

Remarks

Public interface for managing policies enforced on a device. Most clients of this class must be registered with the system as a device administrator. Additionally, a device administrator may be registered as either a profile or device owner. A given method is accessible to all device administrators unless the documentation for that method specifies that it is restricted to either device or profile owners. Any application calling an api may only pass as an argument a device administrator component it owns. Otherwise, a SecurityException will be thrown.

<b>Note: </b>on android.content.pm.PackageManager#FEATURE_AUTOMOTIVE automotive builds, some methods can throw an UnsafeStateException exception (for example, if the vehicle is moving), so callers running on automotive builds should always check for that exception, otherwise they might crash.

<div class="special reference"> <h3>Developer Guides</h3>

For more information about managing policies for device administration, read the Device Administration developer guide. </div>

Java documentation for android.app.admin.DevicePolicyManager.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

DevicePolicyManager(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

ActionAddDeviceAdmin

Activity action: ask the user to add a new device administrator to the system.

ActionAdminPolicyCompliance

Activity action: Starts the administrator to show policy compliance for the provisioning.

ActionApplicationDelegationScopesChanged

Broadcast Action: Sent after application delegation scopes are changed.

ActionCheckPolicyCompliance

Activity action: launch the DPC to check policy compliance.

ActionDeviceAdminService

Service action: Action for a service that device owner and profile owner can optionally own.

ActionDeviceFinancingStateChanged

Broadcast Action: Broadcast sent to indicate that the device financing state has changed.

ActionDeviceOwnerChanged

Broadcast action: sent when the device owner is set, changed or cleared.

ActionDevicePolicyResourceUpdated

Broadcast action: notify system apps (e.

ActionGetProvisioningMode

Activity action: Starts the administrator to get the mode for the provisioning.

ActionManagedProfileProvisioned

Broadcast Action: This broadcast is sent to indicate that provisioning of a managed profile has completed successfully.

ActionProfileOwnerChanged

Broadcast action: sent when the profile owner is set, changed or cleared.

ActionProvisioningSuccessful

Activity action: This activity action is sent to indicate that provisioning of a managed profile or managed device has completed successfully.

ActionProvisionManagedDevice

Activity action: Starts the provisioning flow which sets up a managed device.

ActionProvisionManagedProfile

Activity action: Starts the provisioning flow which sets up a managed profile.

ActionSetNewParentProfilePassword

Activity action: have the user enter a new password for the parent profile.

ActionSetNewPassword

Activity action: have the user enter a new password.

ActionStartEncryption

Activity action: begin the process of encrypting data on the device.

ActionSystemUpdatePolicyChanged

Broadcast action: notify that a new local system update policy has been set by the device owner.

DelegationAppRestrictions

Delegation of application restrictions management.

DelegationBlockUninstall

Delegation of application uninstall block.

DelegationCertInstall

Delegation of certificate installation and management.

DelegationCertSelection

Grants access to selection of KeyChain certificates on behalf of requesting apps.

DelegationEnableSystemApp

Delegation for enabling system apps.

DelegationInstallExistingPackage

Delegation for installing existing packages.

DelegationKeepUninstalledPackages

Delegation of management of uninstalled packages.

DelegationNetworkLogging

Grants access to #setNetworkLoggingEnabled, #isNetworkLoggingEnabled and #retrieveNetworkLogs.

DelegationPackageAccess

Delegation of package access state.

DelegationPermissionGrant

Delegation of permission policy and permission grant state.

DelegationSecurityLogging

Grants access to #setSecurityLoggingEnabled, #isSecurityLoggingEnabled, #retrieveSecurityLogs, and #retrievePreRebootSecurityLogs.

ExtraAddExplanation

An optional CharSequence providing additional explanation for why the admin is being added.

ExtraDelegationScopes

An ArrayList<String> corresponding to the delegation scopes given to an app in the #ACTION_APPLICATION_DELEGATION_SCOPES_CHANGED broadcast.

ExtraDeviceAdmin

The ComponentName of the administrator component.

ExtraDevicePasswordRequirementOnly

A boolean extra for #ACTION_SET_NEW_PARENT_PROFILE_PASSWORD requesting that only device password requirement is enforced during the parent profile password enrolment flow.

ExtraPasswordComplexity

An integer indicating the complexity level of the new password an app would like the user to set when launching the action #ACTION_SET_NEW_PASSWORD.

ExtraProvisioningAccountToMigrate

An android.accounts.Account extra holding the account to migrate during managed profile provisioning.

ExtraProvisioningAdminExtrasBundle

A android.os.Parcelable extra of type android.os.PersistableBundle that allows a mobile device management application or NFC programmer application which starts managed provisioning to pass data to the management application instance after provisioning.

ExtraProvisioningAllowedProvisioningModes

An ArrayList of Integer extra specifying the allowed provisioning modes.

ExtraProvisioningAllowOffline

A boolean extra indicating whether offline provisioning is allowed.

ExtraProvisioningDeviceAdminComponentName

A ComponentName extra indicating the device admin receiver of the mobile device management application that will be set as the profile owner or device owner and active admin.

ExtraProvisioningDeviceAdminMinimumVersionCode

An int extra holding a minimum required version code for the device admin package.

ExtraProvisioningDeviceAdminPackageChecksum

A String extra holding the URL-safe base64 encoded SHA-256 hash of the file at download location specified in #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION.

ExtraProvisioningDeviceAdminPackageDownloadCookieHeader

A String extra holding a http cookie header which should be used in the http request to the url specified in #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION.

ExtraProvisioningDeviceAdminPackageDownloadLocation

A String extra holding a url that specifies the download location of the device admin package.

ExtraProvisioningDeviceAdminPackageName

A String extra holding the package name of the mobile device management application that will be set as the profile owner or device owner.

ExtraProvisioningDeviceAdminSignatureChecksum

A String extra holding the URL-safe base64 encoded SHA-256 checksum of any signature of the android package archive at the download location specified in #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION.

ExtraProvisioningDisclaimerContent

A Uri extra pointing to disclaimer content.

ExtraProvisioningDisclaimerHeader

A String extra of localized disclaimer header.

ExtraProvisioningDisclaimers

A Bundle[] extra consisting of list of disclaimer headers and disclaimer contents.

ExtraProvisioningEmailAddress

This member is deprecated.

ExtraProvisioningImei

A string extra holding the IMEI (International Mobile Equipment Identity) of the device.

ExtraProvisioningKeepAccountOnMigration

Boolean extra to indicate that the migrated account should be kept.

ExtraProvisioningKeepScreenOn

A boolean flag that indicates whether the screen should be on throughout the provisioning flow.

ExtraProvisioningLeaveAllSystemAppsEnabled

A Boolean extra that can be used by the mobile device management application to skip the disabling of system apps during provisioning when set to true.

ExtraProvisioningLocale

A String extra holding the java.util.Locale that the device will be set to.

ExtraProvisioningLocalTime

A Long extra holding the wall clock time (in milliseconds) to be set on the device's android.app.AlarmManager.

ExtraProvisioningLogoUri

A Uri extra pointing to a logo image.

ExtraProvisioningMainColor

A integer extra indicating the predominant color to show during the provisioning.

ExtraProvisioningMode

An intent extra holding the provisioning mode returned by the administrator.

ExtraProvisioningSensorsPermissionGrantOptOut

A boolean extra indicating the admin of a fully-managed device opts out of controlling permission grants for sensor-related permissions, see #setPermissionGrantState(ComponentName, String, String, int).

ExtraProvisioningSerialNumber

A string extra holding the serial number of the device.

ExtraProvisioningShouldLaunchResultIntent

A boolean extra that determines whether the provisioning flow should launch the resulting launch intent, if one is supplied by the device policy management role holder via #EXTRA_RESULT_LAUNCH_INTENT.

ExtraProvisioningSkipEducationScreens

A boolean extra indicating if the education screens from the provisioning flow should be skipped.

ExtraProvisioningSkipEncryption

A boolean extra indicating whether device encryption can be skipped as part of device owner or managed profile provisioning.

ExtraProvisioningSkipUserConsent

A boolean extra indicating if the user consent steps from the provisioning flow should be skipped.

ExtraProvisioningTimeZone

A String extra holding the time zone android.app.AlarmManager that the device will be set to.

ExtraProvisioningUseMobileData

A boolean extra indicating if mobile data should be used during the provisioning flow for downloading the admin app.

ExtraProvisioningWifiAnonymousIdentity

The anonymous identity of the wifi network in #EXTRA_PROVISIONING_WIFI_SSID.

ExtraProvisioningWifiCaCertificate

The CA certificate of the wifi network in #EXTRA_PROVISIONING_WIFI_SSID.

ExtraProvisioningWifiDomain

The domain of the wifi network in #EXTRA_PROVISIONING_WIFI_SSID.

ExtraProvisioningWifiEapMethod

The EAP method of the wifi network in #EXTRA_PROVISIONING_WIFI_SSID and could be one of PEAP, TLS, TTLS, PWD, SIM, AKA or AKA_PRIME.

ExtraProvisioningWifiHidden

A boolean extra indicating whether the wifi network in #EXTRA_PROVISIONING_WIFI_SSID is hidden or not.

ExtraProvisioningWifiIdentity

The identity of the wifi network in #EXTRA_PROVISIONING_WIFI_SSID.

ExtraProvisioningWifiPacUrl

A String extra holding the proxy auto-config (PAC) URL for the wifi network in #EXTRA_PROVISIONING_WIFI_SSID.

ExtraProvisioningWifiPassword

A String extra holding the password of the wifi network in #EXTRA_PROVISIONING_WIFI_SSID.

ExtraProvisioningWifiPhase2Auth

The phase 2 authentication of the wifi network in #EXTRA_PROVISIONING_WIFI_SSID and could be one of NONE, PAP, MSCHAP, MSCHAPV2, GTC, SIM, AKA or AKA_PRIME.

ExtraProvisioningWifiProxyBypass

A String extra holding the proxy bypass for the wifi network in #EXTRA_PROVISIONING_WIFI_SSID.

ExtraProvisioningWifiProxyHost

A String extra holding the proxy host for the wifi network in #EXTRA_PROVISIONING_WIFI_SSID.

ExtraProvisioningWifiProxyPort

An int extra holding the proxy port for the wifi network in #EXTRA_PROVISIONING_WIFI_SSID.

ExtraProvisioningWifiSecurityType

A String extra indicating the security type of the wifi network in #EXTRA_PROVISIONING_WIFI_SSID and could be one of NONE, WPA, WEP or EAP.

ExtraProvisioningWifiSsid

A String extra holding the ssid of the wifi network that should be used during nfc device owner provisioning for downloading the mobile device management application.

ExtraProvisioningWifiUserCertificate

The user certificate of the wifi network in #EXTRA_PROVISIONING_WIFI_SSID.

ExtraResourceIds

An integer array extra for #ACTION_DEVICE_POLICY_RESOURCE_UPDATED to indicate which resource IDs (see DevicePolicyResources.Drawables and DevicePolicyResources.Strings) have been updated.

ExtraResourceType

An int extra for #ACTION_DEVICE_POLICY_RESOURCE_UPDATED to indicate the type of the resource being updated, the type can be #EXTRA_RESOURCE_TYPE_DRAWABLE or #EXTRA_RESOURCE_TYPE_STRING

ExtraResourceTypeDrawable
Obsolete.

A int value for #EXTRA_RESOURCE_TYPE to indicate that a resource of type Drawable is being updated.

ExtraResourceTypeString
Obsolete.

A int value for #EXTRA_RESOURCE_TYPE to indicate that a resource of type String is being updated.

ExtraResultLaunchIntent

An Intent result extra specifying the Intent to be launched after provisioning is finalized.

FlagEvictCredentialEncryptionKey
Obsolete.

Flag for #lockNow(int): also evict the user's credential encryption key from the keyring.

FlagManagedCanAccessParent
Obsolete.

Flag used by #addCrossProfileIntentFilter to allow activities in the managed profile to access intents sent from the parent profile.

FlagParentCanAccessManaged
Obsolete.

Flag used by #addCrossProfileIntentFilter to allow activities in the parent profile to access intents sent from the managed profile.

IdTypeBaseInfo
Obsolete.

Specifies that the device should attest its manufacturer details.

IdTypeImei
Obsolete.

Specifies that the device should attest its IMEI.

IdTypeIndividualAttestation
Obsolete.

Specifies that the device should attest using an individual attestation certificate.

IdTypeMeid
Obsolete.

Specifies that the device should attest its MEID.

IdTypeSerial
Obsolete.

Specifies that the device should attest its serial number.

InstallkeyRequestCredentialsAccess
Obsolete.

Specifies that the calling app should be granted access to the installed credentials immediately.

InstallkeySetUserSelectable
Obsolete.

Specifies that a user can select the key via the Certificate Selection prompt.

KeyguardDisableBiometrics
Obsolete.

Disable all biometric authentication on keyguard secure screens (e.

KeyguardDisableFace
Obsolete.

Disable face authentication on keyguard secure screens (e.

KeyguardDisableFeaturesAll
Obsolete.

Disable all current and future keyguard customizations.

KeyguardDisableFeaturesNone
Obsolete.

Widgets are enabled in keyguard

KeyguardDisableFingerprint
Obsolete.

Disable fingerprint authentication on keyguard secure screens (e.

KeyguardDisableIris
Obsolete.

Disable iris authentication on keyguard secure screens (e.

KeyguardDisableRemoteInput

Disable text entry into notifications on secure keyguard screens (e.

KeyguardDisableSecureCamera
Obsolete.

Disable the camera on secure keyguard screens (e.

KeyguardDisableSecureNotifications
Obsolete.

Disable showing all notifications on secure keyguard screens (e.

KeyguardDisableShortcutsAll
Obsolete.

Disable all keyguard shortcuts.

KeyguardDisableTrustAgents
Obsolete.

Disable trust agents on secure keyguard screens (e.

KeyguardDisableUnredactedNotifications
Obsolete.

Only allow redacted notifications on secure keyguard screens (e.

KeyguardDisableWidgetsAll
Obsolete.

Disable all keyguard widgets.

LeaveAllSystemAppsEnabled
Obsolete.

Flag used by #createAndManageUser to specify that the newly created user should skip the disabling of system apps during provisioning.

LockTaskFeatureBlockActivityStartInTask
Obsolete.

Enable blocking of non-allowlisted activities from being started into a locked task.

LockTaskFeatureGlobalActions
Obsolete.

Enable the global actions dialog during LockTask mode.

LockTaskFeatureHome
Obsolete.

Enable the Home button during LockTask mode.

LockTaskFeatureKeyguard
Obsolete.

Enable the keyguard during LockTask mode.

LockTaskFeatureNone
Obsolete.

Disable all configurable SystemUI features during LockTask mode.

LockTaskFeatureNotifications
Obsolete.

Enable notifications during LockTask mode.

LockTaskFeatureOverview
Obsolete.

Enable the Overview button and the Overview screen during LockTask mode.

LockTaskFeatureSystemInfo
Obsolete.

Enable the system info area in the status bar during LockTask mode.

MakeUserEphemeral
Obsolete.

Flag used by #createAndManageUser to specify that the user should be created ephemeral.

MimeTypeProvisioningNfc

This MIME type is used for starting the device owner provisioning.

MteDisabled
Obsolete.

Require that MTE be disabled on the device.

MteEnabled
Obsolete.

Require that MTE be enabled on the device, if supported.

MteNotControlledByPolicy
Obsolete.

Allow the user to choose whether to enable MTE on the device.

NearbyStreamingDisabled
Obsolete.

Indicates that nearby streaming is disabled.

NearbyStreamingEnabled
Obsolete.

Indicates that nearby streaming is enabled.

NearbyStreamingNotControlledByPolicy
Obsolete.

Indicates that nearby streaming is not controlled by policy, which means nearby streaming is allowed.

NearbyStreamingSameManagedAccountOnly
Obsolete.

Indicates that nearby streaming is enabled only to devices offering a comparable level of security, with the same authenticated managed account.

OperationSafetyReasonDrivingDistraction
Obsolete.

Indicates that a UnsafeStateException was thrown because the operation would distract the driver of the vehicle.

PasswordComplexityHigh
Obsolete.

Constant for #getPasswordComplexity() and #setRequiredPasswordComplexity(int).

PasswordComplexityLow
Obsolete.

Constant for #getPasswordComplexity() and #setRequiredPasswordComplexity(int).

PasswordComplexityMedium
Obsolete.

Constant for #getPasswordComplexity() and #setRequiredPasswordComplexity(int).

PasswordComplexityNone
Obsolete.

Constant for #getPasswordComplexity() and #setRequiredPasswordComplexity(int): no password.

PersonalAppsNotSuspended
Obsolete.

Return value for #getPersonalAppsSuspendedReasons when personal apps are not suspended.

PersonalAppsSuspendedExplicitly
Obsolete.

Flag for #getPersonalAppsSuspendedReasons return value.

PersonalAppsSuspendedProfileTimeout
Obsolete.

Flag for #getPersonalAppsSuspendedReasons return value.

PolicyDisableCamera

Constant to indicate the feature of disabling the camera.

PolicyDisableScreenCapture

Constant to indicate the feature of disabling screen captures.

PrivateDnsModeOff
Obsolete.

Specifies that Private DNS was turned off completely.

PrivateDnsModeOpportunistic
Obsolete.

Specifies that the device owner requested opportunistic DNS over TLS

PrivateDnsModeProviderHostname
Obsolete.

Specifies that the device owner configured a specific host to use for Private DNS.

PrivateDnsModeUnknown
Obsolete.

Specifies that the Private DNS setting is in an unknown state.

PrivateDnsSetErrorFailureSetting
Obsolete.

General failure to set the Private DNS mode, not due to one of the reasons listed above.

PrivateDnsSetErrorHostNotServing
Obsolete.

If the privateDnsHost provided was of a valid hostname but that host was found to not support DNS-over-TLS.

PrivateDnsSetNoError
Obsolete.

The selected mode has been set successfully.

ProvisioningModeFullyManagedDevice

The provisioning mode for fully managed device.

ProvisioningModeManagedProfile

The provisioning mode for managed profile.

ProvisioningModeManagedProfileOnPersonalDevice

The provisioning mode for a managed profile on a personal device.

ResetPasswordDoNotAskCredentialsOnBoot
Obsolete.

Flag for #resetPasswordWithToken and #resetPassword: don't ask for user credentials on device boot.

ResetPasswordRequireEntry
Obsolete.

Flag for #resetPasswordWithToken and #resetPassword: don't allow other admins to change the password again until the user has entered it.

SkipSetupWizard
Obsolete.

Flag used by #createAndManageUser to skip setup wizard after creating a new user.

WifiSecurityEnterprise192
Obsolete.

Constant for #getMinimumRequiredWifiSecurityLevel() and #setMinimumRequiredWifiSecurityLevel(int): enterprise 192 bit network.

WifiSecurityEnterpriseEap
Obsolete.

Constant for #getMinimumRequiredWifiSecurityLevel() and #setMinimumRequiredWifiSecurityLevel(int): enterprise EAP network.

WifiSecurityOpen
Obsolete.

Constant for #getMinimumRequiredWifiSecurityLevel() and #setMinimumRequiredWifiSecurityLevel(int): no minimum security level.

WifiSecurityPersonal
Obsolete.

Constant for #getMinimumRequiredWifiSecurityLevel() and #setMinimumRequiredWifiSecurityLevel(int): personal network such as WEP, WPA2-PSK.

WipeEuicc
Obsolete.

Flag for #wipeData(int): also erase the device's eUICC data.

WipeExternalStorage
Obsolete.

Flag for #wipeData(int): also erase the device's external storage (such as SD cards).

WipeResetProtectionData
Obsolete.

Flag for #wipeData(int): also erase the factory reset protection data.

WipeSilently

Flag for #wipeData(int): won't show reason for wiping to the user.

Properties

ActiveAdmins

Return a list of all currently active device administrators' component names.

AutoTimeRequired

This member is deprecated.

Class

Returns the runtime class of this Object.

(Inherited from Object)
CredentialManagerPolicy

Called by a device owner or profile owner of a managed profile to retrieve the credential manager policy. -or- Called by a device owner or profile owner of a managed profile to set the credential manager policy.

CurrentFailedPasswordAttempts

Retrieve the number of times the user has failed at entering a password since that last successful password entry.

DeviceOwnerLockScreenInfo
DeviceOwnerLockScreenInfoFormatted
DevicePolicyManagementRoleHolderPackage

Returns the package name of the device policy management role holder.

EnrollmentSpecificId

Returns an enrollment-specific identifier of this device, which is guaranteed to be the same value for the same device, enrolled into the same organization by the same managing app.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsActivePasswordSufficient

Determines whether the calling user's current password meets policy requirements (e.

IsActivePasswordSufficientForDeviceRequirement

Called by profile owner of a managed profile to determine whether the current device password meets policy requirements set explicitly device-wide.

IsAffiliatedUser

Returns whether this user is affiliated with the device.

IsCallerApplicationRestrictionsManagingPackage

Called by any application to find out whether it has been granted permission via #setApplicationRestrictionsManagingPackage to manage application restrictions for the calling user.

IsComplianceAcknowledgementRequired

Called by a profile owner of an organization-owned managed profile to query whether it needs to acknowledge device compliance to allow the user to turn the profile off if needed according to the maximum profile time off policy.

IsDeviceFinanced

Returns true if this device is marked as a financed device.

IsDeviceIdAttestationSupported

Returns true if the device supports attestation of device identifiers in addition to key attestation.

IsLogoutEnabled

Returns whether logout is enabled by a device owner.

IsOrganizationOwnedDeviceWithManagedProfile

Apps can use this method to find out if the device was provisioned as organization-owend device with a managed profile.

IsStatusBarDisabled

Returns whether the status bar is disabled/enabled, see #setStatusBarDisabled.

IsUniqueDeviceAttestationSupported

Returns true if the StrongBox Keymaster implementation on the device was provisioned with an individual attestation certificate and can sign attestation records using it (as attestation using an individual attestation certificate is a feature only Keymaster implementations with StrongBox security level can implement).

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
ManagedProfileCallerIdAccessPolicy

Called by a profile owner of a managed profile to retrieve the caller id policy. -or- Called by a profile owner of a managed profile to set the packages that are allowed to lookup contacts in the managed profile based on caller id information.

ManagedProfileContactsAccessPolicy

Called by a profile owner of a managed profile to determine the current policy applied to managed profile contacts. -or- Called by a profile owner of a managed profile to set the packages that are allowed access to the managed profile contacts from the parent user.

ManagedSubscriptionsPolicy

Returns the current ManagedSubscriptionsPolicy. -or- Called by a profile owner of an organization-owned device to specify ManagedSubscriptionsPolicy

MinimumRequiredWifiSecurityLevel

Returns the current Wi-Fi minimum security level. -or- Called by device owner or profile owner of an organization-owned managed profile to specify the minimum security level required for Wi-Fi networks.

MtePolicy

Called by a device owner, profile owner of an organization-owned device to get the Memory Tagging Extension (MTE) policy

        <a href="https://source.android.com/docs/security/test/memory-safety/arm-mte">
        Learn more about MTE</a> -or- Called by a device owner, profile owner of an organization-owned device, to set the Memory
        Tagging Extension (MTE) policy.
NearbyAppStreamingPolicy

Returns the current runtime nearby app streaming policy set by the device or profile owner. -or- Called by a device/profile owner to set nearby app streaming policy.

NearbyNotificationStreamingPolicy

Returns the current runtime nearby notification streaming policy set by the device or profile owner. -or- Called by a device/profile owner to set nearby notification streaming policy.

PasswordComplexity

Returns how complex the current user's screen lock is.

PeerReference (Inherited from Object)
PreferentialNetworkServiceConfigs

Get preferential network configuration PreferentialNetworkServiceConfig -or- Sets preferential network configurations.

PreferentialNetworkServiceEnabled

Indicates whether preferential network service is enabled. -or- Sets whether preferential network service is enabled.

RequiredPasswordComplexity

Gets the password complexity requirement set by #setRequiredPasswordComplexity(int), for the current user. -or- Sets a minimum password complexity requirement for the user's screen lock.

Resources

Returns a DevicePolicyResourcesManager containing the required APIs to set, reset, and get device policy related resources.

StorageEncryptionStatus

Called by an application that is administering the device to determine the current encryption status of the device.

SystemUpdatePolicy

Retrieve a local system update policy set previously by #setSystemUpdatePolicy.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

TransferOwnershipBundle

Returns the data passed from the current administrator to the new administrator during an ownership transfer.

UsbDataSignalingEnabled

Returns whether USB data signaling is currently enabled. -or- Called by a device owner or profile owner of an organization-owned managed profile to enable or disable USB data signaling for the device.

UserRestrictionsGlobally

Called by a profile or device owner to get global user restrictions set with #addUserRestrictionGlobally(String).

WifiSsidPolicy

Returns the current Wi-Fi SSID policy. -or- Called by device owner or profile owner of an organization-owned managed profile to specify the Wi-Fi SSID policy (WifiSsidPolicy).

Methods

AcknowledgeDeviceCompliant()

Called by a profile owner of an organization-owned managed profile to acknowledge that the device is compliant and the user can turn the profile off if needed according to the maximum time off policy.

AddCrossProfileIntentFilter(ComponentName, IntentFilter, DevicePolicyManagerFlags)

Called by the profile owner of a managed profile so that some intents sent in the managed profile can also be resolved in the parent, or vice versa.

AddCrossProfileWidgetProvider(ComponentName, String)

Called by the profile owner of a managed profile or a holder of the permission android.Manifest.permission#MANAGE_DEVICE_POLICY_PROFILE_INTERACTION to enable widget providers from a given package to be available in the parent profile.

AddOverrideApn(ComponentName, ApnSetting)

Called by device owner or managed profile owner to add an override APN.

AddPersistentPreferredActivity(ComponentName, IntentFilter, ComponentName)

Called by a profile owner or device owner or holder of the permission android.Manifest.permission#MANAGE_DEVICE_POLICY_LOCK_TASK.

AddUserRestriction(ComponentName, String)

Called by a profile owner, device owner or a holder of any permission that is associated with a user restriction to set a user restriction specified by the key.

AddUserRestrictionGlobally(String)

Called by a profile owner, device owner or a holder of any permission that is associated with a user restriction to set a user restriction specified by the provided key globally on all users.

BindDeviceAdminServiceAsUser(ComponentName, Intent, IServiceConnection, Bind, UserHandle)

Called by a device owner to bind to a service from a secondary managed user or vice versa.

BindDeviceAdminServiceAsUser(ComponentName, Intent, IServiceConnection, Context+BindServiceFlags, UserHandle)
CanAdminGrantSensorsPermissions()

Returns true if the caller is running on a device where an admin can grant permissions related to device sensors.

CanUsbDataSignalingBeDisabled()

Returns whether enabling or disabling USB data signaling is supported on the device.

ClearApplicationUserData(ComponentName, String, IExecutor, DevicePolicyManager+IOnClearApplicationUserDataListener)

Called by the device owner or profile owner to clear application user data of a given package.

ClearCrossProfileIntentFilters(ComponentName)

Called by a profile owner of a managed profile to remove the cross-profile intent filters that go from the managed profile to the parent, or from the parent to the managed profile.

ClearDeviceOwnerApp(String)

Clears the current device owner.

ClearPackagePersistentPreferredActivities(ComponentName, String)

Called by a profile owner or device owner or holder of the permission android.Manifest.permission#MANAGE_DEVICE_POLICY_LOCK_TASK to remove all persistent intent handler preferences associated with the given package that were set by #addPersistentPreferredActivity.

ClearProfileOwner(ComponentName)

Clears the active profile owner.

ClearResetPasswordToken(ComponentName)

Called by a profile, device owner or holder of the permission android.Manifest.permission#MANAGE_DEVICE_POLICY_RESET_PASSWORD to revoke the current password reset token.

ClearUserRestriction(ComponentName, String)

Called by a profile owner, device owner or a holder of any permission that is associated with a user restriction to clear a user restriction specified by the key.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CreateAdminSupportIntent(String)

Called by any app to display a support dialog when a feature was disabled by an admin.

CreateAndInitializeUser(ComponentName, String, String, ComponentName, Bundle)

Called by a device owner to create a user with the specified name.

CreateAndManageUser(ComponentName, String, ComponentName, PersistableBundle, UserManagementFlags)

Called by a device owner to create a user with the specified name and a given component of the calling package as profile owner.

CreateUser(ComponentName, String)

Called by a device owner to create a user with the specified name.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
EnableSystemApp(ComponentName, Intent)

Re-enable system apps by intent that were disabled by default when the user was initialized.

EnableSystemApp(ComponentName, String)

Re-enable a system app that was disabled by default when the user was initialized.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
FromContext(Context)
GenerateKeyPair(ComponentName, String, KeyGenParameterSpec, IdAttestationFlags)

This API can be called by the following to generate a new private/public key pair: <ul> <li>Device owner</li> <li>Profile owner</li> <li>Delegated certificate installer</li> <li>Credential management app</li> <li>An app that holds the android.Manifest.permission#MANAGE_DEVICE_POLICY_CERTIFICATES permission</li> </ul> If the device supports key generation via secure hardware, this method is useful for creating a key in KeyChain that never left the secure hardware.

GetAccountTypesWithManagementDisabled()

Gets the array of accounts for which account management is disabled by the profile owner or device owner.

GetAffiliationIds(ComponentName)

Returns the set of affiliation ids previously set via #setAffiliationIds, or an empty set if none have been set.

GetAlwaysOnVpnLockdownWhitelist(ComponentName)

Called by device or profile owner to query the set of packages that are allowed to access the network directly when always-on VPN is in lockdown mode but not connected.

GetAlwaysOnVpnPackage(ComponentName)

Called by a device or profile owner to read the name of the package administering an always-on VPN connection for the current user.

GetApplicationRestrictions(ComponentName, String)

Retrieves the application restrictions for a given target application running in the calling user.

GetApplicationRestrictionsManagingPackage(ComponentName)

Called by a profile owner or device owner to retrieve the application restrictions managing package for the current user, or null if none is set.

GetAutoTimeEnabled(ComponentName)

Returns true if auto time is enabled on the device.

GetAutoTimeZoneEnabled(ComponentName)

Returns true if auto time zone is enabled on the device.

GetBindDeviceAdminTargetUsers(ComponentName)

Returns the list of target users that the calling device owner or owner of secondary user can use when calling #bindDeviceAdminServiceAsUser.

GetBluetoothContactSharingDisabled(ComponentName)

Called by a profile owner of a managed profile to determine whether or not Bluetooth devices cannot access enterprise contacts.

GetCameraDisabled(ComponentName)

Determine whether or not the device's cameras have been disabled for this user, either by the calling admin, if specified, or all admins.

GetCertInstallerPackage(ComponentName)

Called by a profile owner or device owner to retrieve the certificate installer for the user, or null if none is set.

GetCrossProfileCalendarPackages(ComponentName)

Gets a set of package names that are allowed to access cross-profile calendar APIs.

GetCrossProfileCallerIdDisabled(ComponentName)

Called by a profile owner of a managed profile to determine whether or not caller-Id information has been disabled.

GetCrossProfileContactsSearchDisabled(ComponentName)

Called by a profile owner of a managed profile to determine whether or not contacts search has been disabled.

GetCrossProfilePackages(ComponentName)

Returns the set of package names that the admin has previously set as allowed to request user consent for cross-profile communication, via #setCrossProfilePackages(ComponentName, Set).

GetCrossProfileWidgetProviders(ComponentName)

Called by the profile owner of a managed profile or a holder of the permission android.Manifest.permission#MANAGE_DEVICE_POLICY_PROFILE_INTERACTION to query providers from which packages are available in the parent profile.

GetDelegatedScopes(ComponentName, String)

Called by a profile owner or device owner to retrieve a list of the scopes given to a delegate package.

GetDelegatePackages(ComponentName, String)

Called by a profile owner or device owner to retrieve a list of delegate packages that were granted a delegation scope.

GetEndUserSessionMessage(ComponentName)

Returns the user session end message.

GetEndUserSessionMessageFormatted(ComponentName)

Returns the user session end message.

GetFactoryResetProtectionPolicy(ComponentName)

Callable by device owner or profile owner of an organization-owned device, to retrieve the current factory reset protection (FRP) policy set previously by #setFactoryResetProtectionPolicy.

GetGlobalPrivateDnsHost(ComponentName)

Returns the system-wide Private DNS host.

GetGlobalPrivateDnsMode(ComponentName)

Returns the system-wide Private DNS mode.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetInstalledCaCerts(ComponentName)

Returns all CA certificates that are currently trusted, excluding system CA certificates.

GetKeepUninstalledPackages(ComponentName)

Get the list of apps to keep around as APKs even if no user has currently installed it.

GetKeyguardDisabledFeatures(ComponentName)

Determine whether or not features have been disabled in keyguard either by the calling admin, if specified, or all admins that set restrictions on this user and its participating profiles.

GetKeyPairGrants(String)

Called by a device or profile owner, or delegated certificate chooser (an app that has been delegated the #DELEGATION_CERT_SELECTION privilege), to query which apps have access to a given KeyChain key.

GetLockTaskFeatures(ComponentName)

Gets which system features are enabled for LockTask mode.

GetLockTaskPackages(ComponentName)

Returns the list of packages allowed to start the lock task mode.

GetLongSupportMessage(ComponentName)

Called by a device admin to get the long support message.

GetLongSupportMessageFormatted(ComponentName)

Called by a device admin to get the long support message.

GetManagedProfileMaximumTimeOff(ComponentName)

Called by a profile owner of an organization-owned managed profile to get maximum time the profile is allowed to be turned off.

GetMaximumFailedPasswordsForWipe(ComponentName)

Retrieve the current maximum number of login attempts that are allowed before the device or profile is wiped, for a particular admin or all admins that set restrictions on this user and its participating profiles.

GetMaximumTimeToLock(ComponentName)

Retrieve the current maximum time to unlock for a particular admin or all admins that set restrictions on this user and its participating profiles.

GetMeteredDataDisabledPackages(ComponentName)

Called by a device or profile owner to retrieve the list of packages which are restricted by the admin from using metered data.

GetOrganizationColor(ComponentName)

Called by a profile owner of a managed profile to retrieve the color used for customization.

GetOrganizationName(ComponentName)

Called by the device owner (since API 26) or profile owner (since API 24) or holders of the permission android.Manifest.permission#MANAGE_DEVICE_POLICY_ORGANIZATION_IDENTITY to retrieve the name of the organization under management.

        @param admin Which {@link DeviceAdminReceiver</code> this request is associated with.
GetOrganizationNameFormatted(ComponentName)

Called by the device owner (since API 26) or profile owner (since API 24) or holders of the permission android.Manifest.permission#MANAGE_DEVICE_POLICY_ORGANIZATION_IDENTITY to retrieve the name of the organization under management.

        @param admin Which {@link DeviceAdminReceiver</code> this request is associated with.
GetOverrideApns(ComponentName)

Called by device owner or managed profile owner to get all override APNs inserted by device owner or managed profile owner previously using #addOverrideApn.

GetParentProfileInstance(ComponentName)

Called by the profile owner of a managed profile to obtain a DevicePolicyManager whose calls act on the parent profile.

GetPasswordExpiration(ComponentName)

Get the current password expiration time for a particular admin or all admins that set restrictions on this user and its participating profiles.

GetPasswordExpirationTimeout(ComponentName)

Get the password expiration timeout for the given admin.

GetPasswordHistoryLength(ComponentName)

Retrieve the current password history length for a particular admin or all admins that set restrictions on this user and its participating profiles.

GetPasswordMaximumLength(PasswordQuality)

Return the maximum password length that the device supports for a particular password quality.

GetPasswordMinimumLength(ComponentName)

Retrieve the current minimum password length for a particular admin or all admins that set restrictions on this user and its participating profiles.

GetPasswordMinimumLetters(ComponentName)

Retrieve the current number of letters required in the password for a particular admin or all admins that set restrictions on this user and its participating profiles.

GetPasswordMinimumLowerCase(ComponentName)

Retrieve the current number of lower case letters required in the password for a particular admin or all admins that set restrictions on this user and its participating profiles.

GetPasswordMinimumNonLetter(ComponentName)

Retrieve the current number of non-letter characters required in the password for a particular admin or all admins that set restrictions on this user and its participating profiles.

GetPasswordMinimumNumeric(ComponentName)

Retrieve the current number of numerical digits required in the password for a particular admin or all admins that set restrictions on this user and its participating profiles.

GetPasswordMinimumSymbols(ComponentName)

Retrieve the current number of symbols required in the password for a particular admin or all admins that set restrictions on this user and its participating profiles.

GetPasswordMinimumUpperCase(ComponentName)

Retrieve the current number of upper case letters required in the password for a particular admin or all admins that set restrictions on this user and its participating profiles.

GetPasswordQuality(ComponentName)

Retrieve the current minimum password quality for a particular admin or all admins that set restrictions on this user and its participating profiles.

GetPendingSystemUpdate(ComponentName)

Called by device or profile owners to get information about a pending system update.

GetPermissionGrantState(ComponentName, String, String)

Returns the current grant state of a runtime permission for a specific application.

GetPermissionPolicy(ComponentName)

Returns the current runtime permission policy set by the device or profile owner.

GetPermittedAccessibilityServices(ComponentName)

Returns the list of permitted accessibility services set by this device or profile owner.

GetPermittedCrossProfileNotificationListeners(ComponentName)

Returns the list of packages installed on the primary user that allowed to use a android.service.notification.NotificationListenerService to receive notifications from this managed profile, as set by the profile owner.

GetPermittedInputMethods(ComponentName)

Returns the list of permitted input methods set by this device or profile owner.

GetPersonalAppsSuspendedReasons(ComponentName)

Called by profile owner of an organization-owned managed profile to check whether personal apps are suspended.

GetRequiredStrongAuthTimeout(ComponentName)

Determine for how long the user will be able to use secondary, non strong auth for authentication, since last strong method authentication (password, pin or pattern) was used.

GetScreenCaptureDisabled(ComponentName)

Determine whether or not screen capture has been disabled by the calling admin, if specified, or all admins.

GetSecondaryUsers(ComponentName)

Called by a device owner to list all secondary users on the device.

GetShortSupportMessage(ComponentName)

Called by a device admin or holder of the permission android.Manifest.permission#MANAGE_DEVICE_POLICY_SUPPORT_MESSAGE to get the short support message.

GetShortSupportMessageFormatted(ComponentName)

Called by a device admin or holder of the permission android.Manifest.permission#MANAGE_DEVICE_POLICY_SUPPORT_MESSAGE to get the short support message.

GetStartUserSessionMessage(ComponentName)

Returns the user session start message.

GetStartUserSessionMessageFormatted(ComponentName)

Returns the user session start message.

GetStorageEncryption(ComponentName)

This member is deprecated.

GetTrustAgentConfiguration(ComponentName, ComponentName)

Gets configuration for the given trust agent based on aggregating all calls to #setTrustAgentConfiguration(ComponentName, ComponentName, PersistableBundle) for all device admins.

GetUserControlDisabledPackages(ComponentName)

Returns the list of packages over which user control is disabled by a device or profile owner or holders of the permission android.Manifest.permission#MANAGE_DEVICE_POLICY_APPS_CONTROL.

GetUserRestrictions(ComponentName)

Called by an admin to get user restrictions set by themselves with #addUserRestriction(ComponentName, String).

GetWifiMacAddress(ComponentName)

Called by a device owner or profile owner on organization-owned device to get the MAC address of the Wi-Fi device.

GrantKeyPairToApp(ComponentName, String, String)

Called by a device or profile owner, or delegated certificate chooser (an app that has been delegated the #DELEGATION_CERT_SELECTION privilege), to grant an application access to an already-installed (or generated) KeyChain key.

GrantKeyPairToWifiAuth(String)

Called by a device or profile owner, or delegated certificate chooser (an app that has been delegated the #DELEGATION_CERT_SELECTION privilege), to allow using a KeyChain key pair for authentication to Wifi networks.

HasCaCertInstalled(ComponentName, Byte[])

Returns whether this certificate is installed as a trusted CA.

HasGrantedPolicy(ComponentName, DeviceAdminUses)

Returns true if an administrator has been granted a particular device policy.

HasKeyPair(String)

This API can be called by the following to query whether a certificate and private key are installed under a given alias: <ul> <li>Device owner</li> <li>Profile owner</li> <li>Delegated certificate installer</li> <li>Credential management app</li> <li>An app that holds the android.Manifest.permission#MANAGE_DEVICE_POLICY_CERTIFICATES permission</li> </ul>

        If called by the credential management app, the alias must exist in the credential
        management app's <code data-dev-comment-type="c">android.security.AppUriAuthenticationPolicy</code>.
HasLockdownAdminConfiguredNetworks(ComponentName)

Called by a device owner or a profile owner of an organization-owned managed profile to determine whether the user is prevented from modifying networks configured by the admin.

InstallCaCert(ComponentName, Byte[])

Installs the given certificate as a user CA.

InstallExistingPackage(ComponentName, String)

Install an existing package that has been installed in another user, or has been kept after removal via #setKeepUninstalledPackages.

InstallKeyPair(ComponentName, IPrivateKey, Certificate, String)

This API can be called by the following to install a certificate and corresponding private key: <ul> <li>Device owner</li> <li>Profile owner</li> <li>Delegated certificate installer</li> <li>Credential management app</li> <li>An app that holds the android.Manifest.permission#MANAGE_DEVICE_POLICY_CERTIFICATES permission</li> </ul> All apps within the profile will be able to access the certificate and use the private key, given direct user approval.

InstallKeyPair(ComponentName, IPrivateKey, Certificate[], String, Boolean)

This API can be called by the following to install a certificate chain and corresponding private key for the leaf certificate: <ul> <li>Device owner</li> <li>Profile owner</li> <li>Delegated certificate installer</li> <li>Credential management app</li> <li>An app that holds the android.Manifest.permission#MANAGE_DEVICE_POLICY_CERTIFICATES permission</li> </ul> All apps within the profile will be able to access the certificate chain and use the private key, given direct user approval.

InstallKeyPair(ComponentName, IPrivateKey, Certificate[], String, InstallKeyFlags)

This API can be called by the following to install a certificate chain and corresponding private key for the leaf certificate: <ul> <li>Device owner</li> <li>Profile owner</li> <li>Delegated certificate installer</li> <li>Credential management app</li> <li>An app that holds the android.Manifest.permission#MANAGE_DEVICE_POLICY_CERTIFICATES permission</li> </ul> All apps within the profile will be able to access the certificate chain and use the private key, given direct user approval (if the user is allowed to select the private key).

InstallSystemUpdate(ComponentName, Uri, IExecutor, DevicePolicyManager+InstallSystemUpdateCallback)

Called by device owner or profile owner of an organization-owned managed profile to install a system update from the given file.

IsAdminActive(ComponentName)

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

IsAlwaysOnVpnLockdownEnabled(ComponentName)

Called by device or profile owner to query whether current always-on VPN is configured in lockdown mode.

IsApplicationHidden(ComponentName, String)

Determine if a package is hidden.

IsBackupServiceEnabled(ComponentName)

Return whether the backup service is enabled by the device owner or profile owner for the current user, as previously set by #setBackupServiceEnabled(ComponentName, boolean).

IsCommonCriteriaModeEnabled(ComponentName)

Returns whether Common Criteria mode is currently enabled.

IsDeviceOwnerApp(String)

Used to determine if a particular package has been registered as a Device Owner app.

IsEphemeralUser(ComponentName)

Checks if the profile owner is running in an ephemeral user.

IsKeyPairGrantedToWifiAuth(String)

Called by a device or profile owner, or delegated certificate chooser (an app that has been delegated the #DELEGATION_CERT_SELECTION privilege), to query whether a KeyChain key pair can be used for authentication to Wifi networks.

IsLockTaskPermitted(String)

This function lets the caller know whether the given component is allowed to start the lock task mode.

IsManagedProfile(ComponentName)

Return if this user is a managed profile of another user.

IsMasterVolumeMuted(ComponentName)

Called by profile or device owners to check whether the global volume mute is on or off.

IsNetworkLoggingEnabled(ComponentName)

Return whether network logging is enabled by a device owner or profile owner of a managed profile.

IsOverrideApnEnabled(ComponentName)

Called by device owner to check if override APNs are currently enabled.

IsPackageSuspended(ComponentName, String)

Determine if a package is suspended.

IsProfileOwnerApp(String)

Used to determine if a particular package is registered as the profile owner for the user.

IsProvisioningAllowed(String)

Returns whether it is possible for the caller to initiate provisioning of a managed profile or device, setting itself as the device or profile owner.

IsResetPasswordTokenActive(ComponentName)

Called by a profile, device owner or a holder of the permission android.Manifest.permission#MANAGE_DEVICE_POLICY_RESET_PASSWORD to check if the current reset password token is active.

IsSafeOperation(Int32)

Checks if it's safe to run operations that can be affected by the given reason.

IsSecurityLoggingEnabled(ComponentName)

Return whether security logging is enabled or not by the admin.

IsUninstallBlocked(ComponentName, String)

Check whether the user has been blocked by device policy from uninstalling a package.

IsUsingUnifiedPassword(ComponentName)

When called by a profile owner of a managed profile returns true if the profile uses unified challenge with its parent user.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
ListForegroundAffiliatedUsers()

Gets the list of #isAffiliatedUser() affiliated users running on foreground.

LockNow()

Make the device lock immediately, as if the lock screen timeout has expired at the point of this call.

LockNow(DevicePolicyManagerFlags)

Make the device lock immediately, as if the lock screen timeout has expired at the point of this call.

LogoutUser(ComponentName)

Called by a profile owner of secondary user that is affiliated with the device to stop the calling user and switch back to primary user (when the user was #switchUser(ComponentName, UserHandle) switched to) or stop the user (when it was #startUserInBackground(ComponentName, UserHandle) started in background.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
Reboot(ComponentName)

Called by device owner to reboot the device.

RemoveActiveAdmin(ComponentName)

Remove a current administration component.

RemoveCrossProfileWidgetProvider(ComponentName, String)

Called by the profile owner of a managed profile or a holder of the permission android.Manifest.permission#MANAGE_DEVICE_POLICY_PROFILE_INTERACTION to disable widget providers from a given package to be available in the parent profile.

RemoveKeyPair(ComponentName, String)

This API can be called by the following to remove a certificate and private key pair installed under a given alias: <ul> <li>Device owner</li> <li>Profile owner</li> <li>Delegated certificate installer</li> <li>Credential management app</li> </ul>

RemoveOverrideApn(ComponentName, Int32)

Called by device owner or managed profile owner to remove an override APN.

RemoveUser(ComponentName, UserHandle)

Called by a device owner to remove a user/profile and all associated data.

RequestBugreport(ComponentName)

Called by a device owner to request a bugreport.

ResetPassword(String, ResetPasswordFlags)

Force a new password for device unlock (the password needed to access the entire device) or the work profile challenge on the current user.

ResetPasswordWithToken(ComponentName, String, Byte[], ResetPasswordFlags)

Called by device or profile owner to force set a new device unlock password or a managed profile challenge on current user.

RetrieveNetworkLogs(ComponentName, Int64)

Called by device owner, profile owner of a managed profile or delegated app with #DELEGATION_NETWORK_LOGGING to retrieve the most recent batch of network logging events.

RetrievePreRebootSecurityLogs(ComponentName)

Called by device owner or profile owner of an organization-owned managed profile to retrieve device logs from before the device's last reboot.

RetrieveSecurityLogs(ComponentName)

Called by device owner or profile owner of an organization-owned managed profile to retrieve all new security logging entries since the last call to this API after device boots.

RevokeKeyPairFromApp(ComponentName, String, String)

Called by a device or profile owner, or delegated certificate chooser (an app that has been delegated the #DELEGATION_CERT_SELECTION privilege), to revoke an application's grant to a KeyChain key pair.

RevokeKeyPairFromWifiAuth(String)

Called by a device or profile owner, or delegated certificate chooser (an app that has been delegated the #DELEGATION_CERT_SELECTION privilege), to deny using a KeyChain key pair for authentication to Wifi networks.

SetAccountManagementDisabled(ComponentName, String, Boolean)

Called by a device owner or profile owner to disable account management for a specific type of account.

SetAffiliationIds(ComponentName, ICollection<String>)

Indicates the entity that controls the device.

SetAlwaysOnVpnPackage(ComponentName, String, Boolean)

Called by a device or profile owner to configure an always-on VPN connection through a specific application for the current user.

SetAlwaysOnVpnPackage(ComponentName, String, Boolean, ICollection<String>)

A version of #setAlwaysOnVpnPackage(ComponentName, String, boolean) that allows the admin to specify a set of apps that should be able to access the network directly when VPN is not connected.

SetApplicationHidden(ComponentName, String, Boolean)

Hide or unhide packages.

SetApplicationRestrictions(ComponentName, String, Bundle)

Sets the application restrictions for a given target application running in the calling user.

SetApplicationRestrictionsManagingPackage(ComponentName, String)

Called by a profile owner or device owner to grant permission to a package to manage application restrictions for the calling user via #setApplicationRestrictions and #getApplicationRestrictions.

SetAutoTimeEnabled(ComponentName, Boolean)

Called by a device owner, a profile owner for the primary user or a profile owner of an organization-owned managed profile to turn auto time on and off.

SetAutoTimeRequired(ComponentName, Boolean)

Called by a device owner, or alternatively a profile owner from Android 8.

SetAutoTimeZoneEnabled(ComponentName, Boolean)

Called by a device owner, a profile owner for the primary user or a profile owner of an organization-owned managed profile to turn auto time zone on and off.

SetBackupServiceEnabled(ComponentName, Boolean)

Allows the device owner or profile owner to enable or disable the backup service.

SetBluetoothContactSharingDisabled(ComponentName, Boolean)

Called by a profile owner of a managed profile to set whether bluetooth devices can access enterprise contacts.

SetCameraDisabled(ComponentName, Boolean)

Called by an application that is administering the device to disable all cameras on the device, for this user.

SetCertInstallerPackage(ComponentName, String)

Called by a profile owner or device owner to grant access to privileged certificate manipulation APIs to a third-party certificate installer app.

SetCommonCriteriaModeEnabled(ComponentName, Boolean)

Called by device owner or profile owner of an organization-owned managed profile to toggle Common Criteria mode for the device.

SetConfiguredNetworksLockdownState(ComponentName, Boolean)

Called by a device owner or a profile owner of an organization-owned managed profile to control whether the user can change networks configured by the admin.

SetCrossProfileCalendarPackages(ComponentName, ICollection<String>)

Allows a set of packages to access cross-profile calendar APIs.

SetCrossProfileCallerIdDisabled(ComponentName, Boolean)

Called by a profile owner of a managed profile to set whether caller-Id information from the managed profile will be shown in the parent profile, for incoming calls.

SetCrossProfileContactsSearchDisabled(ComponentName, Boolean)

Called by a profile owner of a managed profile to set whether contacts search from the managed profile will be shown in the parent profile, for incoming calls.

SetCrossProfilePackages(ComponentName, ICollection<String>)

Sets the set of admin-allowlisted package names that are allowed to request user consent for cross-profile communication.

SetDefaultDialerApplication(String)

Must be called by a device owner or a profile owner of an organization-owned managed profile to set the default dialer application for the calling user.

SetDefaultSmsApplication(ComponentName, String)

Must be called by a device owner or a profile owner of an organization-owned managed profile to set the default SMS application.

SetDelegatedScopes(ComponentName, String, IList<String>)

Called by a profile owner or device owner to grant access to privileged APIs to another app.

SetDeviceOwnerLockScreenInfo(ComponentName, ICharSequence)

Sets the device owner information to be shown on the lock screen.

SetDeviceOwnerLockScreenInfo(ComponentName, String)

Sets the device owner information to be shown on the lock screen.

SetEndUserSessionMessage(ComponentName, ICharSequence)

Called by a device owner to specify the user session end message.

SetEndUserSessionMessage(ComponentName, String)

Called by a device owner to specify the user session end message.

SetFactoryResetProtectionPolicy(ComponentName, FactoryResetProtectionPolicy)

Callable by device owner or profile owner of an organization-owned device, to set a factory reset protection (FRP) policy.

SetGlobalPrivateDnsModeOpportunistic(ComponentName)

Sets the global Private DNS mode to opportunistic.

SetGlobalPrivateDnsModeSpecifiedHost(ComponentName, String)

Sets the global Private DNS host to be used.

SetGlobalSetting(ComponentName, String, String)

This method is mostly deprecated.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetKeepUninstalledPackages(ComponentName, IList<String>)

Set a list of apps to keep around as APKs even if no user has currently installed it.

SetKeyguardDisabled(ComponentName, Boolean)

Called by a device owner or profile owner of secondary users that is affiliated with the device to disable the keyguard altogether.

SetKeyguardDisabledFeatures(ComponentName, KeyguardDisable)

Called by an application that is administering the device to disable keyguard customizations, such as widgets.

SetKeyPairCertificate(ComponentName, String, IList<Certificate>, Boolean)

This API can be called by the following to associate certificates with a key pair that was generated using #generateKeyPair, and set whether the key is available for the user to choose in the certificate selection prompt: <ul> <li>Device owner</li> <li>Profile owner</li> <li>Delegated certificate installer</li> <li>Credential management app</li> </ul>

SetLocationEnabled(ComponentName, Boolean)

Called by device owners to set the user's global location setting.

SetLockTaskFeatures(ComponentName, LockTaskFeatures)

Sets which system features are enabled when the device runs in lock task mode.

SetLockTaskPackages(ComponentName, String[])

Sets which packages may enter lock task mode.

SetLogoutEnabled(ComponentName, Boolean)

Called by a device owner to specify whether logout is enabled for all secondary users.

SetLongSupportMessage(ComponentName, ICharSequence)

Called by a device admin to set the long support message.

SetLongSupportMessage(ComponentName, String)

Called by a device admin to set the long support message.

SetManagedProfileMaximumTimeOff(ComponentName, Int64)

Called by a profile owner of an organization-owned managed profile to set maximum time the profile is allowed to be turned off.

SetMasterVolumeMuted(ComponentName, Boolean)

Called by profile or device owners to set the global volume mute on or off.

SetMaximumFailedPasswordsForWipe(ComponentName, Int32)

Setting this to a value greater than zero enables a policy that will perform a device or profile wipe after too many incorrect device-unlock passwords have been entered.

SetMaximumTimeToLock(ComponentName, Int64)

Called by an application that is administering the device to set the maximum time for user activity until the device will lock.

SetMeteredDataDisabledPackages(ComponentName, IList<String>)

Called by a device or profile owner to restrict packages from using metered data.

SetNetworkLoggingEnabled(ComponentName, Boolean)

Called by a device owner, profile owner of a managed profile or delegated app with #DELEGATION_NETWORK_LOGGING to control the network logging feature.

SetOrganizationColor(ComponentName, Color)

Called by a profile owner of a managed profile to set the color used for customization.

SetOrganizationId(String)

Sets the Enterprise ID for the work profile or managed device.

SetOrganizationName(ComponentName, ICharSequence)

Called by the device owner (since API 26) or profile owner (since API 24) to set the name of the organization under management.

SetOrganizationName(ComponentName, String)

Called by the device owner (since API 26) or profile owner (since API 24) to set the name of the organization under management.

SetOverrideApnsEnabled(ComponentName, Boolean)

Called by device owner to set if override APNs should be enabled.

SetPackagesSuspended(ComponentName, String[], Boolean)

Called by device or profile owners to suspend packages for this user.

SetPasswordExpirationTimeout(ComponentName, Int64)

Called by a device admin to set the password expiration timeout.

SetPasswordHistoryLength(ComponentName, Int32)

Called by an application that is administering the device to set the length of the password history.

SetPasswordMinimumLength(ComponentName, Int32)

Called by an application that is administering the device to set the minimum allowed password length.

SetPasswordMinimumLetters(ComponentName, Int32)

Called by an application that is administering the device to set the minimum number of letters required in the password.

SetPasswordMinimumLowerCase(ComponentName, Int32)

Called by an application that is administering the device to set the minimum number of lower case letters required in the password.

SetPasswordMinimumNonLetter(ComponentName, Int32)

Called by an application that is administering the device to set the minimum number of non-letter characters (numerical digits or symbols) required in the password.

SetPasswordMinimumNumeric(ComponentName, Int32)

Called by an application that is administering the device to set the minimum number of numerical digits required in the password.

SetPasswordMinimumSymbols(ComponentName, Int32)

Called by an application that is administering the device to set the minimum number of symbols required in the password.

SetPasswordMinimumUpperCase(ComponentName, Int32)

Called by an application that is administering the device to set the minimum number of upper case letters required in the password.

SetPasswordQuality(ComponentName, PasswordQuality)

Called by an application that is administering the device to set the password restrictions it is imposing.

SetPermissionGrantState(ComponentName, String, String, PermissionGrantState)

Sets the grant state of a runtime permission for a specific application.

SetPermissionPolicy(ComponentName, PermissionPolicy)

Set the default response for future runtime permission requests by applications.

SetPermittedAccessibilityServices(ComponentName, IList<String>)

Called by a profile or device owner to set the permitted android.accessibilityservice.AccessibilityService.

SetPermittedCrossProfileNotificationListeners(ComponentName, IList<String>)

Called by a profile owner of a managed profile to set the packages that are allowed to use a android.service.notification.NotificationListenerService in the primary user to see notifications from the managed profile.

SetPermittedInputMethods(ComponentName, IList<String>)

Called by a profile or device owner or holder of the android.Manifest.permission#MANAGE_DEVICE_POLICY_INPUT_METHODS permission to set the permitted input methods services for this user.

SetPersonalAppsSuspended(ComponentName, Boolean)

Called by a profile owner of an organization-owned managed profile to suspend personal apps on the device.

SetProfileEnabled(ComponentName)

Sets the enabled state of the profile.

SetProfileName(ComponentName, String)

Sets the name of the profile.

SetRecommendedGlobalProxy(ComponentName, ProxyInfo)

Set a network-independent global HTTP proxy.

SetRequiredStrongAuthTimeout(ComponentName, Int64)

Called by a device/profile owner to set the timeout after which unlocking with secondary, non strong auth (e.

SetResetPasswordToken(ComponentName, Byte[])

Called by a profile or device owner to provision a token which can later be used to reset the device lockscreen password (if called by device owner), or managed profile challenge (if called by profile owner), via #resetPasswordWithToken.

SetRestrictionsProvider(ComponentName, ComponentName)

Designates a specific service component as the provider for making permission requests of a local or remote administrator of the user.

SetScreenCaptureDisabled(ComponentName, Boolean)

Called by a device/profile owner to set whether the screen capture is disabled.

SetSecureSetting(ComponentName, String, String)

This method is mostly deprecated.

SetSecurityLoggingEnabled(ComponentName, Boolean)

Called by device owner or a profile owner of an organization-owned managed profile to control the security logging feature.

SetShortSupportMessage(ComponentName, ICharSequence)

Called by a device admin to set the short support message.

SetShortSupportMessage(ComponentName, String)

Called by a device admin to set the short support message.

SetStartUserSessionMessage(ComponentName, ICharSequence)

Called by a device owner to specify the user session start message.

SetStartUserSessionMessage(ComponentName, String)

Called by a device owner to specify the user session start message.

SetStatusBarDisabled(ComponentName, Boolean)

Called by device owner or profile owner of secondary users that is affiliated with the device to disable the status bar.

SetStorageEncryption(ComponentName, Boolean)

This member is deprecated.

SetSystemSetting(ComponentName, String, String)

Called by a device or profile owner to update android.provider.Settings.System settings.

SetSystemUpdatePolicy(ComponentName, SystemUpdatePolicy)

Called by device owners or profile owners of an organization-owned managed profile to to set a local system update policy.

SetTime(ComponentName, Int64)

Called by a device owner or a profile owner of an organization-owned managed profile to set the system wall clock time.

SetTimeZone(ComponentName, String)

Called by a device owner or a profile owner of an organization-owned managed profile to set the system's persistent default time zone.

SetTrustAgentConfiguration(ComponentName, ComponentName, PersistableBundle)

Sets a list of configuration features to enable for a trust agent component.

SetUninstallBlocked(ComponentName, String, Boolean)

Change whether a user can uninstall a package.

SetUserControlDisabledPackages(ComponentName, IList<String>)

Called by a device owner or a profile owner or holder of the permission android.Manifest.permission#MANAGE_DEVICE_POLICY_APPS_CONTROL to disable user control over apps.

SetUserIcon(ComponentName, Bitmap)

Called by profile or device owners to set the user's photo.

StartUserInBackground(ComponentName, UserHandle)

Called by a device owner to start the specified secondary user in background.

StopUser(ComponentName, UserHandle)

Called by a device owner to stop the specified secondary user.

SwitchUser(ComponentName, UserHandle)

Called by a device owner to switch the specified secondary user to the foreground.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
TransferOwnership(ComponentName, ComponentName, PersistableBundle)

Changes the current administrator to another one.

UninstallAllUserCaCerts(ComponentName)

Uninstalls all custom trusted CA certificates from the profile.

UninstallCaCert(ComponentName, Byte[])

Uninstalls the given certificate from trusted user CAs, if present.

UnregisterFromRuntime() (Inherited from Object)
UpdateOverrideApn(ComponentName, Int32, ApnSetting)

Called by device owner or managed profile owner to update an override APN.

Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
WipeData(WipeDataFlags)

See #wipeData(int, CharSequence)

WipeData(WipeDataFlags, ICharSequence)

Ask that all user data be wiped.

WipeData(WipeDataFlags, String)

Ask that all user data be wiped.

WipeDevice(WipeDataFlags)

Ask that the device be wiped and factory reset.

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to