From c4ad2c4f59d8927cd3a9084fd9262404ab2b4fab Mon Sep 17 00:00:00 2001 From: Aishwarya Mallampati Date: Wed, 1 Jun 2022 16:14:21 +0000 Subject: [PATCH] Extract hostname if mMmsProxyAddress starts with http. Bug: 226279832 Test: atest com.android.internal.telephony.dataconnection.ApnSettingTest#testBuild_mmsProxyAddrStartsWithHttp Change-Id: I3cf4a23ab6d6f7f21116ec591b11ec1c8a798f51 Change-Id: Ic05c39c8c86294564e65c4d0ab0ee263abe03fb3 --- telephony/java/android/telephony/data/ApnSetting.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/telephony/java/android/telephony/data/ApnSetting.java b/telephony/java/android/telephony/data/ApnSetting.java index 235ed842b749c..dbbe1adc342a1 100644 --- a/telephony/java/android/telephony/data/ApnSetting.java +++ b/telephony/java/android/telephony/data/ApnSetting.java @@ -2193,11 +2193,10 @@ public class ApnSetting implements Parcelable { } 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; + Log.wtf(LOG_TAG,"mms proxy(" + mMmsProxyAddress + + ") should be a hostname, not a url"); + Uri mMmsProxyAddressUri = Uri.parse(mMmsProxyAddress); + mMmsProxyAddress = mMmsProxyAddressUri.getHost(); } return new ApnSetting(this); }