Fixing rank migration code to handle null values correctly.

Bug: 19297508
Change-Id: I652ef30ab37f5b09204f0388de8e065d64b7724d
This commit is contained in:
Sunny Goyal
2015-02-10 19:52:36 -08:00
parent 8f9a787945
commit c87775d8e6

View File

@@ -638,7 +638,8 @@ public class LauncherProvider extends ContentProvider {
new String[] {Integer.toString(LauncherSettings.Favorites.ITEM_TYPE_FOLDER)});
while (c.moveToNext()) {
db.execSQL("UPDATE favorites SET rank=cellX+(cellY*?) WHERE container=?;",
db.execSQL("UPDATE favorites SET rank=cellX+(cellY*?) WHERE "
+ "container=? AND cellX IS NOT NULL AND cellY IS NOT NULL;",
new Object[] {c.getLong(1) + 1, c.getLong(0)});
}