diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 4a3650fc4a6a4..e23ffe412d4a2 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -3681,9 +3681,14 @@ public class DevicePolicyManager { /** * Check whether the current user has been blocked by device policy from uninstalling a package. * Requires the caller to be the profile owner if checking a specific admin's policy. + *
+ * Note: Starting from {@link android.os.Build.VERSION_CODES#LOLLIPOP_MR1}, the
+ * behavior of this API is changed such that passing null as the admin
+ * parameter will return if any admin has blocked the uninstallation. Before L MR1, passing
+ * null will cause a NullPointerException to be raised.
*
* @param admin The name of the admin component whose blocking policy will be checked, or null
- * to check if any admin has blocked the uninstallation.
+ * to check if any admin has blocked the uninstallation.
* @param packageName package to check.
* @return true if uninstallation is blocked.
*/