From 598421095aacb599d4bc8e8fcea20734d7847d0c Mon Sep 17 00:00:00 2001 From: Shufeng Hou Date: Tue, 3 Nov 2015 10:29:52 +0800 Subject: SystemUI: Support display for radio tech Support monitor locale change and display for radio tech. CRs-Fixed: 653747 Change-Id: I66d0bb29d0121a19ada0c1ad03ceeec9a03243df --- .../java/android/telephony/TelephonyManager.java | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'telephony/java') diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 4799753..8ea496b 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1642,6 +1642,37 @@ public class TelephonyManager { } } + /** + * convert network class to string base on network type + * @param type for which network type is returned + * @return the network class type string + * @hide + */ + public String networkClassToString(int type) { + String ratClassName = ""; + int networkClass = getNetworkClass(type); + Rlog.d(TAG, "networkType = " + type + " networkClass = " + networkClass); + if (mContext == null) return null; + switch (networkClass) { + case TelephonyManager.NETWORK_CLASS_2_G: + ratClassName = mContext.getResources().getString( + com.android.internal.R.string.config_rat_2g); + break; + case TelephonyManager.NETWORK_CLASS_3_G: + ratClassName = mContext.getResources().getString( + com.android.internal.R.string.config_rat_3g); + break; + case TelephonyManager.NETWORK_CLASS_4_G: + ratClassName = mContext.getResources().getString( + com.android.internal.R.string.config_rat_4g); + break; + default: + ratClassName = ""; + break; + } + return ratClassName; + } + // // // SIM Card -- cgit v1.1