public class PackageItemInfo extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PackageItemInfo.DisplayNameComparator |
Modifier and Type | Field and Description |
---|---|
int |
banner
A drawable resource identifier (in the package's resources) of this
component's banner.
|
static int |
DUMP_FLAG_ALL |
static int |
DUMP_FLAG_APPLICATION |
static int |
DUMP_FLAG_DETAILS |
int |
icon
A drawable resource identifier (in the package's resources) of this
component's icon.
|
int |
labelRes
A string resource identifier (in the package's resources) of this
component's label.
|
int |
logo
A drawable resource identifier (in the package's resources) of this
component's logo.
|
Bundle |
metaData
Additional meta-data associated with this component.
|
String |
name
Public name of this item.
|
CharSequence |
nonLocalizedLabel
The string provided in the AndroidManifest file, if any.
|
String |
packageName
Name of the package that this item is in.
|
int |
showUserIcon
If different of UserHandle.USER_NULL, The icon of this item will be the one of that user.
|
Modifier | Constructor and Description |
---|---|
|
PackageItemInfo() |
|
PackageItemInfo(PackageItemInfo orig) |
protected |
PackageItemInfo(Parcel source) |
Modifier and Type | Method and Description |
---|---|
protected void |
dumpBack(Printer pw,
String prefix) |
protected void |
dumpFront(Printer pw,
String prefix) |
protected ApplicationInfo |
getApplicationInfo()
Get the ApplicationInfo for the application to which this item belongs,
if available, otherwise returns null.
|
Drawable |
loadBanner(PackageManager pm)
Retrieve the current graphical banner associated with this item.
|
protected Drawable |
loadDefaultBanner(PackageManager pm)
Retrieve the default graphical banner associated with this item.
|
Drawable |
loadDefaultIcon(PackageManager pm)
Retrieve the default graphical icon associated with this item.
|
protected Drawable |
loadDefaultLogo(PackageManager pm)
Retrieve the default graphical logo associated with this item.
|
Drawable |
loadIcon(PackageManager pm)
Retrieve the current graphical icon associated with this item.
|
CharSequence |
loadLabel(PackageManager pm)
Retrieve the current textual label associated with this item.
|
Drawable |
loadLogo(PackageManager pm)
Retrieve the current graphical logo associated with this item.
|
CharSequence |
loadSafeLabel(PackageManager pm)
Same as
loadLabel(PackageManager) with the addition that
the returned label is safe for being presented in the UI since it
will not contain new lines and the length will be limited to a
reasonable amount. |
Drawable |
loadUnbadgedIcon(PackageManager pm)
Retrieve the current graphical icon associated with this item without
the addition of a work badge if applicable.
|
XmlResourceParser |
loadXmlMetaData(PackageManager pm,
String name)
Load an XML resource attached to the meta-data of this item.
|
void |
writeToParcel(Parcel dest,
int parcelableFlags) |
public String name
public String packageName
public int labelRes
public CharSequence nonLocalizedLabel
PackageManager.getApplicationLabel(android.content.pm.ApplicationInfo)
public int icon
public int banner
public int logo
public Bundle metaData
PackageManager.GET_META_DATA
flag when requesting the info.public int showUserIcon
public static final int DUMP_FLAG_DETAILS
public static final int DUMP_FLAG_APPLICATION
public static final int DUMP_FLAG_ALL
public PackageItemInfo()
public PackageItemInfo(PackageItemInfo orig)
protected PackageItemInfo(Parcel source)
public CharSequence loadLabel(PackageManager pm)
pm
- A PackageManager from which the label can be loaded; usually
the PackageManager from which you originally retrieved this item.public CharSequence loadSafeLabel(PackageManager pm)
loadLabel(PackageManager)
with the addition that
the returned label is safe for being presented in the UI since it
will not contain new lines and the length will be limited to a
reasonable amount. This prevents a malicious party to influence UI
layout via the app label misleading the user into performing a
detrimental for them action. If the label is too long it will be
truncated and ellipsized at the end.pm
- A PackageManager from which the label can be loaded; usually
the PackageManager from which you originally retrieved this itempublic Drawable loadIcon(PackageManager pm)
pm
- A PackageManager from which the icon can be loaded; usually
the PackageManager from which you originally retrieved this item.public Drawable loadUnbadgedIcon(PackageManager pm)
pm
- A PackageManager from which the icon can be loaded; usually
the PackageManager from which you originally retrieved this item.public Drawable loadBanner(PackageManager pm)
pm
- A PackageManager from which the banner can be loaded; usually
the PackageManager from which you originally retrieved this item.public Drawable loadDefaultIcon(PackageManager pm)
pm
- A PackageManager from which the icon can be loaded; usually
the PackageManager from which you originally retrieved this item.protected Drawable loadDefaultBanner(PackageManager pm)
pm
- A PackageManager from which the banner can be loaded; usually
the PackageManager from which you originally retrieved this item.public Drawable loadLogo(PackageManager pm)
pm
- A PackageManager from which the logo can be loaded; usually
the PackageManager from which you originally retrieved this item.protected Drawable loadDefaultLogo(PackageManager pm)
pm
- A PackageManager from which the logo can be loaded; usually
the PackageManager from which you originally retrieved this item.public XmlResourceParser loadXmlMetaData(PackageManager pm, String name)
pm
- A PackageManager from which the XML can be loaded; usually
the PackageManager from which you originally retrieved this item.name
- Name of the meta-date you would like to load.public void writeToParcel(Parcel dest, int parcelableFlags)
protected ApplicationInfo getApplicationInfo()