1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 10:17:18 +00:00

Get widget messages in a transaction

This commit is contained in:
M66B 2019-12-12 13:07:42 +01:00
parent 6adead5905
commit f142b90efe

View file

@ -81,7 +81,15 @@ public class WidgetUnifiedRemoteViewsFactory implements RemoteViewsService.Remot
colorWidgetRead = ContextCompat.getColor(context, R.color.colorWidgetRead);
DB db = DB.getInstance(context);
messages = db.message().getWidgetUnified(folder < 0 ? null : folder, threading, unseen, flagged);
try {
db.beginTransaction();
messages = db.message().getWidgetUnified(folder < 0 ? null : folder, threading, unseen, flagged);
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
}
@Override