mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
parent
e6b2d31db7
commit
491440094b
@ -86,6 +86,9 @@ public class MmsDownloadJob extends MasterSecretJob {
|
||||
|
||||
try {
|
||||
RetrieveConf retrieveConf = getMmsConnection(context).retrieve(contentLocation, transactionId);
|
||||
if (retrieveConf == null) {
|
||||
throw new MmsException("RetrieveConf was null");
|
||||
}
|
||||
storeRetrievedMms(masterSecret, contentLocation, messageId, threadId, retrieveConf);
|
||||
} catch (ApnUnavailableException e) {
|
||||
Log.w(TAG, e);
|
||||
|
@ -18,6 +18,7 @@ package org.thoughtcrime.securesms.mms;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.util.Log;
|
||||
|
||||
import org.apache.http.Header;
|
||||
@ -57,7 +58,7 @@ public class IncomingLegacyMmsConnection extends LegacyMmsConnection implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public RetrieveConf retrieve(String contentLocation, byte[] transactionId) throws MmsRadioException, ApnUnavailableException, IOException {
|
||||
public @Nullable RetrieveConf retrieve(String contentLocation, byte[] transactionId) throws MmsRadioException, ApnUnavailableException, IOException {
|
||||
MmsRadio radio = MmsRadio.getInstance(context);
|
||||
Apn contentApn = new Apn(contentLocation, apn.getProxy(), Integer.toString(apn.getPort()), apn.getUsername(), apn.getPassword());
|
||||
if (isCdmaDevice()) {
|
||||
|
@ -21,6 +21,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build.VERSION;
|
||||
import android.os.Build.VERSION_CODES;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.telephony.SmsManager;
|
||||
import android.util.Log;
|
||||
|
||||
@ -55,7 +56,7 @@ public class IncomingLollipopMmsConnection extends LollipopMmsConnection impleme
|
||||
|
||||
@Override
|
||||
@TargetApi(VERSION_CODES.LOLLIPOP)
|
||||
public synchronized RetrieveConf retrieve(String contentLocation, byte[] transactionId) throws MmsException {
|
||||
public synchronized @Nullable RetrieveConf retrieve(String contentLocation, byte[] transactionId) throws MmsException {
|
||||
beginTransaction();
|
||||
|
||||
try {
|
||||
|
@ -1,10 +1,12 @@
|
||||
package org.thoughtcrime.securesms.mms;
|
||||
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ws.com.google.android.mms.MmsException;
|
||||
import ws.com.google.android.mms.pdu.RetrieveConf;
|
||||
|
||||
public interface IncomingMmsConnection {
|
||||
RetrieveConf retrieve(String contentLocation, byte[] transactionId) throws MmsException, MmsRadioException, ApnUnavailableException, IOException;
|
||||
@Nullable RetrieveConf retrieve(String contentLocation, byte[] transactionId) throws MmsException, MmsRadioException, ApnUnavailableException, IOException;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user