diff options
Diffstat (limited to 'src/com/android/launcher3/ShortcutInfo.java')
-rw-r--r-- | src/com/android/launcher3/ShortcutInfo.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/com/android/launcher3/ShortcutInfo.java b/src/com/android/launcher3/ShortcutInfo.java index 660f32c79..79d114c06 100644 --- a/src/com/android/launcher3/ShortcutInfo.java +++ b/src/com/android/launcher3/ShortcutInfo.java @@ -64,6 +64,12 @@ class ShortcutInfo extends ItemInfo { long firstInstallTime; int flags = 0; + /** + * If this shortcut is a placeholder, then intent will be a market intent for the package, and + * this will hold the original intent from the database. Otherwise, null. + */ + Intent restoredIntent; + ShortcutInfo() { itemType = LauncherSettings.BaseLauncherColumns.ITEM_TYPE_SHORTCUT; } @@ -72,6 +78,21 @@ class ShortcutInfo extends ItemInfo { return intent; } + protected Intent getRestoredIntent() { + return restoredIntent; + } + + /** + * Overwrite placeholder data with restored data, or do nothing if this is not a placeholder. + */ + public void restore() { + if (restoredIntent != null) { + intent = restoredIntent; + restoredIntent = null; + } + } + + ShortcutInfo(Intent intent, CharSequence title, Bitmap icon) { this(); this.intent = intent; |