Remove widget panel related leftover workspace items
Upgrade launcher DB version and remove items with
widget panel IDs from the database.
Test: follow test instructions (in CL comment)
Bug: 198254728
Change-Id: I077a5f70ee93b7eca738b38f6b0e788d49f7ce70
diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java
index 49f20c6..df09f29 100644
--- a/src/com/android/launcher3/LauncherProvider.java
+++ b/src/com/android/launcher3/LauncherProvider.java
@@ -97,7 +97,7 @@
* 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
*/
- 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 KEY_LAYOUT_PROVIDER_AUTHORITY = "KEY_LAYOUT_PROVIDER_AUTHORITY";
@@ -864,6 +864,11 @@
}
}
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
return;
}