am 8f993de8: Merge "Expose an API to generate a badged icon for managed profiles."

* commit '8f993de81f9e9bcfd136c42bb6bf12114fedfd36':
  Expose an API to generate a badged icon for managed profiles.
This commit is contained in:
Amith Yamasani
2014-04-11 22:04:41 +00:00
committed by Android Git Automerger
2 changed files with 15 additions and 1 deletions

View File

@@ -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);

View File

@@ -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.
* <P>
* If the original drawable is not a BitmapDrawable, then the original
* drawable is returned.
* </P>
*
* @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) {