Add re-export SMS support and hard code Phase 0.

This commit is contained in:
Cody Henthorne
2022-11-16 11:42:41 -05:00
committed by Alex Hart
parent fd1d2ec8fc
commit 7c60c32918
13 changed files with 129 additions and 55 deletions

View File

@@ -417,6 +417,20 @@ public abstract class MessageDatabase extends Database implements MmsSmsColumns,
return 0;
}
/**
* Resets the exported state and exported flag so messages can be re-exported.
*/
public void clearExportState() {
ContentValues values = new ContentValues(2);
values.putNull(EXPORT_STATE);
values.put(EXPORTED, MessageExportStatus.UNEXPORTED.serialize());
SQLiteDatabaseExtensionsKt.update(getWritableDatabase(), getTableName())
.values(values)
.where(EXPORT_STATE + " IS NOT NULL OR " + EXPORTED + " != ?", MessageExportStatus.UNEXPORTED)
.run();
}
/**
* Reset the exported status (not state) to the default for clearing errors.
*/