Reset operation states on boot

This commit is contained in:
M66B 2020-02-20 12:03:27 +01:00
parent a650fdc82b
commit e29ef76d59
2 changed files with 6 additions and 0 deletions

View File

@ -127,6 +127,9 @@ public interface DaoOperation {
@Query("UPDATE operation SET state = :state WHERE id = :id")
int setOperationState(long id, String state);
@Query("UPDATE operation SET state = NULL")
int resetOperationStates();
@Query("UPDATE operation SET error = :error WHERE id = :id")
int setOperationError(long id, String error);

View File

@ -1678,6 +1678,9 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
db.folder().setFolderSyncState(folder.id, null);
}
// Reset operations
db.operation().resetOperationStates();
// Restore notifications
db.message().clearNotifyingMessages();