Clearing DB if necessary, when applying the default layout

Bug: 19574498
Change-Id: I34850d9a7f7316bcc2cb9fc8a5be57d2488c16a6
This commit is contained in:
Sunny Goyal
2015-03-04 09:51:18 -08:00
parent e72f3d53f8
commit c6c8fef3e9

View File

@@ -305,6 +305,10 @@ public class LauncherProvider extends ContentProvider {
if (loader == null) {
loader = getDefaultLayoutParser();
}
// There might be some partially restored DB items, due to buggy restore logic in
// previous versions of launcher.
createEmptyDB();
// Populate favorites table with initial favorites
if ((mOpenHelper.loadFavorites(mOpenHelper.getWritableDatabase(), loader) <= 0)
&& usingExternallyProvidedLayout) {