LauncherApps.IsPackageEnabled(String, UserHandle) 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.
Checks if the package is installed and enabled for a profile.
[Android.Runtime.Register("isPackageEnabled", "(Ljava/lang/String;Landroid/os/UserHandle;)Z", "GetIsPackageEnabled_Ljava_lang_String_Landroid_os_UserHandle_Handler")]
public virtual bool IsPackageEnabled (string? packageName, Android.OS.UserHandle? user);
[<Android.Runtime.Register("isPackageEnabled", "(Ljava/lang/String;Landroid/os/UserHandle;)Z", "GetIsPackageEnabled_Ljava_lang_String_Landroid_os_UserHandle_Handler")>]
abstract member IsPackageEnabled : string * Android.OS.UserHandle -> bool
override this.IsPackageEnabled : string * Android.OS.UserHandle -> bool
Parameters
- packageName
- String
The package to check.
- user
- UserHandle
The UserHandle of the profile.
Returns
true if the package exists and is enabled.
- Attributes
Remarks
Checks if the package is installed and enabled for a profile.
If the user in question is a hidden profile UserManager.USER_TYPE_PROFILE_PRIVATE
, caller should have either:
<ul> <li>the privileged android.Manifest.permission.ACCESS_HIDDEN_PROFILES_FULL
permission</li> <li>the normal android.Manifest.permission.ACCESS_HIDDEN_PROFILES
permission and the android.app.role.RoleManager.ROLE_HOME
role. </li> </ul>
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.