From 591d6d77ccc242fcd4678141102531f093cd2a4f Mon Sep 17 00:00:00 2001 From: Jeffrey Sharkey <> Date: Fri, 27 Mar 2009 19:45:21 -0700 Subject: [PATCH] AI 143232: am: CL 143057 Don't NPE when editing a folder name. Only happens when user changes orientation while editing, where getFolderById can return the wrong folder type for the given ID. Original author: jsharkey Merged from: //branches/cupcake/... Automated import of CL 143232 --- src/com/android/launcher/LauncherModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher/LauncherModel.java b/src/com/android/launcher/LauncherModel.java index e3020818b6..b6c90a285a 100644 --- a/src/com/android/launcher/LauncherModel.java +++ b/src/com/android/launcher/LauncherModel.java @@ -1243,7 +1243,7 @@ public class LauncherModel { FolderInfo getFolderById(Context context, long id) { final ContentResolver cr = context.getContentResolver(); Cursor c = cr.query(LauncherSettings.Favorites.CONTENT_URI, null, - "_id=? and itemType=? or itemType=?", + "_id=? and (itemType=? or itemType=?)", new String[] { String.valueOf(id), String.valueOf(LauncherSettings.Favorites.ITEM_TYPE_USER_FOLDER), String.valueOf(LauncherSettings.Favorites.ITEM_TYPE_LIVE_FOLDER) }, null);