summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdnan <adnan@cyngn.com>2014-11-19 23:52:17 (GMT)
committerAdnan <adnan@cyngn.com>2014-11-19 23:54:00 (GMT)
commit783be63c0a6d9b47f900c5d711a6a1663f1ca112 (patch)
tree4481f40b9167c3f91b1a81b22af8946787ec55de
parent8b6ad0ca18654695cedc2d369b271549630d8a2d (diff)
downloadandroid_packages_apps_Trebuchet-783be63c0a6d9b47f900c5d711a6a1663f1ca112.zip
android_packages_apps_Trebuchet-783be63c0a6d9b47f900c5d711a6a1663f1ca112.tar.gz
android_packages_apps_Trebuchet-783be63c0a6d9b47f900c5d711a6a1663f1ca112.tar.bz2
Trebuchet: Fix migration from L to Trebuchet.
Change-Id: Ide667f2bba1dcce2ff3d9a6b08e15bf9bf0ada34
-rw-r--r--src/com/android/launcher3/LauncherProvider.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java
index 419505e..f1b7d33 100644
--- a/src/com/android/launcher3/LauncherProvider.java
+++ b/src/com/android/launcher3/LauncherProvider.java
@@ -959,17 +959,17 @@ public class LauncherProvider extends ContentProvider {
}
if (oldVersion < 21) {
- //Check for column's existence, hackish way to make sure
- //we can upgrade from Trebuchet and from Launcher3(new)
+ // Check for column's existence, hackish way to make sure
+ // we can upgrade from Trebuchet and from Launcher3(new)
Cursor c = null;
try {
c = db.rawQuery("SELECT hidden FROM favorites", null);
- //if we have don't have hidden, add it
- if (c == null || (c != null && !c.moveToNext())) {
- db.execSQL("ALTER TABLE favorites ADD hidden INTEGER DEFAULT 0");
- } else {
- //otherwise, we don't have profiles
+ // if we have have hidden, add profiles
+ if (c != null) {
addProfileColumn(db);
+ } else {
+ // otherwise, we don't have hidden, add it
+ db.execSQL("ALTER TABLE favorites ADD hidden INTEGER DEFAULT 0");
}
} catch (SQLException e) {
Log.e(TAG, e.getMessage(), e);