diff options
| author | Svet Ganov <svetoslavganov@google.com> | 2017-10-18 17:12:17 -0700 |
|---|---|---|
| committer | Svet Ganov <svetoslavganov@google.com> | 2017-10-18 17:29:28 -0700 |
| commit | d96953ad7ab13ec988585dcb93a2a3e2120b23f5 (patch) | |
| tree | db72dca6d8c7f9f4c943480dfc424163be2ba5a8 /core/java | |
| parent | 3bdfe1a2517c4e2b6e9c7b7fe6b91eff77e4bd00 (diff) | |
Preserve ranking attrs of resolve infos for installing a feature split
If an intent resolves to an activity in a fearture split not on the device
we create a synthetic resolve info to involve the installer that replaces
the resolve info for the missing activity. The synthetic resolve info was
not inheriting the priority/preferred order/default status resulting in a
different result ranking than what original resolve info would produce,
hence affecting resolution. Activities in a feature split should resolve
as if they are present on the device.
Also when downloading a feature split we involve the instant app installer
which resuls in a disabmiguation UI item "Instant app" with an instant app
icon despite that in this case the synthetic resolve info is for downloading
a piece of an already installed app (standard or instant). When installing
a feature spluit the user should see UI as if the piece of the app would
handle the intent.
Test: manual
bug:67710878
Change-Id: I8dd356c7b2c9742144f10e5b48daf5b28f6934ad
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/content/pm/ResolveInfo.java | 34 |
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. |
