mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 23:36:47 +00:00
update placeholder on package install or restore
Bug: 10778992 Change-Id: I3293d8bab8ae0ef49fc5554531bba5bd6f70932c
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user