use of com.android.launcher3.model.GridBackupTable in project android_packages_apps_Trebuchet by LineageOS.
the class RestoreDbTask method restoreWorkspace.
private void restoreWorkspace(@NonNull Context context, @NonNull SQLiteDatabase db, @NonNull DatabaseHelper helper, @NonNull BackupManager backupManager) throws Exception {
final InvariantDeviceProfile idp = LauncherAppState.getIDP(context);
GridBackupTable backupTable = new GridBackupTable(context, db, idp.numHotseatIcons, idp.numColumns, idp.numRows);
if (backupTable.restoreFromRawBackupIfAvailable(getDefaultProfileId(db))) {
int itemsDeleted = sanitizeDB(helper, db, backupManager);
LauncherAppState.getInstance(context).getModel().forceReload();
restoreAppWidgetIdsIfExists(context);
if (itemsDeleted == 0) {
// all the items are restored, we no longer need the backup table
dropTable(db, Favorites.BACKUP_TABLE_NAME);
}
}
}
Aggregations