Share via


DevicePolicyManager.SetKeepUninstalledPackages Method

Definition

Set a list of apps to keep around as APKs even if no user has currently installed it.

[Android.Runtime.Register("setKeepUninstalledPackages", "(Landroid/content/ComponentName;Ljava/util/List;)V", "GetSetKeepUninstalledPackages_Landroid_content_ComponentName_Ljava_util_List_Handler", ApiSince=28)]
public virtual void SetKeepUninstalledPackages (Android.Content.ComponentName? admin, System.Collections.Generic.IList<string> packageNames);
[<Android.Runtime.Register("setKeepUninstalledPackages", "(Landroid/content/ComponentName;Ljava/util/List;)V", "GetSetKeepUninstalledPackages_Landroid_content_ComponentName_Ljava_util_List_Handler", ApiSince=28)>]
abstract member SetKeepUninstalledPackages : Android.Content.ComponentName * System.Collections.Generic.IList<string> -> unit
override this.SetKeepUninstalledPackages : Android.Content.ComponentName * System.Collections.Generic.IList<string> -> unit

Parameters

admin
ComponentName

Which DeviceAdminReceiver this request is associated with, or null if the caller is a keep uninstalled packages delegate.

packageNames
IList<String>

List of package names to keep cached.

Attributes

Remarks

Set a list of apps to keep around as APKs even if no user has currently installed it. This function can be called by a device owner or by a delegate given the #DELEGATION_KEEP_UNINSTALLED_PACKAGES scope via #setDelegatedScopes.

Please note that setting this policy does not imply that specified apps will be automatically pre-cached.

Java documentation for android.app.admin.DevicePolicyManager.setKeepUninstalledPackages(android.content.ComponentName, java.util.List<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