DevicePolicyManager.IsPackageSuspended(ComponentName, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determine if a package is suspended.
[Android.Runtime.Register("isPackageSuspended", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "GetIsPackageSuspended_Landroid_content_ComponentName_Ljava_lang_String_Handler", ApiSince=24)]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_PACKAGE_STATE")]
public virtual bool IsPackageSuspended (Android.Content.ComponentName? admin, string? packageName);
[<Android.Runtime.Register("isPackageSuspended", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "GetIsPackageSuspended_Landroid_content_ComponentName_Ljava_lang_String_Handler", ApiSince=24)>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_PACKAGE_STATE")>]
abstract member IsPackageSuspended : Android.Content.ComponentName * string -> bool
override this.IsPackageSuspended : Android.Content.ComponentName * string -> bool
Parameters
- admin
- ComponentName
Which DeviceAdminReceiver
this request is associated with. Null if the
caller is not a device admin.
- packageName
- String
The name of the package to retrieve the suspended status of.
Returns
true
if the package is suspended or false
if the package is not
suspended, could not be found or an error occurred.
- Attributes
Remarks
Determine if a package is suspended. This function can be called by a device owner, profile owner, or by a delegate given the #DELEGATION_PACKAGE_ACCESS
scope via #setDelegatedScopes
or by holders of the permission android.Manifest.permission#MANAGE_DEVICE_POLICY_PACKAGE_STATE
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.