summaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/trebuchet/ShortcutInfo.java
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2013-02-24 23:23:24 +0100
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-03-04 10:37:52 -0800
commit4b8d06f6be5c4ba2d069e69001f7032492df2e2c (patch)
tree2b23daa1cf453adb67066a8819350378a40b3e1b /src/com/cyanogenmod/trebuchet/ShortcutInfo.java
parent251be3ae738b77c404712cc97045ca934cb0e295 (diff)
downloadpackages_apps_trebuchet-4b8d06f6be5c4ba2d069e69001f7032492df2e2c.zip
packages_apps_trebuchet-4b8d06f6be5c4ba2d069e69001f7032492df2e2c.tar.gz
packages_apps_trebuchet-4b8d06f6be5c4ba2d069e69001f7032492df2e2c.tar.bz2
Trebuchet: fix uninstall app from shortcut
When uninstalling an app from a shortcut, there are 2 incorrect cases: 1.- If the user proceeds with the uninstall process, all the shortcuts references are removed from the workspace, except the one used to start that process, because the shortcut is removed from the workspace, but not from the favorites database. A reboot of the device will restore the shortcut into the workspace again. 2.- If the user cancels the uninstall process, the shortcut used is not restored, because it was removed in the drag&drop process. This change restore the shortcut prior to start the uninstall process. For restoring the shortcuts the patchset verifies 3 conditions: 1.- If the shortcut was in the desktop, the shortcut is restored in the same position. 2.- If the shortcut was contained by a folder with one or two shortcuts, then the folder is removed in the darg&drop, so the folder is recreated in the same location, and all its shortcuts are restored 3.- If the shortcut was contained by a folder with more than 2 shortcuts, the shortcut is restored in the same folder. If the user proceeds with the uninstall process then as the shortcut is present in the workspace, the shortcut will be removed. Change-Id: I95e2684d01cabd0d5a04f17c896c72cad2b14d38 Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'src/com/cyanogenmod/trebuchet/ShortcutInfo.java')
-rw-r--r--src/com/cyanogenmod/trebuchet/ShortcutInfo.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/cyanogenmod/trebuchet/ShortcutInfo.java b/src/com/cyanogenmod/trebuchet/ShortcutInfo.java
index 8f0d8d3..d08700c 100644
--- a/src/com/cyanogenmod/trebuchet/ShortcutInfo.java
+++ b/src/com/cyanogenmod/trebuchet/ShortcutInfo.java
@@ -69,6 +69,14 @@ class ShortcutInfo extends ItemInfo {
*/
private ShortcutListener mListener;
+ /**
+ * The shortcut folder information
+ *
+ * NOTE: For now only is filled when the shortcut is being dropped, so the shortcut
+ * can be restored if finally the item is not dropped. Only for internal use.
+ */
+ FolderInfo mFolderInfo = null;
+
ShortcutInfo() {
itemType = LauncherSettings.BaseLauncherColumns.ITEM_TYPE_SHORTCUT;
}