mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-07-08 06:54:09 +01:00
Remove blank MMS config overrides.
Some SIM cards include blank values for `uaProfUrl` and `userAgent`. Passing in these blank values along with the overrides causes a 412 precondition error when downloading MMS from ATT&T. If these values happen to be blank, then they should be removed completely from the overrides, allowing the request to use the default `uaProfUrl` and `userAgent` for the system. Fixes #9173
This commit is contained in:
@@ -26,6 +26,8 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.telephony.SmsManager;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
|
||||
import com.google.android.mms.InvalidHeaderValueException;
|
||||
@@ -99,6 +101,14 @@ public class IncomingLollipopMmsConnection extends LollipopMmsConnection impleme
|
||||
}
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(configOverrides.getString(SmsManager.MMS_CONFIG_USER_AGENT))) {
|
||||
configOverrides.remove(SmsManager.MMS_CONFIG_USER_AGENT);
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(configOverrides.getString(SmsManager.MMS_CONFIG_UA_PROF_URL))) {
|
||||
configOverrides.remove(SmsManager.MMS_CONFIG_UA_PROF_URL);
|
||||
}
|
||||
|
||||
smsManager.downloadMultimediaMessage(getContext(),
|
||||
contentLocation,
|
||||
pointer.getUri(),
|
||||
|
||||
Reference in New Issue
Block a user