diff options
author | Winson Chung <winsonc@google.com> | 2011-08-25 13:51:25 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-08-25 13:53:35 -0700 |
commit | c22a54d4263086f8f8d5844a33550c77b09b38bd (patch) | |
tree | db129b6cfb98410b94ddcc722a1c2807b3647374 /src | |
parent | 536f7db06c18d2622332f7f67002f323b71f1043 (diff) | |
download | android_packages_apps_Trebuchet-c22a54d4263086f8f8d5844a33550c77b09b38bd.tar.gz android_packages_apps_Trebuchet-c22a54d4263086f8f8d5844a33550c77b09b38bd.tar.bz2 android_packages_apps_Trebuchet-c22a54d4263086f8f8d5844a33550c77b09b38bd.zip |
Tweaking the logging in the fail case, adding additional cases for where the db icon cache should be updated. (5205131)
Change-Id: If5bf8d959ba9af40dbe8c13e6ed352a345e1679a
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher2/LauncherModel.java | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index 1f722994c..7d6206222 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -209,11 +209,10 @@ public class LauncherModel extends BroadcastReceiver { if (item != modelItem) { // the modelItem needs to match up perfectly with item if our model is to be // consistent with the database-- for now, just require modelItem == item - Log.e(TAG, "item: " + ((item != null) ? item.toString() : "null")); - Log.e(TAG, "modelItem: " + ((modelItem != null) ? modelItem.toString() : - "null")); - throw new RuntimeException("Error: ItemInfo passed to moveItemInDatabase " + - "doesn't match original"); + String msg = "item: " + ((item != null) ? item.toString() : "null") + + "modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + + "Error: ItemInfo passed to moveItemInDatabase doesn't match original"; + throw new RuntimeException(msg); } // Items are added/removed from the corresponding FolderInfo elsewhere, such @@ -258,11 +257,10 @@ public class LauncherModel extends BroadcastReceiver { if (item != modelItem) { // the modelItem needs to match up perfectly with item if our model is to be // consistent with the database-- for now, just require modelItem == item - Log.e(TAG, "item: " + ((item != null) ? item.toString() : "null")); - Log.e(TAG, "modelItem: " + ((modelItem != null) ? modelItem.toString() : - "null")); - throw new RuntimeException("Error: ItemInfo passed to moveItemInDatabase " + - "doesn't match original"); + String msg = "item: " + ((item != null) ? item.toString() : "null") + + "modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + + "Error: ItemInfo passed to resizeItemInDatabase doesn't match original"; + throw new RuntimeException(msg); } } }); @@ -471,11 +469,10 @@ public class LauncherModel extends BroadcastReceiver { if (item != modelItem) { // the modelItem needs to match up perfectly with item if our model is to be // consistent with the database-- for now, just require modelItem == item - Log.e(TAG, "item: " + ((item != null) ? item.toString() : "null")); - Log.e(TAG, "modelItem: " + ((modelItem != null) ? modelItem.toString() : - "null")); - throw new RuntimeException("Error: ItemInfo passed to updateItemInDatabase " + - "doesn't match original"); + String msg = "item: " + ((item != null) ? item.toString() : "null") + + "modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + + "Error: ItemInfo passed to updateItemInDatabase doesn't match original"; + throw new RuntimeException(msg); } } }); @@ -522,12 +519,14 @@ public class LauncherModel extends BroadcastReceiver { cr.delete(LauncherSettings.Favorites.getContentUri(info.id, false), null, null); sItemsIdMap.remove(info.id); sFolders.remove(info.id); + sDbIconCache.remove(info); sWorkspaceItems.remove(info); cr.delete(LauncherSettings.Favorites.CONTENT_URI_NO_NOTIFICATION, LauncherSettings.Favorites.CONTAINER + "=" + info.id, null); for (ItemInfo childInfo : info.contents) { sItemsIdMap.remove(childInfo.id); + sDbIconCache.remove(childInfo); } } }); |