summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorSvet Ganov <svetoslavganov@google.com>2017-10-19 14:41:26 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-10-19 14:41:26 +0000
commit6f0e008318f61ec5cd4e75ead485fb888a643617 (patch)
treef7d3a4383e5ad836626dd3bfec2cae7b255f29cc /core/java
parentf26a40f7ee14c9a620d6cf78ca6c363c1e3bc675 (diff)
parent9a7a6e20009c4e21062ed8e2e8b6a726e4dc56f5 (diff)
Merge "Preserve ranking attrs of resolve infos for installing a feature split" into oc-mr1-dev am: 8f231b7aa6
am: 9a7a6e2000 Change-Id: I4e359a54b1eb6a681e4e6fabe31e0cf20a1c87a9
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/content/pm/ResolveInfo.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/core/java/android/content/pm/ResolveInfo.java b/core/java/android/content/pm/ResolveInfo.java
index 799316700b4d..3f63d80f5864 100644
--- a/core/java/android/content/pm/ResolveInfo.java
+++ b/core/java/android/content/pm/ResolveInfo.java
@@ -222,6 +222,40 @@ public class ResolveInfo implements Parcelable {
}
/**
+ * @return The resource that would be used when loading
+ * the label for this resolve info.
+ *
+ * @hide
+ */
+ public int resolveLabelResId() {
+ if (labelRes != 0) {
+ return labelRes;
+ }
+ final ComponentInfo componentInfo = getComponentInfo();
+ if (componentInfo.labelRes != 0) {
+ return componentInfo.labelRes;
+ }
+ return componentInfo.applicationInfo.labelRes;
+ }
+
+ /**
+ * @return The resource that would be used when loading
+ * the icon for this resolve info.
+ *
+ * @hide
+ */
+ public int resolveIconResId() {
+ if (icon != 0) {
+ return icon;
+ }
+ final ComponentInfo componentInfo = getComponentInfo();
+ if (componentInfo.icon != 0) {
+ return componentInfo.icon;
+ }
+ return componentInfo.applicationInfo.icon;
+ }
+
+ /**
* Retrieve the current graphical icon associated with this resolution. This
* will call back on the given PackageManager to load the icon from
* the application.