AI 143382: am: CL 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/...
  Original author: android-build
  Merged from: //branches/donutburger/...

Automated import of CL 143382
This commit is contained in:
Jeffrey Sharkey 2009-03-27 19:39:58 -07:00 committed by The Android Open Source Project
parent ccb1ecbe63
commit c975a06ac3
1 changed files with 1 additions and 1 deletions

View File

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