Merge "Extract hostname if mMmsProxyAddress starts with http." into tm-qpr-dev

This commit is contained in:
Aishwarya Mallampati
2022-06-14 15:11:30 +00:00
committed by Android (Google) Code Review

View File

@@ -2190,11 +2190,10 @@ public class ApnSetting implements Parcelable {
} }
if ((mApnTypeBitmask & TYPE_MMS) != 0 && !TextUtils.isEmpty(mMmsProxyAddress) if ((mApnTypeBitmask & TYPE_MMS) != 0 && !TextUtils.isEmpty(mMmsProxyAddress)
&& mMmsProxyAddress.startsWith("http")) { && mMmsProxyAddress.startsWith("http")) {
if (Build.IS_DEBUGGABLE) { Log.wtf(LOG_TAG,"mms proxy(" + mMmsProxyAddress
throw new IllegalArgumentException("mms proxy(" + mMmsProxyAddress + ") should be a hostname, not a url");
+ ") should be a hostname, not a url"); Uri mMmsProxyAddressUri = Uri.parse(mMmsProxyAddress);
} mMmsProxyAddress = mMmsProxyAddressUri.getHost();
return null;
} }
return new ApnSetting(this); return new ApnSetting(this);
} }