Make sure mms proxy is hostname

Bug: 226279832
Test: verified no regression in mms
Change-Id: If08e70e4fb9b72065194552aa96c9dabe1c17f1e
This commit is contained in:
Sooraj Sasindran
2022-04-07 12:07:13 -07:00
parent 8089e6f249
commit 49dfa28259

View File

@@ -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);
}