{
	"id": "57e1d7e9-94f1-4138-bbf0-0644ef83425e",
	"created_at": "2026-04-06T00:08:02.538436Z",
	"updated_at": "2026-04-10T13:11:55.208975Z",
	"deleted_at": null,
	"sha1_hash": "405023a95e5571b9cb2fd6770c99063586462921",
	"title": "DevicePolicyManager  |  API reference  |  Android Developers",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 3243512,
	"plain_text": "DevicePolicyManager  |  API reference  |  Android Developers\r\nArchived: 2026-04-05 17:08:50 UTC\r\nDevicePolicyManager Stay organized with collections Save and categorize content based\r\non your preferences.\r\npublic class DevicePolicyManager\r\nextends Object\r\nManages device policy and restrictions applied to the user of the device or apps running on the device.\r\nThis class contains three types of methods:\r\n1. Those aimed at managing apps\r\n2. Those aimed at the Device Policy Management Role Holder\r\n3. Those aimed at apps which wish to respect device policy\r\nThe intended caller for each API is indicated in its Javadoc.\r\nManaging Apps\r\nApps can be made capable of setting device policy (\"Managing Apps\") either by being set as a Device Administrator, being\r\nset as a Device Policy Controller, or by holding the appropriate Permissions.\r\nA Device Administrator is an app which is able to enforce device policies that it has declared in its device admin XML file.\r\nAn app can prompt the user to give it device administrator privileges using the ACTION_ADD_DEVICE_ADMIN action.\r\nFor more information about Device Administration, read the Device Administration developer guide.\r\nDevice Administrator apps can also be recognised as Device Policy Controllers. Device Policy Controllers can be one of\r\ntwo types:\r\nA Device Owner, which only ever exists on the System User or Main User, is the most powerful type of Device\r\nPolicy Controller and can affect policy across the device.\r\nA Profile Owner, which can exist on any user, can affect policy on the user it is on, and when it is running on a\r\nprofile has limited ability to affect policy on its parent.\r\nAdditional capabilities can be provided to Device Policy Controllers in the following circumstances:\r\nA Profile Owner on an organization owned device has access to additional abilities, both affecting policy on the\r\nprofile's parent and also the profile itself.\r\nA Profile Owner running on the System User has access to additional capabilities which affect the System User\r\nand also the whole device.\r\nA Profile Owner running on an affiliated user has capabilities similar to that of a Device Owner\r\nFor more information, see Building a Device Policy Controller.\r\nPermissions are generally only given to apps fulfilling particular key roles on the device (such as managing device\r\nlocks ).\r\nDevice Policy Management Role Holder\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 1 of 178\n\nOne app on the device fulfills the Device Policy Management Role and is trusted with managing the overall state of Device\r\nPolicy. This has access to much more powerful methods than managing apps.\r\nQuerying Device Policy\r\nIn most cases, regular apps do not need to concern themselves with device policy, and restrictions will be enforced\r\nautomatically. There are some cases where an app may wish to query device policy to provide a better user experience. Only\r\na small number of policies allow apps to query them directly. These APIs will typically have no special required\r\npermissions.\r\nManaged Provisioning\r\nManaged Provisioning is the process of recognising an app as a Device Owner or Profile Owner. It involves presenting\r\neducation and consent screens to the user to ensure they are aware of the capabilities this grants the Device Policy Controller\r\nFor more information on provisioning, see Building a Device Policy Controller.\r\nA Managed Profile enables data separation. For example to use a device both for personal and corporate usage. The\r\nmanaged profile and its parent share a launcher.\r\nAffiliation\r\nUsing the setAffiliationIds(ComponentName, Set) method, a Device Owner can set a list of affiliation ids for the System\r\nUser . Any Profile Owner on the same device can also call setAffiliationIds(ComponentName, Set) to set affiliation ids\r\nfor the user it is on. When there is the same ID present in both lists, the user is said to be \"affiliated\" and we can refer to\r\nthe Profile Owner as a \"profile owner on an affiliated user\" or an \"affiliated profile owner\". Becoming affiliated grants the\r\nProfile Owner capabilities similar to that of the Device Owner. It also allows use of the\r\nbindDeviceAdminServiceAsUser(ComponentName, Intent, ServiceConnection, BindServiceFlags, UserHandle) APIs for\r\ndirect communication between the Device Owner and affiliated Profile Owners.\r\nOrganization Owned\r\nAn organization owned device is one which is not owned by the person making use of the device and is instead owned by an\r\norganization such as their employer or education provider. These devices are recognised as being organization owned either\r\nby the presence of a device owner or of a profile which has a profile owner is marked as organization owned .\r\nProfile owners running on an organization owned device can exercise additional capabilities using the\r\ngetParentProfileInstance(ComponentName) API which apply to the parent user. Each API will indicate if it is usable in\r\nthis way.\r\nAndroid Automotive\r\nOn \"Android Automotive builds\" , some methods can throw \"an exception\" if an action is unsafe (for example, if the\r\nvehicle is moving). Callers running on \"Android Automotive builds\" should always check for this exception.\r\nRestricted for SDK Runtime environment in API level 34.\r\nRequires the PackageManager#FEATURE_DEVICE_ADMIN feature which can be detected using\r\nPackageManager.hasSystemFeature(String) .\r\nSummary\r\nConstants\r\nString\r\nACTION_ADD_DEVICE_ADMIN\r\nActivity action: ask the user to add a new device administrator to the system.\r\nString ACTION_ADMIN_POLICY_COMPLIANCE\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 2 of 178\n\nActivity action: Starts the administrator to show policy compliance for the provisioning.\r\nString\r\nACTION_APPLICATION_DELEGATION_SCOPES_CHANGED\r\nBroadcast Action: Sent after application delegation scopes are changed.\r\nString\r\nACTION_CHECK_POLICY_COMPLIANCE\r\nActivity action: launch the DPC to check policy compliance.\r\nString\r\nACTION_DEVICE_ADMIN_SERVICE\r\nService action: Action for a service that device owner and profile owner can optionally own.\r\nString\r\nACTION_DEVICE_FINANCING_STATE_CHANGED\r\nBroadcast Action: Broadcast sent to indicate that the device financing state has changed.\r\nString\r\nACTION_DEVICE_OWNER_CHANGED\r\nBroadcast action: sent when the device owner is set, changed or cleared.\r\nString\r\nACTION_DEVICE_POLICY_RESOURCE_UPDATED\r\nBroadcast action: notify system apps (e.g. settings, SysUI, etc) that the device management resources with\r\nIDs EXTRA_RESOURCE_IDS has been updated, the updated resources can be retrieved using\r\nDevicePolicyResourcesManager.getDrawable and DevicePolicyResourcesManager.getString .\r\nString\r\nACTION_GET_PROVISIONING_MODE\r\nActivity action: Starts the administrator to get the mode for the provisioning.\r\nString\r\nACTION_MANAGED_PROFILE_PROVISIONED\r\nBroadcast Action: This broadcast is sent to indicate that provisioning of a managed profile has completed\r\nsuccessfully.\r\nString\r\nACTION_PROFILE_OWNER_CHANGED\r\nBroadcast action: sent when the profile owner is set, changed or cleared.\r\nString\r\nACTION_PROVISIONING_SUCCESSFUL\r\nActivity action: This activity action is sent to indicate that provisioning of a managed profile or managed\r\ndevice has completed successfully.\r\nString\r\nACTION_PROVISION_MANAGED_DEVICE\r\nThis constant was deprecated in API level 31. to support Build.VERSION_CODES.S and later, admin apps\r\nmust implement activities with intent filters for the ACTION_GET_PROVISIONING_MODE and\r\nACTION_ADMIN_POLICY_COMPLIANCE intent actions; using ACTION_PROVISION_MANAGED_DEVICE to start\r\nprovisioning will cause the provisioning to fail; to additionally support pre- Build.VERSION_CODES.S ,\r\nadmin apps must also continue to use this constant.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 3 of 178\n\nString\r\nACTION_PROVISION_MANAGED_PROFILE\r\nActivity action: Starts the provisioning flow which sets up a managed profile.\r\nString\r\nACTION_SET_NEW_PARENT_PROFILE_PASSWORD\r\nActivity action: have the user enter a new password for the parent profile.\r\nString\r\nACTION_SET_NEW_PASSWORD\r\nActivity action: have the user enter a new password.\r\nString\r\nACTION_START_ENCRYPTION\r\nActivity action: begin the process of encrypting data on the device.\r\nString\r\nACTION_SYSTEM_UPDATE_POLICY_CHANGED\r\nBroadcast action: notify that a new local system update policy has been set by the device owner.\r\nint\r\nAPP_FUNCTIONS_DISABLED\r\nIndicates that AppFunctionManager is controlled and disabled by policy, i.e.\r\nint\r\nAPP_FUNCTIONS_DISABLED_CROSS_PROFILE\r\nIndicates that AppFunctionManager is controlled and disabled by a policy for cross profile interactions\r\nonly, i.e.\r\nint\r\nAPP_FUNCTIONS_NOT_CONTROLLED_BY_POLICY\r\nIndicates that AppFunctionManager is not controlled by policy.\r\nint\r\nAUTO_TIME_DISABLED\r\nSpecifies the \"disabled\" auto time state.\r\nint\r\nAUTO_TIME_ENABLED\r\nSpecifies the \"enabled\" auto time state.\r\nint\r\nAUTO_TIME_NOT_CONTROLLED_BY_POLICY\r\nSpecifies that the auto time state is not controlled by device policy.\r\nint\r\nAUTO_TIME_ZONE_DISABLED\r\nSpecifies the \"disabled\" auto time zone state.\r\nint\r\nAUTO_TIME_ZONE_ENABLED\r\nSpecifies the \"enabled\" auto time zone state.\r\nint AUTO_TIME_ZONE_NOT_CONTROLLED_BY_POLICY\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 4 of 178\n\nSpecifies that the auto time zone state is not controlled by device policy.\r\nint\r\nCONTENT_PROTECTION_DISABLED\r\nIndicates that content protection is controlled and disabled by a policy (default).\r\nint\r\nCONTENT_PROTECTION_ENABLED\r\nIndicates that content protection is controlled and enabled by a policy.\r\nint\r\nCONTENT_PROTECTION_NOT_CONTROLLED_BY_POLICY\r\nIndicates that content protection is not controlled by policy, allowing user to choose.\r\nString\r\nDELEGATION_APP_RESTRICTIONS\r\nDelegation of application restrictions management.\r\nString\r\nDELEGATION_BLOCK_UNINSTALL\r\nDelegation of application uninstall block.\r\nString\r\nDELEGATION_CERT_INSTALL\r\nDelegation of certificate installation and management.\r\nString\r\nDELEGATION_CERT_SELECTION\r\nGrants access to selection of KeyChain certificates on behalf of requesting apps.\r\nString\r\nDELEGATION_ENABLE_SYSTEM_APP\r\nDelegation for enabling system apps.\r\nString\r\nDELEGATION_INSTALL_EXISTING_PACKAGE\r\nDelegation for installing existing packages.\r\nString\r\nDELEGATION_KEEP_UNINSTALLED_PACKAGES\r\nDelegation of management of uninstalled packages.\r\nString\r\nDELEGATION_NETWORK_LOGGING\r\nGrants access to setNetworkLoggingEnabled(ComponentName, boolean) ,\r\nisNetworkLoggingEnabled(ComponentName) and retrieveNetworkLogs(ComponentName, long) .\r\nString\r\nDELEGATION_PACKAGE_ACCESS\r\nDelegation of package access state.\r\nString\r\nDELEGATION_PERMISSION_GRANT\r\nDelegation of permission policy and permission grant state.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 5 of 178\n\nString\r\nDELEGATION_SECURITY_LOGGING\r\nGrants access to setSecurityLoggingEnabled(ComponentName, boolean) ,\r\nisSecurityLoggingEnabled(ComponentName) , retrieveSecurityLogs(ComponentName) , and\r\nretrievePreRebootSecurityLogs(ComponentName) .\r\nint\r\nENCRYPTION_STATUS_ACTIVATING\r\nThis constant was deprecated in API level 34. This result code has never actually been used, so there is no\r\nreason for apps to check for it.\r\nint\r\nENCRYPTION_STATUS_ACTIVE\r\nResult code for setStorageEncryption(ComponentName, boolean) and getStorageEncryptionStatus() :\r\nindicating that encryption is active.\r\nint\r\nENCRYPTION_STATUS_ACTIVE_DEFAULT_KEY\r\nResult code for getStorageEncryptionStatus() : indicating that encryption is active, but the encryption\r\nkey is not cryptographically protected by the user's credentials.\r\nint\r\nENCRYPTION_STATUS_ACTIVE_PER_USER\r\nResult code for getStorageEncryptionStatus() : indicating that encryption is active and the encryption\r\nkey is tied to the user or profile.\r\nint\r\nENCRYPTION_STATUS_INACTIVE\r\nResult code for setStorageEncryption(ComponentName, boolean) and getStorageEncryptionStatus() :\r\nindicating that encryption is supported, but is not currently active.\r\nint\r\nENCRYPTION_STATUS_UNSUPPORTED\r\nResult code for setStorageEncryption(ComponentName, boolean) and getStorageEncryptionStatus() :\r\nindicating that encryption is not supported.\r\nString\r\nEXTRA_ADD_EXPLANATION\r\nAn optional CharSequence providing additional explanation for why the admin is being added.\r\nString\r\nEXTRA_DELEGATION_SCOPES\r\nAn ArrayList\u003cString\u003e corresponding to the delegation scopes given to an app in the\r\nACTION_APPLICATION_DELEGATION_SCOPES_CHANGED broadcast.\r\nString\r\nEXTRA_DEVICE_ADMIN\r\nThe ComponentName of the administrator component.\r\nString\r\nEXTRA_DEVICE_PASSWORD_REQUIREMENT_ONLY\r\nA boolean extra for ACTION_SET_NEW_PARENT_PROFILE_PASSWORD requesting that only device password\r\nrequirement is enforced during the parent profile password enrolment flow.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 6 of 178\n\nString\r\nEXTRA_PASSWORD_COMPLEXITY\r\nAn integer indicating the complexity level of the new password an app would like the user to set when\r\nlaunching the action ACTION_SET_NEW_PASSWORD .\r\nString\r\nEXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE\r\nAn Account extra holding the account to migrate during managed profile provisioning.\r\nString\r\nEXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE\r\nA Parcelable extra of type PersistableBundle that is passed directly to the Device Policy Controller\r\nafter provisioning.\r\nString\r\nEXTRA_PROVISIONING_ALLOWED_PROVISIONING_MODES\r\nAn ArrayList of Integer extra specifying the allowed provisioning modes.\r\nString\r\nEXTRA_PROVISIONING_ALLOW_OFFLINE\r\nA boolean extra indicating whether offline provisioning should be used.\r\nString\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME\r\nA ComponentName extra indicating the device admin receiver of the application that will be set as the\r\nDevice Policy Controller.\r\nString\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_MINIMUM_VERSION_CODE\r\nAn int extra holding a minimum required version code for the device admin package.\r\nString\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM\r\nA String extra holding the URL-safe base64 encoded SHA-256 hash of the file at download location\r\nspecified in EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION .\r\nString\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_COOKIE_HEADER\r\nA String extra holding a http cookie header which should be used in the http request to the url specified in\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION .\r\nString\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION\r\nA String extra holding a url that specifies the download location of the device admin package.\r\nString\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME\r\nThis constant was deprecated in API level 23. Use EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME .\r\nString\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM\r\nA String extra holding the URL-safe base64 encoded SHA-256 checksum of any signature of the android\r\npackage archive at the download location specified in\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 7 of 178\n\nString\r\nEXTRA_PROVISIONING_DISCLAIMERS\r\nA Bundle [] extra consisting of list of disclaimer headers and disclaimer contents.\r\nString\r\nEXTRA_PROVISIONING_DISCLAIMER_CONTENT\r\nA Uri extra pointing to disclaimer content.\r\nString\r\nEXTRA_PROVISIONING_DISCLAIMER_HEADER\r\nA String extra of localized disclaimer header.\r\nString\r\nEXTRA_PROVISIONING_EMAIL_ADDRESS\r\nThis constant was deprecated in API level 26. From Build.VERSION_CODES.O , never used while\r\nprovisioning the device.\r\nString\r\nEXTRA_PROVISIONING_IMEI\r\nA string extra holding the IMEI (International Mobile Equipment Identity) of the device.\r\nString\r\nEXTRA_PROVISIONING_KEEP_ACCOUNT_ON_MIGRATION\r\nBoolean extra to indicate that the migrated account should be kept.\r\nString\r\nEXTRA_PROVISIONING_KEEP_SCREEN_ON\r\nThis constant was deprecated in API level 34. from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , the flag\r\nwouldn't be functional. The screen is kept on throughout the provisioning flow.\r\nString\r\nEXTRA_PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED\r\nA Boolean extra that can be used by the mobile device management application to skip the disabling of\r\nsystem apps during provisioning when set to true .\r\nString\r\nEXTRA_PROVISIONING_LOCALE\r\nA String extra holding the Locale that the device will be set to.\r\nString\r\nEXTRA_PROVISIONING_LOCAL_TIME\r\nA Long extra holding the wall clock time (in milliseconds) to be set on the device's AlarmManager .\r\nString\r\nEXTRA_PROVISIONING_LOGO_URI\r\nThis constant was deprecated in API level 33. Logo customization is no longer supported in the\r\nprovisioning flow.\r\nString\r\nEXTRA_PROVISIONING_MAIN_COLOR\r\nThis constant was deprecated in API level 31. Color customization is no longer supported in the\r\nprovisioning flow.\r\nString EXTRA_PROVISIONING_MODE\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 8 of 178\n\nAn intent extra holding the provisioning mode returned by the administrator.\r\nString\r\nEXTRA_PROVISIONING_SENSORS_PERMISSION_GRANT_OPT_OUT\r\nA boolean extra indicating the admin of a fully-managed device opts out of controlling permission grants\r\nfor sensor-related permissions, see setPermissionGrantState(ComponentName,String,String,int) .\r\nString\r\nEXTRA_PROVISIONING_SERIAL_NUMBER\r\nA string extra holding the serial number of the device.\r\nString\r\nEXTRA_PROVISIONING_SHOULD_LAUNCH_RESULT_INTENT\r\nA boolean extra that determines whether the provisioning flow should launch the resulting launch intent, if\r\none is supplied by the device policy management role holder via EXTRA_RESULT_LAUNCH_INTENT .\r\nString\r\nEXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS\r\nA boolean extra indicating if the education screens from the provisioning flow should be skipped.\r\nString\r\nEXTRA_PROVISIONING_SKIP_ENCRYPTION\r\nA boolean extra indicating whether device encryption can be skipped as part of provisioning.\r\nString\r\nEXTRA_PROVISIONING_SKIP_USER_CONSENT\r\nThis constant was deprecated in API level 31. this extra is no longer relevant as device owners cannot\r\ncreate managed profiles\r\nString\r\nEXTRA_PROVISIONING_TIME_ZONE\r\nA String extra holding the time zone AlarmManager that the device will be set to.\r\nString\r\nEXTRA_PROVISIONING_USE_MOBILE_DATA\r\nA boolean extra indicating if mobile data should be used during the provisioning flow for downloading the\r\nadmin app.\r\nString\r\nEXTRA_PROVISIONING_WIFI_ANONYMOUS_IDENTITY\r\nThe anonymous identity of the wifi network in EXTRA_PROVISIONING_WIFI_SSID .\r\nString\r\nEXTRA_PROVISIONING_WIFI_CA_CERTIFICATE\r\nThe CA certificate of the wifi network in EXTRA_PROVISIONING_WIFI_SSID .\r\nString\r\nEXTRA_PROVISIONING_WIFI_DOMAIN\r\nThe domain of the wifi network in EXTRA_PROVISIONING_WIFI_SSID .\r\nString\r\nEXTRA_PROVISIONING_WIFI_EAP_METHOD\r\nThe EAP method of the wifi network in EXTRA_PROVISIONING_WIFI_SSID and could be one of PEAP ,\r\nTLS , TTLS , PWD , SIM , AKA or AKA_PRIME .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 9 of 178\n\nString\r\nEXTRA_PROVISIONING_WIFI_HIDDEN\r\nA boolean extra indicating whether the wifi network in EXTRA_PROVISIONING_WIFI_SSID is hidden or not.\r\nString\r\nEXTRA_PROVISIONING_WIFI_IDENTITY\r\nThe identity of the wifi network in EXTRA_PROVISIONING_WIFI_SSID .\r\nString\r\nEXTRA_PROVISIONING_WIFI_PAC_URL\r\nA String extra holding the proxy auto-config (PAC) URL for the wifi network in\r\nEXTRA_PROVISIONING_WIFI_SSID .\r\nString\r\nEXTRA_PROVISIONING_WIFI_PASSWORD\r\nA String extra holding the password of the wifi network in EXTRA_PROVISIONING_WIFI_SSID .\r\nString\r\nEXTRA_PROVISIONING_WIFI_PHASE2_AUTH\r\nThe phase 2 authentication of the wifi network in EXTRA_PROVISIONING_WIFI_SSID and could be one of\r\nNONE , PAP , MSCHAP , MSCHAPV2 , GTC , SIM , AKA or AKA_PRIME .\r\nString\r\nEXTRA_PROVISIONING_WIFI_PROXY_BYPASS\r\nA String extra holding the proxy bypass for the wifi network in EXTRA_PROVISIONING_WIFI_SSID .\r\nString\r\nEXTRA_PROVISIONING_WIFI_PROXY_HOST\r\nA String extra holding the proxy host for the wifi network in EXTRA_PROVISIONING_WIFI_SSID .\r\nString\r\nEXTRA_PROVISIONING_WIFI_PROXY_PORT\r\nAn int extra holding the proxy port for the wifi network in EXTRA_PROVISIONING_WIFI_SSID .\r\nString\r\nEXTRA_PROVISIONING_WIFI_SECURITY_TYPE\r\nA String extra indicating the security type of the wifi network in EXTRA_PROVISIONING_WIFI_SSID and\r\ncould be one of NONE , WPA , WEP or EAP .\r\nString\r\nEXTRA_PROVISIONING_WIFI_SSID\r\nA String extra holding the ssid of the wifi network that should be used during nfc device owner\r\nprovisioning for downloading the mobile device management application.\r\nString\r\nEXTRA_PROVISIONING_WIFI_USER_CERTIFICATE\r\nThe user certificate of the wifi network in EXTRA_PROVISIONING_WIFI_SSID .\r\nString\r\nEXTRA_RESOURCE_IDS\r\nAn integer array extra for ACTION_DEVICE_POLICY_RESOURCE_UPDATED to indicate which resource IDs (i.e.\r\nString EXTRA_RESOURCE_TYPE\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 10 of 178\n\nAn int extra for ACTION_DEVICE_POLICY_RESOURCE_UPDATED to indicate the type of the resource being\r\nupdated, the type can be EXTRA_RESOURCE_TYPE_DRAWABLE or EXTRA_RESOURCE_TYPE_STRING\r\nint\r\nEXTRA_RESOURCE_TYPE_DRAWABLE\r\nA int value for EXTRA_RESOURCE_TYPE to indicate that a resource of type Drawable is being updated.\r\nint\r\nEXTRA_RESOURCE_TYPE_STRING\r\nA int value for EXTRA_RESOURCE_TYPE to indicate that a resource of type String is being updated.\r\nString\r\nEXTRA_RESULT_LAUNCH_INTENT\r\nAn Intent result extra specifying the Intent to be launched after provisioning is finalized.\r\nint\r\nFLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY\r\nFlag for lockNow(int) : also evict the user's credential encryption key from the keyring.\r\nint\r\nFLAG_MANAGED_CAN_ACCESS_PARENT\r\nFlag used by addCrossProfileIntentFilter(ComponentName, IntentFilter, int) to allow activities in\r\nthe managed profile to access intents sent from the parent profile.\r\nint\r\nFLAG_PARENT_CAN_ACCESS_MANAGED\r\nFlag used by addCrossProfileIntentFilter(ComponentName, IntentFilter, int) to allow activities in\r\nthe parent profile to access intents sent from the managed profile.\r\nint\r\nID_TYPE_BASE_INFO\r\nSpecifies that the device should attest its manufacturer details.\r\nint\r\nID_TYPE_IMEI\r\nSpecifies that the device should attest its IMEI.\r\nint\r\nID_TYPE_INDIVIDUAL_ATTESTATION\r\nSpecifies that the device should attest using an individual attestation certificate.\r\nint\r\nID_TYPE_MEID\r\nSpecifies that the device should attest its MEID.\r\nint\r\nID_TYPE_SERIAL\r\nSpecifies that the device should attest its serial number.\r\nint\r\nINSTALLKEY_REQUEST_CREDENTIALS_ACCESS\r\nSpecifies that the calling app should be granted access to the installed credentials immediately.\r\nint INSTALLKEY_SET_USER_SELECTABLE\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 11 of 178\n\nSpecifies that a user can select the key via the Certificate Selection prompt.\r\nint\r\nKEYGUARD_DISABLE_BIOMETRICS\r\nDisable all biometric authentication on keyguard secure screens (e.g. PIN/Pattern/Password).\r\nint\r\nKEYGUARD_DISABLE_FACE\r\nDisable face authentication on keyguard secure screens (e.g. PIN/Pattern/Password).\r\nint\r\nKEYGUARD_DISABLE_FEATURES_ALL\r\nDisable all current and future keyguard customizations.\r\nint\r\nKEYGUARD_DISABLE_FEATURES_NONE\r\nWidgets are enabled in keyguard\r\nint\r\nKEYGUARD_DISABLE_FINGERPRINT\r\nDisable fingerprint authentication on keyguard secure screens (e.g. PIN/Pattern/Password).\r\nint\r\nKEYGUARD_DISABLE_IRIS\r\nDisable iris authentication on keyguard secure screens (e.g. PIN/Pattern/Password).\r\nint\r\nKEYGUARD_DISABLE_REMOTE_INPUT\r\nThis constant was deprecated in API level 33. This flag was added in version Build.VERSION_CODES.N , but\r\nit never had any effect.\r\nint\r\nKEYGUARD_DISABLE_SECURE_CAMERA\r\nDisable the camera on secure keyguard screens (e.g. PIN/Pattern/Password)\r\nint\r\nKEYGUARD_DISABLE_SECURE_NOTIFICATIONS\r\nDisable showing all notifications on secure keyguard screens (e.g. PIN/Pattern/Password)\r\nint\r\nKEYGUARD_DISABLE_SHORTCUTS_ALL\r\nDisable all keyguard shortcuts.\r\nint\r\nKEYGUARD_DISABLE_TRUST_AGENTS\r\nDisable trust agents on secure keyguard screens (e.g. PIN/Pattern/Password).\r\nint\r\nKEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS\r\nOnly allow redacted notifications on secure keyguard screens (e.g. PIN/Pattern/Password)\r\nint\r\nKEYGUARD_DISABLE_WIDGETS_ALL\r\nDisable all keyguard widgets.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 12 of 178\n\nint\r\nLEAVE_ALL_SYSTEM_APPS_ENABLED\r\nFlag used by createAndManageUser(ComponentName, String, ComponentName, PersistableBundle, int)\r\nto specify that the newly created user should skip the disabling of system apps during provisioning.\r\nint\r\nLOCK_TASK_FEATURE_BLOCK_ACTIVITY_START_IN_TASK\r\nEnable blocking of non-allowlisted activities from being started into a locked task.\r\nint\r\nLOCK_TASK_FEATURE_GLOBAL_ACTIONS\r\nEnable the global actions dialog during LockTask mode.\r\nint\r\nLOCK_TASK_FEATURE_HOME\r\nEnable the Home button during LockTask mode.\r\nint\r\nLOCK_TASK_FEATURE_KEYGUARD\r\nEnable the keyguard during LockTask mode.\r\nint\r\nLOCK_TASK_FEATURE_NONE\r\nDisable all configurable SystemUI features during LockTask mode.\r\nint\r\nLOCK_TASK_FEATURE_NOTIFICATIONS\r\nEnable notifications during LockTask mode.\r\nint\r\nLOCK_TASK_FEATURE_OVERVIEW\r\nEnable the Overview button and the Overview screen during LockTask mode.\r\nint\r\nLOCK_TASK_FEATURE_SYSTEM_INFO\r\nEnable the system info area in the status bar during LockTask mode.\r\nint\r\nMAKE_USER_EPHEMERAL\r\nFlag used by createAndManageUser(ComponentName, String, ComponentName, PersistableBundle, int)\r\nto specify that the user should be created ephemeral.\r\nString\r\nMIME_TYPE_PROVISIONING_NFC\r\nThis MIME type is used for starting the device owner provisioning.\r\nint\r\nMTE_DISABLED\r\nRequire that MTE be disabled on the device.\r\nint\r\nMTE_ENABLED\r\nRequire that MTE be enabled on the device, if supported.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 13 of 178\n\nint\r\nMTE_NOT_CONTROLLED_BY_POLICY\r\nAllow the user to choose whether to enable MTE on the device.\r\nint\r\nNEARBY_STREAMING_DISABLED\r\nIndicates that nearby streaming is disabled.\r\nint\r\nNEARBY_STREAMING_ENABLED\r\nIndicates that nearby streaming is enabled.\r\nint\r\nNEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY\r\nIndicates that nearby streaming is not controlled by policy, which means nearby streaming is allowed.\r\nint\r\nNEARBY_STREAMING_SAME_MANAGED_ACCOUNT_ONLY\r\nIndicates that nearby streaming is enabled only to devices offering a comparable level of security, with the\r\nsame authenticated managed account.\r\nint\r\nOPERATION_SAFETY_REASON_DRIVING_DISTRACTION\r\nIndicates that a UnsafeStateException was thrown because the operation would distract the driver of the\r\nvehicle.\r\nint\r\nPASSWORD_COMPLEXITY_HIGH\r\nConstant for getPasswordComplexity() and setRequiredPasswordComplexity(int) .\r\nint\r\nPASSWORD_COMPLEXITY_LOW\r\nConstant for getPasswordComplexity() and setRequiredPasswordComplexity(int) .\r\nint\r\nPASSWORD_COMPLEXITY_MEDIUM\r\nConstant for getPasswordComplexity() and setRequiredPasswordComplexity(int) .\r\nint\r\nPASSWORD_COMPLEXITY_NONE\r\nConstant for getPasswordComplexity() and setRequiredPasswordComplexity(int) : no password.\r\nint\r\nPASSWORD_QUALITY_ALPHABETIC\r\nConstant for setPasswordQuality(ComponentName, int) : the user must have entered a password\r\ncontaining at least alphabetic (or other symbol) characters.\r\nint\r\nPASSWORD_QUALITY_ALPHANUMERIC\r\nConstant for setPasswordQuality(ComponentName, int) : the user must have entered a password\r\ncontaining at least both\u003e numeric and alphabetic (or other symbol) characters.\r\nint PASSWORD_QUALITY_BIOMETRIC_WEAK\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 14 of 178\n\nConstant for setPasswordQuality(ComponentName, int) : the policy allows for low-security biometric\r\nrecognition technology.\r\nint\r\nPASSWORD_QUALITY_COMPLEX\r\nConstant for setPasswordQuality(ComponentName, int) : allows the admin to set precisely how many\r\ncharacters of various types the password should contain to satisfy the policy.\r\nint\r\nPASSWORD_QUALITY_NUMERIC\r\nConstant for setPasswordQuality(ComponentName, int) : the user must have entered a password\r\ncontaining at least numeric characters.\r\nint\r\nPASSWORD_QUALITY_NUMERIC_COMPLEX\r\nConstant for setPasswordQuality(ComponentName, int) : the user must have entered a password\r\ncontaining at least numeric characters with no repeating (4444) or ordered (1234, 4321, 2468) sequences.\r\nint\r\nPASSWORD_QUALITY_SOMETHING\r\nConstant for setPasswordQuality(ComponentName, int) : the policy requires some kind of password or\r\npattern, but doesn't care what it is.\r\nint\r\nPASSWORD_QUALITY_UNSPECIFIED\r\nConstant for setPasswordQuality(ComponentName, int) : the policy has no requirements for the password.\r\nint\r\nPERMISSION_GRANT_STATE_DEFAULT\r\nRuntime permission state: The user can manage the permission through the UI.\r\nint\r\nPERMISSION_GRANT_STATE_DENIED\r\nRuntime permission state: The permission is denied to the app and the user cannot manage the permission\r\nthrough the UI.\r\nint\r\nPERMISSION_GRANT_STATE_GRANTED\r\nRuntime permission state: The permission is granted to the app and the user cannot manage the permission\r\nthrough the UI.\r\nint\r\nPERMISSION_POLICY_AUTO_DENY\r\nPermission policy to always deny new permission requests for runtime permissions.\r\nint\r\nPERMISSION_POLICY_AUTO_GRANT\r\nPermission policy to always grant new permission requests for runtime permissions.\r\nint\r\nPERMISSION_POLICY_PROMPT\r\nPermission policy to prompt user for new permission requests for runtime permissions.\r\nint PERSONAL_APPS_NOT_SUSPENDED\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 15 of 178\n\nReturn value for getPersonalAppsSuspendedReasons(ComponentName) when personal apps are not\r\nsuspended.\r\nint\r\nPERSONAL_APPS_SUSPENDED_EXPLICITLY\r\nFlag for getPersonalAppsSuspendedReasons(ComponentName) return value.\r\nint\r\nPERSONAL_APPS_SUSPENDED_PROFILE_TIMEOUT\r\nFlag for getPersonalAppsSuspendedReasons(ComponentName) return value.\r\nString\r\nPOLICY_DISABLE_CAMERA\r\nConstant to indicate the feature of disabling the camera.\r\nString\r\nPOLICY_DISABLE_SCREEN_CAPTURE\r\nConstant to indicate the feature of disabling screen captures.\r\nint\r\nPRIVATE_DNS_MODE_OFF\r\nSpecifies that Private DNS was turned off completely.\r\nint\r\nPRIVATE_DNS_MODE_OPPORTUNISTIC\r\nSpecifies that the device owner requested opportunistic DNS over TLS\r\nint\r\nPRIVATE_DNS_MODE_PROVIDER_HOSTNAME\r\nSpecifies that the device owner configured a specific host to use for Private DNS.\r\nint\r\nPRIVATE_DNS_MODE_UNKNOWN\r\nSpecifies that the Private DNS setting is in an unknown state.\r\nint\r\nPRIVATE_DNS_SET_ERROR_FAILURE_SETTING\r\nGeneral failure to set the Private DNS mode, not due to one of the reasons listed above.\r\nint\r\nPRIVATE_DNS_SET_ERROR_HOST_NOT_SERVING\r\nIf the privateDnsHost provided was of a valid hostname but that host was found to not support DNS-over-TLS.\r\nint\r\nPRIVATE_DNS_SET_NO_ERROR\r\nThe selected mode has been set successfully.\r\nint\r\nPROVISIONING_MODE_FULLY_MANAGED_DEVICE\r\nThe provisioning mode for fully managed device.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 16 of 178\n\nint\r\nPROVISIONING_MODE_MANAGED_PROFILE\r\nThe provisioning mode for managed profile.\r\nint\r\nPROVISIONING_MODE_MANAGED_PROFILE_ON_PERSONAL_DEVICE\r\nThe provisioning mode for a managed profile on a personal device.\r\nint\r\nRESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT\r\nFlag for resetPasswordWithToken(ComponentName, String, byte, int) and resetPassword(String,\r\nint) : don't ask for user credentials on device boot.\r\nint\r\nRESET_PASSWORD_REQUIRE_ENTRY\r\nFlag for resetPasswordWithToken(ComponentName, String, byte, int) and resetPassword(String,\r\nint) : don't allow other admins to change the password again until the user has entered it.\r\nint\r\nSKIP_SETUP_WIZARD\r\nFlag used by createAndManageUser(ComponentName, String, ComponentName, PersistableBundle, int)\r\nto skip setup wizard after creating a new user.\r\nint\r\nWIFI_SECURITY_ENTERPRISE_192\r\nConstant for getMinimumRequiredWifiSecurityLevel() and\r\nsetMinimumRequiredWifiSecurityLevel(int) : enterprise 192 bit network.\r\nint\r\nWIFI_SECURITY_ENTERPRISE_EAP\r\nConstant for getMinimumRequiredWifiSecurityLevel() and\r\nsetMinimumRequiredWifiSecurityLevel(int) : enterprise EAP network.\r\nint\r\nWIFI_SECURITY_OPEN\r\nConstant for getMinimumRequiredWifiSecurityLevel() and\r\nsetMinimumRequiredWifiSecurityLevel(int) : no minimum security level.\r\nint\r\nWIFI_SECURITY_PERSONAL\r\nConstant for getMinimumRequiredWifiSecurityLevel() and\r\nsetMinimumRequiredWifiSecurityLevel(int) : personal network such as WEP, WPA2-PSK.\r\nint\r\nWIPE_EUICC\r\nFlag for wipeDevice(int) : also erase the device's eUICC data.\r\nint\r\nWIPE_EXTERNAL_STORAGE\r\nFlag for wipeData(int) : also erase the device's adopted external storage (such as adopted SD cards).\r\nint\r\nWIPE_RESET_PROTECTION_DATA\r\nFlag for wipeData(int) : also erase the factory reset protection data.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 17 of 178\n\nint\r\nWIPE_SILENTLY\r\nFlag for wipeData(int) : won't show reason for wiping to the user.\r\nPublic methods\r\nvoid\r\nacknowledgeDeviceCompliant()\r\nCalled by a profile owner of an organization-owned managed profile to acknowledge tha\r\ndevice is compliant and the user can turn the profile off if needed according to the maxim\r\ntime off policy.\r\nvoid\r\naddCrossProfileIntentFilter(ComponentName admin, IntentFilter filter, int flag\r\nCalled by the profile owner of a managed profile so that some intents sent in the manage\r\nprofile can also be resolved in the parent, or vice versa.\r\nboolean\r\naddCrossProfileWidgetProvider(ComponentName admin, String packageName)\r\nCalled by the profile owner of a managed profile or a holder of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_PROFILE_INTERACTION to enable widget\r\nproviders from a given package to be available in the parent profile.\r\nint\r\naddOverrideApn(ComponentName admin, ApnSetting apnSetting)\r\nCalled by device owner or managed profile owner to add an override APN.\r\nvoid\r\naddPersistentPreferredActivity(ComponentName admin, IntentFilter filter,\r\nComponentName activity)\r\nCalled by a profile owner or device owner or holder of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_LOCK_TASK .\r\nvoid\r\naddUserRestriction(ComponentName admin, String key)\r\nCalled by a profile owner, device owner or a holder of any permission that is associated\r\nuser restriction to set a user restriction specified by the key.\r\nvoid\r\naddUserRestrictionGlobally(String key)\r\nCalled by a profile owner, device owner or a holder of any permission that is associated\r\nuser restriction to set a user restriction specified by the provided key globally on all us\r\nboolean\r\nbindDeviceAdminServiceAsUser(ComponentName admin, Intent serviceIntent,\r\nServiceConnection conn, int flags, UserHandle targetUser)\r\nCalled by a device owner to bind to a service from a secondary managed user or vice ve\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 18 of 178\n\nboolean\r\nbindDeviceAdminServiceAsUser(ComponentName admin, Intent serviceIntent,\r\nServiceConnection conn, Context.BindServiceFlags flags, UserHandle targetUser)\r\nSee\r\nbindDeviceAdminServiceAsUser(ComponentName,Intent,ServiceConnection,int,UserHa\r\nboolean\r\ncanAdminGrantSensorsPermissions()\r\nReturns true if the caller is running on a device where an admin can grant permissions re\r\ndevice sensors.\r\nboolean\r\ncanUsbDataSignalingBeDisabled()\r\nReturns whether enabling or disabling USB data signaling is supported on the device.\r\nvoid\r\nclearApplicationUserData(ComponentName admin, String packageName, Executor exe\r\nDevicePolicyManager.OnClearApplicationUserDataListener listener)\r\nCalled by the device owner or profile owner to clear application user data of a given pac\r\nvoid\r\nclearCrossProfileIntentFilters(ComponentName admin)\r\nCalled by a profile owner of a managed profile to remove the cross-profile intent filters t\r\nfrom the managed profile to the parent, or from the parent to the managed profile.\r\nvoid\r\nclearDeviceOwnerApp(String packageName)\r\nThis method was deprecated in API level 26. This method is expected to be used for testi\r\npurposes only. The device owner will lose control of the device and its data after calling\r\norder to protect any sensitive data that remains on the device, it is advised that the devic\r\nowner factory resets the device instead of calling this method. See wipeData(int) .\r\nvoid\r\nclearPackagePersistentPreferredActivities(ComponentName admin, String packageN\r\nCalled by a profile owner or device owner or holder of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_LOCK_TASK to remove all persistent inten\r\nhandler preferences associated with the given package that were set by\r\naddPersistentPreferredActivity(ComponentName, IntentFilter, ComponentName) .\r\nvoid\r\nclearProfileOwner(ComponentName admin)\r\nThis method was deprecated in API level 26. This method is expected to be used for testi\r\npurposes only. The profile owner will lose control of the user and its data after calling it\r\norder to protect any sensitive data that remains on this user, it is advised that the profile\r\ndeletes it instead of calling this method. See wipeData(int) .\r\nboolean\r\nclearResetPasswordToken(ComponentName admin)\r\nCalled by a profile, device owner or holder of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_RESET_PASSWORD to revoke the current pa\r\nreset token.\r\nvoid clearUserRestriction(ComponentName admin, String key)\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 19 of 178\n\nCalled by a profile owner, device owner or a holder of any permission that is associated\r\nuser restriction to clear a user restriction specified by the key.\r\nIntent\r\ncreateAdminSupportIntent(String restriction)\r\nCalled by any app to display a support dialog when a feature was disabled by an admin.\r\nUserHandle\r\ncreateAndManageUser(ComponentName admin, String name, ComponentName profileOwn\r\nPersistableBundle adminExtras, int flags)\r\nCalled by a device owner to create a user with the specified name and a given componen\r\ncalling package as profile owner.\r\nint\r\nenableSystemApp(ComponentName admin, Intent intent)\r\nRe-enable system apps by intent that were disabled by default when the user was initiali\r\nvoid\r\nenableSystemApp(ComponentName admin, String packageName)\r\nRe-enable a system app that was disabled by default when the user was initialized.\r\nAttestedKeyPair\r\ngenerateKeyPair(ComponentName admin, String algorithm, KeyGenParameterSpec key\r\nint idAttestationFlags)\r\nThis API can be called by the following to generate a new private/public key pair:\r\nDevice owner\r\nProfile owner\r\nDelegated certificate installer\r\nCredential management app\r\nAn app that holds the Manifest.permission.MANAGE_DEVICE_POLICY_CERTIFICATE\r\npermission\r\nIf the device supports key generation via secure hardware, this method is useful for creat\r\nkey in KeyChain that never left the secure hardware.\r\nString[]\r\ngetAccountTypesWithManagementDisabled()\r\nGets the array of accounts for which account management is disabled by the profile own\r\ndevice owner.\r\nList\u003cComponentName\u003e\r\ngetActiveAdmins()\r\nReturn a list of all currently active device administrators' component names.\r\nSet\u003cString\u003e\r\ngetAffiliationIds(ComponentName admin)\r\nReturns the set of affiliation ids previously set via setAffiliationIds(ComponentName,\r\nor an empty set if none have been set.\r\nSet\u003cString\u003e\r\ngetAlwaysOnVpnLockdownWhitelist(ComponentName admin)\r\nCalled by device or profile owner to query the set of packages that are allowed to access\r\nnetwork directly when always-on VPN is in lockdown mode but not connected.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 20 of 178\n\nString\r\ngetAlwaysOnVpnPackage(ComponentName admin)\r\nCalled by a device or profile owner to read the name of the package administering an alw\r\nVPN connection for the current user.\r\nint\r\ngetAppFunctionsPolicy()\r\nReturns the current AppFunctionManager policy.\r\nBundle\r\ngetApplicationRestrictions(ComponentName admin, String packageName)\r\nRetrieves the application restrictions for a given target application running in the calling\r\nString\r\ngetApplicationRestrictionsManagingPackage(ComponentName admin)\r\nThis method was deprecated in API level 26. From Build.VERSION_CODES.O . Use\r\ngetDelegatePackages(ComponentName, String) with the DELEGATION_APP_RESTRICTION\r\nscope instead.\r\nboolean\r\ngetAutoTimeEnabled(ComponentName admin)\r\nReturns true if auto time is enabled on the device.\r\nint\r\ngetAutoTimePolicy()\r\nReturns current auto time policy's state.\r\nboolean\r\ngetAutoTimeRequired()\r\nThis method was deprecated in API level 30. From Build.VERSION_CODES.R . Use\r\ngetAutoTimeEnabled(ComponentName)\r\nboolean\r\ngetAutoTimeZoneEnabled(ComponentName admin)\r\nReturns true if auto time zone is enabled on the device.\r\nint\r\ngetAutoTimeZonePolicy()\r\nReturns auto time zone policy's current state.\r\nList\u003cUserHandle\u003e\r\ngetBindDeviceAdminTargetUsers(ComponentName admin)\r\nReturns the list of target users that the calling device owner or owner of secondary user c\r\nwhen calling bindDeviceAdminServiceAsUser(ComponentName, Intent, ServiceConnect\r\nBindServiceFlags, UserHandle) .\r\nboolean\r\ngetBluetoothContactSharingDisabled(ComponentName admin)\r\nCalled by a profile owner of a managed profile to determine whether or not Bluetooth de\r\ncannot access enterprise contacts.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 21 of 178\n\nboolean\r\ngetCameraDisabled(ComponentName admin)\r\nDetermine whether or not the device's cameras have been disabled for this user, either by\r\ncalling admin, if specified, or all admins.\r\nString\r\ngetCertInstallerPackage(ComponentName admin)\r\nThis method was deprecated in API level 26. From Build.VERSION_CODES.O . Use\r\ngetDelegatePackages(ComponentName, String) with the DELEGATION_CERT_INSTALL s\r\ninstead.\r\nint\r\ngetContentProtectionPolicy(ComponentName admin)\r\nReturns the current content protection policy.\r\nPackagePolicy\r\ngetCredentialManagerPolicy()\r\nCalled by a device owner or profile owner of a managed profile to retrieve the credentia\r\nmanager policy.\r\nSet\u003cString\u003e\r\ngetCrossProfileCalendarPackages(ComponentName admin)\r\nThis method was deprecated in API level 34. Use\r\nsetCrossProfilePackages(ComponentName,Set) .\r\nboolean\r\ngetCrossProfileCallerIdDisabled(ComponentName admin)\r\nThis method was deprecated in API level 34. starting with\r\nBuild.VERSION_CODES.UPSIDE_DOWN_CAKE , use getManagedProfileCallerIdAccessPoli\r\ninstead\r\nboolean\r\ngetCrossProfileContactsSearchDisabled(ComponentName admin)\r\nThis method was deprecated in API level 34. From Build.VERSION_CODES.UPSIDE_DOWN_\r\nuse getManagedProfileContactsAccessPolicy()\r\nSet\u003cString\u003e\r\ngetCrossProfilePackages(ComponentName admin)\r\nReturns the set of package names that the admin has previously set as allowed to request\r\nconsent for cross-profile communication, via setCrossProfilePackages(ComponentName\r\nList\u003cString\u003e\r\ngetCrossProfileWidgetProviders(ComponentName admin)\r\nCalled by the profile owner of a managed profile or a holder of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_PROFILE_INTERACTION to query providers\r\nwhich packages are available in the parent profile.\r\nint\r\ngetCurrentFailedPasswordAttempts()\r\nRetrieve the number of times the user has failed at entering a password since that last su\r\npassword entry.\r\nList\u003cString\u003e getDelegatePackages(ComponentName admin, String delegationScope)\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 22 of 178\n\nCalled by a profile owner or device owner to retrieve a list of delegate packages that wer\r\ngranted a delegation scope.\r\nList\u003cString\u003e\r\ngetDelegatedScopes(ComponentName admin, String delegatedPackage)\r\nCalled by a profile owner or device owner to retrieve a list of the scopes given to a deleg\r\npackage.\r\nCharSequence getDeviceOwnerLockScreenInfo()\r\nString\r\ngetDevicePolicyManagementRoleHolderPackage()\r\nReturns the package name of the device policy management role holder.\r\nCharSequence\r\ngetEndUserSessionMessage(ComponentName admin)\r\nReturns the user session end message.\r\nString\r\ngetEnrollmentSpecificId()\r\nReturns an enrollment-specific identifier of this device, which is guaranteed to be the sam\r\nvalue for the same device, enrolled into the same organization by the same managing ap\r\nFactoryResetProtectionPolicy\r\ngetFactoryResetProtectionPolicy(ComponentName admin)\r\nCallable by device owner or profile owner of an organization-owned device, to retrieve t\r\ncurrent factory reset protection (FRP) policy set previously by\r\nsetFactoryResetProtectionPolicy(ComponentName, FactoryResetProtectionPolicy) .\r\nString\r\ngetGlobalPrivateDnsHost(ComponentName admin)\r\nReturns the system-wide Private DNS host.\r\nint\r\ngetGlobalPrivateDnsMode(ComponentName admin)\r\nReturns the system-wide Private DNS mode.\r\nList\u003cbyte[]\u003e\r\ngetInstalledCaCerts(ComponentName admin)\r\nReturns all CA certificates that are currently trusted, excluding system CA certificates.\r\nList\u003cString\u003e\r\ngetKeepUninstalledPackages(ComponentName admin)\r\nGet the list of apps to keep around as APKs even if no user has currently installed it.\r\nMap\u003cInteger,Set\u003cString\u003e\u003e\r\ngetKeyPairGrants(String alias)\r\nCalled by a device or profile owner, or delegated certificate chooser (an app that has bee\r\ndelegated the DELEGATION_CERT_SELECTION privilege), to query which apps have access\r\ngiven KeyChain key.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 23 of 178\n\nint\r\ngetKeyguardDisabledFeatures(ComponentName admin)\r\nDetermine whether or not features have been disabled in keyguard either by the calling a\r\nif specified, or all admins that set restrictions on this user and its participating profiles.\r\nint\r\ngetLockTaskFeatures(ComponentName admin)\r\nGets which system features are enabled for LockTask mode.\r\nString[]\r\ngetLockTaskPackages(ComponentName admin)\r\nReturns the list of packages allowed to start the lock task mode.\r\nCharSequence\r\ngetLongSupportMessage(ComponentName admin)\r\nCalled by a device admin to get the long support message.\r\nPackagePolicy\r\ngetManagedProfileCallerIdAccessPolicy()\r\nCalled by a profile owner of a managed profile to retrieve the caller id policy.\r\nPackagePolicy\r\ngetManagedProfileContactsAccessPolicy()\r\nCalled by a profile owner of a managed profile to determine the current policy applied to\r\nmanaged profile contacts.\r\nlong\r\ngetManagedProfileMaximumTimeOff(ComponentName admin)\r\nCalled by a profile owner of an organization-owned managed profile to get maximum tim\r\nprofile is allowed to be turned off.\r\nManagedSubscriptionsPolicy\r\ngetManagedSubscriptionsPolicy()\r\nReturns the current ManagedSubscriptionsPolicy .\r\nint\r\ngetMaximumFailedPasswordsForWipe(ComponentName admin)\r\nRetrieve the current maximum number of login attempts that are allowed before the dev\r\nprofile is wiped, for a particular admin or all admins that set restrictions on this user and\r\nparticipating profiles.\r\nlong\r\ngetMaximumTimeToLock(ComponentName admin)\r\nRetrieve the current maximum time to unlock for a particular admin or all admins that se\r\nrestrictions on this user and its participating profiles.\r\nList\u003cString\u003e\r\ngetMeteredDataDisabledPackages(ComponentName admin)\r\nCalled by a device or profile owner to retrieve the list of packages which are restricted b\r\nadmin from using metered data.\r\nint\r\ngetMinimumRequiredWifiSecurityLevel()\r\nReturns the current Wi-Fi minimum security level.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 24 of 178\n\nint\r\ngetMtePolicy()\r\nCalled by a device owner, profile owner of an organization-owned device to get the Mem\r\nTagging Extension (MTE) policy Learn more about MTE\r\nint\r\ngetNearbyAppStreamingPolicy()\r\nReturns the current runtime nearby app streaming policy set by the device or profile own\r\nint\r\ngetNearbyNotificationStreamingPolicy()\r\nReturns the current runtime nearby notification streaming policy set by the device or pro\r\nowner.\r\nint\r\ngetOrganizationColor(ComponentName admin)\r\nThis method was deprecated in API level 31. From Build.VERSION_CODES.R , the organ\r\ncolor is never used as the background color of the confirm credentials screen.\r\nCharSequence\r\ngetOrganizationName(ComponentName admin)\r\nCalled by the device owner (since API 26) or profile owner (since API 24) or holders of\r\npermission Manifest.permission.MANAGE_DEVICE_POLICY_ORGANIZATION_IDENTITY to re\r\nthe name of the organization under management.\r\nList\u003cApnSetting\u003e\r\ngetOverrideApns(ComponentName admin)\r\nCalled by device owner or managed profile owner to get all override APNs inserted by d\r\nowner or managed profile owner previously using addOverrideApn(ComponentName,\r\nApnSetting) .\r\nDevicePolicyManager\r\ngetParentProfileInstance(ComponentName admin)\r\nCalled by the profile owner of a managed profile or other apps in a managed profile to o\r\nDevicePolicyManager whose calls act on the parent profile.\r\nint\r\ngetPasswordComplexity()\r\nReturns how complex the current user's screen lock is.\r\nlong\r\ngetPasswordExpiration(ComponentName admin)\r\nGet the current password expiration time for a particular admin or all admins that set\r\nrestrictions on this user and its participating profiles.\r\nlong\r\ngetPasswordExpirationTimeout(ComponentName admin)\r\nGet the password expiration timeout for the given admin.\r\nint\r\ngetPasswordHistoryLength(ComponentName admin)\r\nRetrieve the current password history length for a particular admin or all admins that set\r\nrestrictions on this user and its participating profiles.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 25 of 178\n\nint\r\ngetPasswordMaximumLength(int quality)\r\nReturn the maximum password length that the device supports for a particular password\r\nint\r\ngetPasswordMinimumLength(ComponentName admin)\r\nThis method was deprecated in API level 31. see setPasswordQuality(ComponentName,i\r\nfor details.\r\nint\r\ngetPasswordMinimumLetters(ComponentName admin)\r\nThis method was deprecated in API level 31. see setPasswordQuality(ComponentName,i\r\nfor details.\r\nint\r\ngetPasswordMinimumLowerCase(ComponentName admin)\r\nThis method was deprecated in API level 31. see setPasswordQuality(ComponentName,i\r\nfor details.\r\nint\r\ngetPasswordMinimumNonLetter(ComponentName admin)\r\nThis method was deprecated in API level 31. see setPasswordQuality(ComponentName,i\r\nfor details.\r\nint\r\ngetPasswordMinimumNumeric(ComponentName admin)\r\nThis method was deprecated in API level 31. see setPasswordQuality(ComponentName,i\r\nfor details.\r\nint\r\ngetPasswordMinimumSymbols(ComponentName admin)\r\nThis method was deprecated in API level 31. see setPasswordQuality(ComponentName,i\r\nfor details.\r\nint\r\ngetPasswordMinimumUpperCase(ComponentName admin)\r\nThis method was deprecated in API level 31. see setPasswordQuality(ComponentName,i\r\nfor details.\r\nint\r\ngetPasswordQuality(ComponentName admin)\r\nThis method was deprecated in API level 31. see setPasswordQuality(ComponentName,i\r\nfor details.\r\nSystemUpdateInfo\r\ngetPendingSystemUpdate(ComponentName admin)\r\nGet information about a pending system update.\r\nint\r\ngetPermissionGrantState(ComponentName admin, String packageName, String permis\r\nReturns the current grant state of a runtime permission for a specific application.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 26 of 178\n\nint\r\ngetPermissionPolicy(ComponentName admin)\r\nReturns the current runtime permission policy set by the device or profile owner.\r\nList\u003cString\u003e\r\ngetPermittedAccessibilityServices(ComponentName admin)\r\nReturns the list of permitted accessibility services set by this device or profile owner.\r\nList\u003cString\u003e\r\ngetPermittedCrossProfileNotificationListeners(ComponentName admin)\r\nReturns the list of packages installed on the primary user that allowed to use a\r\nNotificationListenerService to receive notifications from this managed profile, as se\r\nthe profile owner.\r\nList\u003cString\u003e\r\ngetPermittedInputMethods(ComponentName admin)\r\nReturns the list of permitted input methods set by this device or profile owner.\r\nint\r\ngetPersonalAppsSuspendedReasons(ComponentName admin)\r\nCalled by profile owner of an organization-owned managed profile to check whether per\r\napps are suspended.\r\nList\u003cPreferentialNetworkServiceConfig\u003e\r\ngetPreferentialNetworkServiceConfigs()\r\nGet preferential network configuration\r\nint\r\ngetRequiredPasswordComplexity()\r\nGets the password complexity requirement set by setRequiredPasswordComplexity(int\r\nthe current user.\r\nlong\r\ngetRequiredStrongAuthTimeout(ComponentName admin)\r\nDetermine for how long the user will be able to use secondary, non strong auth for\r\nauthentication, since last strong method authentication (password, pin or pattern) was us\r\nDevicePolicyResourcesManager\r\ngetResources()\r\nReturns a DevicePolicyResourcesManager containing the required APIs to set, reset, an\r\ndevice policy related resources.\r\nboolean\r\ngetScreenCaptureDisabled(ComponentName admin)\r\nDetermine whether or not screen capture has been disabled by the calling admin, if spec\r\nall admins.\r\nList\u003cUserHandle\u003e\r\ngetSecondaryUsers(ComponentName admin)\r\nCalled by a device owner to list all secondary users on the device.\r\nCharSequence getShortSupportMessage(ComponentName admin)\r\nCalled by a device admin or holder of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_SUPPORT_MESSAGE to get the short suppor\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 27 of 178\n\nmessage.\r\nCharSequence\r\ngetStartUserSessionMessage(ComponentName admin)\r\nReturns the user session start message.\r\nboolean\r\ngetStorageEncryption(ComponentName admin)\r\nThis method was deprecated in API level 30. This method only returns the value set by\r\nsetStorageEncryption(ComponentName, boolean) . It does not actually reflect the stora\r\nencryption status. Use getStorageEncryptionStatus() for that. Called by an applicati\r\nis administering the device to determine the requested setting for secure storage.\r\nint\r\ngetStorageEncryptionStatus()\r\nCalled by an application that is administering the device to determine the current encryp\r\nstatus of the device.\r\nSet\u003cInteger\u003e\r\ngetSubscriptionIds()\r\nReturns the subscription ids of all subscriptions which were downloaded by the calling a\r\nSystemUpdatePolicy\r\ngetSystemUpdatePolicy()\r\nRetrieve a local system update policy set previously by\r\nsetSystemUpdatePolicy(ComponentName, SystemUpdatePolicy) .\r\nPersistableBundle\r\ngetTransferOwnershipBundle()\r\nReturns the data passed from the current administrator to the new administrator during a\r\nownership transfer.\r\nList\u003cPersistableBundle\u003e\r\ngetTrustAgentConfiguration(ComponentName admin, ComponentName agent)\r\nGets configuration for the given trust agent based on aggregating all calls to\r\nsetTrustAgentConfiguration(ComponentName,ComponentName,PersistableBundle) for\r\ndevice admins.\r\nList\u003cString\u003e\r\ngetUserControlDisabledPackages(ComponentName admin)\r\nReturns the list of packages over which user control is disabled by a device or profile ow\r\nholders of the permission Manifest.permission.MANAGE_DEVICE_POLICY_APPS_CONTROL .\r\nBundle\r\ngetUserRestrictions(ComponentName admin)\r\nCalled by an admin to get user restrictions set by themselves with\r\naddUserRestriction(ComponentName,String) .\r\nBundle\r\ngetUserRestrictionsGlobally()\r\nCalled by a profile or device owner to get global user restrictions set with\r\naddUserRestrictionGlobally(String) .\r\nString getWifiMacAddress(ComponentName admin)\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 28 of 178\n\nCalled by a device owner or profile owner on organization-owned device to get the MAC\r\naddress of the Wi-Fi device.\r\nWifiSsidPolicy\r\ngetWifiSsidPolicy()\r\nReturns the current Wi-Fi SSID policy.\r\nboolean\r\ngrantKeyPairToApp(ComponentName admin, String alias, String packageName)\r\nCalled by a device or profile owner, or delegated certificate chooser (an app that has bee\r\ndelegated the DELEGATION_CERT_SELECTION privilege), to grant an application access to\r\nalready-installed (or generated) KeyChain key.\r\nboolean\r\ngrantKeyPairToWifiAuth(String alias)\r\nCalled by a device or profile owner, or delegated certificate chooser (an app that has bee\r\ndelegated the DELEGATION_CERT_SELECTION privilege), to allow using a KeyChain key p\r\nauthentication to Wifi networks.\r\nboolean\r\nhasCaCertInstalled(ComponentName admin, byte[] certBuffer)\r\nReturns whether this certificate is installed as a trusted CA.\r\nboolean\r\nhasGrantedPolicy(ComponentName admin, int usesPolicy)\r\nReturns true if an administrator has been granted a particular device policy.\r\nboolean\r\nhasKeyPair(String alias)\r\nThis API can be called by the following to query whether a certificate and private key ar\r\ninstalled under a given alias:\r\nDevice owner\r\nProfile owner\r\nDelegated certificate installer\r\nCredential management app\r\nAn app that holds the Manifest.permission.MANAGE_DEVICE_POLICY_CERTIFICATE\r\npermission\r\nIf called by the credential management app, the alias must exist in the credential manage\r\napp's AppUriAuthenticationPolicy .\r\nboolean\r\nhasLockdownAdminConfiguredNetworks(ComponentName admin)\r\nCalled by a device owner or a profile owner of an organization-owned managed profile t\r\ndetermine whether the user is prevented from modifying networks configured by the adm\r\nboolean\r\ninstallCaCert(ComponentName admin, byte[] certBuffer)\r\nInstalls the given certificate as a user CA.\r\nboolean\r\ninstallExistingPackage(ComponentName admin, String packageName)\r\nInstall an existing package that has been installed in another user, or has been kept after\r\nremoval via setKeepUninstalledPackages(ComponentName, List) .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 29 of 178\n\nboolean\r\ninstallKeyPair(ComponentName admin, PrivateKey privKey, Certificate[] certs, S\r\nalias, int flags)\r\nThis API can be called by the following to install a certificate chain and corresponding p\r\nkey for the leaf certificate:\r\nDevice owner\r\nProfile owner\r\nDelegated certificate installer\r\nCredential management app\r\nAn app that holds the Manifest.permission.MANAGE_DEVICE_POLICY_CERTIFICATE\r\npermission\r\nAll apps within the profile will be able to access the certificate chain and use the private\r\ngiven direct user approval (if the user is allowed to select the private key).\r\nboolean\r\ninstallKeyPair(ComponentName admin, PrivateKey privKey, Certificate[] certs, S\r\nalias, boolean requestAccess)\r\nThis API can be called by the following to install a certificate chain and corresponding p\r\nkey for the leaf certificate:\r\nDevice owner\r\nProfile owner\r\nDelegated certificate installer\r\nCredential management app\r\nAn app that holds the Manifest.permission.MANAGE_DEVICE_POLICY_CERTIFICATE\r\npermission\r\nAll apps within the profile will be able to access the certificate chain and use the private\r\ngiven direct user approval.\r\nboolean\r\ninstallKeyPair(ComponentName admin, PrivateKey privKey, Certificate cert, Stri\r\nalias)\r\nThis API can be called by the following to install a certificate and corresponding private\r\nDevice owner\r\nProfile owner\r\nDelegated certificate installer\r\nCredential management app\r\nAn app that holds the Manifest.permission.MANAGE_DEVICE_POLICY_CERTIFICATE\r\npermission\r\nAll apps within the profile will be able to access the certificate and use the private key, g\r\ndirect user approval.\r\nvoid\r\ninstallSystemUpdate(ComponentName admin, Uri updateFilePath, Executor executor\r\nDevicePolicyManager.InstallSystemUpdateCallback callback)\r\nCalled by device owner or profile owner of an organization-owned managed profile to in\r\nsystem update from the given file.\r\nboolean\r\nisActivePasswordSufficient()\r\nDetermines whether the calling user's current password meets policy requirements (e.g. \r\nminimum length).\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 30 of 178\n\nboolean\r\nisActivePasswordSufficientForDeviceRequirement()\r\nCalled by profile owner of a managed profile to determine whether the current device pa\r\nmeets policy requirements set explicitly device-wide.\r\nboolean\r\nisAdminActive(ComponentName admin)\r\nReturn true if the given administrator component is currently active (enabled) in the syst\r\nboolean\r\nisAffiliatedUser()\r\nReturns whether this user is affiliated with the device.\r\nboolean\r\nisAlwaysOnVpnLockdownEnabled(ComponentName admin)\r\nCalled by device or profile owner to query whether current always-on VPN is configure\r\nlockdown mode.\r\nboolean\r\nisApplicationHidden(ComponentName admin, String packageName)\r\nDetermine if a package is hidden.\r\nboolean\r\nisBackupServiceEnabled(ComponentName admin)\r\nReturn whether the backup service is enabled by the device owner or profile owner for th\r\ncurrent user, as previously set by setBackupServiceEnabled(ComponentName,boolean) .\r\nboolean\r\nisCallerApplicationRestrictionsManagingPackage()\r\nThis method was deprecated in API level 26. From Build.VERSION_CODES.O . Use\r\ngetDelegatedScopes(ComponentName, String) instead.\r\nboolean\r\nisCommonCriteriaModeEnabled(ComponentName admin)\r\nReturns whether Common Criteria mode is currently enabled.\r\nboolean\r\nisComplianceAcknowledgementRequired()\r\nCalled by a profile owner of an organization-owned managed profile to query whether it\r\nto acknowledge device compliance to allow the user to turn the profile off if needed acco\r\nto the maximum profile time off policy.\r\nboolean\r\nisDeviceFinanced()\r\nReturns true if this device is marked as a financed device.\r\nboolean\r\nisDeviceIdAttestationSupported()\r\nReturns true if the device supports attestation of device identifiers in addition to key\r\nattestation.\r\nboolean\r\nisDeviceOwnerApp(String packageName)\r\nUsed to determine if a particular package has been registered as a Device Owner app.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 31 of 178\n\nboolean\r\nisEphemeralUser(ComponentName admin)\r\nChecks if the profile owner is running in an ephemeral user.\r\nboolean\r\nisKeyPairGrantedToWifiAuth(String alias)\r\nCalled by a device or profile owner, or delegated certificate chooser (an app that has bee\r\ndelegated the DELEGATION_CERT_SELECTION privilege), to query whether a KeyChain ke\r\ncan be used for authentication to Wifi networks.\r\nboolean\r\nisLockTaskPermitted(String pkg)\r\nThis function lets the caller know whether the given component is allowed to start the lo\r\nmode.\r\nboolean\r\nisLogoutEnabled()\r\nReturns whether logout is enabled by a device owner.\r\nboolean\r\nisManagedProfile(ComponentName admin)\r\nReturn if this user is a managed profile of another user.\r\nboolean\r\nisMasterVolumeMuted(ComponentName admin)\r\nCalled by profile or device owners to check whether the global volume mute is on or off\r\nstatic boolean\r\nisMtePolicyEnforced()\r\nGet the current MTE state of the device.\r\nboolean\r\nisNetworkLoggingEnabled(ComponentName admin)\r\nReturn whether network logging is enabled by a device owner or profile owner of a man\r\nprofile.\r\nboolean\r\nisOrganizationOwnedDeviceWithManagedProfile()\r\nApps can use this method to find out if the device was provisioned as organization-owen\r\ndevice with a managed profile.\r\nboolean\r\nisOverrideApnEnabled(ComponentName admin)\r\nCalled by device owner to check if override APNs are currently enabled.\r\nboolean\r\nisPackageSuspended(ComponentName admin, String packageName)\r\nDetermine if a package is suspended.\r\nboolean\r\nisPreferentialNetworkServiceEnabled()\r\nIndicates whether preferential network service is enabled.\r\nboolean isProfileOwnerApp(String packageName)\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 32 of 178\n\nUsed to determine if a particular package is registered as the profile owner for the user.\r\nboolean\r\nisProvisioningAllowed(String action)\r\nReturns whether it is possible for the caller to initiate provisioning of a managed profile\r\ndevice, setting itself as the device or profile owner.\r\nboolean\r\nisResetPasswordTokenActive(ComponentName admin)\r\nCalled by a profile, device owner or a holder of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_RESET_PASSWORD to check if the current r\r\npassword token is active.\r\nboolean\r\nisSafeOperation(int reason)\r\nChecks if it's safe to run operations that can be affected by the given reason .\r\nboolean\r\nisSecurityLoggingEnabled(ComponentName admin)\r\nReturn whether security logging is enabled or not by the admin.\r\nboolean\r\nisStatusBarDisabled()\r\nReturns whether the status bar is disabled/enabled, see setStatusBarDisabled(Componen\r\nboolean) .\r\nboolean\r\nisUninstallBlocked(ComponentName admin, String packageName)\r\nCheck whether the user has been blocked by device policy from uninstalling a package.\r\nboolean\r\nisUniqueDeviceAttestationSupported()\r\nReturns true if the StrongBox Keymaster implementation on the device was provision\r\nan individual attestation certificate and can sign attestation records using it (as attestation\r\nan individual attestation certificate is a feature only Keymaster implementations with\r\nStrongBox security level can implement).\r\nboolean\r\nisUsbDataSignalingEnabled()\r\nReturns whether USB data signaling is currently enabled.\r\nboolean\r\nisUsingUnifiedPassword(ComponentName admin)\r\nWhen called by a profile owner of a managed profile returns true if the profile uses unifi\r\nchallenge with its parent user.\r\nList\u003cUserHandle\u003e\r\nlistForegroundAffiliatedUsers()\r\nGets the list of affiliated users running on foreground.\r\nvoid\r\nlockNow()\r\nMake the device lock immediately, as if the lock screen timeout has expired at the point\r\ncall.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 33 of 178\n\nvoid\r\nlockNow(int flags)\r\nMake the device lock immediately, as if the lock screen timeout has expired at the point\r\ncall.\r\nint\r\nlogoutUser(ComponentName admin)\r\nCalled by a profile owner of secondary user that is affiliated with the device to stop the c\r\nuser and switch back to primary user (when the user was\r\nswitchUser(ComponentName,UserHandle) switched to) or stop the user (when it was st\r\nin background .\r\nvoid\r\nreboot(ComponentName admin)\r\nCalled by device owner to reboot the device.\r\nvoid\r\nremoveActiveAdmin(ComponentName admin)\r\nRemove a current administration component.\r\nboolean\r\nremoveCrossProfileWidgetProvider(ComponentName admin, String packageName)\r\nThis method was deprecated in API level 37. While this API still works to mutate the cur\r\nallowlist, please consider switching to setCrossProfileWidgetProviders(Set) for bett\r\nperformance.\r\nboolean\r\nremoveKeyPair(ComponentName admin, String alias)\r\nThis API can be called by the following to remove a certificate and private key pair insta\r\nunder a given alias:\r\nDevice owner\r\nProfile owner\r\nDelegated certificate installer\r\nCredential management app\r\nFrom Android Build.VERSION_CODES.S , the credential management app can call this AP\r\nboolean\r\nremoveOverrideApn(ComponentName admin, int apnId)\r\nCalled by device owner or managed profile owner to remove an override APN.\r\nboolean\r\nremoveUser(ComponentName admin, UserHandle userHandle)\r\nCalled by a device owner to remove a user/profile and all associated data.\r\nboolean\r\nrequestBugreport(ComponentName admin)\r\nCalled by a device owner to request a bugreport.\r\nboolean\r\nresetPassword(String password, int flags)\r\nThis method was deprecated in API level 30. Please use\r\nresetPasswordWithToken(ComponentName, String, byte, int) instead.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 34 of 178\n\nboolean\r\nresetPasswordWithToken(ComponentName admin, String password, byte[] token, int\r\nflags)\r\nCalled by device or profile owner to force set a new device unlock password or a manag\r\nprofile challenge on current user.\r\nList\u003cNetworkEvent\u003e\r\nretrieveNetworkLogs(ComponentName admin, long batchToken)\r\nCalled by device owner, profile owner of a managed profile or delegated app with\r\nDELEGATION_NETWORK_LOGGING to retrieve the most recent batch of network logging eve\r\nList\u003cSecurityLog.SecurityEvent\u003e\r\nretrievePreRebootSecurityLogs(ComponentName admin)\r\nCalled by device owner or profile owner of an organization-owned managed profile to re\r\ndevice logs from before the device's last reboot.\r\nList\u003cSecurityLog.SecurityEvent\u003e\r\nretrieveSecurityLogs(ComponentName admin)\r\nCalled by device owner or profile owner of an organization-owned managed profile to re\r\nall new security logging entries since the last call to this API after device boots.\r\nboolean\r\nrevokeKeyPairFromApp(ComponentName admin, String alias, String packageName)\r\nCalled by a device or profile owner, or delegated certificate chooser (an app that has bee\r\ndelegated the DELEGATION_CERT_SELECTION privilege), to revoke an application's grant t\r\nKeyChain key pair.\r\nboolean\r\nrevokeKeyPairFromWifiAuth(String alias)\r\nCalled by a device or profile owner, or delegated certificate chooser (an app that has bee\r\ndelegated the DELEGATION_CERT_SELECTION privilege), to deny using a KeyChain key pa\r\nauthentication to Wifi networks.\r\nvoid\r\nsetAccountManagementDisabled(ComponentName admin, String accountType, boolean\r\ndisabled)\r\nCalled by a device owner or profile owner to disable account management for a specific\r\naccount.\r\nvoid\r\nsetAffiliationIds(ComponentName admin, Set\u003cString\u003e ids)\r\nIndicates the entity that controls the device.\r\nvoid\r\nsetAlwaysOnVpnPackage(ComponentName admin, String vpnPackage, boolean\r\nlockdownEnabled)\r\nCalled by a device or profile owner to configure an always-on VPN connection through\r\nspecific application for the current user.\r\nvoid setAlwaysOnVpnPackage(ComponentName admin, String vpnPackage, boolean\r\nlockdownEnabled, Set\u003cString\u003e lockdownAllowlist)\r\nA version of setAlwaysOnVpnPackage(ComponentName,String,boolean) that allows the\r\nto specify a set of apps that should be able to access the network directly when VPN is n\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 35 of 178\n\nconnected.\r\nvoid\r\nsetAppFunctionsPolicy(int policy)\r\nSets the AppFunctionManager policy which controls app functions operations on the de\r\nboolean\r\nsetApplicationHidden(ComponentName admin, String packageName, boolean hidden)\r\nHide or unhide packages.\r\nvoid\r\nsetApplicationRestrictions(ComponentName admin, String packageName, Bundle\r\nsettings)\r\nSets the application restrictions for a given target application running in the calling user.\r\nvoid\r\nsetApplicationRestrictionsManagingPackage(ComponentName admin, String packageN\r\nThis method was deprecated in API level 26. From Build.VERSION_CODES.O . Use\r\nsetDelegatedScopes(ComponentName, String, List) with the\r\nDELEGATION_APP_RESTRICTIONS scope instead.\r\nvoid\r\nsetAutoTimeEnabled(ComponentName admin, boolean enabled)\r\nCalled by a device owner, a profile owner for the primary user or a profile owner of an\r\norganization-owned managed profile to turn auto time on and off.\r\nvoid\r\nsetAutoTimePolicy(int policy)\r\nCalled by a device owner, a profile owner for the primary user or a profile owner of an\r\norganization-owned managed profile to turn auto time on and off i.e.\r\nvoid\r\nsetAutoTimeRequired(ComponentName admin, boolean required)\r\nThis method was deprecated in API level 30. From Build.VERSION_CODES.R . Use\r\nsetAutoTimeEnabled(ComponentName, boolean) to turn auto time on or off and use\r\nUserManager.DISALLOW_CONFIG_DATE_TIME to prevent the user from changing this settin\r\nvoid\r\nsetAutoTimeZoneEnabled(ComponentName admin, boolean enabled)\r\nCalled by a device owner, a profile owner for the primary user or a profile owner of an\r\norganization-owned managed profile to turn auto time zone on and off.\r\nvoid\r\nsetAutoTimeZonePolicy(int policy)\r\nCalled by a device owner, a profile owner for the primary user or a profile owner of an\r\norganization-owned managed profile to turn auto time zone on and off.\r\nvoid\r\nsetBackupServiceEnabled(ComponentName admin, boolean enabled)\r\nAllows the device owner or profile owner to enable or disable the backup service.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 36 of 178\n\nvoid\r\nsetBluetoothContactSharingDisabled(ComponentName admin, boolean disabled)\r\nCalled by a profile owner of a managed profile to set whether bluetooth devices can acce\r\nenterprise contacts.\r\nvoid\r\nsetCameraDisabled(ComponentName admin, boolean disabled)\r\nCalled by an application that is administering the device to disable all cameras on the de\r\nfor this user.\r\nvoid\r\nsetCertInstallerPackage(ComponentName admin, String installerPackage)\r\nThis method was deprecated in API level 26. From Build.VERSION_CODES.O . Use\r\nsetDelegatedScopes(ComponentName, String, List) with the DELEGATION_CERT_INSTA\r\nscope instead.\r\nvoid\r\nsetCommonCriteriaModeEnabled(ComponentName admin, boolean enabled)\r\nCalled by device owner or profile owner of an organization-owned managed profile to to\r\nCommon Criteria mode for the device.\r\nvoid\r\nsetConfiguredNetworksLockdownState(ComponentName admin, boolean lockdown)\r\nCalled by a device owner or a profile owner of an organization-owned managed profile t\r\ncontrol whether the user can change networks configured by the admin.\r\nvoid\r\nsetContentProtectionPolicy(ComponentName admin, int policy)\r\nSets the content protection policy which controls scanning for deceptive apps.\r\nvoid\r\nsetCredentialManagerPolicy(PackagePolicy policy)\r\nCalled by a device owner or profile owner of a managed profile to set the credential man\r\npolicy.\r\nvoid\r\nsetCrossProfileCalendarPackages(ComponentName admin, Set\u003cString\u003e packageNames)\r\nThis method was deprecated in API level 34. Use\r\nsetCrossProfilePackages(ComponentName,Set) .\r\nvoid\r\nsetCrossProfileCallerIdDisabled(ComponentName admin, boolean disabled)\r\nThis method was deprecated in API level 34. starting with\r\nBuild.VERSION_CODES.UPSIDE_DOWN_CAKE , use\r\nsetManagedProfileCallerIdAccessPolicy(PackagePolicy) instead\r\nvoid\r\nsetCrossProfileContactsSearchDisabled(ComponentName admin, boolean disabled)\r\nThis method was deprecated in API level 34. From Build.VERSION_CODES.UPSIDE_DOWN_\r\nuse setManagedProfileContactsAccessPolicy(PackagePolicy)\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 37 of 178\n\nvoid\r\nsetCrossProfilePackages(ComponentName admin, Set\u003cString\u003e packageNames)\r\nSets the set of admin-allowlisted package names that are allowed to request user consent\r\ncross-profile communication.\r\nvoid\r\nsetCrossProfileWidgetProviders(Set\u003cString\u003e packageNames)\r\nCalled by the profile owner of a managed profile or a holder of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_PROFILE_INTERACTION to enable widget\r\nproviders from packages to be available in the parent profile.\r\nvoid\r\nsetDefaultDialerApplication(String packageName)\r\nMust be called by a device owner or a profile owner of an organization-owned managed\r\nto set the default dialer application for the calling user.\r\nvoid\r\nsetDefaultSmsApplication(ComponentName admin, String packageName)\r\nMust be called by a device owner or a profile owner of an organization-owned managed\r\nto set the default SMS application.\r\nvoid\r\nsetDelegatedScopes(ComponentName admin, String delegatePackage, List\u003cString\u003e\r\nscopes)\r\nCalled by a profile owner or device owner to grant access to privileged APIs to another a\r\nvoid\r\nsetDeviceOwnerLockScreenInfo(ComponentName admin, CharSequence info)\r\nSets the device owner information to be shown on the lock screen.\r\nvoid\r\nsetEndUserSessionMessage(ComponentName admin, CharSequence endUserSessionMessa\r\nCalled by a device owner to specify the user session end message.\r\nvoid\r\nsetFactoryResetProtectionPolicy(ComponentName admin, FactoryResetProtectionPol\r\npolicy)\r\nCallable by device owner or profile owner of an organization-owned device, to set a fact\r\nreset protection (FRP) policy.\r\nint\r\nsetGlobalPrivateDnsModeOpportunistic(ComponentName admin)\r\nSets the global Private DNS mode to opportunistic.\r\nint\r\nsetGlobalPrivateDnsModeSpecifiedHost(ComponentName admin, String privateDnsHos\r\nSets the global Private DNS host to be used.\r\nvoid\r\nsetGlobalSetting(ComponentName admin, String setting, String value)\r\nThis method is mostly deprecated.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 38 of 178\n\nvoid\r\nsetKeepUninstalledPackages(ComponentName admin, List\u003cString\u003e packageNames)\r\nSet a list of apps to keep around as APKs even if no user has currently installed it.\r\nboolean\r\nsetKeyPairCertificate(ComponentName admin, String alias, List\u003cCertificate\u003e cer\r\nboolean isUserSelectable)\r\nThis API can be called by the following to associate certificates with a key pair that was\r\ngenerated using generateKeyPair(ComponentName, String, KeyGenParameterSpec, int\r\nset whether the key is available for the user to choose in the certificate selection prompt:\r\nDevice owner\r\nProfile owner\r\nDelegated certificate installer\r\nCredential management app\r\nFrom Android Build.VERSION_CODES.S , the credential management app can call this AP\r\nboolean\r\nsetKeyguardDisabled(ComponentName admin, boolean disabled)\r\nCalled by a device owner or profile owner of secondary users that is affiliated with the d\r\nto disable the keyguard altogether.\r\nvoid\r\nsetKeyguardDisabledFeatures(ComponentName admin, int which)\r\nCalled by an application that is administering the device to disable keyguard customizati\r\nsuch as widgets.\r\nvoid\r\nsetLocationEnabled(ComponentName admin, boolean locationEnabled)\r\nCalled by device owners to set the user's global location setting.\r\nvoid\r\nsetLockTaskFeatures(ComponentName admin, int flags)\r\nSets which system features are enabled when the device runs in lock task mode.\r\nvoid\r\nsetLockTaskPackages(ComponentName admin, String[] packages)\r\nSets which packages may enter lock task mode.\r\nvoid\r\nsetLogoutEnabled(ComponentName admin, boolean enabled)\r\nCalled by a device owner to specify whether logout is enabled for all secondary users.\r\nvoid\r\nsetLongSupportMessage(ComponentName admin, CharSequence message)\r\nCalled by a device admin to set the long support message.\r\nvoid\r\nsetManagedProfileCallerIdAccessPolicy(PackagePolicy policy)\r\nCalled by a profile owner of a managed profile to set the packages that are allowed to lo\r\ncontacts in the managed profile based on caller id information.\r\nvoid setManagedProfileContactsAccessPolicy(PackagePolicy policy)\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 39 of 178\n\nCalled by a profile owner of a managed profile to set the packages that are allowed acce\r\nthe managed profile contacts from the parent user.\r\nvoid\r\nsetManagedProfileMaximumTimeOff(ComponentName admin, long timeoutMillis)\r\nCalled by a profile owner of an organization-owned managed profile to set maximum tim\r\nprofile is allowed to be turned off.\r\nvoid\r\nsetManagedSubscriptionsPolicy(ManagedSubscriptionsPolicy policy)\r\nCalled by a profile owner of an organization-owned device to specify\r\nManagedSubscriptionsPolicy\r\nManaged subscriptions policy controls how SIMs would be associated with the managed\r\nprofile.\r\nvoid\r\nsetMasterVolumeMuted(ComponentName admin, boolean on)\r\nCalled by profile or device owners to set the global volume mute on or off.\r\nvoid\r\nsetMaximumFailedPasswordsForWipe(ComponentName admin, int num)\r\nSetting this to a value greater than zero enables a policy that will perform a device or pro\r\nwipe after too many incorrect device-unlock passwords have been entered.\r\nvoid\r\nsetMaximumTimeToLock(ComponentName admin, long timeMs)\r\nCalled by an application that is administering the device to set the maximum time for us\r\nactivity until the device will lock.\r\nList\u003cString\u003e\r\nsetMeteredDataDisabledPackages(ComponentName admin, List\u003cString\u003e packageNames)\r\nCalled by a device or profile owner to restrict packages from using metered data.\r\nvoid\r\nsetMinimumRequiredWifiSecurityLevel(int level)\r\nCalled by device owner or profile owner of an organization-owned managed profile to sp\r\nthe minimum security level required for Wi-Fi networks.\r\nvoid\r\nsetMtePolicy(int policy)\r\nCalled by a device owner, profile owner of an organization-owned device, to set the Mem\r\nTagging Extension (MTE) policy.\r\nvoid\r\nsetNearbyAppStreamingPolicy(int policy)\r\nCalled by a device/profile owner to set nearby app streaming policy.\r\nvoid\r\nsetNearbyNotificationStreamingPolicy(int policy)\r\nCalled by a device/profile owner to set nearby notification streaming policy.\r\nvoid setNetworkLoggingEnabled(ComponentName admin, boolean enabled)\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 40 of 178\n\nCalled by a device owner, profile owner of a managed profile or delegated app with\r\nDELEGATION_NETWORK_LOGGING to control the network logging feature.\r\nvoid\r\nsetOrganizationColor(ComponentName admin, int color)\r\nThis method was deprecated in API level 31. From Build.VERSION_CODES.R , the organ\r\ncolor is never used as the background color of the confirm credentials screen.\r\nvoid\r\nsetOrganizationId(String enterpriseId)\r\nSets the Enterprise ID for the work profile or managed device.\r\nvoid\r\nsetOrganizationName(ComponentName admin, CharSequence title)\r\nCalled by the device owner (since API 26) or profile owner (since API 24) to set the nam\r\nthe organization under management.\r\nvoid\r\nsetOverrideApnsEnabled(ComponentName admin, boolean enabled)\r\nCalled by device owner to set if override APNs should be enabled.\r\nString[]\r\nsetPackagesSuspended(ComponentName admin, String[] packageNames, boolean suspe\r\nCalled by device or profile owners to suspend packages for this user.\r\nvoid\r\nsetPasswordExpirationTimeout(ComponentName admin, long timeout)\r\nCalled by a device admin to set the password expiration timeout.\r\nvoid\r\nsetPasswordHistoryLength(ComponentName admin, int length)\r\nCalled by an application that is administering the device to set the length of the passwor\r\nhistory.\r\nvoid\r\nsetPasswordMinimumLength(ComponentName admin, int length)\r\nThis method was deprecated in API level 31. see setPasswordQuality(ComponentName,i\r\nfor details.\r\nvoid\r\nsetPasswordMinimumLetters(ComponentName admin, int length)\r\nThis method was deprecated in API level 31. see setPasswordQuality(ComponentName,i\r\nfor details.\r\nvoid\r\nsetPasswordMinimumLowerCase(ComponentName admin, int length)\r\nThis method was deprecated in API level 31. see setPasswordQuality(ComponentName,i\r\nfor details.\r\nvoid\r\nsetPasswordMinimumNonLetter(ComponentName admin, int length)\r\nThis method was deprecated in API level 31. see setPasswordQuality(ComponentName,i\r\nfor details.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 41 of 178\n\nvoid\r\nsetPasswordMinimumNumeric(ComponentName admin, int length)\r\nThis method was deprecated in API level 31. see setPasswordQuality(ComponentName,i\r\nfor details.\r\nvoid\r\nsetPasswordMinimumSymbols(ComponentName admin, int length)\r\nThis method was deprecated in API level 31. see setPasswordQuality(ComponentName,i\r\nfor details.\r\nvoid\r\nsetPasswordMinimumUpperCase(ComponentName admin, int length)\r\nThis method was deprecated in API level 31. see setPasswordQuality(ComponentName,i\r\nfor details.\r\nvoid\r\nsetPasswordQuality(ComponentName admin, int quality)\r\nThis method was deprecated in API level 31. Prefer using\r\nsetRequiredPasswordComplexity(int) , to require a password that satisfies a complexi\r\ndefined by the platform, rather than specifying custom password requirement. Setting cu\r\noverly-complicated password requirements leads to passwords that are hard for users to\r\nremember and may not provide any security benefits given as Android uses hardware-ba\r\nthrottling to thwart online and offline brute-forcing of the device's screen lock. Company\r\ndevices (fully-managed and organization-owned managed profile devices) are able to co\r\nusing this method, though it is recommended that setRequiredPasswordComplexity(int\r\nshould be used instead.\r\nboolean\r\nsetPermissionGrantState(ComponentName admin, String packageName, String permis\r\nint grantState)\r\nSets the grant state of a runtime permission for a specific application.\r\nvoid\r\nsetPermissionPolicy(ComponentName admin, int policy)\r\nSet the default response for future runtime permission requests by applications.\r\nboolean\r\nsetPermittedAccessibilityServices(ComponentName admin, List\u003cString\u003e packageNam\r\nCalled by a profile or device owner to set the permitted AccessibilityService .\r\nboolean\r\nsetPermittedCrossProfileNotificationListeners(ComponentName admin, List\u003cString\r\npackageList)\r\nCalled by a profile owner of a managed profile to set the packages that are allowed to us\r\nNotificationListenerService in the primary user to see notifications from the manag\r\nprofile.\r\nboolean\r\nsetPermittedInputMethods(ComponentName admin, List\u003cString\u003e packageNames)\r\nCalled by a profile or device owner or holder of the\r\nManifest.permission.MANAGE_DEVICE_POLICY_INPUT_METHODS permission to set the perm\r\ninput methods services for this user.\r\nvoid setPersonalAppsSuspended(ComponentName admin, boolean suspended)\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 42 of 178\n\nCalled by a profile owner of an organization-owned managed profile to suspend persona\r\non the device.\r\nvoid\r\nsetPreferentialNetworkServiceConfigs(List\u003cPreferentialNetworkServiceConfig\u003e\r\npreferentialNetworkServiceConfigs)\r\nSets preferential network configurations.\r\nvoid\r\nsetPreferentialNetworkServiceEnabled(boolean enabled)\r\nSets whether preferential network service is enabled.\r\nvoid\r\nsetProfileEnabled(ComponentName admin)\r\nSets the enabled state of the profile.\r\nvoid\r\nsetProfileName(ComponentName admin, String profileName)\r\nSets the name of the profile.\r\nvoid\r\nsetRecommendedGlobalProxy(ComponentName admin, ProxyInfo proxyInfo)\r\nSet a network-independent global HTTP proxy.\r\nvoid\r\nsetRequiredPasswordComplexity(int passwordComplexity)\r\nSets a minimum password complexity requirement for the user's screen lock.\r\nvoid\r\nsetRequiredStrongAuthTimeout(ComponentName admin, long timeoutMs)\r\nCalled by a device/profile owner to set the timeout after which unlocking with secondary\r\nstrong auth (e.g. fingerprint, face, trust agents) times out, i.e.\r\nboolean\r\nsetResetPasswordToken(ComponentName admin, byte[] token)\r\nCalled by a profile or device owner to provision a token which can later be used to reset\r\ndevice lockscreen password (if called by device owner), or managed profile challenge (i\r\nby profile owner), via resetPasswordWithToken(ComponentName, String, byte, int) .\r\nvoid\r\nsetRestrictionsProvider(ComponentName admin, ComponentName provider)\r\nDesignates a specific service component as the provider for making permission requests\r\nlocal or remote administrator of the user.\r\nvoid\r\nsetScreenCaptureDisabled(ComponentName admin, boolean disabled)\r\nCalled by a device/profile owner to set whether the screen capture is disabled.\r\nvoid\r\nsetSecureSetting(ComponentName admin, String setting, String value)\r\nThis method is mostly deprecated.\r\nvoid setSecurityLoggingEnabled(ComponentName admin, boolean enabled)\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 43 of 178\n\nCalled by device owner or a profile owner of an organization-owned managed profile to\r\nthe security logging feature.\r\nvoid\r\nsetShortSupportMessage(ComponentName admin, CharSequence message)\r\nCalled by a device admin to set the short support message.\r\nvoid\r\nsetStartUserSessionMessage(ComponentName admin, CharSequence\r\nstartUserSessionMessage)\r\nCalled by a device owner to specify the user session start message.\r\nboolean\r\nsetStatusBarDisabled(ComponentName admin, boolean disabled)\r\nCalled by device owner or profile owner of secondary users that is affiliated with the dev\r\ndisable the status bar.\r\nint\r\nsetStorageEncryption(ComponentName admin, boolean encrypt)\r\nThis method was deprecated in API level 30. This method does not actually modify the s\r\nencryption of the device. It has never affected the encryption status of a device. Called b\r\napplication that is administering the device to request that the storage system be encryp\r\nDoes nothing if the caller is on a secondary user or a managed profile.\r\nWhen multiple device administrators attempt to control device encryption, the most secu\r\nsupported setting will always be used. If any device administrator requests device encryp\r\nwill be enabled; Conversely, if a device administrator attempts to disable device encrypt\r\nwhile another device administrator has enabled it, the call to disable will fail (most com\r\nreturning ENCRYPTION_STATUS_ACTIVE ).\r\nThis policy controls encryption of the secure (application data) storage area. Data writt\r\nother storage areas may or may not be encrypted, and this policy does not require or con\r\nthe encryption of any other storage areas. There is one exception: If\r\nEnvironment.isExternalStorageEmulated() is true , then the directory returned by\r\nEnvironment.getExternalStorageDirectory() must be written to disk within the encry\r\nstorage area.\r\nImportant Note: On some devices, it is possible to encrypt storage without requiring the\r\ncreate a device PIN or Password. In this case, the storage is encrypted, but the encryptio\r\nmay not be fully secured. For maximum security, the administrator should also require (\r\ncheck for) a pattern, PIN, or password.\r\nvoid\r\nsetSystemSetting(ComponentName admin, String setting, String value)\r\nCalled by a device or profile owner to update Settings.System settings.\r\nvoid\r\nsetSystemUpdatePolicy(ComponentName admin, SystemUpdatePolicy policy)\r\nCalled by device owners or profile owners of an organization-owned managed profile to\r\nlocal system update policy.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 44 of 178\n\nboolean\r\nsetTime(ComponentName admin, long millis)\r\nCalled by a device owner or a profile owner of an organization-owned managed profile t\r\nthe system wall clock time.\r\nboolean\r\nsetTimeZone(ComponentName admin, String timeZone)\r\nCalled by a device owner or a profile owner of an organization-owned managed profile t\r\nthe system's persistent default time zone.\r\nvoid\r\nsetTrustAgentConfiguration(ComponentName admin, ComponentName target,\r\nPersistableBundle configuration)\r\nSets a list of configuration features to enable for a trust agent component.\r\nvoid\r\nsetUninstallBlocked(ComponentName admin, String packageName, boolean\r\nuninstallBlocked)\r\nChange whether a user can uninstall a package.\r\nvoid\r\nsetUsbDataSignalingEnabled(boolean enabled)\r\nCalled by a device owner or profile owner of an organization-owned managed profile to\r\nor disable USB data signaling for the device.\r\nvoid\r\nsetUserControlDisabledPackages(ComponentName admin, List\u003cString\u003e packages)\r\nCalled by a device owner or a profile owner or holder of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_APPS_CONTROL to disable user control ove\r\nvoid\r\nsetUserIcon(ComponentName admin, Bitmap icon)\r\nCalled by profile or device owners to set the user's photo.\r\nvoid\r\nsetWifiSsidPolicy(WifiSsidPolicy policy)\r\nCalled by device owner or profile owner of an organization-owned managed profile to sp\r\nthe Wi-Fi SSID policy ( WifiSsidPolicy ).\r\nint\r\nstartUserInBackground(ComponentName admin, UserHandle userHandle)\r\nCalled by a device owner to start the specified secondary user in background.\r\nint\r\nstopUser(ComponentName admin, UserHandle userHandle)\r\nCalled by a device owner to stop the specified secondary user.\r\nboolean\r\nswitchUser(ComponentName admin, UserHandle userHandle)\r\nCalled by a device owner to switch the specified secondary user to the foreground.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 45 of 178\n\nvoid\r\ntransferOwnership(ComponentName admin, ComponentName target, PersistableBundle\r\nbundle)\r\nChanges the current administrator to another one.\r\nvoid\r\nuninstallAllUserCaCerts(ComponentName admin)\r\nUninstalls all custom trusted CA certificates from the profile.\r\nvoid\r\nuninstallCaCert(ComponentName admin, byte[] certBuffer)\r\nUninstalls the given certificate from trusted user CAs, if present.\r\nboolean\r\nupdateOverrideApn(ComponentName admin, int apnId, ApnSetting apnSetting)\r\nCalled by device owner or managed profile owner to update an override APN.\r\nvoid\r\nwipeData(int flags, CharSequence reason)\r\nAsk that all user data be wiped.\r\nvoid\r\nwipeData(int flags)\r\nSee wipeData(int,CharSequence)\r\nvoid\r\nwipeDevice(int flags)\r\nAsk that the device be wiped and factory reset.\r\nInherited methods\r\nFrom class java.lang.Object\r\nObject\r\nclone()\r\nCreates and returns a copy of this object.\r\nboolean\r\nequals(Object obj)\r\nIndicates whether some other object is \"equal to\" this one.\r\nvoid\r\nfinalize()\r\nCalled by the garbage collector on an object when garbage collection determines that there are no\r\nmore references to the object.\r\nfinal\r\nClass\u003c?\u003e\r\ngetClass()\r\nReturns the runtime class of this Object .\r\nint\r\nhashCode()\r\nReturns a hash code value for the object.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 46 of 178\n\nfinal void\r\nnotify()\r\nWakes up a single thread that is waiting on this object's monitor.\r\nfinal void\r\nnotifyAll()\r\nWakes up all threads that are waiting on this object's monitor.\r\nString\r\ntoString()\r\nReturns a string representation of the object.\r\nfinal void\r\nwait(long timeoutMillis, int nanos)\r\nCauses the current thread to wait until it is awakened, typically by being notified or interrupted,\r\nor until a certain amount of real time has elapsed.\r\nfinal void\r\nwait(long timeoutMillis)\r\nCauses the current thread to wait until it is awakened, typically by being notified or interrupted,\r\nor until a certain amount of real time has elapsed.\r\nfinal void\r\nwait()\r\nCauses the current thread to wait until it is awakened, typically by being notified or interrupted.\r\nConstants\r\nACTION_ADD_DEVICE_ADMIN\r\npublic static final String ACTION_ADD_DEVICE_ADMIN\r\nActivity action: ask the user to add a new device administrator to the system. The desired policy is the ComponentName of\r\nthe policy in the EXTRA_DEVICE_ADMIN extra field. This will invoke a UI to bring the user through adding the device\r\nadministrator to the system (or allowing them to reject it).\r\nYou can optionally include the EXTRA_ADD_EXPLANATION field to provide the user with additional explanation (in addition to\r\nyour component's description) about what is being added.\r\nIf your administrator is already active, this will ordinarily return immediately (without user intervention). However, if your\r\nadministrator has been updated and is requesting additional uses-policy flags, the user will be presented with the new list.\r\nNew policies will not be available to the updated administrator until the user has accepted the new list.\r\nConstant Value: \"android.app.action.ADD_DEVICE_ADMIN\"\r\nACTION_ADMIN_POLICY_COMPLIANCE\r\npublic static final String ACTION_ADMIN_POLICY_COMPLIANCE\r\nActivity action: Starts the administrator to show policy compliance for the provisioning. This action is used any time that the\r\nadministrator has an opportunity to show policy compliance before the end of setup wizard. This could happen as part of the\r\nadmin-integrated provisioning flow (in which case this gets sent after ACTION_GET_PROVISIONING_MODE ), or it could happen\r\nduring provisioning finalization if the administrator supports finalization during setup wizard.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 47 of 178\n\nIntents with this action may also be supplied with the EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE extra.\r\nConstant Value: \"android.app.action.ADMIN_POLICY_COMPLIANCE\"\r\nACTION_APPLICATION_DELEGATION_SCOPES_CHANGED\r\npublic static final String ACTION_APPLICATION_DELEGATION_SCOPES_CHANGED\r\nBroadcast Action: Sent after application delegation scopes are changed. The new delegation scopes will be sent in an\r\nArrayList\u003cString\u003e extra identified by the EXTRA_DELEGATION_SCOPES key.\r\nNote: This is a protected intent that can only be sent by the system.\r\nConstant Value: \"android.app.action.APPLICATION_DELEGATION_SCOPES_CHANGED\"\r\nACTION_CHECK_POLICY_COMPLIANCE\r\npublic static final String ACTION_CHECK_POLICY_COMPLIANCE\r\nActivity action: launch the DPC to check policy compliance. This intent is launched when the user taps on the notification\r\nabout personal apps suspension. When handling this intent the DPC must check if personal apps should still be suspended\r\nand either unsuspend them or instruct the user on how to resolve the noncompliance causing the suspension.\r\nConstant Value: \"android.app.action.CHECK_POLICY_COMPLIANCE\"\r\nACTION_DEVICE_ADMIN_SERVICE\r\npublic static final String ACTION_DEVICE_ADMIN_SERVICE\r\nService action: Action for a service that device owner and profile owner can optionally own. If a device owner or a profile\r\nowner has such a service, the system tries to keep a bound connection to it, in order to keep their process always running.\r\nThe service must be protected with the Manifest.permission.BIND_DEVICE_ADMIN permission.\r\nConstant Value: \"android.app.action.DEVICE_ADMIN_SERVICE\"\r\nACTION_DEVICE_FINANCING_STATE_CHANGED\r\npublic static final String ACTION_DEVICE_FINANCING_STATE_CHANGED\r\nBroadcast Action: Broadcast sent to indicate that the device financing state has changed.\r\nThis occurs when, for example, a financing kiosk app has been added or removed.\r\nTo query the current device financing state see isDeviceFinanced() .\r\nThis will be delivered to the following apps if they include a receiver for this action in their manifest:\r\nDevice owner admins.\r\nOrganization-owned profile owner admins\r\nThe supervision app\r\nThe device management role holder\r\nConstant Value: \"android.app.admin.action.DEVICE_FINANCING_STATE_CHANGED\"\r\nACTION_MANAGED_PROFILE_PROVISIONED\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 48 of 178\n\npublic static final String ACTION_MANAGED_PROFILE_PROVISIONED\r\nBroadcast Action: This broadcast is sent to indicate that provisioning of a managed profile has completed successfully.\r\nThe broadcast is limited to the primary profile, to the app specified in the provisioning intent with action\r\nACTION_PROVISION_MANAGED_PROFILE .\r\nThis intent will contain the following extras\r\nIntent.EXTRA_USER , corresponds to the UserHandle of the managed profile.\r\nEXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE , corresponds to the account requested to be migrated at provisioning\r\ntime, if any.\r\nConstant Value: \"android.app.action.MANAGED_PROFILE_PROVISIONED\"\r\nACTION_PROFILE_OWNER_CHANGED\r\npublic static final String ACTION_PROFILE_OWNER_CHANGED\r\nBroadcast action: sent when the profile owner is set, changed or cleared. This broadcast is sent only to the user managed by\r\nthe new profile owner.\r\nConstant Value: \"android.app.action.PROFILE_OWNER_CHANGED\"\r\nACTION_PROVISIONING_SUCCESSFUL\r\npublic static final String ACTION_PROVISIONING_SUCCESSFUL\r\nActivity action: This activity action is sent to indicate that provisioning of a managed profile or managed device has\r\ncompleted successfully. It'll be sent at the same time as DeviceAdminReceiver.ACTION_PROFILE_PROVISIONING_COMPLETE\r\nbroadcast but this will be delivered faster as it's an activity intent.\r\nThe intent is only sent to the new device or profile owner.\r\nConstant Value: \"android.app.action.PROVISIONING_SUCCESSFUL\"\r\nACTION_PROVISION_MANAGED_DEVICE\r\npublic static final String ACTION_PROVISION_MANAGED_DEVICE\r\nThis constant was deprecated in API level 31.\r\nto support Build.VERSION_CODES.S and later, admin apps must implement activities with intent filters for the\r\nACTION_GET_PROVISIONING_MODE and ACTION_ADMIN_POLICY_COMPLIANCE intent actions; using\r\nACTION_PROVISION_MANAGED_DEVICE to start provisioning will cause the provisioning to fail; to additionally support\r\npre- Build.VERSION_CODES.S , admin apps must also continue to use this constant.\r\nActivity action: Starts the provisioning flow which sets up a managed device. Must be started with\r\nandroid.app.Activity.startActivityForResult(Intent,int) .\r\nDuring device owner provisioning a device admin app is set as the owner of the device. A device owner has full control over\r\nthe device. The device owner can not be modified by the user.\r\nA typical use case would be a device that is owned by a company, but used by either an employee or client.\r\nAn intent with this action can be sent only on an unprovisioned device. It is possible to check if provisioning is allowed or\r\nnot by querying the method isProvisioningAllowed(String) .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 49 of 178\n\nThe intent contains the following extras:\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME\r\nEXTRA_PROVISIONING_SKIP_ENCRYPTION , optional\r\nEXTRA_PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED , optional\r\nEXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE , optional\r\nEXTRA_PROVISIONING_LOGO_URI , optional\r\nEXTRA_PROVISIONING_DISCLAIMERS , optional\r\nEXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS , optional\r\nWhen device owner provisioning has completed, an intent of the type\r\nDeviceAdminReceiver.ACTION_PROFILE_PROVISIONING_COMPLETE is broadcast to the device owner.\r\nFrom version Build.VERSION_CODES.O , when device owner provisioning has completed, along with the above broadcast,\r\nactivity intent ACTION_PROVISIONING_SUCCESSFUL will also be sent to the device owner.\r\nIf provisioning fails, the device is factory reset.\r\nA result code of Activity.RESULT_OK implies that the synchronous part of the provisioning flow was successful, although\r\nthis doesn't guarantee the full flow will succeed. Conversely a result code of Activity.RESULT_CANCELED implies that the\r\nuser backed-out of provisioning, or some precondition for provisioning wasn't met.\r\nConstant Value: \"android.app.action.PROVISION_MANAGED_DEVICE\"\r\nACTION_PROVISION_MANAGED_PROFILE\r\npublic static final String ACTION_PROVISION_MANAGED_PROFILE\r\nActivity action: Starts the provisioning flow which sets up a managed profile.\r\nIt is possible to check if provisioning is allowed or not by querying the method isProvisioningAllowed(String) .\r\nThe intent may contain the following extras:\r\nWhen managed provisioning has completed, broadcasts are sent to the application specified in the provisioning intent. The\r\nDeviceAdminReceiver.ACTION_PROFILE_PROVISIONING_COMPLETE broadcast is sent in the managed profile and the\r\nACTION_MANAGED_PROFILE_PROVISIONED broadcast is sent in the primary profile.\r\nFrom version Build.VERSION_CODES.O , when managed provisioning has completed, along with the above broadcast,\r\nactivity intent ACTION_PROVISIONING_SUCCESSFUL will also be sent to the profile owner.\r\nIf provisioning fails, the managed profile is removed so the device returns to its previous state.\r\nIf launched with android.app.Activity.startActivityForResult(Intent,int) a result code of Activity.RESULT_OK\r\nindicates that the synchronous part of the provisioning flow was successful, although this doesn't guarantee the full flow will\r\nsucceed. Conversely a result code of Activity.RESULT_CANCELED indicates that the user backed-out of provisioning or some\r\nprecondition for provisioning wasn't met.\r\nIf a device policy management role holder updater is present on the device, an internet connection attempt must be made\r\nprior to launching this intent.\r\nConstant Value: \"android.app.action.PROVISION_MANAGED_PROFILE\"\r\nACTION_SET_NEW_PARENT_PROFILE_PASSWORD\r\npublic static final String ACTION_SET_NEW_PARENT_PROFILE_PASSWORD\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 50 of 178\n\nActivity action: have the user enter a new password for the parent profile. If the intent is launched from within a managed\r\nprofile, this will trigger entering a new password for the parent of the profile. The caller can optionally set\r\nEXTRA_DEVICE_PASSWORD_REQUIREMENT_ONLY to only enforce device-wide password requirement. In all other cases the\r\nbehaviour is identical to ACTION_SET_NEW_PASSWORD .\r\nConstant Value: \"android.app.action.SET_NEW_PARENT_PROFILE_PASSWORD\"\r\nACTION_SET_NEW_PASSWORD\r\npublic static final String ACTION_SET_NEW_PASSWORD\r\nActivity action: have the user enter a new password.\r\nFor admin apps, this activity should be launched after using setPasswordQuality(ComponentName,int) , or\r\nsetPasswordMinimumLength(ComponentName,int) to have the user enter a new password that meets the current\r\nrequirements. You can use isActivePasswordSufficient() to determine whether you need to have the user select a new\r\npassword in order to meet the current constraints. Upon being resumed from this activity, you can check the new password\r\ncharacteristics to see if they are sufficient.\r\nNon-admin apps can use getPasswordComplexity() to check the current screen lock complexity, and use this activity with\r\nextra EXTRA_PASSWORD_COMPLEXITY to suggest to users how complex the app wants the new screen lock to be. Note that both\r\ngetPasswordComplexity() and the extra EXTRA_PASSWORD_COMPLEXITY require the calling app to have the permission\r\npermission.REQUEST_PASSWORD_COMPLEXITY .\r\nIf the intent is launched from within a managed profile with a profile owner built against Build.VERSION_CODES.M or\r\nbefore, this will trigger entering a new password for the parent of the profile. For all other cases it will trigger entering a new\r\npassword for the user or profile it is launched from.\r\nConstant Value: \"android.app.action.SET_NEW_PASSWORD\"\r\nACTION_START_ENCRYPTION\r\npublic static final String ACTION_START_ENCRYPTION\r\nActivity action: begin the process of encrypting data on the device. This activity should be launched after using\r\nsetStorageEncryption(ComponentName, boolean) to request encryption be activated. After resuming from this activity, use\r\ngetStorageEncryption(ComponentName) to check encryption status. However, on some devices this activity may never\r\nreturn, as it may trigger a reboot and in some cases a complete data wipe of the device.\r\nConstant Value: \"android.app.action.START_ENCRYPTION\"\r\nACTION_SYSTEM_UPDATE_POLICY_CHANGED\r\npublic static final String ACTION_SYSTEM_UPDATE_POLICY_CHANGED\r\nBroadcast action: notify that a new local system update policy has been set by the device owner. The new policy can be\r\nretrieved by getSystemUpdatePolicy() .\r\nConstant Value: \"android.app.action.SYSTEM_UPDATE_POLICY_CHANGED\"\r\nAPP_FUNCTIONS_DISABLED\r\npublic static final int APP_FUNCTIONS_DISABLED\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 51 of 178\n\nIndicates that AppFunctionManager is controlled and disabled by policy, i.e. no apps in the current user are allowed to\r\nexpose app functions.\r\nConstant Value: 1 (0x00000001)\r\nAPP_FUNCTIONS_DISABLED_CROSS_PROFILE\r\npublic static final int APP_FUNCTIONS_DISABLED_CROSS_PROFILE\r\nIndicates that AppFunctionManager is controlled and disabled by a policy for cross profile interactions only, i.e. app\r\nfunctions exposed by apps in the current user can only be invoked within the same user.\r\nThis is different from APP_FUNCTIONS_DISABLED in that it only disables cross profile interactions (even if the caller has\r\npermissions required to interact across users). appfunctions can still be used within the a user profile boundary.\r\nConstant Value: 2 (0x00000002)\r\nAPP_FUNCTIONS_NOT_CONTROLLED_BY_POLICY\r\npublic static final int APP_FUNCTIONS_NOT_CONTROLLED_BY_POLICY\r\nIndicates that AppFunctionManager is not controlled by policy.\r\nIf no admin set this policy, it means appfunctions are enabled.\r\nConstant Value: 0 (0x00000000)\r\nAUTO_TIME_ZONE_DISABLED\r\npublic static final int AUTO_TIME_ZONE_DISABLED\r\nSpecifies the \"disabled\" auto time zone state.\r\nConstant Value: 1 (0x00000001)\r\nAUTO_TIME_ZONE_ENABLED\r\npublic static final int AUTO_TIME_ZONE_ENABLED\r\nSpecifies the \"enabled\" auto time zone state.\r\nConstant Value: 2 (0x00000002)\r\nAUTO_TIME_ZONE_NOT_CONTROLLED_BY_POLICY\r\npublic static final int AUTO_TIME_ZONE_NOT_CONTROLLED_BY_POLICY\r\nSpecifies that the auto time zone state is not controlled by device policy.\r\nConstant Value: 0 (0x00000000)\r\nCONTENT_PROTECTION_DISABLED\r\npublic static final int CONTENT_PROTECTION_DISABLED\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 52 of 178\n\nIndicates that content protection is controlled and disabled by a policy (default).\r\nConstant Value: 1 (0x00000001)\r\nCONTENT_PROTECTION_ENABLED\r\npublic static final int CONTENT_PROTECTION_ENABLED\r\nIndicates that content protection is controlled and enabled by a policy.\r\nConstant Value: 2 (0x00000002)\r\nCONTENT_PROTECTION_NOT_CONTROLLED_BY_POLICY\r\npublic static final int CONTENT_PROTECTION_NOT_CONTROLLED_BY_POLICY\r\nIndicates that content protection is not controlled by policy, allowing user to choose.\r\nConstant Value: 0 (0x00000000)\r\nDELEGATION_CERT_INSTALL\r\npublic static final String DELEGATION_CERT_INSTALL\r\nDelegation of certificate installation and management. This scope grants access to the\r\ngetInstalledCaCerts(ComponentName) , hasCaCertInstalled(ComponentName, byte) , installCaCert(ComponentName,\r\nbyte) , uninstallCaCert(ComponentName, byte) , uninstallAllUserCaCerts(ComponentName) and\r\ninstallKeyPair(ComponentName, PrivateKey, Certificate, String) APIs. This scope also grants the ability to read\r\nidentifiers that the delegating device owner or profile owner can obtain. See getEnrollmentSpecificId() .\r\nConstant Value: \"delegation-cert-install\"\r\nDELEGATION_ENABLE_SYSTEM_APP\r\npublic static final String DELEGATION_ENABLE_SYSTEM_APP\r\nDelegation for enabling system apps. This scope grants access to the enableSystemApp(ComponentName, Intent) API.\r\nConstant Value: \"delegation-enable-system-app\"\r\nDELEGATION_INSTALL_EXISTING_PACKAGE\r\npublic static final String DELEGATION_INSTALL_EXISTING_PACKAGE\r\nDelegation for installing existing packages. This scope grants access to the installExistingPackage(ComponentName,\r\nString) API.\r\nConstant Value: \"delegation-install-existing-package\"\r\nDELEGATION_NETWORK_LOGGING\r\npublic static final String DELEGATION_NETWORK_LOGGING\r\nGrants access to setNetworkLoggingEnabled(ComponentName, boolean) , isNetworkLoggingEnabled(ComponentName) and\r\nretrieveNetworkLogs(ComponentName, long) . Once granted the delegated app will start receiving\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 53 of 178\n\nDelegatedAdminReceiver.onNetworkLogsAvailable() callback, and Device owner or Profile Owner will no longer receive\r\nthe DeviceAdminReceiver.onNetworkLogsAvailable() callback. There can be at most one app that has this delegation. If\r\nanother app already had delegated network logging access, it will lose the delegation when a new app is delegated.\r\nDevice Owner can grant this access since Android 10. Profile Owner of a managed profile can grant this access since\r\nAndroid 12.\r\nConstant Value: \"delegation-network-logging\"\r\nENCRYPTION_STATUS_ACTIVATING\r\npublic static final int ENCRYPTION_STATUS_ACTIVATING\r\nThis constant was deprecated in API level 34.\r\nThis result code has never actually been used, so there is no reason for apps to check for it.\r\nResult code for getStorageEncryptionStatus() : indicating that encryption is not currently active, but is currently being\r\nactivated.\r\nConstant Value: 2 (0x00000002)\r\nENCRYPTION_STATUS_ACTIVE_DEFAULT_KEY\r\npublic static final int ENCRYPTION_STATUS_ACTIVE_DEFAULT_KEY\r\nResult code for getStorageEncryptionStatus() : indicating that encryption is active, but the encryption key is not\r\ncryptographically protected by the user's credentials.\r\nThis value can only be returned on devices that use Full Disk Encryption. Support for Full Disk Encryption was entirely\r\nremoved in API level 33, having been replaced by File Based Encryption. With File Based Encryption, each user's\r\ncredential-encrypted storage is always cryptographically protected by the user's credentials.\r\nConstant Value: 4 (0x00000004)\r\nENCRYPTION_STATUS_ACTIVE_PER_USER\r\npublic static final int ENCRYPTION_STATUS_ACTIVE_PER_USER\r\nResult code for getStorageEncryptionStatus() : indicating that encryption is active and the encryption key is tied to the\r\nuser or profile.\r\nThis value is only returned to apps targeting API level 24 and above. For apps targeting earlier API levels,\r\nENCRYPTION_STATUS_ACTIVE is returned, even if the encryption key is specific to the user or profile.\r\nConstant Value: 5 (0x00000005)\r\npublic static final String EXTRA_ADD_EXPLANATION\r\nAn optional CharSequence providing additional explanation for why the admin is being added.\r\nConstant Value: \"android.app.extra.ADD_EXPLANATION\"\r\npublic static final String EXTRA_DEVICE_ADMIN\r\nThe ComponentName of the administrator component.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 54 of 178\n\nConstant Value: \"android.app.extra.DEVICE_ADMIN\"\r\npublic static final String EXTRA_DEVICE_PASSWORD_REQUIREMENT_ONLY\r\nA boolean extra for ACTION_SET_NEW_PARENT_PROFILE_PASSWORD requesting that only device password requirement is\r\nenforced during the parent profile password enrolment flow.\r\nNormally when enrolling password for the parent profile, both the device-wide password requirement (requirement set via\r\ngetParentProfileInstance(ComponentName) instance) and the profile password requirement are enforced, if the profile\r\ncurrently does not have a separate work challenge. By setting this to true , profile password requirement is explicitly\r\ndisregarded.\r\nConstant Value: \"android.app.extra.DEVICE_PASSWORD_REQUIREMENT_ONLY\"\r\npublic static final String EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE\r\nAn Account extra holding the account to migrate during managed profile provisioning.\r\nIf the account supplied is present in the user, it will be copied, along with its credentials to the managed profile and removed\r\nfrom the user.\r\nConstant Value: \"android.app.extra.PROVISIONING_ACCOUNT_TO_MIGRATE\"\r\npublic static final String EXTRA_PROVISIONING_ALLOWED_PROVISIONING_MODES\r\nAn ArrayList of Integer extra specifying the allowed provisioning modes.\r\nThis extra will be passed to the admin app's ACTION_GET_PROVISIONING_MODE activity, whose result intent must contain\r\nEXTRA_PROVISIONING_MODE set to one of the values in this array.\r\nIf the value set to EXTRA_PROVISIONING_MODE is not in the array, provisioning will fail.\r\nConstant Value: \"android.app.extra.PROVISIONING_ALLOWED_PROVISIONING_MODES\"\r\npublic static final String EXTRA_PROVISIONING_ALLOW_OFFLINE\r\nA boolean extra indicating whether offline provisioning should be used.\r\nThe default value is false .\r\nConstant Value: \"android.app.extra.PROVISIONING_ALLOW_OFFLINE\"\r\npublic static final String EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME\r\nA ComponentName extra indicating the device admin receiver of the application that will be set as the Device Policy\r\nController.\r\nIf an application starts provisioning directly via an intent with action ACTION_PROVISION_MANAGED_DEVICE the package name\r\nof this component has to match the package name of the application that started provisioning.\r\nThis component is set as device owner and active admin when device owner provisioning is started by an intent with action\r\nACTION_PROVISION_MANAGED_DEVICE or by an NFC message containing an NFC record with MIME type\r\nMIME_TYPE_PROVISIONING_NFC . For the NFC record, the component name must be flattened to a string, via\r\nComponentName.flattenToShortString() .\r\nConstant Value: \"android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME\"\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 55 of 178\n\npublic static final String EXTRA_PROVISIONING_DEVICE_ADMIN_MINIMUM_VERSION_CODE\r\nAn int extra holding a minimum required version code for the device admin package. If the device admin is already installed\r\non the device, it will only be re-downloaded from EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION if the\r\nversion of the installed package is less than this version code.\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_DEVICE_ADMIN_MINIMUM_VERSION_CODE\"\r\npublic static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_COOKIE_HEADER\r\nA String extra holding a http cookie header which should be used in the http request to the url specified in\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION .\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value:\r\n\"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_COOKIE_HEADER\"\r\npublic static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION\r\nA String extra holding a url that specifies the download location of the device admin package. When not provided it is\r\nassumed that the device admin package is already installed.\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION\"\r\npublic static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME\r\nThis constant was deprecated in API level 23.\r\nUse EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME .\r\nA String extra holding the package name of the application that will be set as Device Policy Controller.\r\nWhen this extra is set, the application must have exactly one device admin receiver . This receiver will be set as the\r\nDevice Policy Controller.\r\nConstant Value: \"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME\"\r\npublic static final String EXTRA_PROVISIONING_DISCLAIMER_HEADER\r\nA String extra of localized disclaimer header.\r\nThe extra is typically the company name of mobile device management application (MDM) or the organization name.\r\nSystem apps can also insert a disclaimer by declaring an application-level meta-data in AndroidManifest.xml .\r\nFor example:\r\n \u003cmeta-data\r\n android:name=\"android.app.extra.PROVISIONING_DISCLAIMER_HEADER\"\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 56 of 178\n\nandroid:resource=\"@string/disclaimer_header\"\r\n /\u003e\r\nThis must be accompanied with another extra using the key EXTRA_PROVISIONING_DISCLAIMER_CONTENT .\r\nConstant Value: \"android.app.extra.PROVISIONING_DISCLAIMER_HEADER\"\r\npublic static final String EXTRA_PROVISIONING_EMAIL_ADDRESS\r\nThis constant was deprecated in API level 26.\r\nFrom Build.VERSION_CODES.O , never used while provisioning the device.\r\nConstant Value: \"android.app.extra.PROVISIONING_EMAIL_ADDRESS\"\r\npublic static final String EXTRA_PROVISIONING_IMEI\r\nA string extra holding the IMEI (International Mobile Equipment Identity) of the device.\r\nConstant Value: \"android.app.extra.PROVISIONING_IMEI\"\r\npublic static final String EXTRA_PROVISIONING_KEEP_ACCOUNT_ON_MIGRATION\r\nBoolean extra to indicate that the migrated account should be kept.\r\nIf it's set to true , the account will not be removed from the user after it is migrated to the newly created user or profile.\r\nDefaults to false\r\nConstant Value: \"android.app.extra.PROVISIONING_KEEP_ACCOUNT_ON_MIGRATION\"\r\npublic static final String EXTRA_PROVISIONING_KEEP_SCREEN_ON\r\nThis constant was deprecated in API level 34.\r\nfrom Build.VERSION_CODES.UPSIDE_DOWN_CAKE , the flag wouldn't be functional. The screen is kept on throughout the\r\nprovisioning flow.\r\nA boolean flag that indicates whether the screen should be on throughout the provisioning flow.\r\nThis extra can either be passed as an extra to the ACTION_PROVISION_MANAGED_PROFILE intent, or it can be returned by the\r\nadmin app when performing the admin-integrated provisioning flow as a result of the ACTION_GET_PROVISIONING_MODE\r\nactivity.\r\nConstant Value: \"android.app.extra.PROVISIONING_KEEP_SCREEN_ON\"\r\npublic static final String EXTRA_PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED\r\nA Boolean extra that can be used by the mobile device management application to skip the disabling of system apps during\r\nprovisioning when set to true .\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC , an intent with action ACTION_PROVISION_MANAGED_PROFILE that\r\nstarts profile owner provisioning or set as an extra to the intent result of the ACTION_GET_PROVISIONING_MODE activity.\r\nConstant Value: \"android.app.extra.PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED\"\r\npublic static final String EXTRA_PROVISIONING_LOCALE\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 57 of 178\n\nA String extra holding the Locale that the device will be set to. Format: xx_yy, where xx is the language code, and yy the\r\ncountry code.\r\nUse only for device owner provisioning. This extra can be returned by the admin app when performing the admin-integrated\r\nprovisioning flow as a result of the ACTION_GET_PROVISIONING_MODE activity.\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_LOCALE\"\r\npublic static final String EXTRA_PROVISIONING_LOCAL_TIME\r\nA Long extra holding the wall clock time (in milliseconds) to be set on the device's AlarmManager .\r\nUse only for device owner provisioning. This extra can be returned by the admin app when performing the admin-integrated\r\nprovisioning flow as a result of the ACTION_GET_PROVISIONING_MODE activity.\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_LOCAL_TIME\"\r\npublic static final String EXTRA_PROVISIONING_LOGO_URI\r\nThis constant was deprecated in API level 33.\r\nLogo customization is no longer supported in the provisioning flow.\r\nA Uri extra pointing to a logo image. This image will be shown during the provisioning. If this extra is not passed, a\r\ndefault image will be shown.\r\nThe following URI schemes are accepted:\r\ncontent ( ContentResolver.SCHEME_CONTENT )\r\nandroid.resource ( ContentResolver.SCHEME_ANDROID_RESOURCE )\r\nIt is the responsibility of the caller to provide an image with a reasonable pixel density for the device.\r\nIf a content: URI is passed, the intent should also have the flag Intent.FLAG_GRANT_READ_URI_PERMISSION and the uri\r\nshould be added to the ClipData of the intent.\r\nConstant Value: \"android.app.extra.PROVISIONING_LOGO_URI\"\r\nEXTRA_PROVISIONING_MAIN_COLOR\r\npublic static final String EXTRA_PROVISIONING_MAIN_COLOR\r\nThis constant was deprecated in API level 31.\r\nColor customization is no longer supported in the provisioning flow.\r\nA integer extra indicating the predominant color to show during the provisioning. Refer to Color for how the color is\r\nrepresented.\r\nUse with ACTION_PROVISION_MANAGED_PROFILE or ACTION_PROVISION_MANAGED_DEVICE .\r\nConstant Value: \"android.app.extra.PROVISIONING_MAIN_COLOR\"\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 58 of 178\n\npublic static final String EXTRA_PROVISIONING_SENSORS_PERMISSION_GRANT_OPT_OUT\r\nA boolean extra indicating the admin of a fully-managed device opts out of controlling permission grants for sensor-related\r\npermissions, see setPermissionGrantState(ComponentName,String,String,int) . The default for this extra is false - by\r\ndefault, the admin of a fully-managed device has the ability to grant sensors-related permissions.\r\nUse only for device owner provisioning. This extra can be returned by the admin app when performing the admin-integrated\r\nprovisioning flow as a result of the ACTION_GET_PROVISIONING_MODE activity.\r\nThis extra may also be provided to the admin app via an intent extra for ACTION_GET_PROVISIONING_MODE .\r\nConstant Value: \"android.app.extra.PROVISIONING_SENSORS_PERMISSION_GRANT_OPT_OUT\"\r\npublic static final String EXTRA_PROVISIONING_SERIAL_NUMBER\r\nA string extra holding the serial number of the device.\r\nConstant Value: \"android.app.extra.PROVISIONING_SERIAL_NUMBER\"\r\npublic static final String EXTRA_PROVISIONING_SHOULD_LAUNCH_RESULT_INTENT\r\nA boolean extra that determines whether the provisioning flow should launch the resulting launch intent, if one is supplied\r\nby the device policy management role holder via EXTRA_RESULT_LAUNCH_INTENT . Default value is false .\r\nIf true , the resulting intent will be launched by the provisioning flow, if one is supplied by the device policy management\r\nrole holder.\r\nIf false , the resulting intent will be returned as EXTRA_RESULT_LAUNCH_INTENT to the provisioning initiator, if one is\r\nsupplied by the device manager role holder. It will be the responsibility of the provisioning initiator to launch this Intent\r\nafter provisioning completes.\r\nThis extra is respected when provided via the provisioning intent actions such as ACTION_PROVISION_MANAGED_PROFILE .\r\nConstant Value: \"android.app.extra.PROVISIONING_SHOULD_LAUNCH_RESULT_INTENT\"\r\npublic static final String EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS\r\nA boolean extra indicating if the education screens from the provisioning flow should be skipped. If unspecified, defaults to\r\nfalse .\r\nThis extra can be set in the following ways:\r\nBy the admin app when performing the admin-integrated provisioning flow as a result of the\r\nACTION_GET_PROVISIONING_MODE activity\r\nFor managed account enrollment\r\nIf the education screens are skipped, it is the admin application's responsibility to display its own user education screens.\r\nConstant Value: \"android.app.extra.PROVISIONING_SKIP_EDUCATION_SCREENS\"\r\npublic static final String EXTRA_PROVISIONING_SKIP_USER_CONSENT\r\nThis constant was deprecated in API level 31.\r\nthis extra is no longer relevant as device owners cannot create managed profiles\r\nA boolean extra indicating if the user consent steps from the provisioning flow should be skipped.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 59 of 178\n\nIf unspecified, defaults to false .\r\nConstant Value: \"android.app.extra.PROVISIONING_SKIP_USER_CONSENT\"\r\npublic static final String EXTRA_PROVISIONING_TIME_ZONE\r\nA String extra holding the time zone AlarmManager that the device will be set to.\r\nUse only for device owner provisioning. This extra can be returned by the admin app when performing the admin-integrated\r\nprovisioning flow as a result of the ACTION_GET_PROVISIONING_MODE activity.\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_TIME_ZONE\"\r\npublic static final String EXTRA_PROVISIONING_USE_MOBILE_DATA\r\nA boolean extra indicating if mobile data should be used during the provisioning flow for downloading the admin app. If\r\nEXTRA_PROVISIONING_WIFI_SSID is also specified, wifi network will be used instead.\r\nDefault value is false .\r\nIf this extra is set to true and EXTRA_PROVISIONING_WIFI_SSID is not specified, this extra has different behaviour\r\ndepending on the way provisioning is triggered:\r\nFor provisioning started via a QR code or an NFC tag, mobile data is always used for downloading the admin app.\r\nFor all other provisioning methods, a mobile data connection check is made at the start of provisioning. If mobile\r\ndata is connected at that point, the admin app download will happen using mobile data. If mobile data is not\r\nconnected at that point, the end-user will be asked to pick a wifi network and the admin app download will proceed\r\nover wifi.\r\nConstant Value: \"android.app.extra.PROVISIONING_USE_MOBILE_DATA\"\r\npublic static final String EXTRA_PROVISIONING_WIFI_CA_CERTIFICATE\r\nThe CA certificate of the wifi network in EXTRA_PROVISIONING_WIFI_SSID . This should be an X.509 certificate Base64\r\nencoded DER format, ie. PEM representation of a certificate without header, footer and line breaks. More information This\r\nis only used if the EXTRA_PROVISIONING_WIFI_SECURITY_TYPE is EAP .\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_WIFI_CA_CERTIFICATE\"\r\npublic static final String EXTRA_PROVISIONING_WIFI_HIDDEN\r\nA boolean extra indicating whether the wifi network in EXTRA_PROVISIONING_WIFI_SSID is hidden or not.\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_WIFI_HIDDEN\"\r\npublic static final String EXTRA_PROVISIONING_WIFI_PAC_URL\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 60 of 178\n\nA String extra holding the proxy auto-config (PAC) URL for the wifi network in EXTRA_PROVISIONING_WIFI_SSID .\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_WIFI_PAC_URL\"\r\npublic static final String EXTRA_PROVISIONING_WIFI_PASSWORD\r\nA String extra holding the password of the wifi network in EXTRA_PROVISIONING_WIFI_SSID .\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_WIFI_PASSWORD\"\r\npublic static final String EXTRA_PROVISIONING_WIFI_PHASE2_AUTH\r\nThe phase 2 authentication of the wifi network in EXTRA_PROVISIONING_WIFI_SSID and could be one of NONE , PAP ,\r\nMSCHAP , MSCHAPV2 , GTC , SIM , AKA or AKA_PRIME . This is only used if the\r\nEXTRA_PROVISIONING_WIFI_SECURITY_TYPE is EAP .\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_WIFI_PHASE2_AUTH\"\r\npublic static final String EXTRA_PROVISIONING_WIFI_PROXY_BYPASS\r\nA String extra holding the proxy bypass for the wifi network in EXTRA_PROVISIONING_WIFI_SSID .\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_WIFI_PROXY_BYPASS\"\r\npublic static final String EXTRA_PROVISIONING_WIFI_PROXY_HOST\r\nA String extra holding the proxy host for the wifi network in EXTRA_PROVISIONING_WIFI_SSID .\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_WIFI_PROXY_HOST\"\r\npublic static final String EXTRA_PROVISIONING_WIFI_PROXY_PORT\r\nAn int extra holding the proxy port for the wifi network in EXTRA_PROVISIONING_WIFI_SSID .\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_WIFI_PROXY_PORT\"\r\npublic static final String EXTRA_PROVISIONING_WIFI_SECURITY_TYPE\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 61 of 178\n\nA String extra indicating the security type of the wifi network in EXTRA_PROVISIONING_WIFI_SSID and could be one of\r\nNONE , WPA , WEP or EAP .\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE\"\r\npublic static final String EXTRA_PROVISIONING_WIFI_SSID\r\nA String extra holding the ssid of the wifi network that should be used during nfc device owner provisioning for\r\ndownloading the mobile device management application.\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_WIFI_SSID\"\r\npublic static final String EXTRA_PROVISIONING_WIFI_USER_CERTIFICATE\r\nThe user certificate of the wifi network in EXTRA_PROVISIONING_WIFI_SSID . This should be an X.509 certificate and private\r\nkey Base64 encoded DER format, ie. PEM representation of a certificate and key without header, footer and line breaks.\r\nMore information This is only used if the EXTRA_PROVISIONING_WIFI_SECURITY_TYPE is EAP .\r\nUse in an NFC record with MIME_TYPE_PROVISIONING_NFC that starts device owner provisioning via an NFC bump. It can\r\nalso be used for QR code provisioning.\r\nConstant Value: \"android.app.extra.PROVISIONING_WIFI_USER_CERTIFICATE\"\r\npublic static final String EXTRA_RESOURCE_IDS\r\nAn integer array extra for ACTION_DEVICE_POLICY_RESOURCE_UPDATED to indicate which resource IDs (i.e. strings and\r\ndrawables) have been updated.\r\nConstant Value: \"android.app.extra.RESOURCE_IDS\"\r\npublic static final int EXTRA_RESOURCE_TYPE_DRAWABLE\r\nA int value for EXTRA_RESOURCE_TYPE to indicate that a resource of type Drawable is being updated.\r\nConstant Value: 1 (0x00000001)\r\npublic static final int EXTRA_RESOURCE_TYPE_STRING\r\nA int value for EXTRA_RESOURCE_TYPE to indicate that a resource of type String is being updated.\r\nConstant Value: 2 (0x00000002)\r\nFLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY\r\npublic static final int FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY\r\nFlag for lockNow(int) : also evict the user's credential encryption key from the keyring. The user's credential will need to\r\nbe entered again in order to derive the credential encryption key that will be stored back in the keyring for future use.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 62 of 178\n\nThis flag can only be used by a profile owner when locking a managed profile when getStorageEncryptionStatus()\r\nreturns ENCRYPTION_STATUS_ACTIVE_PER_USER .\r\nIn order to secure user data, the user will be stopped and restarted so apps should wait until they are next run to perform\r\nfurther actions.\r\nConstant Value: 1 (0x00000001)\r\nINSTALLKEY_REQUEST_CREDENTIALS_ACCESS\r\npublic static final int INSTALLKEY_REQUEST_CREDENTIALS_ACCESS\r\nSpecifies that the calling app should be granted access to the installed credentials immediately. Otherwise, access to the\r\ncredentials will be gated by user approval. For use with\r\ninstallKeyPair(ComponentName,PrivateKey,Certificate[],String,int)\r\nConstant Value: 1 (0x00000001)\r\nINSTALLKEY_SET_USER_SELECTABLE\r\npublic static final int INSTALLKEY_SET_USER_SELECTABLE\r\nSpecifies that a user can select the key via the Certificate Selection prompt. If this flag is not set when calling\r\ninstallKeyPair(ComponentName, PrivateKey, Certificate, String) , the key can only be granted access by\r\nimplementing DeviceAdminReceiver.onChoosePrivateKeyAlias(Context, Intent, int, Uri, String) . For use with\r\ninstallKeyPair(ComponentName,PrivateKey,Certificate[],String,int)\r\nConstant Value: 2 (0x00000002)\r\nKEYGUARD_DISABLE_BIOMETRICS\r\npublic static final int KEYGUARD_DISABLE_BIOMETRICS\r\nDisable all biometric authentication on keyguard secure screens (e.g. PIN/Pattern/Password).\r\nConstant Value: 416 (0x000001a0)\r\nKEYGUARD_DISABLE_FACE\r\npublic static final int KEYGUARD_DISABLE_FACE\r\nDisable face authentication on keyguard secure screens (e.g. PIN/Pattern/Password).\r\nConstant Value: 128 (0x00000080)\r\nKEYGUARD_DISABLE_FEATURES_ALL\r\npublic static final int KEYGUARD_DISABLE_FEATURES_ALL\r\nDisable all current and future keyguard customizations.\r\nConstant Value: 2147483647 (0x7fffffff)\r\nKEYGUARD_DISABLE_FEATURES_NONE\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 63 of 178\n\npublic static final int KEYGUARD_DISABLE_FEATURES_NONE\r\nWidgets are enabled in keyguard\r\nConstant Value: 0 (0x00000000)\r\nKEYGUARD_DISABLE_FINGERPRINT\r\npublic static final int KEYGUARD_DISABLE_FINGERPRINT\r\nDisable fingerprint authentication on keyguard secure screens (e.g. PIN/Pattern/Password).\r\nConstant Value: 32 (0x00000020)\r\nKEYGUARD_DISABLE_IRIS\r\npublic static final int KEYGUARD_DISABLE_IRIS\r\nDisable iris authentication on keyguard secure screens (e.g. PIN/Pattern/Password).\r\nConstant Value: 256 (0x00000100)\r\nKEYGUARD_DISABLE_REMOTE_INPUT\r\npublic static final int KEYGUARD_DISABLE_REMOTE_INPUT\r\nThis constant was deprecated in API level 33.\r\nThis flag was added in version Build.VERSION_CODES.N , but it never had any effect.\r\nDisable text entry into notifications on secure keyguard screens (e.g. PIN/Pattern/Password).\r\nConstant Value: 64 (0x00000040)\r\nKEYGUARD_DISABLE_SECURE_CAMERA\r\npublic static final int KEYGUARD_DISABLE_SECURE_CAMERA\r\nDisable the camera on secure keyguard screens (e.g. PIN/Pattern/Password)\r\nConstant Value: 2 (0x00000002)\r\nKEYGUARD_DISABLE_SECURE_NOTIFICATIONS\r\npublic static final int KEYGUARD_DISABLE_SECURE_NOTIFICATIONS\r\nDisable showing all notifications on secure keyguard screens (e.g. PIN/Pattern/Password)\r\nConstant Value: 4 (0x00000004)\r\nKEYGUARD_DISABLE_SHORTCUTS_ALL\r\npublic static final int KEYGUARD_DISABLE_SHORTCUTS_ALL\r\nDisable all keyguard shortcuts.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 64 of 178\n\nConstant Value: 512 (0x00000200)\r\nKEYGUARD_DISABLE_TRUST_AGENTS\r\npublic static final int KEYGUARD_DISABLE_TRUST_AGENTS\r\nDisable trust agents on secure keyguard screens (e.g. PIN/Pattern/Password). By setting this flag alone, all trust agents are\r\ndisabled. If the admin then wants to allowlist specific features of some trust agent,\r\nsetTrustAgentConfiguration(ComponentName, ComponentName, PersistableBundle) can be used in conjuction to set trust-agent-specific configurations.\r\nConstant Value: 16 (0x00000010)\r\nKEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS\r\npublic static final int KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS\r\nOnly allow redacted notifications on secure keyguard screens (e.g. PIN/Pattern/Password)\r\nConstant Value: 8 (0x00000008)\r\nKEYGUARD_DISABLE_WIDGETS_ALL\r\npublic static final int KEYGUARD_DISABLE_WIDGETS_ALL\r\nDisable all keyguard widgets. Has no effect between Build.VERSION_CODES.LOLLIPOP and\r\nBuild.VERSION_CODES.UPSIDE_DOWN_CAKE (both inclusive), since keyguard widget is only supported on Android versions\r\nlower than 5.0 and versions higher than 14.\r\nConstant Value: 1 (0x00000001)\r\nLOCK_TASK_FEATURE_BLOCK_ACTIVITY_START_IN_TASK\r\npublic static final int LOCK_TASK_FEATURE_BLOCK_ACTIVITY_START_IN_TASK\r\nEnable blocking of non-allowlisted activities from being started into a locked task.\r\nConstant Value: 64 (0x00000040)\r\nLOCK_TASK_FEATURE_GLOBAL_ACTIONS\r\npublic static final int LOCK_TASK_FEATURE_GLOBAL_ACTIONS\r\nEnable the global actions dialog during LockTask mode. This is the dialog that shows up when the user long-presses the\r\npower button, for example. Note that the user may not be able to power off the device if this flag is not set.\r\nThis flag is enabled by default until setLockTaskFeatures(ComponentName,int) is called for the first time.\r\nConstant Value: 16 (0x00000010)\r\nLOCK_TASK_FEATURE_KEYGUARD\r\npublic static final int LOCK_TASK_FEATURE_KEYGUARD\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 65 of 178\n\nEnable the keyguard during LockTask mode. Note that if the keyguard is already disabled with\r\nsetKeyguardDisabled(ComponentName,boolean) , setting this flag will have no effect. If this flag is not set, the keyguard\r\nwill not be shown even if the user has a lock screen credential.\r\nConstant Value: 32 (0x00000020)\r\nLOCK_TASK_FEATURE_NONE\r\npublic static final int LOCK_TASK_FEATURE_NONE\r\nDisable all configurable SystemUI features during LockTask mode. This includes,\r\nsystem info area in the status bar (connectivity icons, clock, etc.)\r\nnotifications (including alerts, icons, and the notification shade)\r\nHome button\r\nRecents button and UI\r\nglobal actions menu (i.e. power button menu)\r\nkeyguard\r\nConstant Value: 0 (0x00000000)\r\nLOCK_TASK_FEATURE_NOTIFICATIONS\r\npublic static final int LOCK_TASK_FEATURE_NOTIFICATIONS\r\nEnable notifications during LockTask mode. This includes notification icons on the status bar, heads-up notifications, and\r\nthe expandable notification shade. Note that the Quick Settings panel remains disabled. This feature flag can only be used in\r\ncombination with LOCK_TASK_FEATURE_HOME . setLockTaskFeatures(ComponentName,int) throws an\r\nIllegalArgumentException if this feature flag is defined without LOCK_TASK_FEATURE_HOME .\r\nConstant Value: 2 (0x00000002)\r\nLOCK_TASK_FEATURE_SYSTEM_INFO\r\npublic static final int LOCK_TASK_FEATURE_SYSTEM_INFO\r\nEnable the system info area in the status bar during LockTask mode. The system info area usually occupies the right side of\r\nthe status bar (although this can differ across OEMs). It includes all system information indicators, such as date and time,\r\nconnectivity, battery, vibration mode, etc.\r\nConstant Value: 1 (0x00000001)\r\nMIME_TYPE_PROVISIONING_NFC\r\npublic static final String MIME_TYPE_PROVISIONING_NFC\r\nThis MIME type is used for starting the device owner provisioning.\r\nDuring device owner provisioning a device admin app is set as the owner of the device. A device owner has full control over\r\nthe device. The device owner can not be modified by the user and the only way of resetting the device is if the device owner\r\napp calls a factory reset.\r\nA typical use case would be a device that is owned by a company, but used by either an employee or client.\r\nThe NFC message must be sent to an unprovisioned device.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 66 of 178\n\nThe NFC record must contain a serialized Properties object which contains the following properties:\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION , optional\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_COOKIE_HEADER , optional\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM , optional\r\nEXTRA_PROVISIONING_LOCAL_TIME (convert to String), optional\r\nEXTRA_PROVISIONING_TIME_ZONE , optional\r\nEXTRA_PROVISIONING_LOCALE , optional\r\nEXTRA_PROVISIONING_WIFI_SSID , optional\r\nEXTRA_PROVISIONING_WIFI_HIDDEN (convert to String), optional\r\nEXTRA_PROVISIONING_WIFI_SECURITY_TYPE , optional\r\nEXTRA_PROVISIONING_WIFI_PASSWORD , optional\r\nEXTRA_PROVISIONING_WIFI_PROXY_HOST , optional\r\nEXTRA_PROVISIONING_WIFI_PROXY_PORT (convert to String), optional\r\nEXTRA_PROVISIONING_WIFI_PROXY_BYPASS , optional\r\nEXTRA_PROVISIONING_WIFI_PAC_URL , optional\r\nEXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE , optional, supported from Build.VERSION_CODES.M\r\nEXTRA_PROVISIONING_WIFI_EAP_METHOD , optional, supported from Build.VERSION_CODES.Q\r\nEXTRA_PROVISIONING_WIFI_PHASE2_AUTH , optional, supported from Build.VERSION_CODES.Q\r\nEXTRA_PROVISIONING_WIFI_CA_CERTIFICATE , optional, supported from Build.VERSION_CODES.Q\r\nEXTRA_PROVISIONING_WIFI_USER_CERTIFICATE , optional, supported from Build.VERSION_CODES.Q\r\nEXTRA_PROVISIONING_WIFI_IDENTITY , optional, supported from Build.VERSION_CODES.Q\r\nEXTRA_PROVISIONING_WIFI_ANONYMOUS_IDENTITY , optional, supported from Build.VERSION_CODES.Q\r\nEXTRA_PROVISIONING_WIFI_DOMAIN , optional, supported from Build.VERSION_CODES.Q\r\nAs of Build.VERSION_CODES.M , the properties should contain EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME instead\r\nof EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME , (although specifying only\r\nEXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME is still supported).\r\nConstant Value: \"application/com.android.managedprovisioning\"\r\nMTE_DISABLED\r\npublic static final int MTE_DISABLED\r\nRequire that MTE be disabled on the device. Can be set by a device owner.\r\nConstant Value: 2 (0x00000002)\r\nMTE_ENABLED\r\npublic static final int MTE_ENABLED\r\nRequire that MTE be enabled on the device, if supported. Can be set by a device owner or a profile owner of an\r\norganization-owned managed profile.\r\nConstant Value: 1 (0x00000001)\r\nMTE_NOT_CONTROLLED_BY_POLICY\r\npublic static final int MTE_NOT_CONTROLLED_BY_POLICY\r\nAllow the user to choose whether to enable MTE on the device.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 67 of 178\n\nConstant Value: 0 (0x00000000)\r\nNEARBY_STREAMING_DISABLED\r\npublic static final int NEARBY_STREAMING_DISABLED\r\nIndicates that nearby streaming is disabled.\r\nConstant Value: 1 (0x00000001)\r\nNEARBY_STREAMING_ENABLED\r\npublic static final int NEARBY_STREAMING_ENABLED\r\nIndicates that nearby streaming is enabled.\r\nConstant Value: 2 (0x00000002)\r\nNEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY\r\npublic static final int NEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY\r\nIndicates that nearby streaming is not controlled by policy, which means nearby streaming is allowed.\r\nConstant Value: 0 (0x00000000)\r\nNEARBY_STREAMING_SAME_MANAGED_ACCOUNT_ONLY\r\npublic static final int NEARBY_STREAMING_SAME_MANAGED_ACCOUNT_ONLY\r\nIndicates that nearby streaming is enabled only to devices offering a comparable level of security, with the same\r\nauthenticated managed account.\r\nConstant Value: 3 (0x00000003)\r\nOPERATION_SAFETY_REASON_DRIVING_DISTRACTION\r\npublic static final int OPERATION_SAFETY_REASON_DRIVING_DISTRACTION\r\nIndicates that a UnsafeStateException was thrown because the operation would distract the driver of the vehicle.\r\nConstant Value: 1 (0x00000001)\r\nPASSWORD_COMPLEXITY_HIGH\r\npublic static final int PASSWORD_COMPLEXITY_HIGH\r\nConstant for getPasswordComplexity() and setRequiredPasswordComplexity(int) . Define the high password\r\ncomplexity band as:\r\nPIN with no repeating (4444) or ordered (1234, 4321, 2468) sequences, length at least 8\r\nalphabetic, length at least 6\r\nalphanumeric, length at least 6\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 68 of 178\n\nWhen returned from getPasswordComplexity() , the constant represents the exact complexity band the password is in.\r\nWhen passed to setRequiredPasswordComplexity(int) , it sets the minimum complexity band which the password must\r\nmeet.\r\nConstant Value: 327680 (0x00050000)\r\nPASSWORD_COMPLEXITY_MEDIUM\r\npublic static final int PASSWORD_COMPLEXITY_MEDIUM\r\nConstant for getPasswordComplexity() and setRequiredPasswordComplexity(int) . Define the medium password\r\ncomplexity band as:\r\nPIN with no repeating (4444) or ordered (1234, 4321, 2468) sequences, length at least 4\r\nalphabetic, length at least 4\r\nalphanumeric, length at least 4\r\nWhen returned from getPasswordComplexity() , the constant represents the exact complexity band the password is in.\r\nWhen passed to setRequiredPasswordComplexity(int) , it sets the minimum complexity band which the password must\r\nmeet.\r\nConstant Value: 196608 (0x00030000)\r\nPASSWORD_QUALITY_ALPHABETIC\r\npublic static final int PASSWORD_QUALITY_ALPHABETIC\r\nConstant for setPasswordQuality(ComponentName, int) : the user must have entered a password containing at least\r\nalphabetic (or other symbol) characters. Note that quality constants are ordered so that higher values are more restrictive.\r\nConstant Value: 262144 (0x00040000)\r\nPASSWORD_QUALITY_ALPHANUMERIC\r\npublic static final int PASSWORD_QUALITY_ALPHANUMERIC\r\nConstant for setPasswordQuality(ComponentName, int) : the user must have entered a password containing at least both\u003e\r\nnumeric and alphabetic (or other symbol) characters. Note that quality constants are ordered so that higher values are more\r\nrestrictive.\r\nConstant Value: 327680 (0x00050000)\r\nPASSWORD_QUALITY_BIOMETRIC_WEAK\r\npublic static final int PASSWORD_QUALITY_BIOMETRIC_WEAK\r\nConstant for setPasswordQuality(ComponentName, int) : the policy allows for low-security biometric recognition\r\ntechnology. This implies technologies that can recognize the identity of an individual to about a 3 digit PIN (false detection\r\nis less than 1 in 1,000). Note that quality constants are ordered so that higher values are more restrictive.\r\nConstant Value: 32768 (0x00008000)\r\nPASSWORD_QUALITY_COMPLEX\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 69 of 178\n\npublic static final int PASSWORD_QUALITY_COMPLEX\r\nConstant for setPasswordQuality(ComponentName, int) : allows the admin to set precisely how many characters of various\r\ntypes the password should contain to satisfy the policy. The admin should set these requirements via\r\nsetPasswordMinimumLetters(ComponentName, int) , setPasswordMinimumNumeric(ComponentName, int) ,\r\nsetPasswordMinimumSymbols(ComponentName, int) , setPasswordMinimumUpperCase(ComponentName, int) ,\r\nsetPasswordMinimumLowerCase(ComponentName, int) , setPasswordMinimumNonLetter(ComponentName, int) , and\r\nsetPasswordMinimumLength(ComponentName, int) . Note that quality constants are ordered so that higher values are more\r\nrestrictive.\r\nConstant Value: 393216 (0x00060000)\r\nPASSWORD_QUALITY_NUMERIC\r\npublic static final int PASSWORD_QUALITY_NUMERIC\r\nConstant for setPasswordQuality(ComponentName, int) : the user must have entered a password containing at least\r\nnumeric characters. Note that quality constants are ordered so that higher values are more restrictive.\r\nConstant Value: 131072 (0x00020000)\r\nPASSWORD_QUALITY_NUMERIC_COMPLEX\r\npublic static final int PASSWORD_QUALITY_NUMERIC_COMPLEX\r\nConstant for setPasswordQuality(ComponentName, int) : the user must have entered a password containing at least\r\nnumeric characters with no repeating (4444) or ordered (1234, 4321, 2468) sequences. Note that quality constants are\r\nordered so that higher values are more restrictive.\r\nConstant Value: 196608 (0x00030000)\r\nPASSWORD_QUALITY_SOMETHING\r\npublic static final int PASSWORD_QUALITY_SOMETHING\r\nConstant for setPasswordQuality(ComponentName, int) : the policy requires some kind of password or pattern, but doesn't\r\ncare what it is. Note that quality constants are ordered so that higher values are more restrictive.\r\nConstant Value: 65536 (0x00010000)\r\nPASSWORD_QUALITY_UNSPECIFIED\r\npublic static final int PASSWORD_QUALITY_UNSPECIFIED\r\nConstant for setPasswordQuality(ComponentName, int) : the policy has no requirements for the password. Note that\r\nquality constants are ordered so that higher values are more restrictive.\r\nConstant Value: 0 (0x00000000)\r\nPERMISSION_GRANT_STATE_DEFAULT\r\npublic static final int PERMISSION_GRANT_STATE_DEFAULT\r\nRuntime permission state: The user can manage the permission through the UI.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 70 of 178\n\nConstant Value: 0 (0x00000000)\r\nPERMISSION_GRANT_STATE_DENIED\r\npublic static final int PERMISSION_GRANT_STATE_DENIED\r\nRuntime permission state: The permission is denied to the app and the user cannot manage the permission through the UI.\r\nConstant Value: 2 (0x00000002)\r\nPERMISSION_GRANT_STATE_GRANTED\r\npublic static final int PERMISSION_GRANT_STATE_GRANTED\r\nRuntime permission state: The permission is granted to the app and the user cannot manage the permission through the UI.\r\nConstant Value: 1 (0x00000001)\r\nPERMISSION_POLICY_AUTO_DENY\r\npublic static final int PERMISSION_POLICY_AUTO_DENY\r\nPermission policy to always deny new permission requests for runtime permissions. Already granted or denied permissions\r\nare not affected by this.\r\nConstant Value: 2 (0x00000002)\r\nPERMISSION_POLICY_AUTO_GRANT\r\npublic static final int PERMISSION_POLICY_AUTO_GRANT\r\nPermission policy to always grant new permission requests for runtime permissions. Already granted or denied permissions\r\nare not affected by this.\r\nConstant Value: 1 (0x00000001)\r\nPERMISSION_POLICY_PROMPT\r\npublic static final int PERMISSION_POLICY_PROMPT\r\nPermission policy to prompt user for new permission requests for runtime permissions. Already granted or denied\r\npermissions are not affected by this.\r\nConstant Value: 0 (0x00000000)\r\nPERSONAL_APPS_SUSPENDED_PROFILE_TIMEOUT\r\npublic static final int PERSONAL_APPS_SUSPENDED_PROFILE_TIMEOUT\r\nFlag for getPersonalAppsSuspendedReasons(ComponentName) return value. Set when personal apps are suspended by\r\nframework because managed profile was off for longer than allowed by policy.\r\nConstant Value: 2 (0x00000002)\r\nPOLICY_DISABLE_CAMERA\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 71 of 178\n\npublic static final String POLICY_DISABLE_CAMERA\r\nConstant to indicate the feature of disabling the camera. Used as argument to createAdminSupportIntent(String) .\r\nConstant Value: \"policy_disable_camera\"\r\nPOLICY_DISABLE_SCREEN_CAPTURE\r\npublic static final String POLICY_DISABLE_SCREEN_CAPTURE\r\nConstant to indicate the feature of disabling screen captures. Used as argument to createAdminSupportIntent(String) .\r\nConstant Value: \"policy_disable_screen_capture\"\r\nPRIVATE_DNS_MODE_OFF\r\npublic static final int PRIVATE_DNS_MODE_OFF\r\nSpecifies that Private DNS was turned off completely.\r\nConstant Value: 1 (0x00000001)\r\nPRIVATE_DNS_MODE_OPPORTUNISTIC\r\npublic static final int PRIVATE_DNS_MODE_OPPORTUNISTIC\r\nSpecifies that the device owner requested opportunistic DNS over TLS\r\nConstant Value: 2 (0x00000002)\r\nPRIVATE_DNS_MODE_PROVIDER_HOSTNAME\r\npublic static final int PRIVATE_DNS_MODE_PROVIDER_HOSTNAME\r\nSpecifies that the device owner configured a specific host to use for Private DNS.\r\nConstant Value: 3 (0x00000003)\r\nPRIVATE_DNS_MODE_UNKNOWN\r\npublic static final int PRIVATE_DNS_MODE_UNKNOWN\r\nSpecifies that the Private DNS setting is in an unknown state.\r\nConstant Value: 0 (0x00000000)\r\nPRIVATE_DNS_SET_ERROR_FAILURE_SETTING\r\npublic static final int PRIVATE_DNS_SET_ERROR_FAILURE_SETTING\r\nGeneral failure to set the Private DNS mode, not due to one of the reasons listed above.\r\nConstant Value: 2 (0x00000002)\r\nPRIVATE_DNS_SET_ERROR_HOST_NOT_SERVING\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 72 of 178\n\npublic static final int PRIVATE_DNS_SET_ERROR_HOST_NOT_SERVING\r\nIf the privateDnsHost provided was of a valid hostname but that host was found to not support DNS-over-TLS.\r\nConstant Value: 1 (0x00000001)\r\nPRIVATE_DNS_SET_NO_ERROR\r\npublic static final int PRIVATE_DNS_SET_NO_ERROR\r\nThe selected mode has been set successfully. If the mode is PRIVATE_DNS_MODE_PROVIDER_HOSTNAME then it implies the\r\nsupplied host is valid and reachable.\r\nConstant Value: 0 (0x00000000)\r\nPROVISIONING_MODE_FULLY_MANAGED_DEVICE\r\npublic static final int PROVISIONING_MODE_FULLY_MANAGED_DEVICE\r\nThe provisioning mode for fully managed device.\r\nConstant Value: 1 (0x00000001)\r\nPROVISIONING_MODE_MANAGED_PROFILE\r\npublic static final int PROVISIONING_MODE_MANAGED_PROFILE\r\nThe provisioning mode for managed profile.\r\nConstant Value: 2 (0x00000002)\r\nPROVISIONING_MODE_MANAGED_PROFILE_ON_PERSONAL_DEVICE\r\npublic static final int PROVISIONING_MODE_MANAGED_PROFILE_ON_PERSONAL_DEVICE\r\nThe provisioning mode for a managed profile on a personal device.\r\nThis mode is only available when the provisioning initiator has explicitly instructed the provisioning flow to support\r\nmanaged profile on a personal device provisioning. In that case, PROVISIONING_MODE_MANAGED_PROFILE corresponds to an\r\norganization-owned managed profile, whereas this constant corresponds to a personally-owned managed profile.\r\nConstant Value: 3 (0x00000003)\r\nRESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT\r\npublic static final int RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT\r\nFlag for resetPasswordWithToken(ComponentName, String, byte, int) and resetPassword(String, int) : don't ask for\r\nuser credentials on device boot. If the flag is set, the device can be booted without asking for user password. The absence of\r\nthis flag does not change the current boot requirements. This flag can be set by the device owner only. If the app is not the\r\ndevice owner, the flag is ignored. Once the flag is set, it cannot be reverted back without resetting the device to factory\r\ndefaults.\r\nConstant Value: 2 (0x00000002)\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 73 of 178\n\nWIPE_EUICC\r\npublic static final int WIPE_EUICC\r\nFlag for wipeDevice(int) : also erase the device's eUICC data.\r\nConstant Value: 4 (0x00000004)\r\nWIPE_EXTERNAL_STORAGE\r\npublic static final int WIPE_EXTERNAL_STORAGE\r\nFlag for wipeData(int) : also erase the device's adopted external storage (such as adopted SD cards).\r\nConstant Value: 1 (0x00000001)\r\nWIPE_RESET_PROTECTION_DATA\r\npublic static final int WIPE_RESET_PROTECTION_DATA\r\nFlag for wipeData(int) : also erase the factory reset protection data.\r\nThis flag may only be set by device owner admins; if it is set by other admins a SecurityException will be thrown.\r\nConstant Value: 2 (0x00000002)\r\nWIPE_SILENTLY\r\npublic static final int WIPE_SILENTLY\r\nFlag for wipeData(int) : won't show reason for wiping to the user.\r\nConstant Value: 8 (0x00000008)\r\nPublic methods\r\naddCrossProfileIntentFilter\r\npublic void addCrossProfileIntentFilter (ComponentName admin,\r\n IntentFilter filter,\r\n int flags)\r\nCalled by the profile owner of a managed profile so that some intents sent in the managed profile can also be resolved in the\r\nparent, or vice versa. Only activity intents are supported.\r\naddPersistentPreferredActivity\r\npublic void addPersistentPreferredActivity (ComponentName admin,\r\n IntentFilter filter,\r\n ComponentName activity)\r\nCalled by a profile owner or device owner or holder of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_LOCK_TASK . to set a default activity that the system selects to handle intents\r\nthat match the given IntentFilter instead of showing the default disambiguation mechanism. This activity will remain the\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 74 of 178\n\ndefault intent handler even if the set of potential event handlers for the intent filter changes and if the intent preferences are\r\nreset.\r\nNote that the target application should still declare the activity in the manifest, the API just sets the activity to be the default\r\none to handle the given intent filter.\r\nThe default disambiguation mechanism takes over if the activity is not installed (anymore). When the activity is\r\n(re)installed, it is automatically reset as default intent handler for the filter.\r\nNote that calling this API to set a default intent handler, only allow to avoid the default disambiguation mechanism. Implicit\r\nintents that do not trigger this mechanism (like invoking the browser) cannot be configured as they are controlled by other\r\nconfigurations.\r\nThe calling device admin must be a profile owner or device owner. If it is not, a security exception will be thrown.\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , after the persistent preferred activity policy has been set,\r\nPolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the\r\nadmin on whether the policy was successfully set or not. This callback will contain:\r\nThe policy identifier DevicePolicyIdentifiers.PERSISTENT_PREFERRED_ACTIVITY_POLICY\r\nThe additional policy params bundle, which contains PolicyUpdateReceiver.EXTRA_INTENT_FILTER the intent filter\r\nthe policy applies to\r\nThe TargetUser that this policy relates to\r\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\nset or the reason the policy failed to be set (e.g. PolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nNOTE: Performs disk I/O and shouldn't be called on the main thread.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\nfilter IntentFilter : The IntentFilter for which a default handler is added.\r\nactivity\r\nComponentName : The Activity that is added as default intent handler.\r\nThis value cannot be null .\r\naddUserRestriction\r\npublic void addUserRestriction (ComponentName admin,\r\n String key)\r\nCalled by a profile owner, device owner or a holder of any permission that is associated with a user restriction to set a user\r\nrestriction specified by the key.\r\nThe calling device admin must be a profile owner, device owner or holder of any permission that is associated with a user\r\nrestriction; if it is not, a security exception will be thrown.\r\nThe profile owner of an organization-owned managed profile may invoke this method on the DevicePolicyManager\r\ninstance it obtained from getParentProfileInstance(ComponentName) , for enforcing device-wide restrictions.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 75 of 178\n\nSee the constants in UserManager for the list of restrictions that can be enforced device-wide. These constants will also\r\nstate in their documentation which permission is required to manage the restriction using this API.\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , after the user restriction policy has been set,\r\nPolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the\r\nadmin on whether the policy was successfully set or not. This callback will contain:\r\nThe policy identifier returned from DevicePolicyIdentifiers.getIdentifierForUserRestriction(String)\r\nThe TargetUser that this policy relates to\r\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\nset or the reason the policy failed to be set (e.g. PolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with or null if the caller is not a\r\ndevice admin.\r\nkey String : The key of the restriction.\r\nValue is one of the following:\r\nUserManager.ALLOW_PARENT_PROFILE_APP_LINKING\r\nUserManager.DISALLOW_ADD_MANAGED_PROFILE\r\nUserManager.DISALLOW_ADD_PRIVATE_PROFILE\r\nUserManager.DISALLOW_ADD_USER\r\nUserManager.DISALLOW_ADD_WIFI_CONFIG\r\nUserManager.DISALLOW_ADJUST_VOLUME\r\nUserManager.DISALLOW_AIRPLANE_MODE\r\nUserManager.DISALLOW_AMBIENT_DISPLAY\r\nUserManager.DISALLOW_APPS_CONTROL\r\nUserManager.DISALLOW_ASSIST_CONTENT\r\nUserManager.DISALLOW_AUTOFILL\r\nUserManager.DISALLOW_BLUETOOTH\r\nUserManager.DISALLOW_BLUETOOTH_SHARING\r\nUserManager.DISALLOW_CAMERA_TOGGLE\r\nUserManager.DISALLOW_CELLULAR_2G\r\nUserManager.DISALLOW_CHANGE_NEAR_FIELD_COMMUNICATION_RADIO\r\nUserManager.DISALLOW_CHANGE_WIFI_STATE\r\nUserManager.DISALLOW_CONFIG_BLUETOOTH\r\nUserManager.DISALLOW_CONFIG_BRIGHTNESS\r\nUserManager.DISALLOW_CONFIG_CELL_BROADCASTS\r\nUserManager.DISALLOW_CONFIG_CREDENTIALS\r\nUserManager.DISALLOW_CONFIG_DATE_TIME\r\nUserManager.DISALLOW_CONFIG_DEFAULT_APPS\r\nUserManager.DISALLOW_CONFIG_LOCALE\r\nUserManager.DISALLOW_CONFIG_LOCATION\r\nUserManager.DISALLOW_CONFIG_MOBILE_NETWORKS\r\nUserManager.DISALLOW_CONFIG_PRIVATE_DNS\r\nUserManager.DISALLOW_CONFIG_SCREEN_TIMEOUT\r\nUserManager.DISALLOW_CONFIG_TETHERING\r\nUserManager.DISALLOW_CONFIG_VPN\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 76 of 178\n\nUserManager.DISALLOW_CONFIG_WIFI\r\nUserManager.DISALLOW_CONTENT_CAPTURE\r\nUserManager.DISALLOW_CONTENT_SUGGESTIONS\r\nUserManager.DISALLOW_CREATE_WINDOWS\r\nUserManager.DISALLOW_CROSS_PROFILE_COPY_PASTE\r\nUserManager.DISALLOW_DATA_ROAMING\r\nUserManager.DISALLOW_DEBUGGING_FEATURES\r\nUserManager.DISALLOW_FACTORY_RESET\r\nUserManager.DISALLOW_FUN\r\nUserManager.DISALLOW_GRANT_ADMIN\r\nUserManager.DISALLOW_TASK_CONTINUITY_HANDOFF\r\nUserManager.DISALLOW_INSTALL_APPS\r\nUserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES\r\nUserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY\r\nUserManager.DISALLOW_MICROPHONE_TOGGLE\r\nUserManager.DISALLOW_MODIFY_ACCOUNTS\r\nUserManager.DISALLOW_MOUNT_PHYSICAL_MEDIA\r\nUserManager.DISALLOW_NEAR_FIELD_COMMUNICATION_RADIO\r\nUserManager.DISALLOW_NETWORK_RESET\r\nUserManager.DISALLOW_OUTGOING_BEAM\r\nUserManager.DISALLOW_OUTGOING_CALLS\r\nUserManager.DISALLOW_PRINTING\r\nUserManager.DISALLOW_REMOVE_MANAGED_PROFILE\r\nUserManager.DISALLOW_REMOVE_USER\r\nUserManager.DISALLOW_SAFE_BOOT\r\nUserManager.DISALLOW_SET_USER_ICON\r\nUserManager.DISALLOW_SET_WALLPAPER\r\nUserManager.DISALLOW_SHARE_INTO_MANAGED_PROFILE\r\nUserManager.DISALLOW_SHARE_LOCATION\r\nUserManager.DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI\r\nUserManager.DISALLOW_SIM_GLOBALLY\r\nUserManager.DISALLOW_SMS\r\nUserManager.DISALLOW_SYSTEM_ERROR_DIALOGS\r\nUserManager.DISALLOW_THREAD_NETWORK\r\nUserManager.DISALLOW_ULTRA_WIDEBAND_RADIO\r\nUserManager.DISALLOW_UNIFIED_PASSWORD\r\nUserManager.DISALLOW_UNINSTALL_APPS\r\nUserManager.DISALLOW_UNMUTE_MICROPHONE\r\nUserManager.DISALLOW_USB_FILE_TRANSFER\r\nUserManager.DISALLOW_USER_SWITCH\r\nUserManager.DISALLOW_WIFI_DIRECT\r\nUserManager.DISALLOW_WIFI_TETHERING\r\nUserManager.ENSURE_VERIFY_APPS\r\nUserManager.KEY_RESTRICTIONS_PENDING\r\nThrows\r\nSecurityException\r\nif admin is not a device or profile owner and if the caller has not been granted the permission\r\nto set the given user restriction.\r\naddUserRestrictionGlobally\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 77 of 178\n\npublic void addUserRestrictionGlobally (String key)\r\nCalled by a profile owner, device owner or a holder of any permission that is associated with a user restriction to set a user\r\nrestriction specified by the provided key globally on all users. To clear the restriction use\r\nclearUserRestriction(ComponentName, String) .\r\nFor a given user, a restriction will be set if it was applied globally or locally by any admin.\r\nThe calling device admin must be a profile owner, device owner or a holder of any permission that is associated with a user\r\nrestriction; if it is not, a security exception will be thrown.\r\nSee the constants in UserManager for the list of restrictions that can be enforced device-wide. These constants will also\r\nstate in their documentation which permission is required to manage the restriction using this API.\r\nAfter the user restriction policy has been set,\r\nPolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the\r\nadmin on whether the policy was successfully set or not. This callback will contain:\r\nThe policy identifier returned from DevicePolicyIdentifiers.getIdentifierForUserRestriction(String)\r\nThe TargetUser that this policy relates to\r\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\nset or the reason the policy failed to be set (e.g. PolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nParameters\r\nkey String : The key of the restriction.\r\nThis value cannot be null .\r\nValue is one of the following:\r\nUserManager.ALLOW_PARENT_PROFILE_APP_LINKING\r\nUserManager.DISALLOW_ADD_MANAGED_PROFILE\r\nUserManager.DISALLOW_ADD_PRIVATE_PROFILE\r\nUserManager.DISALLOW_ADD_USER\r\nUserManager.DISALLOW_ADD_WIFI_CONFIG\r\nUserManager.DISALLOW_ADJUST_VOLUME\r\nUserManager.DISALLOW_AIRPLANE_MODE\r\nUserManager.DISALLOW_AMBIENT_DISPLAY\r\nUserManager.DISALLOW_APPS_CONTROL\r\nUserManager.DISALLOW_ASSIST_CONTENT\r\nUserManager.DISALLOW_AUTOFILL\r\nUserManager.DISALLOW_BLUETOOTH\r\nUserManager.DISALLOW_BLUETOOTH_SHARING\r\nUserManager.DISALLOW_CAMERA_TOGGLE\r\nUserManager.DISALLOW_CELLULAR_2G\r\nUserManager.DISALLOW_CHANGE_NEAR_FIELD_COMMUNICATION_RADIO\r\nUserManager.DISALLOW_CHANGE_WIFI_STATE\r\nUserManager.DISALLOW_CONFIG_BLUETOOTH\r\nUserManager.DISALLOW_CONFIG_BRIGHTNESS\r\nUserManager.DISALLOW_CONFIG_CELL_BROADCASTS\r\nUserManager.DISALLOW_CONFIG_CREDENTIALS\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 78 of 178\n\nUserManager.DISALLOW_CONFIG_DATE_TIME\r\nUserManager.DISALLOW_CONFIG_DEFAULT_APPS\r\nUserManager.DISALLOW_CONFIG_LOCALE\r\nUserManager.DISALLOW_CONFIG_LOCATION\r\nUserManager.DISALLOW_CONFIG_MOBILE_NETWORKS\r\nUserManager.DISALLOW_CONFIG_PRIVATE_DNS\r\nUserManager.DISALLOW_CONFIG_SCREEN_TIMEOUT\r\nUserManager.DISALLOW_CONFIG_TETHERING\r\nUserManager.DISALLOW_CONFIG_VPN\r\nUserManager.DISALLOW_CONFIG_WIFI\r\nUserManager.DISALLOW_CONTENT_CAPTURE\r\nUserManager.DISALLOW_CONTENT_SUGGESTIONS\r\nUserManager.DISALLOW_CREATE_WINDOWS\r\nUserManager.DISALLOW_CROSS_PROFILE_COPY_PASTE\r\nUserManager.DISALLOW_DATA_ROAMING\r\nUserManager.DISALLOW_DEBUGGING_FEATURES\r\nUserManager.DISALLOW_FACTORY_RESET\r\nUserManager.DISALLOW_FUN\r\nUserManager.DISALLOW_GRANT_ADMIN\r\nUserManager.DISALLOW_TASK_CONTINUITY_HANDOFF\r\nUserManager.DISALLOW_INSTALL_APPS\r\nUserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES\r\nUserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY\r\nUserManager.DISALLOW_MICROPHONE_TOGGLE\r\nUserManager.DISALLOW_MODIFY_ACCOUNTS\r\nUserManager.DISALLOW_MOUNT_PHYSICAL_MEDIA\r\nUserManager.DISALLOW_NEAR_FIELD_COMMUNICATION_RADIO\r\nUserManager.DISALLOW_NETWORK_RESET\r\nUserManager.DISALLOW_OUTGOING_BEAM\r\nUserManager.DISALLOW_OUTGOING_CALLS\r\nUserManager.DISALLOW_PRINTING\r\nUserManager.DISALLOW_REMOVE_MANAGED_PROFILE\r\nUserManager.DISALLOW_REMOVE_USER\r\nUserManager.DISALLOW_SAFE_BOOT\r\nUserManager.DISALLOW_SET_USER_ICON\r\nUserManager.DISALLOW_SET_WALLPAPER\r\nUserManager.DISALLOW_SHARE_INTO_MANAGED_PROFILE\r\nUserManager.DISALLOW_SHARE_LOCATION\r\nUserManager.DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI\r\nUserManager.DISALLOW_SIM_GLOBALLY\r\nUserManager.DISALLOW_SMS\r\nUserManager.DISALLOW_SYSTEM_ERROR_DIALOGS\r\nUserManager.DISALLOW_THREAD_NETWORK\r\nUserManager.DISALLOW_ULTRA_WIDEBAND_RADIO\r\nUserManager.DISALLOW_UNIFIED_PASSWORD\r\nUserManager.DISALLOW_UNINSTALL_APPS\r\nUserManager.DISALLOW_UNMUTE_MICROPHONE\r\nUserManager.DISALLOW_USB_FILE_TRANSFER\r\nUserManager.DISALLOW_USER_SWITCH\r\nUserManager.DISALLOW_WIFI_DIRECT\r\nUserManager.DISALLOW_WIFI_TETHERING\r\nUserManager.ENSURE_VERIFY_APPS\r\nUserManager.KEY_RESTRICTIONS_PENDING\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 79 of 178\n\ncanAdminGrantSensorsPermissions\r\npublic boolean canAdminGrantSensorsPermissions ()\r\nReturns true if the caller is running on a device where an admin can grant permissions related to device sensors. This is a\r\nsignal that the device is a fully-managed device where personal usage is discouraged. The list of permissions is listed in\r\nsetPermissionGrantState(ComponentName,String,String,int) . May be called by any app.\r\nReturns\r\nboolean true if an admin can grant device sensors-related permissions, false otherwise.\r\ncanUsbDataSignalingBeDisabled\r\npublic boolean canUsbDataSignalingBeDisabled ()\r\nReturns whether enabling or disabling USB data signaling is supported on the device.\r\nReturns\r\nboolean true if the device supports enabling and disabling USB data signaling.\r\nclearApplicationUserData\r\npublic void clearApplicationUserData (ComponentName admin,\r\n String packageName,\r\n Executor executor,\r\n DevicePolicyManager.OnClearApplicationUserDataListener listener)\r\nCalled by the device owner or profile owner to clear application user data of a given package. The behaviour of this is\r\nequivalent to the target application calling ActivityManager.clearApplicationUserData() .\r\nNote: an application can store data outside of its application data, e.g. external storage or user dictionary. This data will not\r\nbe wiped by calling this API.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\npackageName\r\nString : The name of the package which will have its user data wiped.\r\nThis value cannot be null .\r\nexecutor\r\nExecutor : The executor through which the listener should be invoked.\r\nThis value cannot be null .\r\nCallback and listener events are dispatched through this Executor , providing an easy way to control\r\nwhich thread is used. To dispatch events through the main thread of your application, you can use\r\nContext.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate\r\nthread.\r\nlistener\r\nDevicePolicyManager.OnClearApplicationUserDataListener : A callback object that will inform the\r\ncaller when the clearing is done.\r\nThis value cannot be null .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 80 of 178\n\nclearCrossProfileIntentFilters\r\npublic void clearCrossProfileIntentFilters (ComponentName admin)\r\nCalled by a profile owner of a managed profile to remove the cross-profile intent filters that go from the managed profile to\r\nthe parent, or from the parent to the managed profile. Only removes those that have been set by the profile owner.\r\nNote: A list of default cross profile intent filters are set up by the system when the profile is created, some of them ensure the\r\nproper functioning of the profile, while others enable sharing of data from the parent to the managed profile for user\r\nconvenience. These default intent filters are not cleared when this API is called. If the default cross profile data sharing is\r\nnot desired, they can be disabled with UserManager.DISALLOW_SHARE_INTO_MANAGED_PROFILE .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value may be null .\r\nclearDeviceOwnerApp\r\npublic void clearDeviceOwnerApp (String packageName)\r\nThis method was deprecated in API level 26.\r\nThis method is expected to be used for testing purposes only. The device owner will lose control of the device and its data\r\nafter calling it. In order to protect any sensitive data that remains on the device, it is advised that the device owner factory\r\nresets the device instead of calling this method. See wipeData(int) .\r\nClears the current device owner. The caller must be the device owner. This function should be used cautiously as once it is\r\ncalled it cannot be undone. The device owner can only be set as a part of device setup, before it completes.\r\nWhile some policies previously set by the device owner will be cleared by this method, it is a best-effort process and some\r\nother policies will still remain in place after the device owner is cleared.\r\nParameters\r\npackageName String : The package name of the device owner.\r\nThrows\r\nSecurityException\r\nif the caller is not in packageName or packageName does not own the current device owner\r\ncomponent.\r\nclearPackagePersistentPreferredActivities\r\npublic void clearPackagePersistentPreferredActivities (ComponentName admin,\r\n String packageName)\r\nCalled by a profile owner or device owner or holder of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_LOCK_TASK to remove all persistent intent handler preferences associated with\r\nthe given package that were set by addPersistentPreferredActivity(ComponentName, IntentFilter, ComponentName) .\r\nThe calling device admin must be a profile owner. If it is not, a security exception will be thrown.\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , after the persistent preferred activity policy has been cleared,\r\nPolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the\r\nadmin on whether the policy was successfully cleared or not. This callback will contain:\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 81 of 178\n\nThe policy identifier DevicePolicyIdentifiers.PERSISTENT_PREFERRED_ACTIVITY_POLICY\r\nThe additional policy params bundle, which contains PolicyUpdateReceiver.EXTRA_INTENT_FILTER the intent filter\r\nthe policy applies to\r\nThe TargetUser that this policy relates to\r\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\ncleared or the reason the policy failed to be cleared (e.g.\r\nPolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is\r\nnot a device admin.\r\nThis value may be null .\r\npackageName String : The name of the package for which preferences are removed.\r\nclearProfileOwner\r\npublic void clearProfileOwner (ComponentName admin)\r\nThis method was deprecated in API level 26.\r\nThis method is expected to be used for testing purposes only. The profile owner will lose control of the user and its data after\r\ncalling it. In order to protect any sensitive data that remains on this user, it is advised that the profile owner deletes it instead\r\nof calling this method. See wipeData(int) .\r\nClears the active profile owner. The caller must be the profile owner of this user, otherwise a SecurityException will be\r\nthrown. This method is not available to managed profile owners.\r\nWhile some policies previously set by the profile owner will be cleared by this method, it is a best-effort process and some\r\nother policies will still remain in place after the profile owner is cleared.\r\nParameters\r\nadmin\r\nComponentName : The component to remove as the profile owner.\r\nThis value cannot be null .\r\nThrows\r\nSecurityException if admin is not an active profile owner, or the method is being called from a managed profile.\r\nclearUserRestriction\r\npublic void clearUserRestriction (ComponentName admin,\r\n String key)\r\nCalled by a profile owner, device owner or a holder of any permission that is associated with a user restriction to clear a user\r\nrestriction specified by the key.\r\nThe calling device admin must be a profile or device owner; if it is not, a security exception will be thrown.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 82 of 178\n\nThe profile owner of an organization-owned managed profile may invoke this method on the DevicePolicyManager\r\ninstance it obtained from getParentProfileInstance(ComponentName) , for clearing device-wide restrictions.\r\nSee the constants in UserManager for the list of restrictions. These constants state in their documentation which permission\r\nis required to manage the restriction using this API.\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , after the user restriction policy has been cleared,\r\nPolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the\r\nadmin on whether the policy was successfully cleared or not. This callback will contain:\r\nThe policy identifier returned from DevicePolicyIdentifiers.getIdentifierForUserRestriction(String)\r\nThe TargetUser that this policy relates to\r\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\ncleared or the reason the policy failed to be cleared (e.g.\r\nPolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with or null if the caller is not a\r\ndevice admin.\r\nkey String : The key of the restriction.\r\nValue is one of the following:\r\nUserManager.ALLOW_PARENT_PROFILE_APP_LINKING\r\nUserManager.DISALLOW_ADD_MANAGED_PROFILE\r\nUserManager.DISALLOW_ADD_PRIVATE_PROFILE\r\nUserManager.DISALLOW_ADD_USER\r\nUserManager.DISALLOW_ADD_WIFI_CONFIG\r\nUserManager.DISALLOW_ADJUST_VOLUME\r\nUserManager.DISALLOW_AIRPLANE_MODE\r\nUserManager.DISALLOW_AMBIENT_DISPLAY\r\nUserManager.DISALLOW_APPS_CONTROL\r\nUserManager.DISALLOW_ASSIST_CONTENT\r\nUserManager.DISALLOW_AUTOFILL\r\nUserManager.DISALLOW_BLUETOOTH\r\nUserManager.DISALLOW_BLUETOOTH_SHARING\r\nUserManager.DISALLOW_CAMERA_TOGGLE\r\nUserManager.DISALLOW_CELLULAR_2G\r\nUserManager.DISALLOW_CHANGE_NEAR_FIELD_COMMUNICATION_RADIO\r\nUserManager.DISALLOW_CHANGE_WIFI_STATE\r\nUserManager.DISALLOW_CONFIG_BLUETOOTH\r\nUserManager.DISALLOW_CONFIG_BRIGHTNESS\r\nUserManager.DISALLOW_CONFIG_CELL_BROADCASTS\r\nUserManager.DISALLOW_CONFIG_CREDENTIALS\r\nUserManager.DISALLOW_CONFIG_DATE_TIME\r\nUserManager.DISALLOW_CONFIG_DEFAULT_APPS\r\nUserManager.DISALLOW_CONFIG_LOCALE\r\nUserManager.DISALLOW_CONFIG_LOCATION\r\nUserManager.DISALLOW_CONFIG_MOBILE_NETWORKS\r\nUserManager.DISALLOW_CONFIG_PRIVATE_DNS\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 83 of 178\n\nUserManager.DISALLOW_CONFIG_SCREEN_TIMEOUT\r\nUserManager.DISALLOW_CONFIG_TETHERING\r\nUserManager.DISALLOW_CONFIG_VPN\r\nUserManager.DISALLOW_CONFIG_WIFI\r\nUserManager.DISALLOW_CONTENT_CAPTURE\r\nUserManager.DISALLOW_CONTENT_SUGGESTIONS\r\nUserManager.DISALLOW_CREATE_WINDOWS\r\nUserManager.DISALLOW_CROSS_PROFILE_COPY_PASTE\r\nUserManager.DISALLOW_DATA_ROAMING\r\nUserManager.DISALLOW_DEBUGGING_FEATURES\r\nUserManager.DISALLOW_FACTORY_RESET\r\nUserManager.DISALLOW_FUN\r\nUserManager.DISALLOW_GRANT_ADMIN\r\nUserManager.DISALLOW_TASK_CONTINUITY_HANDOFF\r\nUserManager.DISALLOW_INSTALL_APPS\r\nUserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES\r\nUserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY\r\nUserManager.DISALLOW_MICROPHONE_TOGGLE\r\nUserManager.DISALLOW_MODIFY_ACCOUNTS\r\nUserManager.DISALLOW_MOUNT_PHYSICAL_MEDIA\r\nUserManager.DISALLOW_NEAR_FIELD_COMMUNICATION_RADIO\r\nUserManager.DISALLOW_NETWORK_RESET\r\nUserManager.DISALLOW_OUTGOING_BEAM\r\nUserManager.DISALLOW_OUTGOING_CALLS\r\nUserManager.DISALLOW_PRINTING\r\nUserManager.DISALLOW_REMOVE_MANAGED_PROFILE\r\nUserManager.DISALLOW_REMOVE_USER\r\nUserManager.DISALLOW_SAFE_BOOT\r\nUserManager.DISALLOW_SET_USER_ICON\r\nUserManager.DISALLOW_SET_WALLPAPER\r\nUserManager.DISALLOW_SHARE_INTO_MANAGED_PROFILE\r\nUserManager.DISALLOW_SHARE_LOCATION\r\nUserManager.DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI\r\nUserManager.DISALLOW_SIM_GLOBALLY\r\nUserManager.DISALLOW_SMS\r\nUserManager.DISALLOW_SYSTEM_ERROR_DIALOGS\r\nUserManager.DISALLOW_THREAD_NETWORK\r\nUserManager.DISALLOW_ULTRA_WIDEBAND_RADIO\r\nUserManager.DISALLOW_UNIFIED_PASSWORD\r\nUserManager.DISALLOW_UNINSTALL_APPS\r\nUserManager.DISALLOW_UNMUTE_MICROPHONE\r\nUserManager.DISALLOW_USB_FILE_TRANSFER\r\nUserManager.DISALLOW_USER_SWITCH\r\nUserManager.DISALLOW_WIFI_DIRECT\r\nUserManager.DISALLOW_WIFI_TETHERING\r\nUserManager.ENSURE_VERIFY_APPS\r\nUserManager.KEY_RESTRICTIONS_PENDING\r\nThrows\r\nSecurityException\r\nif admin is not a device or profile owner and if the caller has not been granted the permission\r\nto set the given user restriction.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 84 of 178\n\ncreateAdminSupportIntent\r\npublic Intent createAdminSupportIntent (String restriction)\r\nCalled by any app to display a support dialog when a feature was disabled by an admin. This returns an intent that can be\r\nused with Context.startActivity(Intent) to display the dialog. It will tell the user that the feature indicated by\r\nrestriction was disabled by an admin, and include a link for more information. The default content of the dialog can be\r\nchanged by the restricting admin via setShortSupportMessage(ComponentName,CharSequence) . If the restriction is not set\r\n(i.e. the feature is available), then the return value will be null .\r\nReturns\r\nIntent\r\nIntent An intent to be used to start the dialog-activity if the restriction is set by an admin, or null if the\r\nrestriction does not exist or no admin set it.\r\ncreateAndManageUser\r\npublic UserHandle createAndManageUser (ComponentName admin,\r\n String name,\r\n ComponentName profileOwner,\r\n PersistableBundle adminExtras,\r\n int flags)\r\nCalled by a device owner to create a user with the specified name and a given component of the calling package as profile\r\nowner. The UserHandle returned by this method should not be persisted as user handles are recycled as users are removed\r\nand created. If you need to persist an identifier for this user, use UserManager.getSerialNumberForUser . The new user will\r\nnot be started in the background.\r\nadmin is the DeviceAdminReceiver which is the device owner. profileOwner is also a DeviceAdminReceiver in the same\r\npackage as admin, and will become the profile owner and will be registered as an active admin on the new user. The profile\r\nowner package will be installed on the new user.\r\nIf the adminExtras are not null, they will be stored on the device until the user is started for the first time. Then the extras\r\nwill be passed to the admin when onEnable is called.\r\nFrom Build.VERSION_CODES.P onwards, if targeting Build.VERSION_CODES.P , throws UserOperationException instead\r\nof returning null on failure.\r\nReturns\r\nUserHandle the UserHandle object for the created user, or null if the user could not be created.\r\nenableSystemApp\r\npublic int enableSystemApp (ComponentName admin,\r\n Intent intent)\r\nRe-enable system apps by intent that were disabled by default when the user was initialized. This function can be called by a\r\ndevice owner, profile owner, or by a delegate given the DELEGATION_ENABLE_SYSTEM_APP scope via\r\nsetDelegatedScopes(ComponentName, String, List) .\r\nParameters\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 85 of 178\n\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if the caller is an\r\nenable system app delegate.\r\nintent\r\nIntent : An intent matching the app(s) to be installed. All apps that resolve for this intent will be re-enabled in the calling profile.\r\nReturns\r\nint int The number of activities that matched the intent and were installed.\r\nenableSystemApp\r\npublic void enableSystemApp (ComponentName admin,\r\n String packageName)\r\nRe-enable a system app that was disabled by default when the user was initialized. This function can be called by a device\r\nowner, profile owner, or by a delegate given the DELEGATION_ENABLE_SYSTEM_APP scope via\r\nsetDelegatedScopes(ComponentName, String, List) .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if the caller\r\nis an enable system app delegate.\r\npackageName String : The package to be re-enabled in the calling profile.\r\ngenerateKeyPair\r\npublic AttestedKeyPair generateKeyPair (ComponentName admin,\r\n String algorithm,\r\n KeyGenParameterSpec keySpec,\r\n int idAttestationFlags)\r\nThis API can be called by the following to generate a new private/public key pair:\r\nDevice owner\r\nProfile owner\r\nDelegated certificate installer\r\nCredential management app\r\nAn app that holds the Manifest.permission.MANAGE_DEVICE_POLICY_CERTIFICATES permission\r\nIf the device supports key generation via secure hardware, this method is useful for creating a key in KeyChain that never\r\nleft the secure hardware. Access to the key is controlled the same way as in installKeyPair(ComponentName, PrivateKey,\r\nCertificate, String) .\r\nFrom Android Build.VERSION_CODES.S , the credential management app can call this API. If called by the credential\r\nmanagement app, the componentName must be null . Note, there can only be a credential management app on an\r\nunmanaged device.\r\nBecause this method might take several seconds to complete, it should only be called from a worker thread. This method\r\nreturns null when called from the main thread.\r\nThis method is not thread-safe, calling it from multiple threads at the same time will result in undefined behavior. If the\r\ncalling thread is interrupted while the invocation is in-flight, it will eventually terminate and return null .\r\nNote: If the provided alias is of an existing alias, all former grants that apps have been given to access the key and\r\ncertificates associated with this alias will be revoked.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 86 of 178\n\nAttestation: to enable attestation, set an attestation challenge in keySpec via\r\nKeyGenParameterSpec.Builder.setAttestationChallenge . By specifying flags to the idAttestationFlags parameter, it is\r\npossible to request the device's unique identity to be included in the attestation record.\r\nSpecific identifiers can be included in the attestation record, and an individual attestation certificate can be used to sign the\r\nattestation record. To find out if the device supports these features, refer to isDeviceIdAttestationSupported() and\r\nisUniqueDeviceAttestationSupported() .\r\nDevice owner, profile owner, their delegated certificate installer and the credential management app can use\r\nID_TYPE_BASE_INFO to request inclusion of the general device information including manufacturer, model, brand, device\r\nand product in the attestation record. Only device owner, profile owner on an organization-owned device or affiliated user,\r\nand their delegated certificate installers can use ID_TYPE_SERIAL , ID_TYPE_IMEI and ID_TYPE_MEID to request unique\r\ndevice identifiers to be attested (the serial number, IMEI and MEID correspondingly), if supported by the device (see\r\nisDeviceIdAttestationSupported() ). Additionally, device owner, profile owner on an organization-owned device and\r\ntheir delegated certificate installers can also request the attestation record to be signed using an individual attestation\r\ncertificate by specifying the ID_TYPE_INDIVIDUAL_ATTESTATION flag (if supported by the device, see\r\nisUniqueDeviceAttestationSupported() ).\r\nIf any of ID_TYPE_SERIAL , ID_TYPE_IMEI and ID_TYPE_MEID is set, it is implicitly assumed that ID_TYPE_BASE_INFO is\r\nalso set.\r\nAttestation using ID_TYPE_INDIVIDUAL_ATTESTATION can only be requested if key generation is done in StrongBox.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if\r\nthe caller is not a device admin.\r\nalgorithm\r\nString : The key generation algorithm, see KeyPairGenerator .\r\nThis value cannot be null .\r\nkeySpec\r\nKeyGenParameterSpec : Specification of the key to generate, see KeyPairGenerator .\r\nThis value cannot be null .\r\nidAttestationFlags\r\nint : A bitmask of the identifiers that should be included in the attestation record\r\n( ID_TYPE_BASE_INFO , ID_TYPE_SERIAL , ID_TYPE_IMEI and ID_TYPE_MEID ), and\r\nID_TYPE_INDIVIDUAL_ATTESTATION if the attestation record should be signed using an\r\nindividual attestation certificate.\r\n0 should be passed in if no device identification is required in the attestation record and the\r\nbatch attestation certificate should be used.\r\nIf any flag is specified, then an attestation challenge must be included in the keySpec .\r\nValue is either 0 or a combination of the following:\r\nID_TYPE_BASE_INFO\r\nID_TYPE_SERIAL\r\nID_TYPE_IMEI\r\nID_TYPE_MEID\r\nID_TYPE_INDIVIDUAL_ATTESTATION\r\nReturns\r\nAttestedKeyPair A non-null AttestedKeyPair if the key generation succeeded, null otherwise.\r\nThrows\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 87 of 178\n\nStrongBoxUnavailableException\r\nif the use of StrongBox for key generation was specified in keySpec but the\r\ndevice does not have one.\r\nIllegalArgumentException\r\nin the following cases:\r\nThe alias in keySpec is empty.\r\nThe algorithm specification in keySpec is not RSAKeyGenParameterSpec\r\nor ECGenParameterSpec .\r\nDevice ID attestation was requested but the keySpec does not contain an\r\nattestation challenge.\r\nSecurityException\r\nif admin is not null and not a device or profile owner, or admin is null but\r\nthe calling application is not a delegated certificate installer or credential\r\nmanagement app. If Device ID attestation is requested (using ID_TYPE_SERIAL ,\r\nID_TYPE_IMEI or ID_TYPE_MEID ), the caller must be the Device Owner or the\r\nCertificate Installer delegate.\r\nUnsupportedOperationException\r\nif Device ID attestation or individual attestation was requested but the underlying\r\nhardware does not support it.\r\ngetAccountTypesWithManagementDisabled\r\npublic String[] getAccountTypesWithManagementDisabled ()\r\nGets the array of accounts for which account management is disabled by the profile owner or device owner.\r\nAccount management can be disabled/enabled by calling setAccountManagementDisabled(ComponentName, String,\r\nboolean) .\r\nThis method may be called on the DevicePolicyManager instance returned from\r\ngetParentProfileInstance(ComponentName) . Note that only a profile owner on an organization-owned device can affect\r\naccount types on the parent profile instance.\r\nReturns\r\nString[]\r\na list of account types for which account management has been disabled.\r\nThis value may be null .\r\ngetActiveAdmins\r\npublic List\u003cComponentName\u003e getActiveAdmins ()\r\nReturn a list of all currently active device administrators' component names. If there are no administrators null may be\r\nreturned.\r\ngetAlwaysOnVpnLockdownWhitelist\r\npublic Set\u003cString\u003e getAlwaysOnVpnLockdownWhitelist (ComponentName admin)\r\nCalled 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. Returns null when always-on VPN is not active or not in lockdown\r\nmode.\r\nParameters\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 88 of 178\n\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\ngetAlwaysOnVpnPackage\r\npublic String getAlwaysOnVpnPackage (ComponentName admin)\r\nCalled by a device or profile owner to read the name of the package administering an always-on VPN connection for the\r\ncurrent user. If there is no such package, or the always-on VPN is provided by the system instead of by an application,\r\nnull will be returned.\r\nParameters\r\nadmin ComponentName : This value cannot be null .\r\nReturns\r\nString Package name of VPN controller responsible for always-on VPN, or null if none is set.\r\ngetAppFunctionsPolicy\r\npublic int getAppFunctionsPolicy ()\r\nReturns the current AppFunctionManager policy.\r\nThe returned policy will be the current resolved policy rather than the policy set by the calling admin.\r\ngetApplicationRestrictions\r\npublic Bundle getApplicationRestrictions (ComponentName admin,\r\n String packageName)\r\nRetrieves the application restrictions for a given target application running in the calling user.\r\nThe caller must be a profile or device owner on that user, or the package allowed to manage application restrictions via\r\nsetDelegatedScopes(ComponentName, String, List) with the DELEGATION_APP_RESTRICTIONS scope; otherwise a security\r\nexception will be thrown.\r\nNOTE: The method performs disk I/O and shouldn't be called on the main thread.\r\nThis method may take several seconds to complete, so it should only be called from a worker thread.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if called by\r\nthe application restrictions managing package.\r\npackageName String : The name of the package to fetch restricted settings of.\r\ngetApplicationRestrictionsManagingPackage\r\npublic String getApplicationRestrictionsManagingPackage (ComponentName admin)\r\nThis method was deprecated in API level 26.\r\nFrom Build.VERSION_CODES.O . Use getDelegatePackages(ComponentName, String) with the\r\nDELEGATION_APP_RESTRICTIONS scope instead.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 89 of 178\n\nCalled by a profile owner or device owner to retrieve the application restrictions managing package for the current user, or\r\nnull if none is set. If there are multiple delegates this function will return one of them.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nReturns\r\nString The package name allowed to manage application restrictions on the current user, or null if none is set.\r\ngetAutoTimeEnabled\r\npublic boolean getAutoTimeEnabled (ComponentName admin)\r\nReturns true if auto time is enabled on the device.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\nReturns\r\nboolean true if auto time is enabled on the device.\r\nThrows\r\nSecurityException\r\nif caller is not a device owner, a profile owner for the primary user, or a profile owner of an\r\norganization-owned managed profile.\r\ngetAutoTimePolicy\r\npublic int getAutoTimePolicy ()\r\nReturns current auto time policy's state.\r\nThrows\r\nSecurityException\r\nif caller is not a device owner, a profile owner for the primary user, or a profile owner of an\r\norganization-owned managed profile, or if the caller does not hold the required permission.\r\ngetAutoTimeZoneEnabled\r\npublic boolean getAutoTimeZoneEnabled (ComponentName admin)\r\nReturns true if auto time zone is enabled on the device.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 90 of 178\n\nReturns\r\nboolean true if auto time zone is enabled on the device.\r\nThrows\r\nSecurityException\r\nif caller is not a device owner, a profile owner for the primary user, or a profile owner of an\r\norganization-owned managed profile.\r\ngetAutoTimeZonePolicy\r\npublic int getAutoTimeZonePolicy ()\r\nReturns auto time zone policy's current state.\r\nThrows\r\nSecurityException\r\nif caller is not a device owner, a profile owner for the primary user, or a profile owner of an\r\norganization-owned managed profile, or if the caller does not hold the required permission.\r\ngetBluetoothContactSharingDisabled\r\npublic boolean getBluetoothContactSharingDisabled (ComponentName admin)\r\nCalled by a profile owner of a managed profile to determine whether or not Bluetooth devices cannot access enterprise\r\ncontacts.\r\nThe calling device admin must be a profile owner. If it is not, a security exception will be thrown.\r\nThis API works on managed profile only.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\ngetCameraDisabled\r\npublic boolean getCameraDisabled (ComponentName admin)\r\nDetermine whether or not the device's cameras have been disabled for this user, either by the calling admin, if specified, or\r\nall admins.\r\nStarting with Android Build.VERSION_CODES.CINNAMON_BUN , this method also checks for external USB cameras that connect\r\ndirectly via the UsbConstants.USB_CLASS_VIDEO interface.\r\nThis method can be called on the DevicePolicyManager instance, returned by\r\ngetParentProfileInstance(ComponentName) , where the caller must be the profile owner of an organization-owned\r\nmanaged profile.\r\nParameters\r\nadmin\r\nComponentName : The name of the admin component to check, or null to check whether any admins have\r\ndisabled the camera\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 91 of 178\n\ngetCertInstallerPackage\r\npublic String getCertInstallerPackage (ComponentName admin)\r\nThis method was deprecated in API level 26.\r\nFrom Build.VERSION_CODES.O . Use getDelegatePackages(ComponentName, String) with the DELEGATION_CERT_INSTALL\r\nscope instead.\r\nCalled by a profile owner or device owner to retrieve the certificate installer for the user, or null if none is set. If there are\r\nmultiple delegates this function will return one of them.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nReturns\r\nString The package name of the current delegated certificate installer, or null if none is set.\r\ngetContentProtectionPolicy\r\npublic int getContentProtectionPolicy (ComponentName admin)\r\nReturns the current content protection policy.\r\nThe returned policy will be the current resolved policy rather than the policy set by the calling admin.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\ngetCredentialManagerPolicy\r\npublic PackagePolicy getCredentialManagerPolicy ()\r\nCalled by a device owner or profile owner of a managed profile to retrieve the credential manager policy.\r\nReturns\r\nPackagePolicy the current credential manager policy if null then this policy has not been configured.\r\nThrows\r\nSecurityException if caller is not a device owner or profile owner of a managed profile.\r\ngetCrossProfileCalendarPackages\r\npublic Set\u003cString\u003e getCrossProfileCalendarPackages (ComponentName admin)\r\nThis method was deprecated in API level 34.\r\nUse setCrossProfilePackages(ComponentName,Set) .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 92 of 178\n\nGets a set of package names that are allowed to access cross-profile calendar APIs.\r\nCalled by a profile owner of a managed profile.\r\nParameters\r\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\ngetCrossProfilePackages\r\npublic Set\u003cString\u003e getCrossProfilePackages (ComponentName admin)\r\nReturns the set of package names that the admin has previously set as allowed to request user consent for cross-profile\r\ncommunication, via setCrossProfilePackages(ComponentName,Set) .\r\nAssumes that the caller is a profile owner and is the given admin .\r\nNote that other apps not included in the returned set may be able to request user consent for cross-profile communication if\r\nthey have been explicitly allowlisted by the OEM.\r\nParameters\r\nadmin\r\nComponentName : the DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\ngetDelegatePackages\r\npublic List\u003cString\u003e getDelegatePackages (ComponentName admin,\r\n String delegationScope)\r\nCalled by a profile owner or device owner to retrieve a list of delegate packages that were granted a delegation scope.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\ndelegationScope\r\nString : The scope whose delegates should be retrieved.\r\nThis value cannot be null .\r\nReturns\r\nList\u003cString\u003e\r\nA list of package names of the current delegated packages for delegationScope .\r\nThis value may be null .\r\ngetDelegatedScopes\r\npublic List\u003cString\u003e getDelegatedScopes (ComponentName admin,\r\n String delegatedPackage)\r\nCalled by a profile owner or device owner to retrieve a list of the scopes given to a delegate package. Other apps can use this\r\nmethod to retrieve their own delegated scopes by passing null for admin and their own package name as\r\ndelegatedPackage .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 93 of 178\n\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if the\r\ncaller is delegatedPackage .\r\ndelegatedPackage\r\nString : The package name of the app whose scopes should be retrieved.\r\nThis value cannot be null .\r\nReturns\r\nList\u003cString\u003e A list containing the scopes given to delegatedPackage .\r\ngetDeviceOwnerLockScreenInfo\r\npublic CharSequence getDeviceOwnerLockScreenInfo ()\r\nReturns\r\nCharSequence The device owner information. If it is not set returns null .\r\ngetDevicePolicyManagementRoleHolderPackage\r\npublic String getDevicePolicyManagementRoleHolderPackage ()\r\nReturns the package name of the device policy management role holder.\r\nIf the device policy management role holder is not configured for this device, returns null .\r\ngetEndUserSessionMessage\r\npublic CharSequence getEndUserSessionMessage (ComponentName admin)\r\nReturns the user session end message.\r\nParameters\r\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\ngetEnrollmentSpecificId\r\npublic String getEnrollmentSpecificId ()\r\nReturns an enrollment-specific identifier of this device, which is guaranteed to be the same value for the same device,\r\nenrolled into the same organization by the same managing app. This identifier is high-entropy, useful for uniquely\r\nidentifying individual devices within the same organisation. It is available both in a work profile and on a fully-managed\r\ndevice. The identifier would be consistent even if the work profile is removed and enrolled again (to the same organization),\r\nor the device is factory reset and re-enrolled. Can only be called by the Profile Owner and Device Owner, and starting from\r\nAndroid Build.VERSION_CODES.VANILLA_ICE_CREAM , holders of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_CERTIFICATES . If setOrganizationId(String) was not called, then the\r\nreturned value will be an empty string.\r\nNote about access to device identifiers: a device owner, a profile owner of an organization-owned device or the delegated\r\ncertificate installer (holding the DELEGATION_CERT_INSTALL delegation) on such a device can still obtain hardware\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 94 of 178\n\nidentifiers by calling e.g. Build.getSerial() , in addition to using this method. However, a profile owner on a personal\r\n(non organization-owned) device, or the delegated certificate installer on such a device, cannot obtain hardware identifiers\r\nanymore and must switch to using this method.\r\nReturns\r\nString\r\nA stable, enrollment-specific identifier.\r\nThis value cannot be null .\r\ngetGlobalPrivateDnsHost\r\npublic String getGlobalPrivateDnsHost (ComponentName admin)\r\nReturns the system-wide Private DNS host.\r\nParameters\r\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nReturns\r\nString The hostname used for Private DNS queries, null if none is set.\r\ngetGlobalPrivateDnsMode\r\npublic int getGlobalPrivateDnsMode (ComponentName admin)\r\nReturns the system-wide Private DNS mode.\r\nParameters\r\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nReturns\r\nint\r\none of PRIVATE_DNS_MODE_OFF , PRIVATE_DNS_MODE_OPPORTUNISTIC , PRIVATE_DNS_MODE_PROVIDER_HOSTNAME\r\nor PRIVATE_DNS_MODE_UNKNOWN .\r\ngetInstalledCaCerts\r\npublic List\u003cbyte[]\u003e getInstalledCaCerts (ComponentName admin)\r\nReturns all CA certificates that are currently trusted, excluding system CA certificates. If a user has installed any certificates\r\nby other means than device policy these will be included too.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if calling from a\r\ndelegated certificate installer.\r\nReturns\r\nList\u003cbyte[]\u003e\r\na List of byte[] arrays, each encoding one user CA certificate.\r\nThis value cannot be null .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 95 of 178\n\ngetKeyPairGrants\r\npublic Map\u003cInteger,Set\u003cString\u003e\u003e getKeyPairGrants (String alias)\r\nCalled by a device or profile owner, or delegated certificate chooser (an app that has been delegated the\r\nDELEGATION_CERT_SELECTION privilege), to query which apps have access to a given KeyChain key. Key are granted on a\r\nper-UID basis, so if several apps share the same UID, granting access to one of them automatically grants it to others. This\r\nmethod returns a map containing one entry per grantee UID. Entries have UIDs as keys and sets of corresponding package\r\nnames as values. In particular, grantee packages that don't share UID with other packages are represented by entries having\r\nsingleton sets as values.\r\nParameters\r\nalias\r\nString : The alias of the key to grant access to.\r\nThis value cannot be null .\r\nReturns\r\nMap\u003cInteger,Set\u003cString\u003e\u003e\r\napps that have access to a given key, arranged in a map from UID to sets of package\r\nnames.\r\nThis value cannot be null .\r\ngetKeyguardDisabledFeatures\r\npublic int getKeyguardDisabledFeatures (ComponentName admin)\r\nDetermine whether or not features have been disabled in keyguard either by the calling admin, if specified, or all admins that\r\nset restrictions on this user and its participating profiles. Restrictions on profiles that have a separate challenge are not taken\r\ninto account.\r\nThis method can be called on the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName)\r\nin order to retrieve restrictions on the parent profile.\r\nParameters\r\nadmin\r\nComponentName : The name of the admin component to check, or null to check whether any admins have\r\ndisabled features in keyguard.\r\ngetLockTaskFeatures\r\npublic int getLockTaskFeatures (ComponentName admin)\r\nGets which system features are enabled for LockTask mode.\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , the returned policy will be the current resolved policy rather than\r\nthe policy set by the calling admin.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\ngetLockTaskPackages\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 96 of 178\n\npublic String[] getLockTaskPackages (ComponentName admin)\r\nReturns the list of packages allowed to start the lock task mode.\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , the returned policy will be the current resolved policy rather than\r\nthe policy set by the calling admin.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\nReturns\r\nString[] This value cannot be null .\r\ngetLongSupportMessage\r\npublic CharSequence getLongSupportMessage (ComponentName admin)\r\nCalled by a device admin to get the long support message.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\ngetManagedProfileCallerIdAccessPolicy\r\npublic PackagePolicy getManagedProfileCallerIdAccessPolicy ()\r\nCalled by a profile owner of a managed profile to retrieve the caller id policy.\r\nThe calling device admin must be a profile owner of a managed profile. If it is not, a SecurityException will be thrown.\r\nReturns\r\nPackagePolicy\r\nthe current caller id policy.\r\nThis value may be null .\r\ngetManagedProfileContactsAccessPolicy\r\npublic PackagePolicy getManagedProfileContactsAccessPolicy ()\r\nCalled by a profile owner of a managed profile to determine the current policy applied to managed profile contacts.\r\nThe calling device admin must be a profile owner of a managed profile. If it is not, a SecurityException will be thrown.\r\nReturns\r\nPackagePolicy\r\nthe current contacts search policy.\r\nThis value may be null .\r\ngetManagedProfileMaximumTimeOff\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 97 of 178\n\npublic long getManagedProfileMaximumTimeOff (ComponentName admin)\r\nCalled by a profile owner of an organization-owned managed profile to get maximum time the profile is allowed to be\r\nturned off.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nReturns\r\nlong Maximum time the profile is allowed to be off in milliseconds or 0 if not limited.\r\ngetMaximumFailedPasswordsForWipe\r\npublic int getMaximumFailedPasswordsForWipe (ComponentName admin)\r\nRetrieve the current maximum number of login attempts that are allowed before the device or profile is wiped, for a\r\nparticular admin or all admins that set restrictions on this user and its participating profiles. Restrictions on profiles that have\r\na separate challenge are not taken into account.\r\nThis method can be called on the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName)\r\nin order to retrieve the value for the parent profile.\r\nOn devices not supporting PackageManager.FEATURE_SECURE_LOCK_SCREEN feature, the password is always empty and this\r\nmethod returns a default value (0) indicating that the policy is not set.\r\nRequires the PackageManager#FEATURE_SECURE_LOCK_SCREEN feature which can be detected using\r\nPackageManager.hasSystemFeature(String) .\r\nParameters\r\nadmin ComponentName : The name of the admin component to check, or null to aggregate all admins.\r\ngetMaximumTimeToLock\r\npublic long getMaximumTimeToLock (ComponentName admin)\r\nRetrieve the current maximum time to unlock for a particular admin or all admins that set restrictions on this user and its\r\nparticipating profiles. Restrictions on profiles that have a separate challenge are not taken into account.\r\nThis method can be called on the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName)\r\nin order to retrieve restrictions on the parent profile.\r\nParameters\r\nadmin ComponentName : The name of the admin component to check, or null to aggregate all admins.\r\nReturns\r\nlong\r\ntime in milliseconds for the given admin or the minimum value (strictest) of all admins if admin is null.\r\nReturns 0 if there are no restrictions.\r\ngetMeteredDataDisabledPackages\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 98 of 178\n\npublic List\u003cString\u003e getMeteredDataDisabledPackages (ComponentName admin)\r\nCalled by a device or profile owner to retrieve the list of packages which are restricted by the admin from using metered\r\ndata.\r\nParameters\r\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nReturns\r\nList\u003cString\u003e\r\nthe list of restricted package names.\r\nThis value cannot be null .\r\ngetMinimumRequiredWifiSecurityLevel\r\npublic int getMinimumRequiredWifiSecurityLevel ()\r\nReturns the current Wi-Fi minimum security level.\r\ngetMtePolicy\r\npublic int getMtePolicy ()\r\nCalled by a device owner, profile owner of an organization-owned device to get the Memory Tagging Extension (MTE)\r\npolicy Learn more about MTE\r\ngetNearbyAppStreamingPolicy\r\npublic int getNearbyAppStreamingPolicy ()\r\nReturns the current runtime nearby app streaming policy set by the device or profile owner.\r\nThe caller must be the target user's device owner/profile owner or hold the READ_NEARBY_STREAMING_POLICY permission.\r\ngetNearbyNotificationStreamingPolicy\r\npublic int getNearbyNotificationStreamingPolicy ()\r\nReturns the current runtime nearby notification streaming policy set by the device or profile owner.\r\nThe caller must be the target user's device owner/profile owner or hold the READ_NEARBY_STREAMING_POLICY permission.\r\ngetOrganizationColor\r\npublic int getOrganizationColor (ComponentName admin)\r\nThis method was deprecated in API level 31.\r\nFrom Build.VERSION_CODES.R , the organization color is never used as the background color of the confirm credentials\r\nscreen.\r\nCalled by a profile owner of a managed profile to retrieve the color used for customization. This color is used as background\r\ncolor of the confirm credentials screen for that user.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 99 of 178\n\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nReturns\r\nint The 24bit (0xRRGGBB) representation of the color to be used.\r\ngetParentProfileInstance\r\npublic DevicePolicyManager getParentProfileInstance (ComponentName admin)\r\nCalled by the profile owner of a managed profile or other apps in a managed profile to obtain a DevicePolicyManager\r\nwhose calls act on the parent profile.\r\nThe following methods are supported for the parent instance, all other methods will throw a SecurityException when called\r\non the parent instance:\r\ngetPasswordQuality(ComponentName)\r\nsetPasswordQuality(ComponentName, int)\r\ngetPasswordMinimumLength(ComponentName)\r\nsetPasswordMinimumLength(ComponentName, int)\r\ngetPasswordMinimumUpperCase(ComponentName)\r\nsetPasswordMinimumUpperCase(ComponentName, int)\r\ngetPasswordMinimumLowerCase(ComponentName)\r\nsetPasswordMinimumLowerCase(ComponentName, int)\r\ngetPasswordMinimumLetters(ComponentName)\r\nsetPasswordMinimumLetters(ComponentName, int)\r\ngetPasswordMinimumNumeric(ComponentName)\r\nsetPasswordMinimumNumeric(ComponentName, int)\r\ngetPasswordMinimumSymbols(ComponentName)\r\nsetPasswordMinimumSymbols(ComponentName, int)\r\ngetPasswordMinimumNonLetter(ComponentName)\r\nsetPasswordMinimumNonLetter(ComponentName, int)\r\ngetPasswordHistoryLength(ComponentName)\r\nsetPasswordHistoryLength(ComponentName, int)\r\ngetPasswordExpirationTimeout(ComponentName)\r\nsetPasswordExpirationTimeout(ComponentName, long)\r\ngetPasswordExpiration(ComponentName)\r\ngetPasswordMaximumLength(int)\r\nisActivePasswordSufficient()\r\ngetCurrentFailedPasswordAttempts()\r\ngetMaximumFailedPasswordsForWipe(ComponentName)\r\nsetMaximumFailedPasswordsForWipe(ComponentName, int)\r\ngetMaximumTimeToLock(ComponentName)\r\nsetMaximumTimeToLock(ComponentName, long)\r\nlockNow()\r\ngetKeyguardDisabledFeatures(ComponentName)\r\nsetKeyguardDisabledFeatures(ComponentName, int)\r\ngetTrustAgentConfiguration(ComponentName, ComponentName)\r\nsetTrustAgentConfiguration(ComponentName, ComponentName, PersistableBundle)\r\ngetRequiredStrongAuthTimeout(ComponentName)\r\nsetRequiredStrongAuthTimeout(ComponentName, long)\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 100 of 178\n\ngetAccountTypesWithManagementDisabled()\r\nsetRequiredPasswordComplexity(int)\r\ngetRequiredPasswordComplexity()\r\nThe following methods are supported for the parent instance but can only be called by the profile owner on an organization\r\nowned managed profile:\r\ngetPasswordComplexity()\r\nsetCameraDisabled(ComponentName, boolean)\r\ngetCameraDisabled(ComponentName)\r\nsetAccountManagementDisabled(ComponentName,String,boolean)\r\nsetPermittedInputMethods(ComponentName, List)\r\ngetPermittedInputMethods(ComponentName)\r\nwipeData(int)\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with or null if the caller is not a\r\nprofile owner.\r\ngetPasswordComplexity\r\npublic int getPasswordComplexity ()\r\nReturns how complex the current user's screen lock is.\r\nNote that when called from a profile which uses an unified challenge with its parent, the screen lock complexity of the\r\nparent will be returned.\r\nApps need the permission.REQUEST_PASSWORD_COMPLEXITY permission to call this method. On Android\r\nBuild.VERSION_CODES.S and above, the calling application does not need this permission if it is a device owner or a profile\r\nowner.\r\nThis method can be called on the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName)\r\nin order to retrieve restrictions on the parent profile.\r\ngetPasswordExpiration\r\npublic long getPasswordExpiration (ComponentName admin)\r\nGet the current password expiration time for a particular admin or all admins that set restrictions on this user and its\r\nparticipating profiles. Restrictions on profiles that have a separate challenge are not taken into account. If admin is null ,\r\nthen a composite of all expiration times is returned - which will be the minimum of all of them.\r\nThis method can be called on the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName)\r\nin order to retrieve the password expiration for the parent profile.\r\nOn devices not supporting PackageManager.FEATURE_SECURE_LOCK_SCREEN feature, the password expiration is always\r\ndisabled and this method always returns 0.\r\nRequires the PackageManager#FEATURE_SECURE_LOCK_SCREEN feature which can be detected using\r\nPackageManager.hasSystemFeature(String) .\r\nParameters\r\nadmin ComponentName : The name of the admin component to check, or null to aggregate all admins.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 101 of 178\n\nReturns\r\nlong The password expiration time, in milliseconds since epoch.\r\ngetPasswordMaximumLength\r\npublic int getPasswordMaximumLength (int quality)\r\nReturn the maximum password length that the device supports for a particular password quality.\r\nOn devices not supporting PackageManager.FEATURE_SECURE_LOCK_SCREEN feature, the password is always empty and this\r\nmethod always returns 0.\r\nParameters\r\nquality int : The quality being interrogated.\r\nReturns\r\nint Returns the maximum length that the user can enter.\r\ngetPasswordMinimumLength\r\npublic int getPasswordMinimumLength (ComponentName admin)\r\nThis method was deprecated in API level 31.\r\nsee setPasswordQuality(ComponentName,int) for details.\r\nRetrieve the current minimum password length for a particular admin or all admins that set restrictions on this user and its\r\nparticipating profiles. Restrictions on profiles that have a separate challenge are not taken into account.\r\nOn devices not supporting PackageManager.FEATURE_SECURE_LOCK_SCREEN feature, the password is always treated as empty.\r\nThis method can be called on the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName)\r\nin order to retrieve restrictions on the parent profile.\r\nParameters\r\nadmin ComponentName : The name of the admin component to check, or null to aggregate all admins.\r\ngetPasswordQuality\r\npublic int getPasswordQuality (ComponentName admin)\r\nThis method was deprecated in API level 31.\r\nsee setPasswordQuality(ComponentName,int) for details.\r\nRetrieve the current minimum password quality for a particular admin or all admins that set restrictions on this user and its\r\nparticipating profiles. Restrictions on profiles that have a separate challenge are not taken into account.\r\nThis method can be called on the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName)\r\nin order to retrieve restrictions on the parent profile.\r\nNote: on devices not supporting PackageManager.FEATURE_SECURE_LOCK_SCREEN feature, the password is always treated as\r\nempty.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 102 of 178\n\nParameters\r\nadmin ComponentName : The name of the admin component to check, or null to aggregate all admins.\r\ngetPermissionGrantState\r\npublic int getPermissionGrantState (ComponentName admin,\r\n String packageName,\r\n String permission)\r\nReturns the current grant state of a runtime permission for a specific application. This function can be called by a device\r\nowner, profile owner, or by a delegate given the DELEGATION_PERMISSION_GRANT scope via\r\nsetDelegatedScopes(ComponentName, String, List) .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is\r\nnot a device admin.\r\nThis value may be null .\r\npackageName\r\nString : The application to check the grant state for.\r\nThis value cannot be null .\r\npermission\r\nString : The permission to check for.\r\nThis value cannot be null .\r\nSee also:\r\nsetPermissionGrantState(ComponentName,String,String,int)\r\nPackageManager.checkPermission(String,String)\r\nsetDelegatedScopes(ComponentName, String, List)\r\nDELEGATION_PERMISSION_GRANT\r\ngetPermissionPolicy\r\npublic int getPermissionPolicy (ComponentName admin)\r\nReturns the current runtime permission policy set by the device or profile owner. The default is\r\nPERMISSION_POLICY_PROMPT .\r\nParameters\r\nadmin ComponentName : Which profile or device owner this request is associated with.\r\nReturns\r\nint the current policy for future permission requests.\r\ngetPermittedAccessibilityServices\r\npublic List\u003cString\u003e getPermittedAccessibilityServices (ComponentName admin)\r\nReturns the list of permitted accessibility services set by this device or profile owner.\r\nAn empty list means no accessibility services except system services are allowed. null means all accessibility services are\r\nallowed.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 103 of 178\n\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nReturns\r\nList\u003cString\u003e List of accessibility service package names.\r\ngetPermittedCrossProfileNotificationListeners\r\npublic List\u003cString\u003e getPermittedCrossProfileNotificationListeners (ComponentName admin)\r\nReturns the list of packages installed on the primary user that allowed to use a NotificationListenerService to receive\r\nnotifications from this managed profile, as set by the profile owner.\r\nAn empty list means no notification listener services except system ones are allowed. A null return value indicates that all\r\nnotification listeners are allowed.\r\nParameters\r\nadmin ComponentName : This value cannot be null .\r\ngetPermittedInputMethods\r\npublic List\u003cString\u003e getPermittedInputMethods (ComponentName admin)\r\nReturns the list of permitted input methods set by this device or profile owner.\r\nThis method can be called on the DevicePolicyManager instance, returned by\r\ngetParentProfileInstance(ComponentName) , where the caller must be a profile owner of an organization-owned managed\r\nprofile. If called on the parent instance, then the returned list of permitted input methods are those which are applied on the\r\npersonal profile.\r\nAn empty list means no input methods except system input methods are allowed. Null means all input methods are allowed.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\nReturns\r\nList\u003cString\u003e\r\nList of input method package names.\r\nThis value may be null .\r\nThrows\r\nSecurityException\r\nif admin is not a device, profile owner or if called on the parent profile and the admin is not\r\na profile owner of an organization-owned managed profile.\r\ngetPersonalAppsSuspendedReasons\r\npublic int getPersonalAppsSuspendedReasons (ComponentName admin)\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 104 of 178\n\nCalled by profile owner of an organization-owned managed profile to check whether personal apps are suspended.\r\nParameters\r\nadmin ComponentName : This value cannot be null .\r\ngetRequiredStrongAuthTimeout\r\npublic long getRequiredStrongAuthTimeout (ComponentName admin)\r\nDetermine for how long the user will be able to use secondary, non strong auth for authentication, since last strong method\r\nauthentication (password, pin or pattern) was used. After the returned timeout the user is required to use strong\r\nauthentication method.\r\nThis method can be called on the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName)\r\nin order to retrieve restrictions on the parent profile.\r\nOn devices not supporting PackageManager.FEATURE_SECURE_LOCK_SCREEN feature, 0 is returned to indicate that no timeout\r\nis configured.\r\nRequires the PackageManager#FEATURE_SECURE_LOCK_SCREEN feature which can be detected using\r\nPackageManager.hasSystemFeature(String) .\r\nParameters\r\nadmin\r\nComponentName : The name of the admin component to check, or null to aggregate across all participating\r\nadmins.\r\nReturns\r\nlong The timeout in milliseconds or 0 if not configured for the provided admin.\r\ngetScreenCaptureDisabled\r\npublic boolean getScreenCaptureDisabled (ComponentName admin)\r\nDetermine whether or not screen capture has been disabled by the calling admin, if specified, or all admins.\r\nThis method can be called on the DevicePolicyManager instance, returned by\r\ngetParentProfileInstance(ComponentName) , where the caller must be the profile owner of an organization-owned\r\nmanaged profile (the calling admin must be specified).\r\nParameters\r\nadmin\r\nComponentName : The name of the admin component to check, or null to check whether any admins have\r\ndisabled screen capture.\r\ngetStartUserSessionMessage\r\npublic CharSequence getStartUserSessionMessage (ComponentName admin)\r\nReturns the user session start message.\r\nParameters\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 105 of 178\n\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\ngetStorageEncryption\r\npublic boolean getStorageEncryption (ComponentName admin)\r\nThis method was deprecated in API level 30.\r\nThis method only returns the value set by setStorageEncryption(ComponentName, boolean) . It does not actually reflect the\r\nstorage encryption status. Use getStorageEncryptionStatus() for that. Called by an application that is administering the\r\ndevice to determine the requested setting for secure storage.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. If null, this will return the\r\nrequested encryption setting as an aggregate of all active administrators.\r\nReturns\r\nboolean true if the admin(s) are requesting encryption, false if not.\r\ngetUserRestrictions\r\npublic Bundle getUserRestrictions (ComponentName admin)\r\nCalled by an admin to get user restrictions set by themselves with addUserRestriction(ComponentName,String) .\r\nThe target user may have more restrictions set by the system or other admin. To get all the user restrictions currently set, use\r\nUserManager.getUserRestrictions() .\r\nThe profile owner of an organization-owned managed profile may invoke this method on the DevicePolicyManager\r\ninstance it obtained from getParentProfileInstance(ComponentName) , for retrieving device-wide restrictions it previously\r\nset with addUserRestriction(ComponentName,String) .\r\nFor callers targeting Android Build.VERSION_CODES.UPSIDE_DOWN_CAKE or above, this API will return the local restrictions\r\nset on the calling user, or on the parent profile if called from the DevicePolicyManager instance obtained from\r\ngetParentProfileInstance(ComponentName) . To get global restrictions set by admin, call\r\ngetUserRestrictionsGlobally() instead.\r\nNote that this is different that the returned restrictions for callers targeting pre Android\r\nBuild.VERSION_CODES.UPSIDE_DOWN_CAKE , were this API returns all local/global restrictions set by the admin on the calling\r\nuser using addUserRestriction(ComponentName,String) or the parent user if called on the DevicePolicyManager instance\r\nit obtained from getParentProfileInstance(ComponentName) .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nReturns\r\nBundle\r\na Bundle whose keys are the user restrictions, and the values a boolean indicating whether the restriction\r\nis set.\r\nThis value cannot be null .\r\ngetUserRestrictionsGlobally\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 106 of 178\n\npublic Bundle getUserRestrictionsGlobally ()\r\nCalled by a profile or device owner to get global user restrictions set with addUserRestrictionGlobally(String) .\r\nTo get all the user restrictions currently set for a certain user, use UserManager.getUserRestrictions() .\r\nReturns\r\nBundle\r\na Bundle whose keys are the user restrictions, and the values a boolean indicating whether the restriction\r\nis set.\r\nThis value cannot be null .\r\ngetWifiMacAddress\r\npublic String getWifiMacAddress (ComponentName admin)\r\nCalled by a device owner or profile owner on organization-owned device to get the MAC address of the Wi-Fi device.\r\nNOTE: The MAC address returned here should only be used for inventory management and is not likely to be the MAC\r\naddress used by the device to connect to Wi-Fi networks: MAC addresses used for scanning and connecting to Wi-Fi\r\nnetworks are randomized by default. To get the randomized MAC address used, call\r\nWifiConfiguration.getRandomizedMacAddress() .\r\nParameters\r\nadmin\r\nComponentName : Which admin this request is associated with. Null if the caller is not a device admin.\r\nThis value may be null .\r\nReturns\r\nString\r\nthe MAC address of the Wi-Fi device, or null when the information is not available. (For example, Wi-Fi\r\nhasn't been enabled, or the device doesn't support Wi-Fi.)\r\nThe address will be in the XX:XX:XX:XX:XX:XX format.\r\ngetWifiSsidPolicy\r\npublic WifiSsidPolicy getWifiSsidPolicy ()\r\nReturns the current Wi-Fi SSID policy. If the policy has not been set, it will return NULL.\r\nThrows\r\nSecurityException\r\nif the caller is not a device owner or a profile owner on an organization-owned managed\r\nprofile.\r\ngrantKeyPairToApp\r\npublic boolean grantKeyPairToApp (ComponentName admin,\r\n String alias,\r\n String packageName)\r\nCalled by a device or profile owner, or delegated certificate chooser (an app that has been delegated the\r\nDELEGATION_CERT_SELECTION privilege), to grant an application access to an already-installed (or generated) KeyChain key.\r\nThis is useful (in combination with installKeyPair(ComponentName, PrivateKey, Certificate, String) or\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 107 of 178\n\ngenerateKeyPair(ComponentName, String, KeyGenParameterSpec, int) ) to let an application call\r\nKeyChain.getPrivateKey(Context, String) without having to call KeyChain.choosePrivateKeyAlias(Activity,\r\nKeyChainAliasCallback, String, Principal, Uri, String) first. The grantee app will receive the\r\nKeyChain.ACTION_KEY_ACCESS_CHANGED broadcast when access to a key is granted. Starting from\r\nBuild.VERSION_CODES.UPSIDE_DOWN_CAKE throws an IllegalArgumentException if alias doesn't correspond to an\r\nexisting key.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if calling\r\nfrom a delegated certificate chooser.\r\nalias\r\nString : The alias of the key to grant access to.\r\nThis value cannot be null .\r\npackageName\r\nString : The name of the (already installed) package to grant access to.\r\nThis value cannot be null .\r\nReturns\r\nboolean true if the grant was set successfully, false otherwise.\r\nThrows\r\nIllegalArgumentException\r\nif packageName or alias are empty, or if packageName is not a name of an installed\r\npackage.\r\nSecurityException if the caller is not a device owner, a profile owner or delegated certificate chooser.\r\ngrantKeyPairToWifiAuth\r\npublic boolean grantKeyPairToWifiAuth (String alias)\r\nCalled by a device or profile owner, or delegated certificate chooser (an app that has been delegated the\r\nDELEGATION_CERT_SELECTION privilege), to allow using a KeyChain key pair for authentication to Wifi networks. The key\r\ncan then be used in configurations passed to WifiManager.addNetwork(WifiConfiguration) . Starting from\r\nBuild.VERSION_CODES.UPSIDE_DOWN_CAKE throws an IllegalArgumentException if alias doesn't correspond to an\r\nexisting key.\r\nParameters\r\nalias\r\nString : The alias of the key pair.\r\nThis value cannot be null .\r\nReturns\r\nboolean true if the operation was set successfully, false otherwise.\r\nThrows\r\nSecurityException if the caller is not a device owner, a profile owner or delegated certificate chooser.\r\nhasCaCertInstalled\r\npublic boolean hasCaCertInstalled (ComponentName admin,\r\n byte[] certBuffer)\r\nReturns whether this certificate is installed as a trusted CA.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 108 of 178\n\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if calling\r\nfrom a delegated certificate installer.\r\ncertBuffer byte : encoded form of the certificate to look up.\r\nhasGrantedPolicy\r\npublic boolean hasGrantedPolicy (ComponentName admin,\r\n int usesPolicy)\r\nReturns true if an administrator has been granted a particular device policy. This can be used to check whether the\r\nadministrator was activated under an earlier set of policies, but requires additional policies after an upgrade.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Must be an active\r\nadministrator, or an exception will be thrown.\r\nThis value cannot be null .\r\nusesPolicy int : Which uses-policy to check, as defined in DeviceAdminInfo .\r\nhasKeyPair\r\npublic boolean hasKeyPair (String alias)\r\nThis API can be called by the following to query whether a certificate and private key are installed under a given alias:\r\nDevice owner\r\nProfile owner\r\nDelegated certificate installer\r\nCredential management app\r\nAn app that holds the Manifest.permission.MANAGE_DEVICE_POLICY_CERTIFICATES permission\r\nIf called by the credential management app, the alias must exist in the credential management app's\r\nAppUriAuthenticationPolicy .\r\nParameters\r\nalias\r\nString : The alias under which the key pair is installed.\r\nThis value cannot be null .\r\nReturns\r\nboolean true if a key pair with this alias exists, false otherwise.\r\nhasLockdownAdminConfiguredNetworks\r\npublic boolean hasLockdownAdminConfiguredNetworks (ComponentName admin)\r\nCalled by a device owner or a profile owner of an organization-owned managed profile to determine whether the user is\r\nprevented from modifying networks configured by the admin.\r\nParameters\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 109 of 178\n\nadmin\r\nComponentName : admin Which DeviceAdminReceiver this request is associated with.\r\nThis value may be null .\r\nThrows\r\nSecurityException if caller is not a device owner or a profile owner of an organization-owned managed profile.\r\ninstallCaCert\r\npublic boolean installCaCert (ComponentName admin,\r\n byte[] certBuffer)\r\nInstalls the given certificate as a user CA.\r\nInserted user CAs aren't automatically trusted by apps in Android 7.0 (API level 24) and higher. App developers can change\r\nthe default behavior for an app by adding a Security Configuration File to the app manifest file. The caller must be a profile\r\nor device owner on that user, or a delegate package given the DELEGATION_CERT_INSTALL scope via\r\nsetDelegatedScopes(ComponentName, String, List) ; otherwise a security exception will be thrown.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if calling\r\nfrom a delegated certificate installer.\r\ncertBuffer byte : encoded form of the certificate to install.\r\nReturns\r\nboolean false if the certBuffer cannot be parsed or installation is interrupted, true otherwise.\r\ninstallExistingPackage\r\npublic boolean installExistingPackage (ComponentName admin,\r\n String packageName)\r\nInstall an existing package that has been installed in another user, or has been kept after removal via\r\nsetKeepUninstalledPackages(ComponentName, List) . This function can be called by a device owner, profile owner or a\r\ndelegate given the DELEGATION_INSTALL_EXISTING_PACKAGE scope via setDelegatedScopes(ComponentName, String,\r\nList) . When called in a secondary user or managed profile, the user/profile must be affiliated with the device. See\r\nisAffiliatedUser() .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\npackageName String : The package to be installed in the calling profile.\r\nReturns\r\nboolean true if the app is installed; false otherwise.\r\nThrows\r\nSecurityException if admin is not the device owner, or the profile owner of an affiliated user or profile.\r\nSee also:\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 110 of 178\n\nsetKeepUninstalledPackages(ComponentName, List)\r\nsetDelegatedScopes(ComponentName, String, List)\r\nisAffiliatedUser()\r\nDELEGATION_PACKAGE_ACCESS\r\ninstallKeyPair\r\npublic boolean installKeyPair (ComponentName admin,\r\n PrivateKey privKey,\r\n Certificate[] certs,\r\n String alias,\r\n int flags)\r\nThis API can be called by the following to install a certificate chain and corresponding private key for the leaf certificate:\r\nDevice owner\r\nProfile owner\r\nDelegated certificate installer\r\nCredential management app\r\nAn app that holds the Manifest.permission.MANAGE_DEVICE_POLICY_CERTIFICATES permission\r\nAll apps within the profile will be able to access the certificate chain and use the private key, given direct user approval (if\r\nthe user is allowed to select the private key).\r\nFrom Android Build.VERSION_CODES.S , the credential management app can call this API. If called by the credential\r\nmanagement app:\r\nThe componentName must be null r\r\nThe alias must exist in the credential management app's AppUriAuthenticationPolicy\r\nThe key pair must not be user selectable\r\nNote, there can only be a credential management app on an unmanaged device.\r\nThe caller of this API may grant itself access to the certificate and private key immediately, without user approval. It is a\r\nbest practice not to request this unless strictly necessary since it opens up additional security vulnerabilities.\r\nInclude INSTALLKEY_SET_USER_SELECTABLE in the flags argument to allow the user to select the key from a dialog.\r\nNote: If the provided alias is of an existing alias, all former grants that apps have been given to access the key and\r\ncertificates associated with this alias will be revoked.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if the caller is\r\nnot a device admin.\r\nprivKey\r\nPrivateKey : The private key to install.\r\nThis value cannot be null .\r\ncerts\r\nCertificate : The certificate chain to install. The chain should start with the leaf certificate and include\r\nthe chain of trust in order. This will be returned by KeyChain.getCertificateChain(Context, String) .\r\nThis value cannot be null .\r\nalias\r\nString : The private key alias under which to install the certificate. If a certificate with that alias already\r\nexists, it will be overwritten.\r\nThis value cannot be null .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 111 of 178\n\nflags\r\nint : Flags to request that the calling app be granted access to the credentials and set the key to be user-selectable. See INSTALLKEY_SET_USER_SELECTABLE and INSTALLKEY_REQUEST_CREDENTIALS_ACCESS .\r\nReturns\r\nboolean true if the keys were installed, false otherwise.\r\nSee also:\r\nKeyChain.getCertificateChain(Context, String)\r\nsetDelegatedScopes(ComponentName, String, List)\r\nDELEGATION_CERT_INSTALL\r\ninstallKeyPair\r\npublic boolean installKeyPair (ComponentName admin,\r\n PrivateKey privKey,\r\n Certificate[] certs,\r\n String alias,\r\n boolean requestAccess)\r\nThis API can be called by the following to install a certificate chain and corresponding private key for the leaf certificate:\r\nDevice owner\r\nProfile owner\r\nDelegated certificate installer\r\nCredential management app\r\nAn app that holds the Manifest.permission.MANAGE_DEVICE_POLICY_CERTIFICATES permission\r\nAll apps within the profile will be able to access the certificate chain and use the private key, given direct user approval.\r\nFrom Android Build.VERSION_CODES.S , the credential management app can call this API. However, this API sets the key\r\npair as user selectable by default, which is not permitted when called by the credential management app. Instead,\r\ninstallKeyPair(ComponentName,PrivateKey,Certificate[],String,int) should be called with\r\nINSTALLKEY_SET_USER_SELECTABLE not set as a flag. Note, there can only be a credential management app on an unmanaged\r\ndevice.\r\nThe caller of this API may grant itself access to the certificate and private key immediately, without user approval. It is a\r\nbest practice not to request this unless strictly necessary since it opens up additional security vulnerabilities.\r\nNote: If the provided alias is of an existing alias, all former grants that apps have been given to access the key and\r\ncertificates associated with this alias will be revoked.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if the\r\ncaller is not a device admin.\r\nprivKey\r\nPrivateKey : The private key to install.\r\nThis value cannot be null .\r\ncerts\r\nCertificate : The certificate chain to install. The chain should start with the leaf certificate and\r\ninclude the chain of trust in order. This will be returned by\r\nKeyChain.getCertificateChain(Context, String) .\r\nThis value cannot be null .\r\nalias String : The private key alias under which to install the certificate. If a certificate with that alias\r\nalready exists, it will be overwritten.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 112 of 178\n\nThis value cannot be null .\r\nrequestAccess\r\nboolean : true to request that the calling app be granted access to the credentials immediately.\r\nOtherwise, access to the credentials will be gated by user approval.\r\nReturns\r\nboolean true if the keys were installed, false otherwise.\r\nSee also:\r\nKeyChain.getCertificateChain(Context, String)\r\nsetDelegatedScopes(ComponentName, String, List)\r\nDELEGATION_CERT_INSTALL\r\ninstallKeyPair\r\npublic boolean installKeyPair (ComponentName admin,\r\n PrivateKey privKey,\r\n Certificate cert,\r\n String alias)\r\nThis API can be called by the following to install a certificate and corresponding private key:\r\nDevice owner\r\nProfile owner\r\nDelegated certificate installer\r\nCredential management app\r\nAn app that holds the Manifest.permission.MANAGE_DEVICE_POLICY_CERTIFICATES permission\r\nAll apps within the profile will be able to access the certificate and use the private key, given direct user approval.\r\nFrom Android Build.VERSION_CODES.S , the credential management app can call this API. However, this API sets the key\r\npair as user selectable by default, which is not permitted when called by the credential management app. Instead,\r\ninstallKeyPair(ComponentName,PrivateKey,Certificate[],String,int) should be called with\r\nINSTALLKEY_SET_USER_SELECTABLE not set as a flag.\r\nAccess to the installed credentials will not be granted to the caller of this API without direct user approval. This is for\r\nsecurity - should a certificate installer become compromised, certificates it had already installed will be protected.\r\nIf the installer must have access to the credentials, call\r\ninstallKeyPair(ComponentName,PrivateKey,Certificate[],String,boolean) instead.\r\nNote: If the provided alias is of an existing alias, all former grants that apps have been given to access the key and\r\ncertificates associated with this alias will be revoked.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if the caller is\r\nnot a device admin.\r\nprivKey\r\nPrivateKey : The private key to install.\r\nThis value cannot be null .\r\ncert\r\nCertificate : The certificate to install.\r\nThis value cannot be null .\r\nalias String : The private key alias under which to install the certificate. If a certificate with that alias already\r\nexists, it will be overwritten.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 113 of 178\n\nThis value cannot be null .\r\nReturns\r\nboolean true if the keys were installed, false otherwise.\r\ninstallSystemUpdate\r\npublic void installSystemUpdate (ComponentName admin,\r\n Uri updateFilePath,\r\n Executor executor,\r\n DevicePolicyManager.InstallSystemUpdateCallback callback)\r\nCalled by device owner or profile owner of an organization-owned managed profile to install a system update from the given\r\nfile. The device will be rebooted in order to finish installing the update. Note that if the device is rebooted, this doesn't\r\nnecessarily mean that the update has been applied successfully. The caller should additionally check the system version with\r\nBuild.FINGERPRINT or Build.VERSION . If an error occurs during processing the OTA before the reboot, the caller will be\r\nnotified by InstallSystemUpdateCallback . If device does not have sufficient battery level, the installation will fail with\r\nerror InstallSystemUpdateCallback.UPDATE_ERROR_BATTERY_LOW .\r\nParameters\r\nadmin\r\nComponentName : The DeviceAdminReceiver that this request is associated with. Null if the caller\r\nis not a device admin.\r\nThis value may be null .\r\nupdateFilePath\r\nUri : A Uri of the file that contains the update. The file should be readable by the calling app.\r\nThis value cannot be null .\r\nexecutor\r\nExecutor : The executor through which the callback should be invoked.\r\nThis value cannot be null .\r\nCallback and listener events are dispatched through this Executor , providing an easy way to\r\ncontrol which thread is used. To dispatch events through the main thread of your application, you\r\ncan use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an\r\nappropriate thread.\r\ncallback\r\nDevicePolicyManager.InstallSystemUpdateCallback : A callback object that will inform the\r\ncaller when installing an update fails.\r\nThis value cannot be null .\r\nisActivePasswordSufficient\r\npublic boolean isActivePasswordSufficient ()\r\nDetermines whether the calling user's current password meets policy requirements (e.g. quality, minimum length). The user\r\nmust be unlocked to perform this check.\r\nPolicy requirements which affect this check can be set by admins of the user, but also by the admin of a managed profile\r\nassociated with the calling user (when the managed profile doesn't have a separate work challenge). When a managed profile\r\nhas a separate work challenge, its policy requirements only affect the managed profile.\r\nDepending on the user, this method checks the policy requirement against one of the following passwords:\r\nFor the primary user or secondary users: the personal keyguard password.\r\nFor managed profiles: a work challenge if set, otherwise the parent user's personal keyguard password.\r\nIn other words, it's always checking the requirement against the password that is protecting the calling user.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 114 of 178\n\nNote that this method considers all policy requirements targeting the password in question. For example a\r\nprofile owner might set a requirement on the parent profile i.e. personal keyguard but not on the profile itself.\r\nWhen the device has a weak personal keyguard password and no separate work challenge, calling this method\r\nwill return false despite the profile owner not setting a policy on the profile itself. This is because the\r\nprofile's current password is the personal keyguard password, and it does not meet all policy requirements.\r\nDevice admins must request DeviceAdminInfo.USES_POLICY_LIMIT_PASSWORD before calling this method.\r\nNote, this policy type is deprecated for device admins in Android 9.0 (API level 28) or higher.\r\nThis method can be called on the DevicePolicyManager instance returned by\r\ngetParentProfileInstance(ComponentName) in order to determine if the password set on the parent profile is\r\nsufficient.\r\nOn devices not supporting PackageManager.FEATURE_SECURE_LOCK_SCREEN feature, the password is always\r\ntreated as empty - i.e. this method will always return false on such devices, provided any password\r\nrequirements were set.\r\nReturns\r\nboolean true if the password meets the policy requirements, false otherwise\r\nisActivePasswordSufficientForDeviceRequirement\r\npublic boolean isActivePasswordSufficientForDeviceRequirement ()\r\nCalled by profile owner of a managed profile to determine whether the current device password meets policy requirements\r\nset explicitly device-wide.\r\nThis API is similar to isActivePasswordSufficient() , with two notable differences:\r\nthis API always targets the device password. As a result it should always be called on the\r\ngetParentProfileInstance(ComponentName) instance.\r\npassword policy requirement set on the managed profile is not taken into consideration by this API, even if the device\r\ncurrently does not have a separate work challenge set.\r\nThis API is designed to facilite progressive password enrollment flows when the DPC imposes both device and profile\r\npassword policies. DPC applies profile password policy by calling setPasswordQuality(ComponentName,int) or\r\nsetRequiredPasswordComplexity(int) on the regular DevicePolicyManager instance, while it applies device-wide policy\r\nby calling setRequiredPasswordComplexity(int) on the getParentProfileInstance(ComponentName) instance. The DPC\r\ncan utilize this check to guide the user to set a device password first taking into consideration the device-wide policy only,\r\nand then prompt the user to either upgrade it to be fully compliant, or enroll a separate work challenge to satisfy the profile\r\npassword policy only.\r\nThe device user must be unlocked (@link UserManager.isUserUnlocked(UserHandle) ) to perform this check.\r\nReturns\r\nboolean true if the device password meets explicit requirement set on it, false otherwise.\r\nThrows\r\nIllegalStateException if the user isn't unlocked\r\nSecurityException\r\nif the calling application is not a profile owner of a managed profile, or if this API is not\r\ncalled on the parent DevicePolicyManager instance.\r\nisAdminActive\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 115 of 178\n\npublic boolean isAdminActive (ComponentName admin)\r\nReturn true if the given administrator component is currently active (enabled) in the system.\r\nParameters\r\nadmin\r\nComponentName : The administrator component to check for.\r\nThis value cannot be null .\r\nReturns\r\nboolean true if admin is currently enabled in the system, false otherwise\r\nisAffiliatedUser\r\npublic boolean isAffiliatedUser ()\r\nReturns whether this user is affiliated with the device.\r\nBy definition, the user that the device owner runs on is always affiliated with the device. Any other user is considered\r\naffiliated with the device if the set specified by its profile owner via setAffiliationIds(ComponentName, Set) intersects\r\nwith the device owner's.\r\nisAlwaysOnVpnLockdownEnabled\r\npublic boolean isAlwaysOnVpnLockdownEnabled (ComponentName admin)\r\nCalled by device or profile owner to query whether current always-on VPN is configured in lockdown mode. Returns\r\nfalse when no always-on configuration is set.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nisApplicationHidden\r\npublic boolean isApplicationHidden (ComponentName admin,\r\n String packageName)\r\nDetermine if a package is hidden. This function can be called by a device owner, profile owner, or by a delegate given the\r\nDELEGATION_PACKAGE_ACCESS scope via setDelegatedScopes(ComponentName, String, List) .\r\nThis method can be called on the DevicePolicyManager instance, returned by\r\ngetParentProfileInstance(ComponentName) , where the caller must be the profile owner of an organization-owned\r\nmanaged profile and the package must be a system package. If called on the parent instance, this will determine whether the\r\npackage is hidden or unhidden in the personal profile.\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , the returned policy will be the current resolved policy rather than\r\nthe policy set by the calling admin.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if the caller\r\nis not a device admin.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 116 of 178\n\npackageName String : The name of the package to retrieve the hidden status of.\r\nReturns\r\nboolean boolean true if the package is hidden, false otherwise.\r\nThrows\r\nIllegalArgumentException if called on the parent profile and the package provided is not a system package.\r\nSecurityException\r\nif admin is not a device or profile owner or if called on the parent profile and the\r\nadmin is not a profile owner of an organization-owned managed profile.\r\nisBackupServiceEnabled\r\npublic boolean isBackupServiceEnabled (ComponentName admin)\r\nReturn whether the backup service is enabled by the device owner or profile owner for the current user, as previously set by\r\nsetBackupServiceEnabled(ComponentName,boolean) .\r\nWhether the backup functionality is actually enabled or not depends on settings from both the current user and the device\r\nowner, please see setBackupServiceEnabled(ComponentName,boolean) for details.\r\nBackup service manages all backup and restore mechanisms on the device.\r\nParameters\r\nadmin ComponentName : This value cannot be null .\r\nReturns\r\nboolean true if backup service is enabled, false otherwise.\r\nisCommonCriteriaModeEnabled\r\npublic boolean isCommonCriteriaModeEnabled (ComponentName admin)\r\nReturns whether Common Criteria mode is currently enabled. Device owner and profile owner of an organization-owned\r\nmanaged profile can query its own Common Criteria mode setting by calling this method with its admin ComponentName .\r\nAny caller can obtain the aggregated device-wide Common Criteria mode state by passing null as the admin argument.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\nReturns\r\nboolean true if Common Criteria mode is enabled, false otherwise.\r\nisDeviceFinanced\r\npublic boolean isDeviceFinanced ()\r\nReturns true if this device is marked as a financed device.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 117 of 178\n\nA financed device can be entered into lock task mode (see setLockTaskPackages(ComponentName, String) ) by the holder\r\nof the role android.app.role.RoleManager#ROLE_FINANCED_DEVICE_KIOSK . If this occurs, Device Owners and Profile\r\nOwners that have set lock task packages or features, or that attempt to set lock task packages or features, will receive a\r\ncallback indicating that it could not be set. See PolicyUpdateReceiver.onPolicyChanged and\r\nPolicyUpdateReceiver.onPolicySetResult .\r\nTo be informed of changes to this status you can subscribe to the broadcast ACTION_DEVICE_FINANCING_STATE_CHANGED .\r\nThrows\r\nSecurityException\r\nif the caller is not a device owner, profile owner of an organization-owned managed profile,\r\nprofile owner on the primary user or holder of one of the following roles:\r\nandroid.app.role.RoleManager.ROLE_DEVICE_POLICY_MANAGEMENT ,\r\nandroid.app.role.RoleManager.ROLE_SYSTEM_SUPERVISION .\r\nisDeviceIdAttestationSupported\r\npublic boolean isDeviceIdAttestationSupported ()\r\nReturns true if the device supports attestation of device identifiers in addition to key attestation. See\r\ngenerateKeyPair(ComponentName,String,KeyGenParameterSpec,int)\r\nReturns\r\nboolean true if Device ID attestation is supported.\r\nisDeviceOwnerApp\r\npublic boolean isDeviceOwnerApp (String packageName)\r\nUsed to determine if a particular package has been registered as a Device Owner app. A device owner app is a special device\r\nadmin that cannot be deactivated by the user, once activated as a device admin. It also cannot be uninstalled. To check\r\nwhether a particular package is currently registered as the device owner app, pass in the package name from\r\nContext.getPackageName() to this method.\r\nThis is useful for device admin apps that want to check whether they are also registered as the device owner app. The exact\r\nmechanism by which a device admin app is registered as a device owner app is defined by the setup process.\r\nParameters\r\npackageName String : the package name of the app, to compare with the registered device owner app, if any.\r\nReturns\r\nboolean whether or not the package is registered as the device owner app.\r\nisEphemeralUser\r\npublic boolean isEphemeralUser (ComponentName admin)\r\nChecks if the profile owner is running in an ephemeral user.\r\nParameters\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 118 of 178\n\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nReturns\r\nboolean whether the profile owner is running in an ephemeral user.\r\nisKeyPairGrantedToWifiAuth\r\npublic boolean isKeyPairGrantedToWifiAuth (String alias)\r\nCalled by a device or profile owner, or delegated certificate chooser (an app that has been delegated the\r\nDELEGATION_CERT_SELECTION privilege), to query whether a KeyChain key pair can be used for authentication to Wifi\r\nnetworks.\r\nParameters\r\nalias\r\nString : The alias of the key pair.\r\nThis value cannot be null .\r\nReturns\r\nboolean true if the key pair can be used, false otherwise.\r\nisLockTaskPermitted\r\npublic boolean isLockTaskPermitted (String pkg)\r\nThis function lets the caller know whether the given component is allowed to start the lock task mode.\r\nParameters\r\npkg String : The package to check\r\nisLogoutEnabled\r\npublic boolean isLogoutEnabled ()\r\nReturns whether logout is enabled by a device owner.\r\nReturns\r\nboolean true if logout is enabled by device owner, false otherwise.\r\nisMasterVolumeMuted\r\npublic boolean isMasterVolumeMuted (ComponentName admin)\r\nCalled by profile or device owners to check whether the global volume mute is on or off.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 119 of 178\n\nReturns\r\nboolean true if global volume is muted, false if it's not.\r\nisMtePolicyEnforced\r\npublic static boolean isMtePolicyEnforced ()\r\nGet the current MTE state of the device. Learn more about MTE\r\nReturns\r\nboolean whether MTE is currently enabled on the device.\r\nisNetworkLoggingEnabled\r\npublic boolean isNetworkLoggingEnabled (ComponentName admin)\r\nReturn whether network logging is enabled by a device owner or profile owner of a managed profile.\r\nReturns\r\nboolean true if network logging is enabled by device owner or profile owner, false otherwise.\r\nThrows\r\nSecurityException\r\nif admin is not a device owner or profile owner and caller has no MANAGE_USERS\r\npermission\r\nisOrganizationOwnedDeviceWithManagedProfile\r\npublic boolean isOrganizationOwnedDeviceWithManagedProfile ()\r\nApps can use this method to find out if the device was provisioned as organization-owend device with a managed profile.\r\nThis, together with checking whether the device has a device owner (by calling isDeviceOwnerApp(String) ), could be used\r\nto learn whether the device is owned by an organization or an individual: If this method returns true OR\r\nisDeviceOwnerApp(String) returns true (for any package), then the device is owned by an organization. Otherwise, it's\r\nowned by an individual.\r\nReturns\r\nboolean true if the device was provisioned as organization-owned device, false otherwise.\r\nisOverrideApnEnabled\r\npublic boolean isOverrideApnEnabled (ComponentName admin)\r\nCalled by device owner to check if override APNs are currently enabled.\r\nParameters\r\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 120 of 178\n\nReturns\r\nboolean true if override APNs are currently enabled, false otherwise.\r\nisPreferentialNetworkServiceEnabled\r\npublic boolean isPreferentialNetworkServiceEnabled ()\r\nIndicates whether preferential network service is enabled.\r\nBefore Android version Build.VERSION_CODES.TIRAMISU : This method can be called by the profile owner of a managed\r\nprofile.\r\nStarting from Android version Build.VERSION_CODES.TIRAMISU : This method can be called by the profile owner of a\r\nmanaged profile or device owner.\r\nReturns\r\nboolean whether preferential network service is enabled.\r\nisProfileOwnerApp\r\npublic boolean isProfileOwnerApp (String packageName)\r\nUsed to determine if a particular package is registered as the profile owner for the user. A profile owner is a special device\r\nadmin that has additional privileges within the profile.\r\nParameters\r\npackageName String : The package name of the app to compare with the registered profile owner.\r\nReturns\r\nboolean Whether or not the package is registered as the profile owner.\r\nisProvisioningAllowed\r\npublic boolean isProvisioningAllowed (String action)\r\nReturns whether it is possible for the caller to initiate provisioning of a managed profile or device, setting itself as the device\r\nor profile owner.\r\nReturns\r\nboolean whether provisioning a managed profile or device is possible.\r\nisSafeOperation\r\npublic boolean isSafeOperation (int reason)\r\nChecks if it's safe to run operations that can be affected by the given reason .\r\nNote: notice that the operation safety state might change between the time this method returns and the operation's method is\r\ncalled, so calls to the latter could still throw a UnsafeStateException even when this method returns true .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 121 of 178\n\nReturns\r\nboolean whether it's safe to run operations that can be affected by the given reason .\r\nisSecurityLoggingEnabled\r\npublic boolean isSecurityLoggingEnabled (ComponentName admin)\r\nReturn whether security logging is enabled or not by the admin.\r\nCan only be called by the device owner or a profile owner of an organization-owned managed profile, otherwise a\r\nSecurityException will be thrown.\r\nParameters\r\nadmin\r\nComponentName : Which device admin this request is associated with. Null if the caller is not a device admin.\r\nThis value may be null .\r\nReturns\r\nboolean true if security logging is enabled, false otherwise.\r\nisStatusBarDisabled\r\npublic boolean isStatusBarDisabled ()\r\nReturns whether the status bar is disabled/enabled, see setStatusBarDisabled(ComponentName, boolean) .\r\nCallable by device owner or profile owner of secondary users that is affiliated with the device owner.\r\nThis policy has no effect in LockTask mode. The behavior of the status bar in LockTask mode can be configured with\r\nsetLockTaskFeatures(ComponentName,int) .\r\nThis policy also does not have any effect while on the lock screen, where the status bar will not be disabled.\r\nThrows\r\nSecurityException\r\nif the caller is not the device owner, or a profile owner of secondary user that is affiliated with\r\nthe device.\r\nisUninstallBlocked\r\npublic boolean isUninstallBlocked (ComponentName admin,\r\n String packageName)\r\nCheck whether the user has been blocked by device policy from uninstalling a package. Requires the caller to be the profile\r\nowner if checking a specific admin's policy.\r\nNote: Starting from Build.VERSION_CODES.LOLLIPOP_MR1 , the behavior of this API is changed such that passing null as\r\nthe admin parameter will return if any admin has blocked the uninstallation. Before L MR1, passing null will cause a\r\nNullPointerException to be raised.\r\nNote: If your app targets Android 11 (API level 30) or higher, this method returns a filtered result. Learn more about how to\r\nmanage package visibility.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 122 of 178\n\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , the returned policy will be the current resolved policy rather than\r\nthe policy set by the calling admin.\r\nParameters\r\nadmin\r\nComponentName : The name of the admin component whose blocking policy will be checked, or\r\nnull to check whether any admin has blocked the uninstallation. Starting from\r\nBuild.VERSION_CODES.UPSIDE_DOWN_CAKE admin will be ignored and assumed null .\r\npackageName String : package to check.\r\nReturns\r\nboolean\r\ntrue if uninstallation is blocked and the given package is visible to you, false otherwise if uninstallation\r\nisn't blocked or the given package isn't visible to you.\r\nisUniqueDeviceAttestationSupported\r\npublic boolean isUniqueDeviceAttestationSupported ()\r\nReturns true if the StrongBox Keymaster implementation on the device was provisioned with an individual attestation\r\ncertificate and can sign attestation records using it (as attestation using an individual attestation certificate is a feature only\r\nKeymaster implementations with StrongBox security level can implement). For use prior to calling\r\ngenerateKeyPair(ComponentName,String,KeyGenParameterSpec,int) .\r\nReturns\r\nboolean true if individual attestation is supported.\r\nisUsbDataSignalingEnabled\r\npublic boolean isUsbDataSignalingEnabled ()\r\nReturns whether USB data signaling is currently enabled.\r\nWhen called by a device owner or profile owner of an organization-owned managed profile, this API returns whether USB\r\ndata signaling is currently enabled by that admin. When called by any other app, returns whether USB data signaling is\r\ncurrently enabled on the device.\r\nReturns\r\nboolean true if USB data signaling is enabled, false otherwise.\r\nisUsingUnifiedPassword\r\npublic boolean isUsingUnifiedPassword (ComponentName admin)\r\nWhen called by a profile owner of a managed profile returns true if the profile uses unified challenge with its parent user.\r\nNote: This method is not concerned with password quality and will return false if the profile has empty password as a\r\nseparate challenge.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 123 of 178\n\nlistForegroundAffiliatedUsers\r\npublic List\u003cUserHandle\u003e listForegroundAffiliatedUsers ()\r\nGets the list of affiliated users running on foreground.\r\nlockNow\r\npublic void lockNow ()\r\nMake the device lock immediately, as if the lock screen timeout has expired at the point of this call.\r\nThis method secures the device in response to an urgent situation, such as a lost or stolen device. After this method is called,\r\nthe device must be unlocked using strong authentication (PIN, pattern, or password). This API is intended for use only by\r\ndevice admins.\r\nFrom version Build.VERSION_CODES.R onwards, the caller must either have the LOCK_DEVICE permission or the device\r\nmust have the device admin feature; if neither is true, then the method will return without completing any action. Before\r\nversion Build.VERSION_CODES.R , the device needed the device admin feature, regardless of the caller's permissions.\r\nThe calling device admin must have requested DeviceAdminInfo.USES_POLICY_FORCE_LOCK to be able to call this method; if\r\nit has not, a security exception will be thrown.\r\nIf there's no lock type set, this method forces the device to go to sleep but doesn't lock the device. Device admins who find\r\nthe device in this state can lock an otherwise-insecure device by first calling resetPassword(String, int) to set the\r\npassword and then lock the device.\r\nThis method can be called on the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName)\r\nin order to lock the parent profile.\r\nNOTE: on automotive builds , this method doesn't turn off the screen as it would be a driving safety distraction.\r\nEquivalent to calling lockNow(int) with no flags.\r\nlockNow\r\npublic void lockNow (int flags)\r\nMake the device lock immediately, as if the lock screen timeout has expired at the point of this call.\r\nThis method secures the device in response to an urgent situation, such as a lost or stolen device. After this method is called,\r\nthe device must be unlocked using strong authentication (PIN, pattern, or password). This API is intended for use only by\r\ndevice admins.\r\nFrom version Build.VERSION_CODES.R onwards, the caller must either have the LOCK_DEVICE permission or the device\r\nmust have the device admin feature; if neither is true, then the method will return without completing any action. Before\r\nversion Build.VERSION_CODES.R , the device needed the device admin feature, regardless of the caller's permissions.\r\nA calling device admin must have requested DeviceAdminInfo.USES_POLICY_FORCE_LOCK to be able to call this method; if it\r\nhas not, a security exception will be thrown.\r\nIf there's no lock type set, this method forces the device to go to sleep but doesn't lock the device. Device admins who find\r\nthe device in this state can lock an otherwise-insecure device by first calling resetPassword(String, int) to set the\r\npassword and then lock the device.\r\nThis method can be called on the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName)\r\nin order to lock the parent profile as well as the managed profile.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 124 of 178\n\nNOTE: In order to lock the parent profile and evict the encryption key of the managed profile, lockNow() must be called\r\ntwice: First, lockNow() should be called on the DevicePolicyManager instance returned by\r\ngetParentProfileInstance(ComponentName) , then lockNow(int) should be called on the DevicePolicyManager instance\r\nassociated with the managed profile, with the FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY flag. Calling the method twice in\r\nthis order ensures that all users are locked and does not stop the device admin on the managed profile from issuing a second\r\ncall to lock its own profile.\r\nNOTE: on automotive builds , this method doesn't turn off the screen as it would be a driving safety distraction.\r\nreboot\r\npublic void reboot (ComponentName admin)\r\nCalled by device owner to reboot the device. If there is an ongoing call on the device, throws an IllegalStateException .\r\nParameters\r\nadmin\r\nComponentName : Which device owner the request is associated with.\r\nThis value cannot be null .\r\nremoveActiveAdmin\r\npublic void removeActiveAdmin (ComponentName admin)\r\nRemove a current administration component. This can only be called by the application that owns the administration\r\ncomponent; if you try to remove someone else's component, a security exception will be thrown.\r\nNote that the operation is not synchronous and the admin might still be active (as indicated by getActiveAdmins() ) by the\r\ntime this method returns.\r\nParameters\r\nadmin\r\nComponentName : The administration compononent to remove.\r\nThis value cannot be null .\r\nremoveKeyPair\r\npublic boolean removeKeyPair (ComponentName admin,\r\n String alias)\r\nThis API can be called by the following to remove a certificate and private key pair installed under a given alias:\r\nDevice owner\r\nProfile owner\r\nDelegated certificate installer\r\nCredential management app\r\nFrom Android Build.VERSION_CODES.S , the credential management app can call this API. If called by the credential\r\nmanagement app, the componentName must be null . Note, there can only be a credential management app on an\r\nunmanaged device.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if the caller is not\r\na device admin.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 125 of 178\n\nalias\r\nString : The private key alias under which the certificate is installed.\r\nThis value cannot be null .\r\nReturns\r\nboolean true if the private key alias no longer exists, false otherwise.\r\nThrows\r\nSecurityException\r\nif admin is not null and not a device or profile owner, or admin is null but the calling\r\napplication is not a delegated certificate installer or credential management app.\r\nremoveOverrideApn\r\npublic boolean removeOverrideApn (ComponentName admin,\r\n int apnId)\r\nCalled by device owner or managed profile owner to remove an override APN.\r\nThis method may returns false if there is no override APN with the given apnId .\r\nBefore Android version Build.VERSION_CODES.TIRAMISU : Only device owners can remove APNs.\r\nStarting from Android version Build.VERSION_CODES.TIRAMISU : Both device owners and managed profile owners can\r\nremove enterprise APNs ( ApnSetting.TYPE_ENTERPRISE ), while only device owners can remove other type of APNs.\r\nParameters\r\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\napnId int : the id of the override APN to remove\r\nReturns\r\nboolean true if the required override APN is successfully removed, false otherwise.\r\nThrows\r\nSecurityException\r\nIf request is for enterprise APN admin is either device owner or profile owner and in all other\r\ntypes of APN if admin is not a device owner.\r\nremoveUser\r\npublic boolean removeUser (ComponentName admin,\r\n UserHandle userHandle)\r\nCalled by a device owner to remove a user/profile and all associated data. The primary user can not be removed.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nuserHandle\r\nUserHandle : the user to remove.\r\nThis value cannot be null .\r\nReturns\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 126 of 178\n\nboolean true if the user was removed, false otherwise.\r\nrequestBugreport\r\npublic boolean requestBugreport (ComponentName admin)\r\nCalled by a device owner to request a bugreport.\r\nIf the device contains secondary users or profiles, they must be affiliated with the device. Otherwise a SecurityException\r\nwill be thrown. See isAffiliatedUser() .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nReturns\r\nboolean\r\ntrue if the bugreport collection started successfully, or false if it wasn't triggered because a previous\r\nbugreport operation is still active (either the bugreport is still running or waiting for the user to share or\r\ndecline)\r\nThrows\r\nSecurityException\r\nif admin is not a device owner, or there is at least one profile or secondary user that is not\r\naffiliated with the device.\r\nresetPassword\r\npublic boolean resetPassword (String password,\r\n int flags)\r\nThis method was deprecated in API level 30.\r\nPlease use resetPasswordWithToken(ComponentName, String, byte, int) instead.\r\nForce a new password for device unlock (the password needed to access the entire device) or the work profile challenge on\r\nthe current user. This takes effect immediately.\r\nBefore Build.VERSION_CODES.N , this API is available to device admin, profile owner and device owner. Starting from\r\nBuild.VERSION_CODES.N , legacy device admin (who is not also profile owner or device owner) can only call this API to set\r\na new password if there is currently no password set. Profile owner and device owner can continue to force change an\r\nexisting password as long as the target user is unlocked, although device owner will not be able to call this API at all if there\r\nis also a managed profile on the device.\r\nBetween Build.VERSION_CODES.O , Build.VERSION_CODES.P and Build.VERSION_CODES.Q , profile owner and devices\r\nowner targeting SDK level Build.VERSION_CODES.O or above who attempt to call this API will receive\r\nSecurityException ; they are encouraged to migrate to the new resetPasswordWithToken(ComponentName, String, byte,\r\nint) API instead. Profile owner and device owner targeting older SDK levels are not affected: they continue to experience\r\nthe existing behaviour described in the previous paragraph.\r\nStarting from Build.VERSION_CODES.R , this API is no longer supported in most cases. Device owner and profile owner\r\ncalling this API will receive SecurityException if they target SDK level Build.VERSION_CODES.O or above, or they will\r\nreceive a silent failure (API returning false ) if they target lower SDK level. For legacy device admins, this API throws\r\nSecurityException if they target SDK level Build.VERSION_CODES.N or above, and returns false otherwise. Only\r\nprivileged apps holding RESET_PASSWORD permission which are part of the system factory image can still call this API\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 127 of 178\n\nto set a new password if there is currently no password set. In this case, if the device already has a password, this API will\r\nthrow SecurityException .\r\nThe given password must be sufficient for the current password quality and length constraints as returned by\r\ngetPasswordQuality(ComponentName) and getPasswordMinimumLength(ComponentName) ; if it does not meet these\r\nconstraints, then it will be rejected and false returned. Note that the password may be a stronger quality (containing\r\nalphanumeric characters when the requested quality is only numeric), in which case the currently active quality will be\r\nincreased to match.\r\nOn devices not supporting PackageManager.FEATURE_SECURE_LOCK_SCREEN feature, this methods does nothing.\r\nThe calling device admin must have requested DeviceAdminInfo.USES_POLICY_RESET_PASSWORD to be able to call this\r\nmethod; if it has not, a security exception will be thrown.\r\nRequires the PackageManager#FEATURE_SECURE_LOCK_SCREEN feature which can be detected using\r\nPackageManager.hasSystemFeature(String) .\r\nReturns\r\nboolean Returns true if the password was applied, or false if it is not acceptable for the current constraints.\r\nresetPasswordWithToken\r\npublic boolean resetPasswordWithToken (ComponentName admin,\r\n String password,\r\n byte[] token,\r\n int flags)\r\nCalled by device or profile owner to force set a new device unlock password or a managed profile challenge on current user.\r\nThis takes effect immediately.\r\nUnlike resetPassword(String, int) , this API can change the password even before the user or device is unlocked or\r\ndecrypted. The supplied token must have been previously provisioned via setResetPasswordToken(ComponentName, byte) ,\r\nand in active state isResetPasswordTokenActive(ComponentName) .\r\nThe given password must be sufficient for the current password quality and length constraints as returned by\r\ngetPasswordQuality(ComponentName) and getPasswordMinimumLength(ComponentName) ; if it does not meet these\r\nconstraints, then it will be rejected and false returned. Note that the password may be a stronger quality, for example, a\r\npassword containing alphanumeric characters when the requested quality is only numeric.\r\nCalling with a null or empty password will clear any existing PIN, pattern or password if the current password constraints\r\nallow it.\r\nOn devices not supporting PackageManager.FEATURE_SECURE_LOCK_SCREEN feature, calling this methods has no effect - the\r\npassword is always empty - and false is returned.\r\nRequires the PackageManager#FEATURE_SECURE_LOCK_SCREEN feature which can be detected using\r\nPackageManager.hasSystemFeature(String) .\r\nReturns\r\nboolean Returns true if the password was applied, or false if it is not acceptable for the current constraints.\r\nretrieveNetworkLogs\r\npublic List\u003cNetworkEvent\u003e retrieveNetworkLogs (ComponentName admin,\r\n long batchToken)\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 128 of 178\n\nCalled by device owner, profile owner of a managed profile or delegated app with DELEGATION_NETWORK_LOGGING to retrieve\r\nthe most recent batch of network logging events.\r\nWhen network logging is enabled by a profile owner, the network logs will only include work profile network activity, not\r\nactivity on the personal profile. A device owner or profile owner has to provide a batchToken provided as part of\r\nDeviceAdminReceiver.onNetworkLogsAvailable callback. If the token doesn't match the token of the most recent available\r\nbatch of logs, null will be returned.\r\nNetworkEvent can be one of DnsEvent or ConnectEvent .\r\nThe list of network events is sorted chronologically, and contains at most 1200 events.\r\nAccess to the logs is rate limited and this method will only return a new batch of logs after the device device owner has been\r\nnotified via DeviceAdminReceiver.onNetworkLogsAvailable .\r\nIf the caller is not a profile owner and a secondary user or profile is created, calling this method will throw a\r\nSecurityException until all users become affiliated again. It will also no longer be possible to retrieve the network logs\r\nbatch with the most recent batchToken provided by DeviceAdminReceiver.onNetworkLogsAvailable . See\r\nDevicePolicyManager.setAffiliationIds .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if called by a\r\ndelegated app.\r\nbatchToken long : A token of the batch to retrieve\r\nReturns\r\nList\u003cNetworkEvent\u003e\r\nA new batch of network logs which is a list of NetworkEvent . Returns null if the batch\r\nrepresented by batchToken is no longer available or if logging is disabled.\r\nThrows\r\nSecurityException\r\nif admin is not a device owner, profile owner or if the admin is not a profile owner and there\r\nis at least one profile or secondary user that is not affiliated with the device.\r\nretrievePreRebootSecurityLogs\r\npublic List\u003cSecurityLog.SecurityEvent\u003e retrievePreRebootSecurityLogs (ComponentName admin)\r\nCalled by device owner or profile owner of an organization-owned managed profile to retrieve device logs from before the\r\ndevice's last reboot.\r\nThis API is not supported on all devices. Calling this API on unsupported devices will result in null being returned.\r\nThe device logs are retrieved from a RAM region which is not guaranteed to be corruption-free during power cycles,\r\nas a result be cautious about data corruption when parsing.\r\nWhen called by a device owner, if there is any other user or profile on the device, it must be affiliated with the device.\r\nOtherwise a SecurityException will be thrown. See isAffiliatedUser() .\r\nParameters\r\nadmin ComponentName : Which device admin this request is associated with, or null if called by a delegated app.\r\nReturns\r\nList\u003cSecurityLog.SecurityEvent\u003e\r\nDevice logs from before the latest reboot of the system, or null if this API is\r\nnot supported on the device.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 129 of 178\n\nThrows\r\nSecurityException\r\nif the caller is not allowed to access security logging, or there is at least one profile or\r\nsecondary user that is not affiliated with the device.\r\nretrieveSecurityLogs\r\npublic List\u003cSecurityLog.SecurityEvent\u003e retrieveSecurityLogs (ComponentName admin)\r\nCalled by device owner or profile owner of an organization-owned managed profile to retrieve all new security logging\r\nentries since the last call to this API after device boots.\r\nAccess to the logs is rate limited and it will only return new logs after the admin has been notified via\r\nDeviceAdminReceiver.onSecurityLogsAvailable .\r\nWhen called by a device owner, if there is any other user or profile on the device, it must be affiliated with the device.\r\nOtherwise a SecurityException will be thrown. See isAffiliatedUser() .\r\nParameters\r\nadmin ComponentName : Which device admin this request is associated with, or null if called by a delegated app.\r\nThrows\r\nSecurityException\r\nif the caller is not allowed to access security logging, or there is at least one profile or\r\nsecondary user that is not affiliated with the device.\r\nrevokeKeyPairFromApp\r\npublic boolean revokeKeyPairFromApp (ComponentName admin,\r\n String alias,\r\n String packageName)\r\nCalled by a device or profile owner, or delegated certificate chooser (an app that has been delegated the\r\nDELEGATION_CERT_SELECTION privilege), to revoke an application's grant to a KeyChain key pair. Calls by the application to\r\nKeyChain.getPrivateKey(Context, String) will fail after the grant is revoked. The grantee app will receive the\r\nKeyChain.ACTION_KEY_ACCESS_CHANGED broadcast when access to a key is revoked. Starting from\r\nBuild.VERSION_CODES.UPSIDE_DOWN_CAKE throws an IllegalArgumentException if alias doesn't correspond to an\r\nexisting key.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if calling\r\nfrom a delegated certificate chooser.\r\nalias\r\nString : The alias of the key to revoke access from.\r\nThis value cannot be null .\r\npackageName\r\nString : The name of the (already installed) package to revoke access from.\r\nThis value cannot be null .\r\nReturns\r\nboolean true if the grant was revoked successfully, false otherwise.\r\nThrows\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 130 of 178\n\nIllegalArgumentException\r\nif packageName or alias are empty, or if packageName is not a name of an installed\r\npackage.\r\nSecurityException if the caller is not a device owner, a profile owner or delegated certificate chooser.\r\nrevokeKeyPairFromWifiAuth\r\npublic boolean revokeKeyPairFromWifiAuth (String alias)\r\nCalled by a device or profile owner, or delegated certificate chooser (an app that has been delegated the\r\nDELEGATION_CERT_SELECTION privilege), to deny using a KeyChain key pair for authentication to Wifi networks. Configured\r\nnetworks using this key won't be able to authenticate. Starting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE throws an\r\nIllegalArgumentException if alias doesn't correspond to an existing key.\r\nParameters\r\nalias\r\nString : The alias of the key pair.\r\nThis value cannot be null .\r\nReturns\r\nboolean true if the operation was set successfully, false otherwise.\r\nThrows\r\nSecurityException if the caller is not a device owner, a profile owner or delegated certificate chooser.\r\nsetAccountManagementDisabled\r\npublic void setAccountManagementDisabled (ComponentName admin,\r\n String accountType,\r\n boolean disabled)\r\nCalled by a device owner or profile owner to disable account management for a specific type of account.\r\nThe calling device admin must be a device owner or profile owner. If it is not, a security exception will be thrown.\r\nWhen account management is disabled for an account type, adding or removing an account of that type will not be possible.\r\nFrom Build.VERSION_CODES.N the profile or device owner can still use AccountManager APIs to add or remove accounts\r\nwhen account management for a specific type is disabled.\r\nThis method may be called on the DevicePolicyManager instance returned from\r\ngetParentProfileInstance(ComponentName) by the profile owner on an organization-owned device, to restrict accounts\r\nthat may not be managed on the primary profile.\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , after the account management disabled policy has been set,\r\nPolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the\r\nadmin on whether the policy was successfully set or not. This callback will contain:\r\nThe policy identifier DevicePolicyIdentifiers.ACCOUNT_MANAGEMENT_DISABLED_POLICY\r\nThe additional policy params bundle, which contains PolicyUpdateReceiver.EXTRA_ACCOUNT_TYPE the account type\r\nthe policy applies to\r\nThe TargetUser that this policy relates to\r\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\nset or the reason the policy failed to be set (e.g. PolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 131 of 178\n\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is\r\nnot a device admin.\r\nThis value may be null .\r\naccountType String : For which account management is disabled or enabled.\r\ndisabled boolean : The boolean indicating that account management will be disabled (true) or enabled (false).\r\nsetAffiliationIds\r\npublic void setAffiliationIds (ComponentName admin,\r\n Set\u003cString\u003e ids)\r\nIndicates the entity that controls the device. Two users are affiliated if the set of ids set by the device owner and the admin of\r\nthe secondary user.\r\nA user that is affiliated with the device owner user is considered to be affiliated with the device.\r\nNote: Features that depend on user affiliation (such as security logging or bindDeviceAdminServiceAsUser(ComponentName,\r\nIntent, ServiceConnection, BindServiceFlags, UserHandle) ) won't be available when a secondary user is created, until it\r\nbecomes affiliated. Therefore it is recommended that the appropriate affiliation ids are set by its owner as soon as possible\r\nafter the user is created.\r\nNote: This method used to be available for affiliating device owner and profile owner. However, since Android 11, this\r\ncombination is not possible. This method is now only useful for affiliating the primary user with managed secondary users.\r\nParameters\r\nadmin\r\nComponentName : Which device owner, or owner of secondary user, this request is associated with.\r\nThis value cannot be null .\r\nids\r\nSet : A set of opaque non-empty affiliation ids.\r\nThis value cannot be null .\r\nsetAlwaysOnVpnPackage\r\npublic void setAlwaysOnVpnPackage (ComponentName admin,\r\n String vpnPackage,\r\n boolean lockdownEnabled)\r\nCalled by a device or profile owner to configure an always-on VPN connection through a specific application for the current\r\nuser. This connection is automatically granted and persisted after a reboot.\r\nTo support the always-on feature, an app must\r\ndeclare a VpnService in its manifest, guarded by Manifest.permission.BIND_VPN_SERVICE ;\r\ntarget API 24 or above; and\r\nnot explicitly opt out of the feature through VpnService.SERVICE_META_DATA_SUPPORTS_ALWAYS_ON .\r\nThe call will fail if called with the package name of an unsupported VPN app.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 132 of 178\n\nEnabling lockdown via lockdownEnabled argument carries the risk that any failure of the VPN provider could break\r\nnetworking for all apps. This method clears any lockdown allowlist set by\r\nsetAlwaysOnVpnPackage(ComponentName,String,boolean,Set) .\r\nStarting from API 31 calling this method with vpnPackage set to null only removes the existing configuration if it was\r\npreviously created by this admin. To remove VPN configuration created by the user use\r\nUserManager.DISALLOW_CONFIG_VPN .\r\nParameters\r\nadmin ComponentName : This value cannot be null .\r\nvpnPackage\r\nString : The package name for an installed VPN app on the device, or null to remove an\r\nexisting always-on VPN configuration.\r\nlockdownEnabled\r\nboolean : true to disallow networking when the VPN is not connected or false otherwise.\r\nThis has no effect when clearing.\r\nsetAlwaysOnVpnPackage\r\npublic void setAlwaysOnVpnPackage (ComponentName admin,\r\n String vpnPackage,\r\n boolean lockdownEnabled,\r\n Set\u003cString\u003e lockdownAllowlist)\r\nA version of setAlwaysOnVpnPackage(ComponentName,String,boolean) that allows the admin to specify a set of apps that\r\nshould be able to access the network directly when VPN is not connected. When VPN connects these apps switch over to\r\nVPN if allowed to use that VPN. System apps can always bypass VPN.\r\nNote that the system doesn't update the allowlist when packages are installed or uninstalled, the admin app must call this\r\nmethod to keep the list up to date.\r\nWhen lockdownEnabled is false lockdownAllowlist is ignored . When lockdownEnabled is true and\r\nlockdownAllowlist is null or empty, only system apps can bypass VPN.\r\nSetting always-on VPN package to null or using setAlwaysOnVpnPackage(ComponentName,String,boolean) clears\r\nlockdown allowlist.\r\nParameters\r\nadmin ComponentName : This value cannot be null .\r\nvpnPackage\r\nString : package name for an installed VPN app on the device, or null to remove an\r\nexisting always-on VPN configuration\r\nlockdownEnabled\r\nboolean : true to disallow networking when the VPN is not connected or false otherwise.\r\nThis has no effect when clearing.\r\nlockdownAllowlist\r\nSet : Packages that will be able to access the network directly when VPN is in lockdown\r\nmode but not connected. Has no effect when clearing.\r\nThis value may be null .\r\nsetAppFunctionsPolicy\r\npublic void setAppFunctionsPolicy (int policy)\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 133 of 178\n\nSets the AppFunctionManager policy which controls app functions operations on the device. An app function is a piece of\r\nfunctionality that apps expose to the system for cross-app orchestration.\r\nThis function can only be called by a device owner, a profile owner or holders of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_APP_FUNCTIONS .\r\nsetApplicationHidden\r\npublic boolean setApplicationHidden (ComponentName admin,\r\n String packageName,\r\n boolean hidden)\r\nHide or unhide packages. When a package is hidden it is unavailable for use, but the data and actual package file remain.\r\nThis function can be called by a device owner, profile owner, or by a delegate given the DELEGATION_PACKAGE_ACCESS scope\r\nvia setDelegatedScopes(ComponentName, String, List) .\r\nThis method can be called on the DevicePolicyManager instance, returned by\r\ngetParentProfileInstance(ComponentName) , where the caller must be the profile owner of an organization-owned\r\nmanaged profile and the package must be a system package. If called on the parent instance, then the package is hidden or\r\nunhidden in the personal profile.\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , after the application hidden policy has been set,\r\nPolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the\r\nadmin on whether the policy was successfully set or not. This callback will contain:\r\nThe policy identifier DevicePolicyIdentifiers.APPLICATION_HIDDEN_POLICY\r\nThe additional policy params bundle, which contains PolicyUpdateReceiver.EXTRA_PACKAGE_NAME the package\r\nname the policy applies to\r\nThe TargetUser that this policy relates to\r\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\nset or the reason the policy failed to be set (e.g. PolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if the caller\r\nis not a device admin.\r\npackageName String : The name of the package to hide or unhide.\r\nhidden boolean : true if the package should be hidden, false if it should be unhidden.\r\nReturns\r\nboolean boolean Whether the hidden setting of the package was successfully updated.\r\nThrows\r\nIllegalArgumentException if called on the parent profile and the package provided is not a system package.\r\nSecurityException\r\nif admin is not a device or profile owner or if called on the parent profile and the\r\nadmin is not a profile owner of an organization-owned managed profile.\r\nsetApplicationRestrictions\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 134 of 178\n\npublic void setApplicationRestrictions (ComponentName admin,\r\n String packageName,\r\n Bundle settings)\r\nSets the application restrictions for a given target application running in the calling user.\r\nThe caller must be a profile or device owner on that user, or the package allowed to manage application restrictions via\r\nsetDelegatedScopes(ComponentName, String, List) with the DELEGATION_APP_RESTRICTIONS scope; otherwise a security\r\nexception will be thrown.\r\nThe provided Bundle consists of key-value pairs, where the types of values may be:\r\nboolean\r\nint\r\nString or String[]\r\nFrom Build.VERSION_CODES.M , Bundle or Bundle[]\r\nIf the restrictions are not available yet, but may be applied in the near future, the caller can notify the target application of\r\nthat by adding UserManager.KEY_RESTRICTIONS_PENDING to the settings parameter.\r\nThe application restrictions are only made visible to the target application via\r\nUserManager.getApplicationRestrictions(String) , in addition to the profile or device owner, and the application\r\nrestrictions managing package via getApplicationRestrictions(ComponentName, String) .\r\nStarting from Android Version Build.VERSION_CODES.UPSIDE_DOWN_CAKE , multiple admins can set app restrictions for the\r\nsame application, the target application can get the list of app restrictions set by each admin via\r\nRestrictionsManager.getApplicationRestrictionsPerAdmin() .\r\nStarting from Android Version Build.VERSION_CODES.VANILLA_ICE_CREAM , the device policy management role holder can\r\nalso set app restrictions on any applications in the calling user, as well as the parent user of an organization-owned managed\r\nprofile via the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName) . App restrictions\r\nset by the device policy management role holder are returned by UserManager.getApplicationRestrictions(String) but\r\nthe target application should use RestrictionsManager.getApplicationRestrictionsPerAdmin() to retrieve them,\r\nalongside any app restrictions the profile or device owner might have set.\r\nNOTE: The method performs disk I/O and shouldn't be called on the main thread.\r\nThis method may take several seconds to complete, so it should only be called from a worker thread.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if called by\r\nthe application restrictions managing package.\r\npackageName String : The name of the package to update restricted settings for.\r\nsettings\r\nBundle : A Bundle to be parsed by the receiving application, conveying a new set of active\r\nrestrictions.\r\nSee also:\r\nsetDelegatedScopes(ComponentName, String, List)\r\nDELEGATION_APP_RESTRICTIONS\r\nUserManager.KEY_RESTRICTIONS_PENDING\r\nsetAutoTimeEnabled\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 135 of 178\n\npublic void setAutoTimeEnabled (ComponentName admin,\r\n boolean enabled)\r\nCalled by a device owner, a profile owner for the primary user or a profile owner of an organization-owned managed profile\r\nto turn auto time on and off.\r\nCallers are recommended to use UserManager.DISALLOW_CONFIG_DATE_TIME to prevent the user from changing this setting,\r\nthat way no user will be able set the date and time zone.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\nenabled boolean : Whether time should be obtained automatically from the network or not.\r\nThrows\r\nSecurityException\r\nif caller is not a device owner, a profile owner for the primary user, or a profile owner of an\r\norganization-owned managed profile.\r\nsetAutoTimePolicy\r\npublic void setAutoTimePolicy (int policy)\r\nCalled by a device owner, a profile owner for the primary user or a profile owner of an organization-owned managed profile\r\nto turn auto time on and off i.e. Whether time should be obtained automatically from the network or not.\r\nCallers are recommended to use UserManager.DISALLOW_CONFIG_DATE_TIME to prevent the user from changing this setting,\r\nthat way no user will be able set the date and time zone.\r\nThrows\r\nSecurityException\r\nif caller is not a device owner, a profile owner for the primary user, or a profile owner of an\r\norganization-owned managed profile, or if the caller does not hold the required permission.\r\nsetAutoTimeRequired\r\npublic void setAutoTimeRequired (ComponentName admin,\r\n boolean required)\r\nThis method was deprecated in API level 30.\r\nFrom Build.VERSION_CODES.R . Use setAutoTimeEnabled(ComponentName, boolean) to turn auto time on or off and use\r\nUserManager.DISALLOW_CONFIG_DATE_TIME to prevent the user from changing this setting.\r\nCalled by a device owner, or alternatively a profile owner from Android 8.0 (API level 26) or higher, to set whether auto\r\ntime is required. If auto time is required, no user will be able set the date and time and network date and time will be used.\r\nNote: If auto time is required the user can still manually set the time zone. Staring from Android 11, if auto time is required,\r\nthe user cannot manually set the time zone.\r\nThe calling device admin must be a device owner, or alternatively a profile owner from Android 8.0 (API level 26) or higher.\r\nIf it is not, a security exception will be thrown.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 136 of 178\n\nStaring from Android 11, this API switches to use UserManager.DISALLOW_CONFIG_DATE_TIME to enforce the auto time\r\nsettings. Calling this API to enforce auto time will result in UserManager.DISALLOW_CONFIG_DATE_TIME being set, while\r\ncalling this API to lift the requirement will result in UserManager.DISALLOW_CONFIG_DATE_TIME being cleared. From\r\nAndroid 11, this API can also no longer be called on a managed profile.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nrequired boolean : Whether auto time is set required or not.\r\nThrows\r\nSecurityException\r\nif admin is not a device owner, not a profile owner or if this API is called on a managed\r\nprofile.\r\nsetAutoTimeZoneEnabled\r\npublic void setAutoTimeZoneEnabled (ComponentName admin,\r\n boolean enabled)\r\nCalled by a device owner, a profile owner for the primary user or a profile owner of an organization-owned managed profile\r\nto turn auto time zone on and off.\r\nCallers are recommended to use UserManager.DISALLOW_CONFIG_DATE_TIME to prevent the user from changing this setting,\r\nthat way no user will be able set the date and time zone.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with or Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\nenabled boolean : Whether time zone should be obtained automatically from the network or not.\r\nThrows\r\nSecurityException\r\nif caller is not a device owner, a profile owner for the primary user, or a profile owner of an\r\norganization-owned managed profile.\r\nsetAutoTimeZonePolicy\r\npublic void setAutoTimeZonePolicy (int policy)\r\nCalled by a device owner, a profile owner for the primary user or a profile owner of an organization-owned managed profile\r\nto turn auto time zone on and off.\r\nCallers are recommended to use UserManager.DISALLOW_CONFIG_DATE_TIME to prevent the user from changing this setting,\r\nthat way no user will be able set the date and time zone.\r\nThrows\r\nSecurityException\r\nif caller is not a device owner, a profile owner for the primary user, or a profile owner of an\r\norganization-owned managed profile, or if the caller does not hold the required permission.\r\nsetBackupServiceEnabled\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 137 of 178\n\npublic void setBackupServiceEnabled (ComponentName admin,\r\n boolean enabled)\r\nAllows the device owner or profile owner to enable or disable the backup service.\r\nEach user has its own backup service which manages the backup and restore mechanisms in that user. Disabling the backup\r\nservice will prevent data from being backed up or restored.\r\nDevice owner calls this API to control backup services across all users on the device. Profile owner can use this API to\r\nenable or disable the profile's backup service. However, for a managed profile its backup functionality is only enabled if\r\nboth the device owner and the profile owner have enabled the backup service.\r\nBy default, backup service is disabled on a device with device owner, and within a managed profile.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nenabled boolean : true to enable the backup service, false to disable it.\r\nsetBluetoothContactSharingDisabled\r\npublic void setBluetoothContactSharingDisabled (ComponentName admin,\r\n boolean disabled)\r\nCalled by a profile owner of a managed profile to set whether bluetooth devices can access enterprise contacts.\r\nThe calling device admin must be a profile owner. If it is not, a security exception will be thrown.\r\nThis API works on managed profile only.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\ndisabled boolean : If true, bluetooth devices cannot access enterprise contacts.\r\nsetCameraDisabled\r\npublic void setCameraDisabled (ComponentName admin,\r\n boolean disabled)\r\nCalled by an application that is administering the device to disable all cameras on the device, for this user. After setting this,\r\nno applications running as this user will be able to access any cameras on the device.\r\nStarting with Android Build.VERSION_CODES.CINNAMON_BUN , this method also blocks application access to external USB\r\ncameras that connect directly via the UsbConstants.USB_CLASS_VIDEO interface.\r\nThis method can be called on the DevicePolicyManager instance, returned by\r\ngetParentProfileInstance(ComponentName) , where the caller must be the profile owner of an organization-owned\r\nmanaged profile.\r\nIf the caller is device owner, then the restriction will be applied to all users. If called on the parent instance, then the\r\nrestriction will be applied on the personal profile.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 138 of 178\n\nThe calling device admin must have requested DeviceAdminInfo.USES_POLICY_DISABLE_CAMERA to be able to call this\r\nmethod; if it has not, a security exception will be thrown.\r\nNote, this policy type is deprecated for legacy device admins since Build.VERSION_CODES.Q . On Android\r\nBuild.VERSION_CODES.Q devices, legacy device admins targeting SDK version Build.VERSION_CODES.P or below can still\r\ncall this API to disable camera, while legacy device admins targeting SDK version Build.VERSION_CODES.Q will receive a\r\nSecurityException. Starting from Android Build.VERSION_CODES.R , requests to disable camera from legacy device admins\r\ntargeting SDK version Build.VERSION_CODES.P or below will be silently ignored.\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , after the camera disabled policy has been set,\r\nPolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the\r\nadmin on whether the policy was successfully set or not. This callback will contain:\r\nThe policy identifier: userRestriction_no_camera\r\nThe TargetUser that this policy relates to\r\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\nset or the reason the policy failed to be set (e.g. PolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with or null if the caller is not\r\na device admin\r\ndisabled boolean : Whether or not the camera should be disabled.\r\nsetCertInstallerPackage\r\npublic void setCertInstallerPackage (ComponentName admin,\r\n String installerPackage)\r\nThis method was deprecated in API level 26.\r\nFrom Build.VERSION_CODES.O . Use setDelegatedScopes(ComponentName, String, List) with the\r\nDELEGATION_CERT_INSTALL scope instead.\r\nCalled by a profile owner or device owner to grant access to privileged certificate manipulation APIs to a third-party\r\ncertificate installer app. Granted APIs include getInstalledCaCerts(ComponentName) ,\r\nhasCaCertInstalled(ComponentName, byte) , installCaCert(ComponentName, byte) , uninstallCaCert(ComponentName,\r\nbyte) , uninstallAllUserCaCerts(ComponentName) and installKeyPair(ComponentName, PrivateKey, Certificate,\r\nString) .\r\nDelegated certificate installer is a per-user state. The delegated access is persistent until it is later cleared by calling this\r\nmethod with a null value or uninstalling the certificate installer.\r\nNote:Starting from Build.VERSION_CODES.N , if the caller application's target SDK version is Build.VERSION_CODES.N or\r\nnewer, the supplied certificate installer package must be installed when calling this API, otherwise an\r\nIllegalArgumentException will be thrown.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 139 of 178\n\ninstallerPackage\r\nString : The package name of the certificate installer which will be given access. If null is\r\ngiven the current package will be cleared.\r\nsetCommonCriteriaModeEnabled\r\npublic void setCommonCriteriaModeEnabled (ComponentName admin,\r\n boolean enabled)\r\nCalled by device owner or profile owner of an organization-owned managed profile to toggle Common Criteria mode for the\r\ndevice. When the device is in Common Criteria mode, certain device functionalities are tuned to meet the higher security\r\nlevel required by Common Criteria certification. For example:\r\nBluetooth long term key material is additionally integrity-protected with AES-GCM.\r\nWiFi configuration store is additionally integrity-protected with AES-GCM.\r\nCommon Criteria mode is disabled by default.\r\nNote: if Common Critera mode is turned off after being enabled previously, all existing WiFi configurations will be lost.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\nenabled boolean : whether Common Criteria mode should be enabled or not.\r\nsetConfiguredNetworksLockdownState\r\npublic void setConfiguredNetworksLockdownState (ComponentName admin,\r\n boolean lockdown)\r\nCalled by a device owner or a profile owner of an organization-owned managed profile to control whether the user can\r\nchange networks configured by the admin. When this lockdown is enabled, the user can still configure and connect to other\r\nWi-Fi networks, or use other Wi-Fi capabilities such as tethering.\r\nWiFi network configuration lockdown is controlled by a global settings\r\nSettings.Global.WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN and calling this API effectively modifies the global settings.\r\nPreviously device owners can also control this directly via setGlobalSetting(ComponentName, String, String) but they\r\nare recommended to switch to this API.\r\nParameters\r\nadmin\r\nComponentName : admin Which DeviceAdminReceiver this request is associated with. Null if the caller is\r\nnot a device admin.\r\nThis value may be null .\r\nlockdown boolean : Whether the admin configured networks should be unmodifiable by the user.\r\nThrows\r\nSecurityException if caller is not a device owner or a profile owner of an organization-owned managed profile.\r\nsetContentProtectionPolicy\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 140 of 178\n\npublic void setContentProtectionPolicy (ComponentName admin,\r\n int policy)\r\nSets the content protection policy which controls scanning for deceptive apps.\r\nThis function can only be called by the device owner, a profile owner of an affiliated user or profile, or the profile owner\r\nwhen no device owner is set or holders of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_CONTENT_PROTECTION . See isAffiliatedUser() . Any policy set via this\r\nmethod will be cleared if the user becomes unaffiliated.\r\nAfter the content protection policy has been set,\r\nPolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the\r\nadmin on whether the policy was successfully set or not. This callback will contain:\r\nThe policy identifier DevicePolicyIdentifiers.CONTENT_PROTECTION_POLICY\r\nThe TargetUser that this policy relates to\r\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\nset or the reason the policy failed to be set (e.g. PolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nsetCredentialManagerPolicy\r\npublic void setCredentialManagerPolicy (PackagePolicy policy)\r\nCalled by a device owner or profile owner of a managed profile to set the credential manager policy.\r\nAffects APIs exposed by CredentialManager .\r\nA PackagePolicy.PACKAGE_POLICY_ALLOWLIST policy type will limit the credential providers that the user can use to the list\r\nof packages in the policy.\r\nA PackagePolicy.PACKAGE_POLICY_ALLOWLIST_AND_SYSTEM policy type allows access from the OEM default credential\r\nproviders and the allowlist of credential providers.\r\nA PackagePolicy.PACKAGE_POLICY_BLOCKLIST policy type will block the credential providers listed in the policy from being\r\nused by the user.\r\nParameters\r\npolicy PackagePolicy : the policy to set, setting this value to null will allow all packages\r\nThrows\r\nSecurityException if caller is not a device owner or profile owner of a managed profile\r\nsetCrossProfileCalendarPackages\r\npublic void setCrossProfileCalendarPackages (ComponentName admin,\r\n Set\u003cString\u003e packageNames)\r\nThis method was deprecated in API level 34.\r\nUse setCrossProfilePackages(ComponentName,Set) .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 141 of 178\n\nAllows a set of packages to access cross-profile calendar APIs.\r\nCalled by a profile owner of a managed profile.\r\nCalling with a null value for the set disables the restriction so that all packages are allowed to access cross-profile\r\ncalendar APIs. Calling with an empty set disallows all packages from accessing cross-profile calendar APIs. If this method\r\nisn't called, no package is allowed to access cross-profile calendar APIs by default.\r\nParameters\r\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\npackageNames\r\nSet : set of packages to be allowlisted.\r\nThis value may be null .\r\nsetCrossProfilePackages\r\npublic void setCrossProfilePackages (ComponentName admin,\r\n Set\u003cString\u003e packageNames)\r\nSets the set of admin-allowlisted package names that are allowed to request user consent for cross-profile communication.\r\nAssumes that the caller is a profile owner and is the given admin .\r\nPrevious calls are overridden by each subsequent call to this method.\r\nNote that other apps may be able to request user consent for cross-profile communication if they have been explicitly\r\nallowlisted by the OEM.\r\nWhen previously-set cross-profile packages are missing from packageNames , the app-op for INTERACT_ACROSS_PROFILES\r\nwill be reset for those packages. This will not occur for packages that are allowlisted by the OEM.\r\nParameters\r\nadmin\r\nComponentName : the DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\npackageNames\r\nSet : the new cross-profile package names.\r\nThis value cannot be null .\r\nsetCrossProfileWidgetProviders\r\npublic void setCrossProfileWidgetProviders (Set\u003cString\u003e packageNames)\r\nCalled by the profile owner of a managed profile or a holder of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_PROFILE_INTERACTION to enable widget providers from packages to be\r\navailable in the parent profile. As a result the user will be able to add widgets from the allowlisted package running under\r\nthe profile to a widget host which runs under the parent profile, for example the home screen. Note that a package may have\r\nzero or more provider components, where each component provides a different widget type.\r\nNote: By default no widget provider package is allowlisted.\r\nNote: This API updates the entire allowlist in one-go, overriding any previous allowlist. This is more efficient than using\r\naddCrossProfileWidgetProvider(ComponentName, String) and removeCrossProfileWidgetProvider(ComponentName,\r\nString) to update the allowlist one package a time, especially if the allowlist consists of many packages.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 142 of 178\n\nParameters\r\npackageNames\r\nSet : The packages from which widget providers are allowlisted.\r\nThis value cannot be null .\r\nsetDefaultDialerApplication\r\npublic void setDefaultDialerApplication (String packageName)\r\nMust be called by a device owner or a profile owner of an organization-owned managed profile to set the default dialer\r\napplication for the calling user.\r\nWhen the profile owner of an organization-owned managed profile calls this method, it sets the default dialer application in\r\nthe work profile. This is only meaningful when work profile telephony is enabled by\r\nsetManagedSubscriptionsPolicy(ManagedSubscriptionsPolicy) .\r\nIf the device does not support telephony ( PackageManager.FEATURE_TELEPHONY ), calling this method will do nothing.\r\nParameters\r\npackageName\r\nString : The name of the package to set as the default dialer application.\r\nThis value cannot be null .\r\nThrows\r\nIllegalArgumentException\r\nif the package cannot be set as the default dialer, for example if the package is not\r\ninstalled or does not expose the expected activities or services that a dialer app is\r\nrequired to have.\r\nSecurityException\r\nif admin is not a device or profile owner or a profile owner of an organization-owned\r\nmanaged profile.\r\nsetDefaultSmsApplication\r\npublic void setDefaultSmsApplication (ComponentName admin,\r\n String packageName)\r\nMust be called by a device owner or a profile owner of an organization-owned managed profile to set the default SMS\r\napplication.\r\nThis method can be called on the DevicePolicyManager instance, returned by\r\ngetParentProfileInstance(ComponentName) , where the caller must be the profile owner of an organization-owned\r\nmanaged profile and the package must be a pre-installed system package. If called on the parent instance, then the default\r\nSMS application is set on the personal profile.\r\nStarting from Android Build.VERSION_CODES.UPSIDE_DOWN_CAKE , the profile owner of an organization-owned managed\r\nprofile can also call this method directly (not on the parent profile instance) to set the default SMS application in the work\r\nprofile. This is only meaningful when work profile telephony is enabled by\r\nsetManagedSubscriptionsPolicy(ManagedSubscriptionsPolicy) .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is\r\nnot a device admin.\r\nThis value may be null .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 143 of 178\n\npackageName\r\nString : The name of the package to set as the default SMS application.\r\nThis value cannot be null .\r\nsetDelegatedScopes\r\npublic void setDelegatedScopes (ComponentName admin,\r\n String delegatePackage,\r\n List\u003cString\u003e scopes)\r\nCalled by a profile owner or device owner to grant access to privileged APIs to another app. Granted APIs are determined by\r\nscopes , which is a list of the DELEGATION_* constants.\r\nA broadcast with the ACTION_APPLICATION_DELEGATION_SCOPES_CHANGED action will be sent to the delegatePackage with\r\nits new scopes in an ArrayList\u003cString\u003e extra under the EXTRA_DELEGATION_SCOPES key. The broadcast is sent with the\r\nIntent.FLAG_RECEIVER_REGISTERED_ONLY flag.\r\nDelegated scopes are a per-user state. The delegated access is persistent until it is later cleared by calling this method with an\r\nempty scopes list or uninstalling the delegatePackage .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\ndelegatePackage\r\nString : The package name of the app which will be given access.\r\nThis value cannot be null .\r\nscopes\r\nList : The groups of privileged APIs whose access should be granted to delegatedPackage .\r\nThis value cannot be null .\r\nsetDeviceOwnerLockScreenInfo\r\npublic void setDeviceOwnerLockScreenInfo (ComponentName admin,\r\n CharSequence info)\r\nSets the device owner information to be shown on the lock screen.\r\nDevice owner information set using this method overrides any owner information manually set by the user and prevents the\r\nuser from further changing it.\r\nIf the device owner information is null or empty then the device owner info is cleared and the user owner info is shown\r\non the lock screen if it is set.\r\nIf the device owner information contains only whitespaces then the message on the lock screen will be blank and the user\r\nwill not be allowed to change it.\r\nIf the device owner information needs to be localized, it is the responsibility of the DeviceAdminReceiver to listen to the\r\nIntent.ACTION_LOCALE_CHANGED broadcast and set a new version of this string accordingly.\r\nMay be called by the device owner or the profile owner of an organization-owned device.\r\nParameters\r\nadmin\r\nComponentName : The name of the admin component to check. Null if the caller is not a device admin.\r\nThis value may be null .\r\ninfo CharSequence : Device owner information which will be displayed instead of the user owner info.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 144 of 178\n\nsetEndUserSessionMessage\r\npublic void setEndUserSessionMessage (ComponentName admin,\r\n CharSequence endUserSessionMessage)\r\nCalled by a device owner to specify the user session end message. This may be displayed during a user switch.\r\nThe message should be limited to a short statement or it may be truncated.\r\nIf the message needs to be localized, it is the responsibility of the DeviceAdminReceiver to listen to the\r\nIntent.ACTION_LOCALE_CHANGED broadcast and set a new version of this message accordingly.\r\nParameters\r\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nendUserSessionMessage CharSequence : message for ending user session, or null to use system default message.\r\nsetFactoryResetProtectionPolicy\r\npublic void setFactoryResetProtectionPolicy (ComponentName admin,\r\n FactoryResetProtectionPolicy policy)\r\nCallable by device owner or profile owner of an organization-owned device, to set a factory reset protection (FRP) policy.\r\nWhen a new policy is set, the system notifies the FRP management agent of a policy change by broadcasting\r\nACTION_RESET_PROTECTION_POLICY_CHANGED .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\npolicy FactoryResetProtectionPolicy : the new FRP policy, or null to clear the current policy.\r\nsetGlobalPrivateDnsModeOpportunistic\r\npublic int setGlobalPrivateDnsModeOpportunistic (ComponentName admin)\r\nSets the global Private DNS mode to opportunistic. May only be called by the device owner.\r\nIn this mode, the DNS subsystem will attempt a TLS handshake to the network-supplied resolver prior to attempting name\r\nresolution in cleartext.\r\nNote: The device owner won't be able to set the global private DNS mode if there are unaffiliated secondary users or profiles\r\non the device. It's recommended that affiliation ids are set for new users as soon as possible after provisioning via\r\nsetAffiliationIds(ComponentName, Set) .\r\nParameters\r\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nsetGlobalPrivateDnsModeSpecifiedHost\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 145 of 178\n\npublic int setGlobalPrivateDnsModeSpecifiedHost (ComponentName admin,\r\n String privateDnsHost)\r\nSets the global Private DNS host to be used. May only be called by the device owner.\r\nNote that the method is blocking as it will perform a connectivity check to the resolver, to ensure it is valid. Because of that,\r\nthe method should not be called on any thread that relates to user interaction, such as the UI thread.\r\nIn case a VPN is used in conjunction with Private DNS resolver, the Private DNS resolver must be reachable both from\r\nwithin and outside the VPN. Otherwise, the device may lose the ability to resolve hostnames as system traffic to the resolver\r\nmay not go through the VPN.\r\nNote: The device owner won't be able to set the global private DNS mode if there are unaffiliated secondary users or profiles\r\non the device. It's recommended that affiliation ids are set for new users as soon as possible after provisioning via\r\nsetAffiliationIds(ComponentName, Set) .\r\nThis method may take several seconds to complete, so it should only be called from a worker thread.\r\nParameters\r\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nprivateDnsHost\r\nString : The hostname of a server that implements DNS over TLS (RFC7858).\r\nThis value cannot be null .\r\nsetKeepUninstalledPackages\r\npublic void setKeepUninstalledPackages (ComponentName admin,\r\n List\u003cString\u003e packageNames)\r\nSet a list of apps to keep around as APKs even if no user has currently installed it. This function can be called by a device\r\nowner or by a delegate given the DELEGATION_KEEP_UNINSTALLED_PACKAGES scope via setDelegatedScopes(ComponentName,\r\nString, List) .\r\nPlease note that setting this policy does not imply that specified apps will be automatically pre-cached.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if the\r\ncaller is a keep uninstalled packages delegate.\r\npackageNames\r\nList : List of package names to keep cached.\r\nThis value cannot be null .\r\nsetKeyPairCertificate\r\npublic boolean setKeyPairCertificate (ComponentName admin,\r\n String alias,\r\n List\u003cCertificate\u003e certs,\r\n boolean isUserSelectable)\r\nThis API can be called by the following to associate certificates with a key pair that was generated using\r\ngenerateKeyPair(ComponentName, String, KeyGenParameterSpec, int) , and set whether the key is available for the user\r\nto choose in the certificate selection prompt:\r\nDevice owner\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 146 of 178\n\nProfile owner\r\nDelegated certificate installer\r\nCredential management app\r\nFrom Android Build.VERSION_CODES.S , the credential management app can call this API. If called by the credential\r\nmanagement app, the componentName must be null . Note, there can only be a credential management app on an\r\nunmanaged device.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if the\r\ncaller is not a device admin.\r\nalias\r\nString : The private key alias under which to install the certificate. The alias should denote\r\nan existing private key. If a certificate with that alias already exists, it will be overwritten.\r\nThis value cannot be null .\r\ncerts\r\nList : The certificate chain to install. The chain should start with the leaf certificate and include\r\nthe chain of trust in order. This will be returned by KeyChain.getCertificateChain(Context,\r\nString) .\r\nThis value cannot be null .\r\nisUserSelectable\r\nboolean : true to indicate that a user can select this key via the certificate selection prompt,\r\nfalse to indicate that this key can only be granted access by implementing\r\nDeviceAdminReceiver.onChoosePrivateKeyAlias(Context, Intent, int, Uri, String) .\r\nReturns\r\nboolean\r\ntrue if the provided alias exists and the certificates has been successfully associated with it, false\r\notherwise.\r\nThrows\r\nSecurityException\r\nif admin is not null and not a device or profile owner, or admin is null but the calling\r\napplication is not a delegated certificate installer or credential management app.\r\nsetKeyguardDisabled\r\npublic boolean setKeyguardDisabled (ComponentName admin,\r\n boolean disabled)\r\nCalled by a device owner or profile owner of secondary users that is affiliated with the device to disable the keyguard\r\naltogether.\r\nSetting the keyguard to disabled has the same effect as choosing \"None\" as the screen lock type. However, this call has no\r\neffect if a password, pin or pattern is currently set. If a password, pin or pattern is set after the keyguard was disabled, the\r\nkeyguard stops being disabled.\r\nAs of Build.VERSION_CODES.P , this call also dismisses the keyguard if it is currently shown.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\ndisabled boolean : true disables the keyguard, false reenables it.\r\nReturns\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 147 of 178\n\nboolean false if attempting to disable the keyguard while a lock password was in place. true otherwise.\r\nThrows\r\nSecurityException\r\nif admin is not the device owner, or a profile owner of secondary user that is affiliated with\r\nthe device.\r\nsetKeyguardDisabledFeatures\r\npublic void setKeyguardDisabledFeatures (ComponentName admin,\r\n int which)\r\nCalled by an application that is administering the device to disable keyguard customizations, such as widgets. After setting\r\nthis, keyguard features will be disabled according to the provided feature list.\r\nA calling device admin must have requested DeviceAdminInfo.USES_POLICY_DISABLE_KEYGUARD_FEATURES to be able to call\r\nthis method; if it has not, a security exception will be thrown.\r\nCalling this from a managed profile before version Build.VERSION_CODES.M will throw a security exception. From version\r\nBuild.VERSION_CODES.M the profile owner of a managed profile can set:\r\nKEYGUARD_DISABLE_TRUST_AGENTS , which affects the parent user, but only if there is no separate challenge set on the\r\nmanaged profile.\r\nKEYGUARD_DISABLE_FINGERPRINT , KEYGUARD_DISABLE_FACE or KEYGUARD_DISABLE_IRIS which affects the managed\r\nprofile challenge if there is one, or the parent user otherwise.\r\nKEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS which affects notifications generated by applications in the managed\r\nprofile.\r\nFrom version Build.VERSION_CODES.VANILLA_ICE_CREAM , the profile owner of a managed profile can also set\r\nKEYGUARD_DISABLE_WIDGETS_ALL which disables keyguard widgets for the managed profile.\r\nFrom version Build.VERSION_CODES.R the profile owner of an organization-owned managed profile can set:\r\nKEYGUARD_DISABLE_SECURE_CAMERA which affects the parent user when called on the parent profile.\r\nKEYGUARD_DISABLE_SECURE_NOTIFICATIONS which affects the parent user when called on the parent profile.\r\nStarting from version Build.VERSION_CODES.VANILLA_ICE_CREAM the profile owner of an organization-owned managed\r\nprofile can set:\r\nKEYGUARD_DISABLE_WIDGETS_ALL which affects the parent user when called on the parent profile.\r\nKEYGUARD_DISABLE_TRUST_AGENTS , KEYGUARD_DISABLE_FINGERPRINT , KEYGUARD_DISABLE_FACE , KEYGUARD_DISABLE_IRIS ,\r\nKEYGUARD_DISABLE_SECURE_CAMERA and KEYGUARD_DISABLE_SECURE_NOTIFICATIONS can also be set on the\r\nDevicePolicyManager instance returned by getParentProfileInstance(ComponentName) in order to set restrictions on the\r\nparent profile. KEYGUARD_DISABLE_SECURE_CAMERA can only be set on the parent profile instance if the calling device admin\r\nis the profile owner of an organization-owned managed profile.\r\nRequests to disable other features on a managed profile will be ignored.\r\nThe admin can check which features have been disabled by calling getKeyguardDisabledFeatures(ComponentName)\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 148 of 178\n\nwhich\r\nint : The disabled features flag which can be either KEYGUARD_DISABLE_FEATURES_NONE (default),\r\nKEYGUARD_DISABLE_FEATURES_ALL , or a combination of KEYGUARD_DISABLE_WIDGETS_ALL ,\r\nKEYGUARD_DISABLE_SECURE_CAMERA , KEYGUARD_DISABLE_SECURE_NOTIFICATIONS ,\r\nKEYGUARD_DISABLE_TRUST_AGENTS , KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS ,\r\nKEYGUARD_DISABLE_FINGERPRINT , KEYGUARD_DISABLE_FACE , KEYGUARD_DISABLE_IRIS ,\r\nKEYGUARD_DISABLE_SHORTCUTS_ALL .\r\nsetLocationEnabled\r\npublic void setLocationEnabled (ComponentName admin,\r\n boolean locationEnabled)\r\nCalled by device owners to set the user's global location setting.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nlocationEnabled\r\nboolean : whether location should be enabled or disabled. Note: on automotive builds , calls\r\nto disable will be ignored.\r\nsetLockTaskFeatures\r\npublic void setLockTaskFeatures (ComponentName admin,\r\n int flags)\r\nSets which system features are enabled when the device runs in lock task mode. This method doesn't affect the features\r\nwhen lock task mode is inactive. Any system features not included in flags are implicitly disabled when calling this\r\nmethod. By default, only LOCK_TASK_FEATURE_GLOBAL_ACTIONS is enabled; all the other features are disabled. To disable the\r\nglobal actions dialog, call this method omitting LOCK_TASK_FEATURE_GLOBAL_ACTIONS .\r\nThis method can only be called by the device owner, a profile owner of an affiliated user or profile, or the profile owner\r\nwhen no device owner is set or holders of the permission Manifest.permission.MANAGE_DEVICE_POLICY_LOCK_TASK . See\r\nisAffiliatedUser() . Any features set using this method are cleared if the user becomes unaffiliated.\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , after the lock task features policy has been set,\r\nPolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the\r\nadmin on whether the policy was successfully set or not. This callback will contain:\r\nThe policy identifier DevicePolicyIdentifiers.LOCK_TASK_POLICY\r\nThe TargetUser that this policy relates to\r\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\nset or the reason the policy failed to be set (e.g. PolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , lock task features and lock task packages are bundled as one\r\npolicy. A failure to apply one will result in a failure to apply the other.\r\nsetLockTaskPackages\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 149 of 178\n\npublic void setLockTaskPackages (ComponentName admin,\r\n String[] packages)\r\nSets which packages may enter lock task mode.\r\nAny packages that share uid with an allowed package will also be allowed to activate lock task. From\r\nBuild.VERSION_CODES.M removing packages from the lock task package list results in locked tasks belonging to those\r\npackages to be finished.\r\nThis function can only be called by the device owner, a profile owner of an affiliated user or profile, or the profile owner\r\nwhen no device owner is set or holders of the permission Manifest.permission.MANAGE_DEVICE_POLICY_LOCK_TASK . See\r\nisAffiliatedUser() . Any package set via this method will be cleared if the user becomes unaffiliated.\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , after the lock task policy has been set,\r\nPolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the\r\nadmin on whether the policy was successfully set or not. This callback will contain:\r\nThe policy identifier DevicePolicyIdentifiers.LOCK_TASK_POLICY\r\nThe TargetUser that this policy relates to\r\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\nset or the reason the policy failed to be set (e.g. PolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , lock task features and lock task packages are bundled as one\r\npolicy. A failure to apply one will result in a failure to apply the other.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\npackages\r\nString : The list of packages allowed to enter lock task mode.\r\nThis value cannot be null .\r\nSee also:\r\nisAffiliatedUser()\r\nActivity.startLockTask()\r\nDeviceAdminReceiver.onLockTaskModeEntering(Context,Intent,String)\r\nDeviceAdminReceiver.onLockTaskModeExiting(Context,Intent)\r\nUserManager.DISALLOW_CREATE_WINDOWS\r\nsetLogoutEnabled\r\npublic void setLogoutEnabled (ComponentName admin,\r\n boolean enabled)\r\nCalled by a device owner to specify whether logout is enabled for all secondary users. The system may show a logout button\r\nthat stops the user and switches back to the primary user.\r\nParameters\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 150 of 178\n\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nenabled boolean : whether logout should be enabled or not.\r\nsetLongSupportMessage\r\npublic void setLongSupportMessage (ComponentName admin,\r\n CharSequence message)\r\nCalled by a device admin to set the long support message. This will be displayed to the user in the device administrators\r\nsettings screen. If the message is longer than 20000 characters it may be truncated.\r\nIf the long support message needs to be localized, it is the responsibility of the DeviceAdminReceiver to listen to the\r\nIntent.ACTION_LOCALE_CHANGED broadcast and set a new version of this string accordingly.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nmessage CharSequence : Long message to be displayed to the user in settings or null to clear the existing message.\r\nsetManagedProfileCallerIdAccessPolicy\r\npublic void setManagedProfileCallerIdAccessPolicy (PackagePolicy policy)\r\nCalled by a profile owner of a managed profile to set the packages that are allowed to lookup contacts in the managed\r\nprofile based on caller id information.\r\nFor example, the policy determines if a dialer app in the parent profile resolving an incoming call can search the caller id\r\ndata, such as phone number, of managed contacts and return managed contacts that match.\r\nThe calling device admin must be a profile owner of a managed profile. If it is not, a SecurityException will be thrown.\r\nA PackagePolicy.PACKAGE_POLICY_ALLOWLIST_AND_SYSTEM policy type allows access from the OEM default packages for\r\nthe Sms, Dialer and Contact roles, in addition to the packages specified in PackagePolicy.getPackageNames()\r\nParameters\r\npolicy PackagePolicy : the policy to set, setting this value to null will allow all packages\r\nsetManagedProfileContactsAccessPolicy\r\npublic void setManagedProfileContactsAccessPolicy (PackagePolicy policy)\r\nCalled by a profile owner of a managed profile to set the packages that are allowed access to the managed profile contacts\r\nfrom the parent user.\r\nFor example, the system will enforce the provided policy and determine if contacts in the managed profile are shown when\r\nqueried by an application in the parent user.\r\nThe calling device admin must be a profile owner of a managed profile. If it is not, a SecurityException will be thrown.\r\nA PackagePolicy.PACKAGE_POLICY_ALLOWLIST_AND_SYSTEM policy type allows access from the OEM default packages for\r\nthe Sms, Dialer and Contact roles, in addition to the packages specified in PackagePolicy.getPackageNames()\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 151 of 178\n\nParameters\r\npolicy PackagePolicy : the policy to set, setting this value to null will allow all packages\r\nsetManagedProfileMaximumTimeOff\r\npublic void setManagedProfileMaximumTimeOff (ComponentName admin,\r\n long timeoutMillis)\r\nCalled by a profile owner of an organization-owned managed profile to set maximum time the profile is allowed to be turned\r\noff. If the profile is turned off for longer, personal apps are suspended on the device.\r\nWhen personal apps are suspended, an ongoing notification about that is shown to the user. When the user taps the\r\nnotification, system invokes ACTION_CHECK_POLICY_COMPLIANCE in the profile owner package. Profile owner\r\nimplementation that uses personal apps suspension must handle this intent.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\ntimeoutMillis\r\nlong : Maximum time the profile is allowed to be off in milliseconds or 0 if not limited. The\r\nminimum non-zero value corresponds to 72 hours. If an admin sets a smaller non-zero value, 72\r\nhours will be set instead.\r\nsetManagedSubscriptionsPolicy\r\npublic void setManagedSubscriptionsPolicy (ManagedSubscriptionsPolicy policy)\r\nCalled by a profile owner of an organization-owned device to specify ManagedSubscriptionsPolicy\r\nManaged subscriptions policy controls how SIMs would be associated with the managed profile. For example a policy of\r\ntype ManagedSubscriptionsPolicy.TYPE_ALL_MANAGED_SUBSCRIPTIONS assigns all SIM-based subscriptions to the managed\r\nprofile. In this case OEM default dialer and messages app are automatically installed in the managed profile and all\r\nincoming and outgoing calls and text messages are handled by them.\r\nThis API can only be called during device setup.\r\nParameters\r\npolicy\r\nManagedSubscriptionsPolicy : ManagedSubscriptionsPolicy policy, passing null for this resets the\r\npolicy to be the default.\r\nsetMasterVolumeMuted\r\npublic void setMasterVolumeMuted (ComponentName admin,\r\n boolean on)\r\nCalled by profile or device owners to set the global volume mute on or off. This has no effect when set on a managed\r\nprofile.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 152 of 178\n\non boolean : true to mute global volume, false to turn mute off.\r\nsetMaximumFailedPasswordsForWipe\r\npublic void setMaximumFailedPasswordsForWipe (ComponentName admin,\r\n int num)\r\nSetting this to a value greater than zero enables a policy that will perform a device or profile wipe after too many incorrect\r\ndevice-unlock passwords have been entered. This policy combines watching for failed passwords and wiping the device, and\r\nrequires that calling Device Admins request both DeviceAdminInfo.USES_POLICY_WATCH_LOGIN and\r\nDeviceAdminInfo.USES_POLICY_WIPE_DATA }.\r\nWhen this policy is set on the system or the main user, the device will be factory reset after too many incorrect password\r\nattempts. When set on any other user, only the corresponding user or profile will be wiped.\r\nTo implement any other policy (e.g. wiping data for a particular application only, erasing or revoking credentials, or\r\nreporting the failure to a server), you should implement\r\nDeviceAdminReceiver.onPasswordFailed(Context,android.content.Intent) instead. Do not use this API, because if the\r\nmaximum count is reached, the device or profile will be wiped immediately, and your callback will not be invoked.\r\nThis method can be called on the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName)\r\nin order to set a value on the parent profile. This allows a profile wipe after too many incorrect device-unlock password have\r\nbeen entered on the parent profile even if each profile has a separate challenge.\r\nOn devices not supporting PackageManager.FEATURE_SECURE_LOCK_SCREEN feature, the password is always empty and this\r\nmethod has no effect - i.e. the policy is not set.\r\nRequires the PackageManager#FEATURE_SECURE_LOCK_SCREEN feature which can be detected using\r\nPackageManager.hasSystemFeature(String) .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\nnum int : The number of failed password attempts at which point the device or profile will be wiped.\r\nsetMaximumTimeToLock\r\npublic void setMaximumTimeToLock (ComponentName admin,\r\n long timeMs)\r\nCalled by an application that is administering the device to set the maximum time for user activity until the device will lock.\r\nThis limits the length that the user can set. It takes effect immediately.\r\nA calling device admin must have requested DeviceAdminInfo.USES_POLICY_FORCE_LOCK to be able to call this method; if it\r\nhas not, a security exception will be thrown.\r\nThis method can be called on the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName)\r\nin order to set restrictions on the parent profile.\r\nParameters\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 153 of 178\n\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\ntimeMs long : The new desired maximum time to lock in milliseconds. A value of 0 means there is no restriction.\r\nsetMeteredDataDisabledPackages\r\npublic List\u003cString\u003e setMeteredDataDisabledPackages (ComponentName admin,\r\n List\u003cString\u003e packageNames)\r\nCalled by a device or profile owner to restrict packages from using metered data.\r\nParameters\r\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\npackageNames\r\nList : the list of package names to be restricted.\r\nThis value cannot be null .\r\nReturns\r\nList\u003cString\u003e\r\na list of package names which could not be restricted.\r\nThis value cannot be null .\r\nsetMinimumRequiredWifiSecurityLevel\r\npublic void setMinimumRequiredWifiSecurityLevel (int level)\r\nCalled by device owner or profile owner of an organization-owned managed profile to specify the minimum security level\r\nrequired for Wi-Fi networks. The device may not connect to networks that do not meet the minimum security level. If the\r\ncurrent network does not meet the minimum security level set, it will be disconnected. The following shows the Wi-Fi\r\nsecurity levels from the lowest to the highest security level: WIFI_SECURITY_OPEN WIFI_SECURITY_PERSONAL\r\nWIFI_SECURITY_ENTERPRISE_EAP WIFI_SECURITY_ENTERPRISE_192\r\nsetMtePolicy\r\npublic void setMtePolicy (int policy)\r\nCalled by a device owner, profile owner of an organization-owned device, to set the Memory Tagging Extension (MTE)\r\npolicy. MTE is a CPU extension that allows to protect against certain classes of security problems at a small runtime\r\nperformance cost overhead.\r\nThe MTE policy can only be set to MTE_DISABLED if called by a device owner. Otherwise a SecurityException will be\r\nthrown.\r\nThe device needs to be rebooted to apply changes to the MTE policy.\r\nsetNearbyAppStreamingPolicy\r\npublic void setNearbyAppStreamingPolicy (int policy)\r\nCalled by a device/profile owner to set nearby app streaming policy. App streaming is when the device starts an app on a\r\nvirtual display and sends a video stream of the app to nearby devices.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 154 of 178\n\nsetNearbyNotificationStreamingPolicy\r\npublic void setNearbyNotificationStreamingPolicy (int policy)\r\nCalled by a device/profile owner to set nearby notification streaming policy. Notification streaming is sending notification\r\ndata from pre-installed apps to nearby devices.\r\nsetNetworkLoggingEnabled\r\npublic void setNetworkLoggingEnabled (ComponentName admin,\r\n boolean enabled)\r\nCalled by a device owner, profile owner of a managed profile or delegated app with DELEGATION_NETWORK_LOGGING to\r\ncontrol the network logging feature.\r\nSupported for a device owner from Android 8 and a delegated app granted by a device owner from Android 10. Supported\r\nfor a profile owner of a managed profile and a delegated app granted by a profile owner from Android 12. When network\r\nlogging is enabled by a profile owner, the network logs will only include work profile network activity, not activity on the\r\npersonal profile.\r\nNetwork logs contain DNS lookup and connect() library call events. The following library functions are recorded while\r\nnetwork logging is active:\r\ngetaddrinfo()\r\ngethostbyname()\r\nconnect()\r\nNetwork logging is a low-overhead tool for forensics but it is not guaranteed to use full system call logging; event reporting\r\nis enabled by default for all processes but not strongly enforced. Events from applications using alternative implementations\r\nof libc, making direct kernel calls, or deliberately obfuscating traffic may not be recorded.\r\nSome common network events may not be reported. For example:\r\nApplications may hardcode IP addresses to reduce the number of DNS lookups, or use an alternative system for name\r\nresolution, and so avoid calling getaddrinfo() or gethostbyname .\r\nApplications may use datagram sockets for performance reasons, for example for a game client. Calling connect()\r\nis unnecessary for this kind of socket, so it will not trigger a network event.\r\nIt is possible to directly intercept layer 3 traffic leaving the device using an always-on VPN service. See\r\nsetAlwaysOnVpnPackage(ComponentName,String,boolean) and VpnService for details.\r\nNote: The device owner won't be able to retrieve network logs if there are unaffiliated secondary users or profiles on the\r\ndevice, regardless of whether the feature is enabled. Logs will be discarded if the internal buffer fills up while waiting for all\r\nusers to become affiliated. Therefore it's recommended that affiliation ids are set for new users as soon as possible after\r\nprovisioning via setAffiliationIds(ComponentName, Set) .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if called by a\r\ndelegated app.\r\nenabled boolean : whether network logging should be enabled or not.\r\nsetOrganizationColor\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 155 of 178\n\npublic void setOrganizationColor (ComponentName admin,\r\n int color)\r\nThis method was deprecated in API level 31.\r\nFrom Build.VERSION_CODES.R , the organization color is never used as the background color of the confirm credentials\r\nscreen.\r\nCalled by a profile owner of a managed profile to set the color used for customization. This color is used as background\r\ncolor of the confirm credentials screen for that user. The default color is teal (#00796B).\r\nThe confirm credentials screen can be created using\r\nKeyguardManager.createConfirmDeviceCredentialIntent(CharSequence, CharSequence) .\r\nStarting from Android R, the organization color will no longer be used as the background color of the confirm credentials\r\nscreen.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\ncolor int : The 24bit (0xRRGGBB) representation of the color to be used.\r\nsetOrganizationId\r\npublic void setOrganizationId (String enterpriseId)\r\nSets the Enterprise ID for the work profile or managed device. This is a requirement for generating an enrollment-specific\r\nID for the device, see getEnrollmentSpecificId() . It is recommended that the Enterprise ID is at least 6 characters long,\r\nand no more than 64 characters.\r\nParameters\r\nenterpriseId\r\nString : An identifier of the organization this work profile or device is enrolled into.\r\nThis value cannot be null .\r\nsetOrganizationName\r\npublic void setOrganizationName (ComponentName admin,\r\n CharSequence title)\r\nCalled by the device owner (since API 26) or profile owner (since API 24) to set the name of the organization under\r\nmanagement.\r\nIf the organization name needs to be localized, it is the responsibility of the caller to listen to the\r\nIntent.ACTION_LOCALE_CHANGED broadcast and set a new version of this string accordingly.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\ntitle CharSequence : The organization name or null to clear a previously set name.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 156 of 178\n\nsetOverrideApnsEnabled\r\npublic void setOverrideApnsEnabled (ComponentName admin,\r\n boolean enabled)\r\nCalled by device owner to set if override APNs should be enabled.\r\nOverride APNs are separated from other APNs on the device, and can only be inserted or modified by the device owner.\r\nWhen enabled, only override APNs are in use, any other APNs are ignored.\r\nNote: Enterprise APNs added by managed profile owners do not need to be enabled by this API. They are part of the\r\npreferential network service config and is controlled by setPreferentialNetworkServiceConfigs(List) .\r\nParameters\r\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nenabled boolean : true if override APNs should be enabled, false otherwise\r\nsetPackagesSuspended\r\npublic String[] setPackagesSuspended (ComponentName admin,\r\n String[] packageNames,\r\n boolean suspended)\r\nCalled by device or profile owners to suspend packages for this user. This function can be called by a device owner, profile\r\nowner, or by a delegate given the DELEGATION_PACKAGE_ACCESS scope via setDelegatedScopes(ComponentName, String,\r\nList) .\r\nA suspended package will not be able to start activities. Its notifications will be hidden, it will not show up in recents, will\r\nnot be able to show toasts or dialogs or ring the device.\r\nThe package must already be installed. If the package is uninstalled while suspended the package will no longer be\r\nsuspended. The admin can block this by using setUninstallBlocked(ComponentName, String, boolean) .\r\nSome apps cannot be suspended, such as device admins, the active launcher, the required package installer, the required\r\npackage uninstaller, the required package verifier, the default dialer, and the permission controller.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is\r\nnot a device admin.\r\nThis value may be null .\r\npackageNames\r\nString : The package names to suspend or unsuspend.\r\nThis value cannot be null .\r\nsuspended\r\nboolean : If set to true than the packages will be suspended, if set to false the packages will be\r\nunsuspended.\r\nReturns\r\nString[]\r\nan array of package names for which the suspended status is not set as requested in this method.\r\nThis value cannot be null .\r\nsetPasswordExpirationTimeout\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 157 of 178\n\npublic void setPasswordExpirationTimeout (ComponentName admin,\r\n long timeout)\r\nCalled by a device admin to set the password expiration timeout. Calling this method will restart the countdown for\r\npassword expiration for the given admin, as will changing the device password (for all admins).\r\nThe provided timeout is the time delta in ms and will be added to the current time. For example, to have the password expire\r\n5 days from now, timeout would be 5 * 86400 * 1000 = 432000000 ms for timeout.\r\nTo disable password expiration, a value of 0 may be used for timeout.\r\nOn devices not supporting PackageManager.FEATURE_SECURE_LOCK_SCREEN feature, the password expiration is always\r\ndisabled.\r\nA calling device admin must have requested DeviceAdminInfo.USES_POLICY_EXPIRE_PASSWORD to be able to call this\r\nmethod; if it has not, a security exception will be thrown.\r\nNote that setting the password will automatically reset the expiration time for all active admins. Active admins do not need\r\nto explicitly call this method in that case.\r\nThis method can be called on the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName)\r\nin order to set restrictions on the parent profile.\r\nRequires the PackageManager#FEATURE_SECURE_LOCK_SCREEN feature which can be detected using\r\nPackageManager.hasSystemFeature(String) .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\ntimeout\r\nlong : The limit (in ms) that a password can remain in effect. A value of 0 means there is no restriction\r\n(unlimited).\r\nsetPasswordMinimumLength\r\npublic void setPasswordMinimumLength (ComponentName admin,\r\n int length)\r\nThis method was deprecated in API level 31.\r\nsee setPasswordQuality(ComponentName,int) for details.\r\nCalled by an application that is administering the device to set the minimum allowed password length. After setting this, the\r\nuser will not be able to enter a new password that is not at least as restrictive as what has been set. Note that the current\r\npassword will remain until the user has set a new one, so the change does not take place immediately. To prompt the user for\r\na new password, use ACTION_SET_NEW_PASSWORD or ACTION_SET_NEW_PARENT_PROFILE_PASSWORD after setting this value.\r\nThis constraint is only imposed if the administrator has also requested either PASSWORD_QUALITY_NUMERIC ,\r\nPASSWORD_QUALITY_NUMERIC_COMPLEX , PASSWORD_QUALITY_ALPHABETIC , PASSWORD_QUALITY_ALPHANUMERIC , or\r\nPASSWORD_QUALITY_COMPLEX with setPasswordQuality(ComponentName, int) . If an app targeting SDK level\r\nBuild.VERSION_CODES.R and above enforces this constraint without settings password quality to one of these values first,\r\nthis method will throw IllegalStateException .\r\nOn devices not supporting PackageManager.FEATURE_SECURE_LOCK_SCREEN feature, the password is always treated as empty.\r\nThe calling device admin must have requested DeviceAdminInfo.USES_POLICY_LIMIT_PASSWORD to be able to call this\r\nmethod; if it has not, a security exception will be thrown.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 158 of 178\n\nApps targeting Build.VERSION_CODES.R and below can call this method on the DevicePolicyManager instance returned by\r\ngetParentProfileInstance(ComponentName) in order to set restrictions on the parent profile.\r\nNote: this method is ignored on {PackageManager#FEATURE_AUTOMOTIVE automotive builds}.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nlength int : The new desired minimum password length. A value of 0 means there is no restriction.\r\nsetPasswordQuality\r\npublic void setPasswordQuality (ComponentName admin,\r\n int quality)\r\nThis method was deprecated in API level 31.\r\nPrefer using setRequiredPasswordComplexity(int) , to require a password that satisfies a complexity level defined by the\r\nplatform, rather than specifying custom password requirement. Setting custom, overly-complicated password requirements\r\nleads to passwords that are hard for users to remember and may not provide any security benefits given as Android uses\r\nhardware-backed throttling to thwart online and offline brute-forcing of the device's screen lock. Company-owned devices\r\n(fully-managed and organization-owned managed profile devices) are able to continue using this method, though it is\r\nrecommended that setRequiredPasswordComplexity(int) should be used instead.\r\nCalled by an application that is administering the device to set the password restrictions it is imposing. After setting this, the\r\nuser will not be able to enter a new password that is not at least as restrictive as what has been set. Note that the current\r\npassword will remain until the user has set a new one, so the change does not take place immediately. To prompt the user for\r\na new password, use ACTION_SET_NEW_PASSWORD or ACTION_SET_NEW_PARENT_PROFILE_PASSWORD after calling this method.\r\nQuality constants are ordered so that higher values are more restrictive; thus the highest requested quality constant (between\r\nthe policy set here, the user's preference, and any other considerations) is the one that is in effect.\r\nOn devices not supporting PackageManager.FEATURE_SECURE_LOCK_SCREEN feature, the password is always treated as empty.\r\nThe calling device admin must have requested DeviceAdminInfo.USES_POLICY_LIMIT_PASSWORD to be able to call this\r\nmethod; if it has not, a security exception will be thrown.\r\nApps targeting Build.VERSION_CODES.R and below can call this method on the DevicePolicyManager instance returned by\r\ngetParentProfileInstance(ComponentName) in order to set restrictions on the parent profile. Apps targeting\r\nBuild.VERSION_CODES.S and above, with the exception of a profile owner on an organization-owned device (as can be\r\nidentified by isOrganizationOwnedDeviceWithManagedProfile() ), will get a IllegalArgumentException when calling this\r\nmethod on the parent DevicePolicyManager instance.\r\nNote: Specifying password requirements using this method clears the password complexity requirements set using\r\nsetRequiredPasswordComplexity(int) . If this method is called on the DevicePolicyManager instance returned by\r\ngetParentProfileInstance(ComponentName) , then password complexity requirements set on the primary\r\nDevicePolicyManager must be cleared first by calling setRequiredPasswordComplexity(int) with\r\nPASSWORD_COMPLEXITY_NONE first.\r\nNote: this method is ignored on {PackageManager#FEATURE_AUTOMOTIVE automotive builds}.\r\nsetPermissionGrantState\r\npublic boolean setPermissionGrantState (ComponentName admin,\r\n String packageName,\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 159 of 178\n\nString permission,\r\n int grantState)\r\nSets the grant state of a runtime permission for a specific application. The state can be default in which a user can manage\r\nit through the UI, denied , in which the permission is denied and the user cannot manage it through the UI, and granted\r\nin which the permission is granted and the user cannot manage it through the UI. This method can only be called by a profile\r\nowner, device owner, or a delegate given the DELEGATION_PERMISSION_GRANT scope via\r\nsetDelegatedScopes(ComponentName, String, List) .\r\nNote that user cannot manage other permissions in the affected group through the UI either and their granted state will be\r\nkept as the current value. Thus, it's recommended that you set the grant state of all the permissions in the affected group.\r\nSetting the grant state to default does not revoke the permission. It retains the previous grant, if any.\r\nDevice admins with a targetSdkVersion \u003c Build.VERSION_CODES.Q cannot grant and revoke permissions for applications\r\nbuilt with a targetSdkVersion \u003c Build.VERSION_CODES.M .\r\nAdmins with a targetSdkVersion ≥ Build.VERSION_CODES.Q can grant and revoke permissions of all apps. Similar to the\r\nuser revoking a permission from a application built with a targetSdkVersion \u003c Build.VERSION_CODES.M the app-op\r\nmatching the permission is set to AppOpsManager.MODE_IGNORED , but the permission stays granted.\r\nNOTE: On devices running Build.VERSION_CODES.S and above, control over the following, sensors-related, permissions is\r\nrestricted:\r\nManifest.permission.ACCESS_FINE_LOCATION\r\nManifest.permission.ACCESS_BACKGROUND_LOCATION\r\nManifest.permission.ACCESS_COARSE_LOCATION\r\nManifest.permission.CAMERA\r\nManifest.permission.RECORD_AUDIO\r\nManifest.permission.RECORD_BACKGROUND_AUDIO\r\nManifest.permission.ACTIVITY_RECOGNITION\r\nManifest.permission.BODY_SENSORS\r\nOn devices running Build.VERSION_CODES.BAKLAVA , the HealthPermissions are also included in the restricted list.\r\nA profile owner may not grant these permissions (i.e. call this method with any of the permissions listed above and\r\ngrantState of #PERMISSION_GRANT_STATE_GRANTED ), but may deny them.\r\nA device owner, by default, may continue granting these permissions. However, for increased user control, the admin may\r\nopt out of controlling grants for these permissions by including EXTRA_PROVISIONING_SENSORS_PERMISSION_GRANT_OPT_OUT\r\nin the provisioning parameters. In that case the device owner's control will be limited to denying these permissions.\r\nWhen sensor-related permissions aren't grantable due to the above cases, calling this method to grant these permissions will\r\nsilently fail, if device admins are built with targetSdkVersion \u003c Build.VERSION_CODES.VANILLA_ICE_CREAM . If they are\r\nbuilt with targetSdkVersion \u003e= Build.VERSION_CODES.VANILLA_ICE_CREAM , this method will throw a\r\nSecurityException .\r\nNOTE: On devices running Build.VERSION_CODES.S and above, control over the following permissions are restricted for\r\nmanaged profile owners:\r\nManifest.permission.READ_SMS\r\nA managed profile owner may not grant these permissions (i.e. call this method with any of the permissions listed above and\r\ngrantState of #PERMISSION_GRANT_STATE_GRANTED ), but may deny them.\r\nAttempts by the admin to grant these permissions, when the admin is restricted from doing so, will be silently ignored (no\r\nexception will be thrown). Control over the following permissions are restricted for managed profile owners:\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 160 of 178\n\nManifest.permission.READ_SMS\r\nA managed profile owner may not grant these permissions (i.e. call this method with any of the permissions listed above and\r\ngrantState of #PERMISSION_GRANT_STATE_GRANTED ), but may deny them.\r\nReturns\r\nboolean whether the permission was successfully granted or revoked.\r\nSee also:\r\nPERMISSION_GRANT_STATE_DENIED\r\nPERMISSION_GRANT_STATE_DEFAULT\r\nPERMISSION_GRANT_STATE_GRANTED\r\nsetDelegatedScopes(ComponentName, String, List)\r\nDELEGATION_PERMISSION_GRANT\r\nsetPermissionPolicy\r\npublic void setPermissionPolicy (ComponentName admin,\r\n int policy)\r\nSet the default response for future runtime permission requests by applications. This function can be called by a device\r\nowner, profile owner, or by a delegate given the DELEGATION_PERMISSION_GRANT scope via\r\nsetDelegatedScopes(ComponentName, String, List) . The policy can allow for normal operation which prompts the user\r\nto grant a permission, or can allow automatic granting or denying of runtime permission requests by an application. This\r\nalso applies to new permissions declared by app updates. When a permission is denied or granted this way, the effect is\r\nequivalent to setting the permission * grant state via setPermissionGrantState(ComponentName, String, String, int) .\r\nAs this policy only acts on runtime permission requests, it only applies to applications built with a targetSdkVersion of\r\nBuild.VERSION_CODES.M or later.\r\nNOTE: On devices running Build.VERSION_CODES.S and above, an auto-grant policy will not apply to certain sensors-related permissions on some configurations. See setPermissionGrantState(ComponentName,String,String,int) for the list\r\nof permissions affected, and the behavior change for managed profiles and fully-managed devices.\r\nSee also:\r\nsetPermissionGrantState(ComponentName, String, String, int)\r\nsetDelegatedScopes(ComponentName, String, List)\r\nDELEGATION_PERMISSION_GRANT\r\nsetPermittedAccessibilityServices\r\npublic boolean setPermittedAccessibilityServices (ComponentName admin,\r\n List\u003cString\u003e packageNames)\r\nCalled by a profile or device owner to set the permitted AccessibilityService . When set by a device owner or profile\r\nowner the restriction applies to all profiles of the user the device owner or profile owner is an admin for. By default, the user\r\ncan use any accessibility service. When zero or more packages have been added, accessibility services that are not in the list\r\nand not part of the system can not be enabled by the user.\r\nCalling with a null value for the list disables the restriction so that all services can be used, calling with an empty list only\r\nallows the built-in system services. Any non-system accessibility service that's currently enabled must be included in the list.\r\nSystem accessibility services are always available to the user and this method can't disable them.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 161 of 178\n\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\npackageNames List : List of accessibility service package names.\r\nReturns\r\nboolean\r\ntrue if the operation succeeded, or false if the list didn't contain every enabled non-system\r\naccessibility service.\r\nsetPermittedCrossProfileNotificationListeners\r\npublic boolean setPermittedCrossProfileNotificationListeners (ComponentName admin,\r\n List\u003cString\u003e packageList)\r\nCalled by a profile owner of a managed profile to set the packages that are allowed to use a NotificationListenerService\r\nin the primary user to see notifications from the managed profile. By default all packages are permitted by this policy. When\r\nzero or more packages have been added, notification listeners installed on the primary user that are not in the list and are not\r\npart of the system won't receive events for managed profile notifications.\r\nCalling with a null value for the list disables the restriction so that all notification listener services be used. Calling with\r\nan empty list disables all but the system's own notification listeners. System notification listener services are always\r\navailable to the user.\r\nIf a device or profile owner want to stop notification listeners in their user from seeing that user's notifications they should\r\nprevent that service from running instead (e.g. via setApplicationHidden(ComponentName,String,boolean) )\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\npackageList\r\nList : List of package names to allowlist.\r\nThis value may be null .\r\nReturns\r\nboolean true if setting the restriction succeeded. It will fail if called outside a managed profile\r\nsetPermittedInputMethods\r\npublic boolean setPermittedInputMethods (ComponentName admin,\r\n List\u003cString\u003e packageNames)\r\nCalled by a profile or device owner or holder of the Manifest.permission.MANAGE_DEVICE_POLICY_INPUT_METHODS\r\npermission to set the permitted input methods services for this user. By default, the user can use any input method.\r\nThis method can be called on the DevicePolicyManager instance, returned by\r\ngetParentProfileInstance(ComponentName) , where the caller must be a profile owner of an organization-owned device.\r\nIf called on the parent instance:\r\nThe permitted input methods will be applied on the personal profile\r\nCan only permit all input methods (calling this method with a null package list) or only permit system input\r\nmethods (calling this method with an empty package list). This is to prevent the caller from learning which packages\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 162 of 178\n\nare installed on the personal side\r\nWhen zero or more packages have been added, input method that are not in the list and not part of the system can not be\r\nenabled by the user. This method will fail if it is called for a admin that is not for the foreground user or a profile of the\r\nforeground user. Any non-system input method service that's currently enabled must be included in the list.\r\nCalling with a null value for the list disables the restriction so that all input methods can be used, calling with an empty list\r\ndisables all but the system's own input methods.\r\nSystem input methods are always available to the user - this method can't modify this.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is\r\nnot a device admin.\r\nThis value may be null .\r\npackageNames List : List of input method package names.\r\nReturns\r\nboolean\r\ntrue if the operation succeeded, or false if the list didn't contain every enabled non-system input\r\nmethod service.\r\nsetPersonalAppsSuspended\r\npublic void setPersonalAppsSuspended (ComponentName admin,\r\n boolean suspended)\r\nCalled by a profile owner of an organization-owned managed profile to suspend personal apps on the device. When personal\r\napps are suspended the device can only be used for calls.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nsuspended boolean : Whether personal apps should be suspended.\r\nsetPreferentialNetworkServiceConfigs\r\npublic void setPreferentialNetworkServiceConfigs (List\u003cPreferentialNetworkServiceConfig\u003e preferentialNetworkSe\r\nSets preferential network configurations. An example of a supported preferential network service is the Enterprise slice on\r\n5G networks. For devices on 4G networks, the profile owner needs to additionally configure enterprise APN to set up data\r\ncall for the preferential network service. These APNs can be added using addOverrideApn(ComponentName, ApnSetting) .\r\nBy default, preferential network service is disabled on the work profile and fully managed devices, on supported carriers and\r\ndevices. Admins can explicitly enable it with this API. If admin wants to have multiple enterprise slices, it can be configured\r\nby passing list of PreferentialNetworkServiceConfig objects.\r\nParameters\r\npreferentialNetworkServiceConfigs\r\nList : list of preferential network configurations.\r\nThis value cannot be null .\r\nsetPreferentialNetworkServiceEnabled\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 163 of 178\n\npublic void setPreferentialNetworkServiceEnabled (boolean enabled)\r\nSets whether preferential network service is enabled. For example, an organization can have a deal/agreement with a carrier\r\nthat all of the work data from its employees\\u2019 devices will be sent via a network service dedicated for enterprise use.\r\nAn example of a supported preferential network service is the Enterprise slice on 5G networks. For devices on 4G networks,\r\nthe profile owner needs to additionally configure enterprise APN to set up data call for the preferential network service.\r\nThese APNs can be added using addOverrideApn(ComponentName, ApnSetting) . By default, preferential network service is\r\ndisabled on the work profile and fully managed devices, on supported carriers and devices. Admins can explicitly enable it\r\nwith this API.\r\nThis method enables preferential network service with a default configuration. To fine-tune the configuration, use\r\nsetPreferentialNetworkServiceConfigs(List) instead.\r\nBefore Android version Build.VERSION_CODES.TIRAMISU : this method can be called by the profile owner of a managed\r\nprofile.\r\nStarting from Android version Build.VERSION_CODES.TIRAMISU : This method can be called by the profile owner of a\r\nmanaged profile or device owner.\r\nParameters\r\nenabled boolean : whether preferential network service should be enabled.\r\nsetProfileEnabled\r\npublic void setProfileEnabled (ComponentName admin)\r\nSets the enabled state of the profile. A profile should be enabled only once it is ready to be used. Only the profile owner can\r\ncall this.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nsetProfileName\r\npublic void setProfileName (ComponentName admin,\r\n String profileName)\r\nSets the name of the profile. In the device owner case it sets the name of the user which it is called from. Only a profile\r\nowner or device owner can call this. If this is never called by the profile or device owner, the name will be set to default\r\nvalues.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associate with.\r\nThis value cannot be null .\r\nprofileName String : The name of the profile. If the name is longer than 200 characters it will be truncated.\r\nsetRecommendedGlobalProxy\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 164 of 178\n\npublic void setRecommendedGlobalProxy (ComponentName admin,\r\n ProxyInfo proxyInfo)\r\nSet a network-independent global HTTP proxy. This is not normally what you want for typical HTTP proxies - they are\r\ngenerally network dependent. However if you're doing something unusual like general internal filtering this may be useful.\r\nOn a private network where the proxy is not accessible, you may break HTTP using this.\r\nThis method requires the caller to be the device owner.\r\nThis proxy is only a recommendation and it is possible that some apps will ignore it.\r\nNote: The device owner won't be able to set a global HTTP proxy if there are unaffiliated secondary users or profiles on the\r\ndevice. It's recommended that affiliation ids are set for new users as soon as possible after provisioning via\r\nsetAffiliationIds(ComponentName, Set) .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nproxyInfo\r\nProxyInfo : The a ProxyInfo object defining the new global HTTP proxy. A null value will clear\r\nthe global HTTP proxy.\r\nsetRequiredPasswordComplexity\r\npublic void setRequiredPasswordComplexity (int passwordComplexity)\r\nSets a minimum password complexity requirement for the user's screen lock. The complexity level is one of the pre-defined\r\nlevels, and the user is unable to set a password with a lower complexity level.\r\nNote that when called on a profile which uses an unified challenge with its parent, the complexity would apply to the unified\r\nchallenge.\r\nThis method can be called on the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName)\r\nin order to set restrictions on the parent profile.\r\nNote: Specifying password requirements using this method clears any password requirements set using the obsolete\r\nsetPasswordQuality(ComponentName,int) and any of its associated methods. Additionally, if there are password\r\nrequirements set using the obsolete setPasswordQuality(ComponentName,int) on the parent DevicePolicyManager\r\ninstance, they must be cleared by calling setPasswordQuality(ComponentName,int) with PASSWORD_QUALITY_UNSPECIFIED\r\non that instance prior to setting complexity requirement for the managed profile. Starting from\r\nBuild.VERSION_CODES.VANILLA_ICE_CREAM , after the password requirement has been set,\r\nPolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the\r\nadmin on whether the policy was successfully set or not. This callback will contain:\r\nThe policy identifier DevicePolicyIdentifiers.PASSWORD_COMPLEXITY_POLICY\r\nThe TargetUser that this policy relates to\r\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\nset or the reason the policy failed to be set e.g. PolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nsetRequiredStrongAuthTimeout\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 165 of 178\n\npublic void setRequiredStrongAuthTimeout (ComponentName admin,\r\n long timeoutMs)\r\nCalled by a device/profile owner to set the timeout after which unlocking with secondary, non strong auth (e.g. fingerprint,\r\nface, trust agents) times out, i.e. the user has to use a strong authentication method like password, pin or pattern.\r\nThis timeout is used internally to reset the timer to require strong auth again after specified timeout each time it has been\r\nsuccessfully used.\r\nFingerprint can also be disabled altogether using KEYGUARD_DISABLE_FINGERPRINT .\r\nTrust agents can also be disabled altogether using KEYGUARD_DISABLE_TRUST_AGENTS .\r\nA calling device admin can verify the value it has set by calling getRequiredStrongAuthTimeout(ComponentName) and\r\npassing in its instance.\r\nThis method can be called on the DevicePolicyManager instance returned by getParentProfileInstance(ComponentName)\r\nin order to set restrictions on the parent profile.\r\nOn devices not supporting PackageManager.FEATURE_SECURE_LOCK_SCREEN feature, calling this methods has no effect - i.e.\r\nthe timeout is not set.\r\nRequires the PackageManager#FEATURE_SECURE_LOCK_SCREEN feature which can be detected using\r\nPackageManager.hasSystemFeature(String) .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\ntimeoutMs\r\nlong : The new timeout in milliseconds, after which the user will have to unlock with strong\r\nauthentication method. A value of 0 means the admin is not participating in controlling the timeout. The\r\nminimum and maximum timeouts are platform-defined and are typically 1 hour and 72 hours,\r\nrespectively. Though discouraged, the admin may choose to require strong auth at all times using\r\nKEYGUARD_DISABLE_FINGERPRINT and/or KEYGUARD_DISABLE_TRUST_AGENTS .\r\nsetResetPasswordToken\r\npublic boolean setResetPasswordToken (ComponentName admin,\r\n byte[] token)\r\nCalled by a profile or device owner to provision a token which can later be used to reset the device lockscreen password (if\r\ncalled by device owner), or managed profile challenge (if called by profile owner), via\r\nresetPasswordWithToken(ComponentName, String, byte, int) .\r\nIf the user currently has a lockscreen password, the provisioned token will not be immediately usable; it only becomes active\r\nafter the user performs a confirm credential operation, which can be triggered by\r\nKeyguardManager.createConfirmDeviceCredentialIntent . If the user has no lockscreen password, the token is activated\r\nimmediately. In all cases, the active state of the current token can be checked by\r\nisResetPasswordTokenActive(ComponentName) . For security reasons, un-activated tokens are only stored in memory and\r\nwill be lost once the device reboots. In this case a new token needs to be provisioned again.\r\nOnce provisioned and activated, the token will remain effective even if the user changes or clears the lockscreen password.\r\nThis token is highly sensitive and should be treated at the same level as user credentials. In particular, NEVER store this\r\ntoken on device in plaintext. Do not store the plaintext token in device-encrypted storage if it will be needed to reset\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 166 of 178\n\npassword on file-based encryption devices before user unlocks. Consider carefully how any password token will be stored on\r\nyour server and who will need access to them. Tokens may be the subject of legal access requests.\r\nOn devices not supporting PackageManager.FEATURE_SECURE_LOCK_SCREEN feature, the reset token is not set and this method\r\nreturns false.\r\nRequires the PackageManager#FEATURE_SECURE_LOCK_SCREEN feature which can be detected using\r\nPackageManager.hasSystemFeature(String) .\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\ntoken\r\nbyte : a secure token a least 32-byte long, which must be generated by a cryptographically strong random\r\nnumber generator.\r\nReturns\r\nboolean true if the operation is successful, false otherwise.\r\nsetRestrictionsProvider\r\npublic void setRestrictionsProvider (ComponentName admin,\r\n ComponentName provider)\r\nDesignates a specific service component as the provider for making permission requests of a local or remote administrator of\r\nthe user.\r\nOnly a device owner or profile owner can designate the restrictions provider.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nprovider\r\nComponentName : The component name of the service that implements RestrictionsReceiver . If this\r\nparam is null, it removes the restrictions provider previously assigned.\r\nsetScreenCaptureDisabled\r\npublic void setScreenCaptureDisabled (ComponentName admin,\r\n boolean disabled)\r\nCalled by a device/profile owner to set whether the screen capture is disabled. Disabling screen capture also prevents the\r\ncontent from being shown on display devices that do not have a secure video output. See Display.FLAG_SECURE for more\r\ndetails about secure surfaces and secure displays.\r\nThis method can be called on the DevicePolicyManager instance, returned by\r\ngetParentProfileInstance(ComponentName) , where the calling device admin must be the profile owner of an organization-owned managed profile. If it is not, a security exception will be thrown.\r\nIf the caller is device owner or called on the parent instance by a profile owner of an organization-owned managed profile,\r\nthen the restriction will be applied to all users.\r\nFrom version Build.VERSION_CODES.M disabling screen capture also blocks assist requests for all activities of the relevant\r\nuser.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 167 of 178\n\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\ndisabled boolean : Whether screen capture is disabled or not.\r\nThrows\r\nSecurityException if the caller is not permitted to control screen capture policy.\r\nsetSecureSetting\r\npublic void setSecureSetting (ComponentName admin,\r\n String setting,\r\n String value)\r\nThis method is mostly deprecated. Most of the settings that still have an effect have dedicated setter methods (e.g.\r\nsetLocationEnabled(ComponentName, boolean) ) or user restrictions.\r\nCalled by profile or device owners to update Settings.Secure settings. Validation that the value of the setting is in the\r\ncorrect form for the setting type should be performed by the caller.\r\nThe settings that can be updated by a profile or device owner with this method are:\r\nSettings.Secure.DEFAULT_INPUT_METHOD\r\nSettings.Secure.SKIP_FIRST_USE_HINTS\r\nA device owner can additionally update the following settings:\r\nSettings.Secure.LOCATION_MODE , but see note below.\r\nNote: Starting from Android O, apps should no longer call this method with the setting\r\nSettings.Secure.INSTALL_NON_MARKET_APPS , which is deprecated. Instead, device owners or profile owners should use\r\nthe restriction UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES . If any app targeting Build.VERSION_CODES.O or\r\nhigher calls this method with Settings.Secure.INSTALL_NON_MARKET_APPS , an UnsupportedOperationException is\r\nthrown. Starting from Android Q, the device and profile owner can also call\r\nUserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY to restrict unknown sources for all users. Note: Starting\r\nfrom Android R, apps should no longer call this method with the setting Settings.Secure.LOCATION_MODE , which is\r\ndeprecated. Instead, device owners should call setLocationEnabled(ComponentName,boolean) . This will be enforced\r\nfor all apps targeting Android R or above.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nsetting String : The name of the setting to update.\r\nvalue String : The value to update the setting to.\r\nsetSecurityLoggingEnabled\r\npublic void setSecurityLoggingEnabled (ComponentName admin,\r\n boolean enabled)\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 168 of 178\n\nCalled by device owner or a profile owner of an organization-owned managed profile to control the security logging feature.\r\nSecurity logs contain various information intended for security auditing purposes. When security logging is enabled by any\r\napp other than the device owner, certain security logs are not visible (for example personal app launch events) or they will\r\nbe redacted (for example, details of the physical volume mount events). Please see SecurityEvent for details.\r\nNote: The device owner won't be able to retrieve security logs if there are unaffiliated secondary users or profiles on the\r\ndevice, regardless of whether the feature is enabled. Logs will be discarded if the internal buffer fills up while waiting for all\r\nusers to become affiliated. Therefore it's recommended that affiliation ids are set for new users as soon as possible after\r\nprovisioning via setAffiliationIds(ComponentName, Set) . Non device owners are not subject to this restriction since all\r\nprivacy-sensitive events happening outside the managed profile would have been redacted already. Starting from\r\nBuild.VERSION_CODES.VANILLA_ICE_CREAM , after the security logging policy has been set,\r\nPolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the\r\nadmin on whether the policy was successfully set or not. This callback will contain:\r\nThe policy identifier DevicePolicyIdentifiers.SECURITY_LOGGING_POLICY\r\nThe TargetUser that this policy relates to\r\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\nset or the reason the policy failed to be set e.g. PolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nParameters\r\nadmin\r\nComponentName : Which device admin this request is associated with, or null if called by a delegated\r\napp.\r\nenabled boolean : whether security logging should be enabled or not.\r\nsetShortSupportMessage\r\npublic void setShortSupportMessage (ComponentName admin,\r\n CharSequence message)\r\nCalled by a device admin to set the short support message. This will be displayed to the user in settings screens where\r\nfunctionality has been disabled by the admin. The message should be limited to a short statement such as \"This setting is\r\ndisabled by your administrator. Contact someone@example.com for support.\" If the message is longer than 200 characters it\r\nmay be truncated.\r\nIf the short support message needs to be localized, it is the responsibility of the DeviceAdminReceiver to listen to the\r\nIntent.ACTION_LOCALE_CHANGED broadcast and set a new version of this string accordingly.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\nmessage CharSequence : Short message to be displayed to the user in settings or null to clear the existing message.\r\nsetStartUserSessionMessage\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 169 of 178\n\npublic void setStartUserSessionMessage (ComponentName admin,\r\n CharSequence startUserSessionMessage)\r\nCalled by a device owner to specify the user session start message. This may be displayed during a user switch.\r\nThe message should be limited to a short statement or it may be truncated.\r\nIf the message needs to be localized, it is the responsibility of the DeviceAdminReceiver to listen to the\r\nIntent.ACTION_LOCALE_CHANGED broadcast and set a new version of this message accordingly.\r\nParameters\r\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nstartUserSessionMessage\r\nCharSequence : message for starting user session, or null to use system default\r\nmessage.\r\nsetStatusBarDisabled\r\npublic boolean setStatusBarDisabled (ComponentName admin,\r\n boolean disabled)\r\nCalled by device owner or profile owner of secondary users that is affiliated with the device to disable the status bar.\r\nDisabling the status bar blocks notifications and quick settings.\r\nNote: This method has no effect for LockTask mode. The behavior of the status bar in LockTask mode can be configured\r\nwith setLockTaskFeatures(ComponentName,int) . Calls to this method when the device is in LockTask mode will be\r\nregistered, but will only take effect when the device leaves LockTask mode.\r\nThis policy does not have any effect while on the lock screen, where the status bar will not be disabled. Using LockTask\r\ninstead of this method is recommended.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\ndisabled boolean : true disables the status bar, false reenables it.\r\nReturns\r\nboolean false if attempting to disable the status bar failed. true otherwise.\r\nThrows\r\nSecurityException\r\nif admin is not the device owner, or a profile owner of secondary user that is affiliated with\r\nthe device.\r\nsetStorageEncryption\r\npublic int setStorageEncryption (ComponentName admin,\r\n boolean encrypt)\r\nThis method was deprecated in API level 30.\r\nThis method does not actually modify the storage encryption of the device. It has never affected the encryption status of a\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 170 of 178\n\ndevice. Called by an application that is administering the device to request that the storage system be encrypted. Does\r\nnothing if the caller is on a secondary user or a managed profile.\r\nWhen multiple device administrators attempt to control device encryption, the most secure, supported setting will always be\r\nused. If any device administrator requests device encryption, it will be enabled; Conversely, if a device administrator\r\nattempts to disable device encryption while another device administrator has enabled it, the call to disable will fail (most\r\ncommonly returning ENCRYPTION_STATUS_ACTIVE ).\r\nThis policy controls encryption of the secure (application data) storage area. Data written to other storage areas may or may\r\nnot be encrypted, and this policy does not require or control the encryption of any other storage areas. There is one\r\nexception: If Environment.isExternalStorageEmulated() is true , then the directory returned by\r\nEnvironment.getExternalStorageDirectory() must be written to disk within the encrypted storage area.\r\nImportant Note: On some devices, it is possible to encrypt storage without requiring the user to create a device PIN or\r\nPassword. In this case, the storage is encrypted, but the encryption key may not be fully secured. For maximum security, the\r\nadministrator should also require (and check for) a pattern, PIN, or password.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nencrypt boolean : true to request encryption, false to release any previous request\r\nsetSystemUpdatePolicy\r\npublic void setSystemUpdatePolicy (ComponentName admin,\r\n SystemUpdatePolicy policy)\r\nCalled by device owners or profile owners of an organization-owned managed profile to set a local system update policy.\r\nWhen a new policy is set, ACTION_SYSTEM_UPDATE_POLICY_CHANGED is broadcast.\r\nIf the supplied system update policy has freeze periods set but the freeze periods do not meet 90-day maximum length or 60-\r\nday minimum separation requirement set out in SystemUpdatePolicy.setFreezePeriods ,\r\nSystemUpdatePolicy.ValidationFailedException will the thrown. Note that the system keeps a record of freeze periods\r\nthe device experienced previously, and combines them with the new freeze periods to be set when checking the maximum\r\nfreeze length and minimum freeze separation constraints. As a result, freeze periods that passed validation during\r\nSystemUpdatePolicy.setFreezePeriods might fail the additional checks here due to the freeze period history. If this is\r\ncausing issues during development, adb shell dpm clear-freeze-period-record can be used to clear the record.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. All components in the\r\npackage can set system update policies and the most recent policy takes effect. This should be null if the\r\ncaller is not a device admin.\r\npolicy SystemUpdatePolicy : the new policy, or null to clear the current policy.\r\nsetTime\r\npublic boolean setTime (ComponentName admin,\r\n long millis)\r\nCalled by a device owner or a profile owner of an organization-owned managed profile to set the system wall clock time.\r\nThis only takes effect if called when Settings.Global.AUTO_TIME is 0, otherwise false will be returned.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 171 of 178\n\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\nmillis long : time in milliseconds since the Epoch\r\nReturns\r\nboolean true if set time succeeded, false otherwise.\r\nThrows\r\nSecurityException if admin is not a device owner or a profile owner of an organization-owned managed profile.\r\nsetTimeZone\r\npublic boolean setTimeZone (ComponentName admin,\r\n String timeZone)\r\nCalled by a device owner or a profile owner of an organization-owned managed profile to set the system's persistent default\r\ntime zone. This only takes effect if called when Settings.Global.AUTO_TIME_ZONE is 0, otherwise false will be returned.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\ntimeZone String : one of the Olson ids from the list returned by TimeZone.getAvailableIDs()\r\nReturns\r\nboolean true if set timezone succeeded, false otherwise.\r\nThrows\r\nSecurityException if admin is not a device owner or a profile owner of an organization-owned managed profile.\r\nsetUninstallBlocked\r\npublic void setUninstallBlocked (ComponentName admin,\r\n String packageName,\r\n boolean uninstallBlocked)\r\nChange whether a user can uninstall a package. This function can be called by a device owner, profile owner, or by a\r\ndelegate given the DELEGATION_BLOCK_UNINSTALL scope via setDelegatedScopes(ComponentName, String, List) or\r\nholders of the permission Manifest.permission.MANAGE_DEVICE_POLICY_APPS_CONTROL .\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , after the set uninstall blocked policy has been set,\r\nPolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the\r\nadmin on whether the policy was successfully set or not. This callback will contain:\r\nThe policy identifier DevicePolicyIdentifiers.PACKAGE_UNINSTALL_BLOCKED_POLICY\r\nThe additional policy params bundle, which contains PolicyUpdateReceiver.EXTRA_PACKAGE_NAME the package\r\nname the policy applies to\r\nThe TargetUser that this policy relates to\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 172 of 178\n\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\nset or the reason the policy failed to be set (e.g. PolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller\r\nis not a device admin.\r\nThis value may be null .\r\npackageName String : package to change.\r\nuninstallBlocked boolean : true if the user shouldn't be able to uninstall the package.\r\nsetUsbDataSignalingEnabled\r\npublic void setUsbDataSignalingEnabled (boolean enabled)\r\nCalled by a device owner or profile owner of an organization-owned managed profile to enable or disable USB data\r\nsignaling for the device. When disabled, USB data connections (except from charging functions) are prohibited.\r\nThis API is not supported on all devices, the caller should call canUsbDataSignalingBeDisabled() to check whether\r\nenabling or disabling USB data signaling is supported on the device. Starting from Android 15, after the USB data signaling\r\npolicy has been set, PolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult)\r\nwill notify the admin on whether the policy was successfully set or not. This callback will contain:\r\nThe TargetUser that this policy relates to\r\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\nset or the reason the policy failed to be set e.g. PolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nParameters\r\nenabled boolean : whether USB data signaling should be enabled or not.\r\nThrows\r\nIllegalStateException\r\nif disabling USB data signaling is not supported or if USB data signaling fails to be\r\nenabled/disabled.\r\nSecurityException if the caller is not permitted to set this policy\r\nsetUserControlDisabledPackages\r\npublic void setUserControlDisabledPackages (ComponentName admin,\r\n List\u003cString\u003e packages)\r\nCalled by a device owner or a profile owner or holder of the permission\r\nManifest.permission.MANAGE_DEVICE_POLICY_APPS_CONTROL to disable user control over apps. User will not be able to clear\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 173 of 178\n\napp data or force-stop packages. When called by a device owner, applies to all users on the device. Packages with user\r\ncontrol disabled are exempted from App Standby Buckets.\r\nStarting from Build.VERSION_CODES.UPSIDE_DOWN_CAKE , after the user control disabled packages policy has been set,\r\nPolicyUpdateReceiver.onPolicySetResult(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the\r\nadmin on whether the policy was successfully set or not. This callback will contain:\r\nThe policy identifier DevicePolicyIdentifiers.USER_CONTROL_DISABLED_PACKAGES_POLICY\r\nThe TargetUser that this policy relates to\r\nThe PolicyUpdateResult , which will be PolicyUpdateResult.RESULT_POLICY_SET if the policy was successfully\r\nset or the reason the policy failed to be set (e.g. PolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY )\r\nIf there has been a change to the policy,\r\nPolicyUpdateReceiver.onPolicyChanged(Context,String,Bundle,TargetUser,PolicyUpdateResult) will notify the admin\r\nof this change. This callback will contain the same parameters as PolicyUpdateReceiver#onPolicySetResult and the\r\nPolicyUpdateResult will contain the reason why the policy changed.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with. Null if the caller is not a\r\ndevice admin.\r\nThis value may be null .\r\npackages\r\nList : The package names for the apps.\r\nThis value cannot be null .\r\nsetUserIcon\r\npublic void setUserIcon (ComponentName admin,\r\n Bitmap icon)\r\nCalled by profile or device owners to set the user's photo.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nicon Bitmap : the bitmap to set as the photo.\r\nsetWifiSsidPolicy\r\npublic void setWifiSsidPolicy (WifiSsidPolicy policy)\r\nCalled by device owner or profile owner of an organization-owned managed profile to specify the Wi-Fi SSID policy\r\n( WifiSsidPolicy ). Wi-Fi SSID policy specifies the SSID restriction the network must satisfy in order to be eligible for a\r\nconnection. Providing a null policy results in the deactivation of the SSID restriction\r\nParameters\r\npolicy\r\nWifiSsidPolicy : Wi-Fi SSID policy.\r\nThis value may be null .\r\nstartUserInBackground\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 174 of 178\n\npublic int startUserInBackground (ComponentName admin,\r\n UserHandle userHandle)\r\nCalled by a device owner to start the specified secondary user in background.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nuserHandle\r\nUserHandle : the user to be started in background.\r\nThis value cannot be null .\r\nstopUser\r\npublic int stopUser (ComponentName admin,\r\n UserHandle userHandle)\r\nCalled by a device owner to stop the specified secondary user.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nuserHandle\r\nUserHandle : the user to be stopped.\r\nThis value cannot be null .\r\nswitchUser\r\npublic boolean switchUser (ComponentName admin,\r\n UserHandle userHandle)\r\nCalled by a device owner to switch the specified secondary user to the foreground.\r\nParameters\r\nadmin\r\nComponentName : Which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\nuserHandle UserHandle : the user to switch to; null will switch to primary.\r\nReturns\r\nboolean true if the switch was successful, false otherwise.\r\ntransferOwnership\r\npublic void transferOwnership (ComponentName admin,\r\n ComponentName target,\r\n PersistableBundle bundle)\r\nChanges the current administrator to another one. All policies from the current administrator are migrated to the new\r\nadministrator. The whole operation is atomic - the transfer is either complete or not done at all.\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 175 of 178\n\nDepending on the current administrator (device owner, profile owner), you have the following expected behaviour:\nA device owner can only be transferred to a new device owner\nA profile owner can only be transferred to a new profile owner\nUse the bundle parameter to pass data to the new administrator. The data will be received in the\nDeviceAdminReceiver.onTransferOwnershipComplete(Context,PersistableBundle) callback of the new administrator.\nThe transfer has failed if the original administrator is still the corresponding owner after calling this method.\nThe incoming target administrator must have the tag inside the tags in the xml file referenced by DeviceAdminReceiver.DEVICE_ADMIN_META_DATA . Otherwise an\nIllegalArgumentException will be thrown.\nParameters\nadmin\nComponentName : which DeviceAdminReceiver this request is associated with.\nThis value cannot be null .\ntarget\nComponentName : which DeviceAdminReceiver we want the new administrator to be.\nThis value cannot be null .\nbundle\nPersistableBundle : data to be sent to the new administrator.\nThis value may be null .\nuninstallAllUserCaCerts\npublic void uninstallAllUserCaCerts (ComponentName admin)\nUninstalls all custom trusted CA certificates from the profile. Certificates installed by means other than device policy will\nalso be removed, except for system CA certificates.\nParameters\nadmin\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if calling from a\ndelegated certificate installer.\nuninstallCaCert\npublic void uninstallCaCert (ComponentName admin,\n byte[] certBuffer)\nUninstalls the given certificate from trusted user CAs, if present. The caller must be a profile or device owner on that user,\nor a delegate package given the DELEGATION_CERT_INSTALL scope via setDelegatedScopes(ComponentName, String,\nList) ; otherwise a security exception will be thrown.\nParameters\nadmin\nComponentName : Which DeviceAdminReceiver this request is associated with, or null if calling\nfrom a delegated certificate installer.\ncertBuffer byte : encoded form of the certificate to remove.\nupdateOverrideApn\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\nPage 176 of 178\n\npublic boolean updateOverrideApn (ComponentName admin,\r\n int apnId,\r\n ApnSetting apnSetting)\r\nCalled by device owner or managed profile owner to update an override APN.\r\nThis method may returns false if there is no override APN with the given apnId .\r\nThis method may also returns false if apnSetting conflicts with an existing override APN. Update the existing\r\nconflicted APN instead.\r\nSee addOverrideApn(ComponentName, ApnSetting) for the definition of conflict.\r\nBefore Android version Build.VERSION_CODES.TIRAMISU : Only device owners can update APNs.\r\nStarting from Android version Build.VERSION_CODES.TIRAMISU : Both device owners and managed profile owners can\r\nupdate enterprise APNs ( ApnSetting.TYPE_ENTERPRISE ), while only device owners can update other type of APNs.\r\nParameters\r\nadmin\r\nComponentName : which DeviceAdminReceiver this request is associated with.\r\nThis value cannot be null .\r\napnId int : the id of the override APN to update\r\napnSetting\r\nApnSetting : the override APN to update.\r\nThis value cannot be null .\r\nReturns\r\nboolean true if the required override APN is successfully updated, false otherwise.\r\nThrows\r\nSecurityException\r\nIf request is for enterprise APN admin is either device owner or profile owner and in all other\r\ntypes of APN if admin is not a device owner.\r\nwipeData\r\npublic void wipeData (int flags,\r\n CharSequence reason)\r\nAsk that all user data be wiped.\r\nIf called as a secondary user or managed profile, the user itself and its associated user data will be wiped. In particular, If the\r\ncaller is a profile owner of an organization-owned managed profile, calling this method will relinquish the device for\r\npersonal use, removing the managed profile and all policies set by the profile owner.\r\nCalling this method from the primary user will only work if the calling app is targeting SDK level\r\nBuild.VERSION_CODES.TIRAMISU or below, in which case it will cause the device to reboot, erasing all device data -\r\nincluding all the secondary users and their data - while booting up. If an app targeting SDK level\r\nBuild.VERSION_CODES.UPSIDE_DOWN_CAKE and above is calling this method from the primary user or last full user,\r\nIllegalStateException will be thrown.\r\nIf an app wants to wipe the entire device irrespective of which user they are from, they should use wipeDevice(int)\r\ninstead.\r\nParameters\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 177 of 178\n\nflags\r\nint : Bit mask of additional options: currently supported flags are WIPE_EXTERNAL_STORAGE and\r\nWIPE_RESET_PROTECTION_DATA .\r\nreason\r\nCharSequence : a string that contains the reason for wiping data, which can be presented to the user.\r\nThis value cannot be null .\r\nwipeDevice\r\npublic void wipeDevice (int flags)\r\nAsk that the device be wiped and factory reset.\r\nThe calling Device Owner or Organization Owned Profile Owner must have requested\r\nDeviceAdminInfo.USES_POLICY_WIPE_DATA to be able to call this method; if it has not, a security exception will be thrown.\r\nSource: https://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nhttps://developer.android.com/reference/android/app/admin/DevicePolicyManager.html\r\nPage 178 of 178",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"origins": [
		"web"
	],
	"references": [
		"https://developer.android.com/reference/android/app/admin/DevicePolicyManager.html"
	],
	"report_names": [
		"DevicePolicyManager.html"
	],
	"threat_actors": [
		{
			"id": "08c8f238-1df5-4e75-b4d8-276ebead502d",
			"created_at": "2023-01-06T13:46:39.344081Z",
			"updated_at": "2026-04-10T02:00:03.294222Z",
			"deleted_at": null,
			"main_name": "Copy-Paste",
			"aliases": [],
			"source_name": "MISPGALAXY:Copy-Paste",
			"tools": [],
			"source_id": "MISPGALAXY",
			"reports": null
		}
	],
	"ts_created_at": 1775434082,
	"ts_updated_at": 1775826715,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/405023a95e5571b9cb2fd6770c99063586462921.pdf",
		"text": "https://archive.orkl.eu/405023a95e5571b9cb2fd6770c99063586462921.txt",
		"img": "https://archive.orkl.eu/405023a95e5571b9cb2fd6770c99063586462921.jpg"
	}
}