Moved exists to send service

This commit is contained in:
M66B
2021-03-30 09:36:51 +02:00
parent e98dafdf3f
commit 90af49d770
3 changed files with 57 additions and 27 deletions

View File

@@ -57,9 +57,6 @@ public class ServiceUI extends IntentService {
static final int PI_SNOOZE = 9;
static final int PI_IGNORED = 10;
static final int PI_THREAD = 11;
static final int PI_WAKEUP = 12;
static final int PI_EXISTS = 15;
public ServiceUI() {
this(ServiceUI.class.getName());
@@ -161,7 +158,7 @@ public class ServiceUI extends IntentService {
break;
case "exists":
onExists(id);
// ignore
break;
default:
@@ -462,25 +459,6 @@ public class ServiceUI extends IntentService {
}
}
private void onExists(long id) {
DB db = DB.getInstance(this);
try {
db.beginTransaction();
// Message could have been deleted in the meantime
EntityMessage message = db.message().getMessage(id);
if (message == null)
return;
EntityOperation.queue(this, message, EntityOperation.EXISTS, true);
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
}
static void sync(Context context, Long account) {
context.startService(new Intent(context, ServiceUI.class)
.setAction(account == null ? "sync" : "sync:" + account));