Merge "Make sure mms proxy is hostname" into tm-dev

This commit is contained in:
TreeHugger Robot
2022-04-08 03:04:25 +00:00
committed by Android (Google) Code Review

View File

@@ -24,6 +24,7 @@ import android.content.ContentValues;
import android.database.Cursor; import android.database.Cursor;
import android.hardware.radio.V1_5.ApnTypes; import android.hardware.radio.V1_5.ApnTypes;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.provider.Telephony; import android.provider.Telephony;
@@ -2183,6 +2184,14 @@ public class ApnSetting implements Parcelable {
|| TextUtils.isEmpty(mApnName) || TextUtils.isEmpty(mEntryName)) { || TextUtils.isEmpty(mApnName) || TextUtils.isEmpty(mEntryName)) {
return null; 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); return new ApnSetting(this);
} }