From 8bd7c52fb0724892da4804aa78458d6de24af4e1 Mon Sep 17 00:00:00 2001 From: Esteban Talavera Date: Mon, 13 Feb 2017 12:35:04 +0000 Subject: [PATCH] Specify limitations of DISALLOW_UNINSTALL_APPS in documentation Bug: 24928722 Fix: 29871221 Bug: 31344846 Test: Builds successfully Change-Id: I870c71d537da79b9dd50f81ba5394eb8afc8d839 --- core/java/android/os/UserManager.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index dfcab3df628dd..c4adcc23ad006 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -30,6 +30,7 @@ import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; +import android.content.IntentFilter; import android.content.IntentSender; import android.content.pm.UserInfo; import android.content.res.Resources; @@ -421,6 +422,14 @@ public class UserManager { *

* The default value is false. * + *

Note: The user will still be able to perform those actions via other + * means (such as adb). Third party apps will also be able to uninstall apps via the + * {@link android.content.pm.PackageInstaller}. {@link #DISALLOW_UNINSTALL_APPS} or + * {@link DevicePolicyManager#setUninstallBlocked(ComponentName, String, boolean)} should be + * used to prevent the user from uninstalling apps completely, and + * {@link DevicePolicyManager#addPersistentPreferredActivity(ComponentName, IntentFilter, ComponentName)} + * to add a default intent handler for a given intent filter. + * *

Key for user restrictions. *

Type: Boolean * @see DevicePolicyManager#addUserRestriction(ComponentName, String)