Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 49dfa282 authored by Sooraj Sasindran's avatar Sooraj Sasindran
Browse files

Make sure mms proxy is hostname

Bug: 226279832
Test: verified no regression in mms
Change-Id: If08e70e4fb9b72065194552aa96c9dabe1c17f1e
parent 8089e6f2
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.content.ContentValues;
import android.database.Cursor;
import android.hardware.radio.V1_5.ApnTypes;
import android.net.Uri;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.Telephony;
@@ -2183,6 +2184,14 @@ public class ApnSetting implements Parcelable {
                || TextUtils.isEmpty(mApnName) || TextUtils.isEmpty(mEntryName)) {
                return null;
            }
            if ((mApnTypeBitmask & TYPE_MMS) != 0 && !TextUtils.isEmpty(mMmsProxyAddress)
                    && mMmsProxyAddress.startsWith("http")) {
                if (Build.IS_DEBUGGABLE) {
                    throw new IllegalArgumentException("mms proxy(" +  mMmsProxyAddress
                            + ") should be a hostname, not a url");
                }
                return null;
            }
            return new ApnSetting(this);
        }