diff options
| author | 2018-11-06 18:19:31 +0000 | |
|---|---|---|
| committer | 2018-11-06 18:19:31 +0000 | |
| commit | 3bedd0a674fc14dab3fc444619b5261a81ed97c7 (patch) | |
| tree | 6f7c4e08369b5f06a17f4f9053ae97c083233f4b | |
| parent | f1e9db0cbe0c896e62abb36db84b58a01d2b33a2 (diff) | |
| parent | 24d9490c482d9fc74f6a1b9b0d7cb00c6d4babd4 (diff) | |
Merge "Added APN to string method"
| -rw-r--r-- | telephony/java/android/telephony/AccessNetworkConstants.java | 26 | ||||
| -rw-r--r-- | telephony/java/android/telephony/data/ApnSetting.java | 10 |
2 files changed, 34 insertions, 2 deletions
diff --git a/telephony/java/android/telephony/AccessNetworkConstants.java b/telephony/java/android/telephony/AccessNetworkConstants.java index cac9f2b51b73..9c64cf6ddd8f 100644 --- a/telephony/java/android/telephony/AccessNetworkConstants.java +++ b/telephony/java/android/telephony/AccessNetworkConstants.java @@ -32,7 +32,20 @@ public final class AccessNetworkConstants { public static final int IWLAN = 5; /** @hide */ - private AccessNetworkType() {}; + private AccessNetworkType() {} + + /** @hide */ + public static String toString(int type) { + switch (type) { + case UNKNOWN: return "UNKNOWN"; + case GERAN: return "GERAN"; + case UTRAN: return "UTRAN"; + case EUTRAN: return "EUTRAN"; + case CDMA2000: return "CDMA2000"; + case IWLAN: return "IWLAN"; + default: return Integer.toString(type); + } + } } /** @@ -47,7 +60,16 @@ public final class AccessNetworkConstants { public static final int WLAN = 2; /** @hide */ - private TransportType() {}; + private TransportType() {} + + /** @hide */ + public static String toString(int type) { + switch (type) { + case WWAN: return "WWAN"; + case WLAN: return "WLAN"; + default: return Integer.toString(type); + } + } } /** diff --git a/telephony/java/android/telephony/data/ApnSetting.java b/telephony/java/android/telephony/data/ApnSetting.java index ed14f91f9934..e1cb7cc2725b 100644 --- a/telephony/java/android/telephony/data/ApnSetting.java +++ b/telephony/java/android/telephony/data/ApnSetting.java @@ -1184,6 +1184,16 @@ public class ApnSetting implements Parcelable { } /** + * @param apnType APN type + * @return APN type in string format + * @hide + */ + public static String getApnTypeString(int apnType) { + String apnTypeString = APN_TYPE_INT_MAP.get(apnType); + return apnTypeString == null ? "Unknown" : apnTypeString; + } + + /** * @param types comma delimited list of APN types. * @return bitmask of APN types. * @hide |