mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 18:45:19 +00:00
25 lines
767 B
Java
25 lines
767 B
Java
|
package org.thoughtcrime.securesms.jobs;
|
||
|
|
||
|
import android.content.Context;
|
||
|
|
||
|
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
||
|
import org.thoughtcrime.securesms.service.KeyCachingService;
|
||
|
import org.whispersystems.jobqueue.JobParameters;
|
||
|
|
||
|
public abstract class MasterSecretJob extends ContextJob {
|
||
|
|
||
|
public MasterSecretJob(Context context, JobParameters parameters) {
|
||
|
super(context, parameters);
|
||
|
}
|
||
|
|
||
|
protected MasterSecret getMasterSecret() throws RequirementNotMetException {
|
||
|
MasterSecret masterSecret = KeyCachingService.getMasterSecret(context);
|
||
|
|
||
|
if (masterSecret == null) throw new RequirementNotMetException();
|
||
|
else return masterSecret;
|
||
|
}
|
||
|
|
||
|
protected static class RequirementNotMetException extends Exception {}
|
||
|
|
||
|
}
|