mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 08:09:12 +01:00
Add support for dependency injection, and accompanying tests.
This commit is contained in:
@@ -62,9 +62,8 @@ public class SmsDecryptJob extends MasterSecretJob {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRun() throws RequirementNotMetException, NoSuchMessageException {
|
||||
MasterSecret masterSecret = getMasterSecret();
|
||||
EncryptingSmsDatabase database = DatabaseFactory.getEncryptingSmsDatabase(context);
|
||||
public void onRun(MasterSecret masterSecret) throws NoSuchMessageException {
|
||||
EncryptingSmsDatabase database = DatabaseFactory.getEncryptingSmsDatabase(context);
|
||||
|
||||
try {
|
||||
SmsMessageRecord record = database.getMessage(masterSecret, messageId);
|
||||
@@ -94,6 +93,11 @@ public class SmsDecryptJob extends MasterSecretJob {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onShouldRetryThrowable(Throwable throwable) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCanceled() {
|
||||
// TODO
|
||||
@@ -166,12 +170,6 @@ public class SmsDecryptJob extends MasterSecretJob {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onShouldRetry(Throwable throwable) {
|
||||
if (throwable instanceof RequirementNotMetException) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private String getAsymmetricDecryptedBody(MasterSecret masterSecret, String body)
|
||||
throws InvalidMessageException
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user