diff options
author | Daniel Bright <dbright@google.com> | 2020-01-16 13:30:30 -0800 |
---|---|---|
committer | Daniel Bright <dbright@google.com> | 2020-01-16 22:49:02 -0800 |
commit | e96a7e16618486782b52b2c7169d2b7b403960cd (patch) | |
tree | 18b9e8e12819c2132cd3a6605d131e03934b551c | |
parent | fbffaeed3750a9843ab1e7a4a555c566877b1f98 (diff) | |
download | Mms-e96a7e16618486782b52b2c7169d2b7b403960cd.tar.gz |
Make string version of APN_TYPEs a @SystemApi
The string version of Apn Types are used in the carrier config table.
Modules besides Telephony uses this table directly and so it made sense to expose
this as a @SystemApi
Test: ApnSettingsTest
Bug: 147465477
Change-Id: Ic4b9f4130f25332a910aa48936d170e4cf487893
-rw-r--r-- | src/com/android/mms/service/ApnSettings.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/com/android/mms/service/ApnSettings.java b/src/com/android/mms/service/ApnSettings.java index 6e54166..7e4a0fc 100644 --- a/src/com/android/mms/service/ApnSettings.java +++ b/src/com/android/mms/service/ApnSettings.java @@ -21,6 +21,7 @@ import android.database.Cursor; import android.net.NetworkUtils; import android.net.Uri; import android.provider.Telephony; +import android.telephony.data.ApnSetting; import android.text.TextUtils; import com.android.mms.service.exception.ApnException; @@ -33,10 +34,6 @@ import java.net.URISyntaxException; */ public class ApnSettings { - // APN types needed in the carrier table. - final static String APN_TYPE_ALL = "*"; - final static String APN_TYPE_MMS = "mms"; - // MMSC URL private final String mServiceCenter; // MMSC proxy address @@ -130,7 +127,7 @@ public class ApnSettings { while (cursor.moveToNext()) { // Read values from APN settings if (isValidApnType( - cursor.getString(COLUMN_TYPE), APN_TYPE_MMS)) { + cursor.getString(COLUMN_TYPE), ApnSetting.TYPE_MMS_STRING)) { String mmscUrl = trimWithNullCheck(cursor.getString(COLUMN_MMSC)); if (TextUtils.isEmpty(mmscUrl)) { continue; @@ -207,13 +204,13 @@ public class ApnSettings { } private static boolean isValidApnType(String types, String requestType) { - // If APN type is unspecified, assume APN_TYPE_ALL. + // If APN type is unspecified, assume TYPE_ALL_STRING. if (TextUtils.isEmpty(types)) { return true; } for (String type : types.split(",")) { type = type.trim(); - if (type.equals(requestType) || type.equals(APN_TYPE_ALL)) { + if (type.equals(requestType) || type.equals(ApnSetting.TYPE_ALL_STRING)) { return true; } } |