DevicePolicyManager.InstallExistingPackage(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.
Install an existing package that has been installed in another user, or has been kept after
removal via #setKeepUninstalledPackages
.
[Android.Runtime.Register("installExistingPackage", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "GetInstallExistingPackage_Landroid_content_ComponentName_Ljava_lang_String_Handler", ApiSince=28)]
public virtual bool InstallExistingPackage (Android.Content.ComponentName admin, string? packageName);
[<Android.Runtime.Register("installExistingPackage", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "GetInstallExistingPackage_Landroid_content_ComponentName_Ljava_lang_String_Handler", ApiSince=28)>]
abstract member InstallExistingPackage : Android.Content.ComponentName * string -> bool
override this.InstallExistingPackage : Android.Content.ComponentName * string -> bool
Parameters
- admin
- ComponentName
Which DeviceAdminReceiver
this request is associated with.
- packageName
- String
The package to be installed in the calling profile.
Returns
true
if the app is installed; false
otherwise.
- Attributes
Remarks
Install an existing package that has been installed in another user, or has been kept after removal via #setKeepUninstalledPackages
. This function can be called by a device owner, profile owner or a delegate given the #DELEGATION_INSTALL_EXISTING_PACKAGE
scope via #setDelegatedScopes
. When called in a secondary user or managed profile, the user/profile must be affiliated with the device. See #isAffiliatedUser
.
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.