update placeholder on package install or restore

Bug: 10778992
Change-Id: I3293d8bab8ae0ef49fc5554531bba5bd6f70932c
This commit is contained in:
Chris Wren
2014-01-27 14:17:08 -05:00
parent c87c21a0cd
commit b6d4c2827a
5 changed files with 88 additions and 4 deletions

View File

@@ -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;