Remove widgets which have invalid size in DB

Bug: 120638555
Change-Id: I23746af44e4390da7b09869e181919e7eac26e58
This commit is contained in:
Sunny Goyal
2018-12-27 12:56:47 -08:00
parent bf588b0a8c
commit b2061daa56

View File

@@ -672,6 +672,11 @@ public class LoaderTask implements Runnable {
appWidgetInfo.spanY = c.getInt(spanYIndex);
appWidgetInfo.user = c.user;
if (appWidgetInfo.spanX <= 0 || appWidgetInfo.spanY <= 0) {
c.markDeleted("Widget has invalid size: "
+ appWidgetInfo.spanX + "x" + appWidgetInfo.spanY);
continue;
}
if (!c.isOnWorkspaceOrHotseat()) {
c.markDeleted("Widget found where container != " +
"CONTAINER_DESKTOP nor CONTAINER_HOTSEAT - ignoring!");