DevicePolicyManager.IsPackageSuspended(ComponentName, String) Method

Definition

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.

Java documentation for android.app.admin.DevicePolicyManager.isPackageSuspended(android.content.ComponentName, java.lang.String).

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.

Applies to