diff --git a/api/current.txt b/api/current.txt index bc7938936491f..4763ca836416f 100644 --- a/api/current.txt +++ b/api/current.txt @@ -19978,6 +19978,7 @@ package android.os { public class UserManager { method public android.os.Bundle getApplicationRestrictions(java.lang.String); + method public android.graphics.drawable.Drawable getBadgedDrawableForUser(android.graphics.drawable.Drawable, android.os.UserHandle); method public long getSerialNumberForUser(android.os.UserHandle); method public int getUserCount(); method public android.os.UserHandle getUserForSerialNumber(long); diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index 728c5607f0d8b..8aef9bdccb82b 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -492,7 +492,20 @@ public class UserManager { return profiles; } - /** @hide */ + /** + * If the target user is a managed profile of the calling user or the caller + * is itself a managed profile, then this returns a badged copy of the given + * icon to be able to distinguish it from the original icon. + *
+ * If the original drawable is not a BitmapDrawable, then the original + * drawable is returned. + *
+ * + * @param icon The icon to badge. + * @param user The target user. + * @return A drawable that combines the original icon and a badge as + * determined by the system. + */ public Drawable getBadgedDrawableForUser(Drawable icon, UserHandle user) { int badgeResId = getBadgeResIdForUser(user.getIdentifier()); if (badgeResId == 0) {