summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorSvet Ganov <svetoslavganov@google.com>2017-10-19 03:26:00 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-10-19 03:26:00 +0000
commit9a7a6e20009c4e21062ed8e2e8b6a726e4dc56f5 (patch)
tree9bd8b076e19034ee9c07ad53310fac74e4d03702 /core/java
parenta0624d59b5d07de166b14dedef681dead6550ddb (diff)
parent8f231b7aa6622c4add467c7145910936acf33d66 (diff)
Merge "Preserve ranking attrs of resolve infos for installing a feature split" into oc-mr1-dev
am: 8f231b7aa6 Change-Id: Id85257c481a7d4e387ffc6ee628bfd2986ab5b3c
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.