|
|
|
@ -26,10 +26,15 @@ import android.support.annotation.Nullable;
|
|
|
|
|
import android.telephony.SmsManager;
|
|
|
|
|
import android.util.Log;
|
|
|
|
|
|
|
|
|
|
import com.google.android.mms.InvalidHeaderValueException;
|
|
|
|
|
import com.google.android.mms.pdu_alt.NotifyRespInd;
|
|
|
|
|
import com.google.android.mms.pdu_alt.PduComposer;
|
|
|
|
|
import com.google.android.mms.pdu_alt.PduHeaders;
|
|
|
|
|
import com.google.android.mms.pdu_alt.PduParser;
|
|
|
|
|
import com.google.android.mms.pdu_alt.RetrieveConf;
|
|
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.providers.MmsBodyProvider;
|
|
|
|
|
import org.thoughtcrime.securesms.transport.UndeliverableMessageException;
|
|
|
|
|
import org.thoughtcrime.securesms.util.Util;
|
|
|
|
|
|
|
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
|
@ -89,7 +94,9 @@ public class IncomingLollipopMmsConnection extends LollipopMmsConnection impleme
|
|
|
|
|
|
|
|
|
|
Log.w(TAG, baos.size() + "-byte response: ");// + Hex.dump(baos.toByteArray()));
|
|
|
|
|
|
|
|
|
|
return (RetrieveConf) new PduParser(baos.toByteArray()).parse();
|
|
|
|
|
RetrieveConf retrieved = (RetrieveConf) new PduParser(baos.toByteArray()).parse();
|
|
|
|
|
sendRetrievedAcknowledgement(transactionId, retrieved.getMmsVersion(), subscriptionId);
|
|
|
|
|
return retrieved;
|
|
|
|
|
} catch (IOException | TimeoutException e) {
|
|
|
|
|
Log.w(TAG, e);
|
|
|
|
|
throw new MmsException(e);
|
|
|
|
@ -97,4 +104,15 @@ public class IncomingLollipopMmsConnection extends LollipopMmsConnection impleme
|
|
|
|
|
endTransaction();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void sendRetrievedAcknowledgement(byte[] transactionId, int mmsVersion, int subscriptionId) {
|
|
|
|
|
try {
|
|
|
|
|
NotifyRespInd retrieveResponse = new NotifyRespInd(mmsVersion, transactionId, PduHeaders.STATUS_RETRIEVED);
|
|
|
|
|
new OutgoingLollipopMmsConnection(getContext()).send(new PduComposer(getContext(), retrieveResponse).make(), subscriptionId);
|
|
|
|
|
} catch (UndeliverableMessageException e) {
|
|
|
|
|
Log.w(TAG, e);
|
|
|
|
|
} catch (InvalidHeaderValueException e) {
|
|
|
|
|
Log.w(TAG, e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|