summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/launcher3/LauncherProvider.java28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java
index 061ac1a..91376a7 100644
--- a/src/com/android/launcher3/LauncherProvider.java
+++ b/src/com/android/launcher3/LauncherProvider.java
@@ -745,7 +745,8 @@ public class LauncherProvider extends ContentProvider {
if (!recreateWorkspaceTable(db)) {
break;
}
- case 22: {
+ case 22:
+ case 23:
if (!addIntegerColumn(db, Favorites.OPTIONS, 0)) {
// Old version remains, which means we wipe old data
break;
@@ -754,9 +755,6 @@ public class LauncherProvider extends ContentProvider {
// Old version remains, which means we wipe old data
break;
}
- }
- case 23:
- // No-op
case 24:
ManagedProfileHeuristic.markExistingUsersForNoFolderCreation(mContext);
case 25:
@@ -769,6 +767,12 @@ public class LauncherProvider extends ContentProvider {
case 27: {
// DB Upgraded successfully
updateDialtactsLauncher(db);
+ }
+ case 28: {
+ if (!ensureSubTypeColumn(db)) {
+ // Old version remains, which means we wipe old data
+ break;
+ }
return;
}
}
@@ -963,6 +967,22 @@ public class LauncherProvider extends ContentProvider {
return true;
}
+ @Thunk boolean ensureSubTypeColumn(SQLiteDatabase db) {
+ Cursor c = null;
+ try {
+ // Make sure subType exists
+ c = db.rawQuery("SELECT subType FROM favorites;", null);
+ } catch (SQLException ex) {
+ Log.e(TAG, ex.getMessage(), ex);
+ return addIntegerColumn(db, "subType", 0);
+ } finally {
+ if (c != null) {
+ c.close();
+ }
+ }
+ return true;
+ }
+
private boolean addProfileColumn(SQLiteDatabase db) {
UserManagerCompat userManager = UserManagerCompat.getInstance(mContext);
// Default to the serial number of this user, for older