diff options
author | Chris Wren <cwren@android.com> | 2014-01-27 14:17:08 -0500 |
---|---|---|
committer | Chris Wren <cwren@android.com> | 2014-02-06 15:05:16 -0500 |
commit | b6d4c2827a1514432b5eda46ff7d484d6cf244ac (patch) | |
tree | 2d75c0acf8507beb7391c67ae4decd1254b9c079 /src/com/android/launcher3/ShortcutInfo.java | |
parent | c87c21a0cd168c65c70b59ad12502a2e1a00b9c4 (diff) | |
download | android_packages_apps_Trebuchet-b6d4c2827a1514432b5eda46ff7d484d6cf244ac.tar.gz android_packages_apps_Trebuchet-b6d4c2827a1514432b5eda46ff7d484d6cf244ac.tar.bz2 android_packages_apps_Trebuchet-b6d4c2827a1514432b5eda46ff7d484d6cf244ac.zip |
update placeholder on package install or restore
Bug: 10778992
Change-Id: I3293d8bab8ae0ef49fc5554531bba5bd6f70932c
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; |