summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/ShortcutInfo.java
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2016-08-29 15:17:48 -0700
committerTony Wickham <twickham@google.com>2016-08-29 15:59:28 -0700
commitfc02c1b446ee54561ac7351fb6ff0f8294785f0e (patch)
treea4fdb8c15c5c1613bef61dd1d8ce5227216f8a23 /src/com/android/launcher3/ShortcutInfo.java
parent4a4b49ff3482cbe7f8192807cdc99437810fe518 (diff)
downloadandroid_packages_apps_Trebuchet-fc02c1b446ee54561ac7351fb6ff0f8294785f0e.tar.gz
android_packages_apps_Trebuchet-fc02c1b446ee54561ac7351fb6ff0f8294785f0e.tar.bz2
android_packages_apps_Trebuchet-fc02c1b446ee54561ac7351fb6ff0f8294785f0e.zip
Use promisedIntent instead of intent when deep shortcuts are restored.
This ensures that the intent has the package corresponding to the shortcut publisher, rather than a market intent. It also ensures that the intent has the EXTRA_SHORTCUT_ID attached. Bug: 31123204 Change-Id: I05d56396b629880322e915f52bfc0605b921b0b1
Diffstat (limited to 'src/com/android/launcher3/ShortcutInfo.java')
-rw-r--r--src/com/android/launcher3/ShortcutInfo.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/launcher3/ShortcutInfo.java b/src/com/android/launcher3/ShortcutInfo.java
index 8c466b2b0..21fa8a05e 100644
--- a/src/com/android/launcher3/ShortcutInfo.java
+++ b/src/com/android/launcher3/ShortcutInfo.java
@@ -167,6 +167,11 @@ public class ShortcutInfo extends ItemInfo {
return intent;
}
+ /** Returns {@link #promisedIntent}, or {@link #intent} if promisedIntent is null. */
+ public Intent getPromisedIntent() {
+ return promisedIntent != null ? promisedIntent : intent;
+ }
+
ShortcutInfo(Intent intent, CharSequence title, CharSequence contentDescription,
Bitmap icon, UserHandleCompat user) {
this();
@@ -349,7 +354,7 @@ public class ShortcutInfo extends ItemInfo {
/** Returns the ShortcutInfo id associated with the deep shortcut. */
public String getDeepShortcutId() {
return itemType == Favorites.ITEM_TYPE_DEEP_SHORTCUT ?
- intent.getStringExtra(ShortcutInfoCompat.EXTRA_SHORTCUT_ID) : null;
+ getPromisedIntent().getStringExtra(ShortcutInfoCompat.EXTRA_SHORTCUT_ID) : null;
}
@Override