Loading res/raw/downgrade_schema.json +2 −1 Original line number Original line Diff line number Diff line Loading @@ -2,8 +2,9 @@ // Note: Comments are not supported in JSON schema, but android parser is lenient. // Note: Comments are not supported in JSON schema, but android parser is lenient. // Maximum DB version supported by this schema // Maximum DB version supported by this schema "version" : 29, "version" : 30, "downgrade_to_29" : [], "downgrade_to_28" : [ "downgrade_to_28" : [ "ALTER TABLE favorites RENAME TO temp_favorites;", "ALTER TABLE favorites RENAME TO temp_favorites;", "CREATE TABLE favorites(_id INTEGER PRIMARY KEY, title TEXT, intent TEXT, container INTEGER, screen INTEGER, cellX INTEGER, cellY INTEGER, spanX INTEGER, spanY INTEGER, itemType INTEGER, appWidgetId INTEGER NOT NULL DEFAULT - 1, iconPackage TEXT, iconResource TEXT, icon BLOB, appWidgetProvider TEXT, modified INTEGER NOT NULL DEFAULT 0, restored INTEGER NOT NULL DEFAULT 0, profileId INTEGER DEFAULT 0, rank INTEGER NOT NULL DEFAULT 0, options INTEGER NOT NULL DEFAULT 0);", "CREATE TABLE favorites(_id INTEGER PRIMARY KEY, title TEXT, intent TEXT, container INTEGER, screen INTEGER, cellX INTEGER, cellY INTEGER, spanX INTEGER, spanY INTEGER, itemType INTEGER, appWidgetId INTEGER NOT NULL DEFAULT - 1, iconPackage TEXT, iconResource TEXT, icon BLOB, appWidgetProvider TEXT, modified INTEGER NOT NULL DEFAULT 0, restored INTEGER NOT NULL DEFAULT 0, profileId INTEGER DEFAULT 0, rank INTEGER NOT NULL DEFAULT 0, options INTEGER NOT NULL DEFAULT 0);", Loading src/com/android/launcher3/LauncherProvider.java +6 −1 Original line number Original line Diff line number Diff line Loading @@ -97,7 +97,7 @@ public class LauncherProvider extends ContentProvider { * Represents the schema of the database. Changes in scheme need not be backwards compatible. * Represents the schema of the database. Changes in scheme need not be backwards compatible. * When increasing the scheme version, ensure that downgrade_schema.json is updated * When increasing the scheme version, ensure that downgrade_schema.json is updated */ */ public static final int SCHEMA_VERSION = 29; public static final int SCHEMA_VERSION = 30; public static final String AUTHORITY = BuildConfig.APPLICATION_ID + ".settings"; public static final String AUTHORITY = BuildConfig.APPLICATION_ID + ".settings"; public static final String KEY_LAYOUT_PROVIDER_AUTHORITY = "KEY_LAYOUT_PROVIDER_AUTHORITY"; public static final String KEY_LAYOUT_PROVIDER_AUTHORITY = "KEY_LAYOUT_PROVIDER_AUTHORITY"; Loading Loading @@ -864,6 +864,11 @@ public class LauncherProvider extends ContentProvider { } } } } case 29: { case 29: { // Remove widget panel related leftover workspace items db.delete(Favorites.TABLE_NAME, Utilities.createDbSelectionQuery( Favorites.SCREEN, IntArray.wrap(-777, -778)), null); } case 30: { // DB Upgraded successfully // DB Upgraded successfully return; return; } } Loading Loading
res/raw/downgrade_schema.json +2 −1 Original line number Original line Diff line number Diff line Loading @@ -2,8 +2,9 @@ // Note: Comments are not supported in JSON schema, but android parser is lenient. // Note: Comments are not supported in JSON schema, but android parser is lenient. // Maximum DB version supported by this schema // Maximum DB version supported by this schema "version" : 29, "version" : 30, "downgrade_to_29" : [], "downgrade_to_28" : [ "downgrade_to_28" : [ "ALTER TABLE favorites RENAME TO temp_favorites;", "ALTER TABLE favorites RENAME TO temp_favorites;", "CREATE TABLE favorites(_id INTEGER PRIMARY KEY, title TEXT, intent TEXT, container INTEGER, screen INTEGER, cellX INTEGER, cellY INTEGER, spanX INTEGER, spanY INTEGER, itemType INTEGER, appWidgetId INTEGER NOT NULL DEFAULT - 1, iconPackage TEXT, iconResource TEXT, icon BLOB, appWidgetProvider TEXT, modified INTEGER NOT NULL DEFAULT 0, restored INTEGER NOT NULL DEFAULT 0, profileId INTEGER DEFAULT 0, rank INTEGER NOT NULL DEFAULT 0, options INTEGER NOT NULL DEFAULT 0);", "CREATE TABLE favorites(_id INTEGER PRIMARY KEY, title TEXT, intent TEXT, container INTEGER, screen INTEGER, cellX INTEGER, cellY INTEGER, spanX INTEGER, spanY INTEGER, itemType INTEGER, appWidgetId INTEGER NOT NULL DEFAULT - 1, iconPackage TEXT, iconResource TEXT, icon BLOB, appWidgetProvider TEXT, modified INTEGER NOT NULL DEFAULT 0, restored INTEGER NOT NULL DEFAULT 0, profileId INTEGER DEFAULT 0, rank INTEGER NOT NULL DEFAULT 0, options INTEGER NOT NULL DEFAULT 0);", Loading
src/com/android/launcher3/LauncherProvider.java +6 −1 Original line number Original line Diff line number Diff line Loading @@ -97,7 +97,7 @@ public class LauncherProvider extends ContentProvider { * Represents the schema of the database. Changes in scheme need not be backwards compatible. * Represents the schema of the database. Changes in scheme need not be backwards compatible. * When increasing the scheme version, ensure that downgrade_schema.json is updated * When increasing the scheme version, ensure that downgrade_schema.json is updated */ */ public static final int SCHEMA_VERSION = 29; public static final int SCHEMA_VERSION = 30; public static final String AUTHORITY = BuildConfig.APPLICATION_ID + ".settings"; public static final String AUTHORITY = BuildConfig.APPLICATION_ID + ".settings"; public static final String KEY_LAYOUT_PROVIDER_AUTHORITY = "KEY_LAYOUT_PROVIDER_AUTHORITY"; public static final String KEY_LAYOUT_PROVIDER_AUTHORITY = "KEY_LAYOUT_PROVIDER_AUTHORITY"; Loading Loading @@ -864,6 +864,11 @@ public class LauncherProvider extends ContentProvider { } } } } case 29: { case 29: { // Remove widget panel related leftover workspace items db.delete(Favorites.TABLE_NAME, Utilities.createDbSelectionQuery( Favorites.SCREEN, IntArray.wrap(-777, -778)), null); } case 30: { // DB Upgraded successfully // DB Upgraded successfully return; return; } } Loading