mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-29 04:55:15 +00:00
30 lines
996 B
Java
30 lines
996 B
Java
|
package org.thoughtcrime.securesms.jobs;
|
||
|
|
||
|
import android.content.Context;
|
||
|
|
||
|
import org.thoughtcrime.securesms.BuildConfig;
|
||
|
import org.thoughtcrime.securesms.TextSecureExpiredException;
|
||
|
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
||
|
import org.thoughtcrime.securesms.util.Util;
|
||
|
import org.whispersystems.jobqueue.JobParameters;
|
||
|
|
||
|
public abstract class SendJob extends MasterSecretJob {
|
||
|
|
||
|
public SendJob(Context context, JobParameters parameters) {
|
||
|
super(context, parameters);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public final void onRun(MasterSecret masterSecret) throws Exception {
|
||
|
if (!Util.isBuildFresh()) {
|
||
|
throw new TextSecureExpiredException(String.format("TextSecure expired (build %d, now %d)",
|
||
|
BuildConfig.BUILD_TIMESTAMP,
|
||
|
System.currentTimeMillis()));
|
||
|
}
|
||
|
|
||
|
onSend(masterSecret);
|
||
|
}
|
||
|
|
||
|
protected abstract void onSend(MasterSecret masterSecret) throws Exception;
|
||
|
}
|