Share via


DevicePolicyManager.IsApplicationHidden(ComponentName, String) Method

Definition

Determine if a package is hidden.

[Android.Runtime.Register("isApplicationHidden", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "GetIsApplicationHidden_Landroid_content_ComponentName_Ljava_lang_String_Handler")]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_PACKAGE_STATE")]
public virtual bool IsApplicationHidden (Android.Content.ComponentName? admin, string? packageName);
[<Android.Runtime.Register("isApplicationHidden", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "GetIsApplicationHidden_Landroid_content_ComponentName_Ljava_lang_String_Handler")>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_PACKAGE_STATE")>]
abstract member IsApplicationHidden : Android.Content.ComponentName * string -> bool
override this.IsApplicationHidden : Android.Content.ComponentName * string -> bool

Parameters

admin
ComponentName

Which DeviceAdminReceiver this request is associated with, or null if the caller is not a device admin.

packageName
String

The name of the package to retrieve the hidden status of.

Returns

boolean true if the package is hidden, false otherwise.

Attributes

Remarks

Determine if a package is hidden. This function can be called by a device owner, profile owner, or by a delegate given the #DELEGATION_PACKAGE_ACCESS scope via #setDelegatedScopes.

This method can be called on the DevicePolicyManager instance, returned by #getParentProfileInstance(ComponentName), where the caller must be the profile owner of an organization-owned managed profile and the package must be a system package. If called on the parent instance, this will determine whether the package is hidden or unhidden in the personal profile.

Starting from Build.VERSION_CODES#UPSIDE_DOWN_CAKE, the returned policy will be the current resolved policy rather than the policy set by the calling admin.

Java documentation for android.app.admin.DevicePolicyManager.isApplicationHidden(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