Fixed not fully restore backup

This commit is contained in:
MrSluffy
2023-12-22 08:26:59 +08:00
parent 382a8103b5
commit 26e452f87f
@@ -76,6 +76,9 @@ import org.xmlpull.v1.XmlPullParser;
import java.io.InputStream;
import java.io.StringReader;
import app.lawnchair.LawnchairApp;
import app.lawnchair.LawnchairAppKt;
/**
* Utility class which maintains an instance of Launcher database and provides
* utility methods
@@ -106,6 +109,12 @@ public class ModelDbController {
boolean isSandbox = mContext instanceof SandboxContext;
String dbName = isSandbox ? null : InvariantDeviceProfile.INSTANCE.get(mContext).dbFile;
if (!forMigration) {
LawnchairApp app = LawnchairAppKt.getLawnchairApp(mContext);
app.renameRestoredDb(dbName);
app.migrateDbName(dbName);
}
// Set the flag for empty DB
Runnable onEmptyDbCreateCallback = forMigration ? () -> {
}