diff options
-rw-r--r-- | res/values/strings.xml | 6 | ||||
-rw-r--r-- | res/xml/device_info_status.xml | 91 | ||||
-rw-r--r-- | src/com/android/settings/deviceinfo/Status.java | 52 |
3 files changed, 83 insertions, 66 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 90f3c3f..5e944f0 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1618,8 +1618,10 @@ <string name="status_msid_number">MSID</string> <!-- About phone, status item title. The phone PRL Version of the current device.--> <string name="status_prl_version">PRL Version</string> - <!-- About phone, status item title. The phone IMEI/MEID number of the current LTE/CDMA device.--> - <string name="status_meid_number">IMEI / MEID</string> + <!-- About phone, status item title. The phone MEID number of the current LTE/CDMA device. [CHAR LIMIT=30] --> + <string name="status_meid_number">MEID</string> + <!-- About phone, status item title. The ICCID of the current LTE device. [CHAR LIMIT=30] --> + <string name="status_icc_id">ICCID</string> <!-- About phone, status item title for the type of data phone network we're connected to, for example 3G or Edge or GPRS --> <string name="status_network_type">Mobile network type</string> <!-- About phone, status item title. The status of data access. For example, the value may be "Connected" --> diff --git a/res/xml/device_info_status.xml b/res/xml/device_info_status.xml index 369c565..19e22f4 100644 --- a/res/xml/device_info_status.xml +++ b/res/xml/device_info_status.xml @@ -4,9 +4,9 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,91 +17,96 @@ <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:title="@string/device_status_activity_title"> - <Preference android:key="battery_status" - style="?android:attr/preferenceInformationStyle" + <Preference android:key="battery_status" + style="?android:attr/preferenceInformationStyle" android:title="@string/battery_status_title" android:summary="@string/device_info_not_available" android:persistent="false" /> - <Preference android:key="battery_level" - style="?android:attr/preferenceInformationStyle" + <Preference android:key="battery_level" + style="?android:attr/preferenceInformationStyle" android:title="@string/battery_level_title" android:summary="@string/device_info_not_available" android:persistent="false" /> - <Preference android:key="number" - style="?android:attr/preferenceInformationStyle" - android:title="@string/status_number" + <Preference android:key="operator_name" + style="?android:attr/preferenceInformationStyle" + android:title="@string/status_operator" android:summary="@string/device_info_not_available" android:persistent="false" /> - <!-- This menu item is only for CDMA phone --> - <Preference android:key="min_number" + <Preference android:key="signal_strength" style="?android:attr/preferenceInformationStyle" - android:title="@string/status_min_number" + android:title="@string/status_signal_strength" android:summary="@string/device_info_not_available" android:persistent="false" /> - <!-- This menu item is only for CDMA phone --> - <Preference android:key="prl_version" + <Preference android:key="network_type" style="?android:attr/preferenceInformationStyle" - android:title="@string/status_prl_version" + android:title="@string/status_network_type" android:summary="@string/device_info_not_available" android:persistent="false" /> - <!-- This menu item is only for CDMA phone --> - <Preference android:key="meid_number" + <Preference android:key="service_state" style="?android:attr/preferenceInformationStyle" - android:title="@string/status_meid_number" + android:title="@string/status_service_state" android:summary="@string/device_info_not_available" android:persistent="false" /> - <Preference android:key="operator_name" - style="?android:attr/preferenceInformationStyle" - android:title="@string/status_operator" + <Preference android:key="roaming_state" + style="?android:attr/preferenceInformationStyle" + android:title="@string/status_roaming" android:summary="@string/device_info_not_available" android:persistent="false" /> - <Preference android:key="signal_strength" - style="?android:attr/preferenceInformationStyle" - android:title="@string/status_signal_strength" + <Preference android:key="data_state" + style="?android:attr/preferenceInformationStyle" + android:title="@string/status_data_state" android:summary="@string/device_info_not_available" android:persistent="false" /> - <Preference android:key="network_type" - style="?android:attr/preferenceInformationStyle" - android:title="@string/status_network_type" + <Preference android:key="number" + style="?android:attr/preferenceInformationStyle" + android:title="@string/status_number" android:summary="@string/device_info_not_available" android:persistent="false" /> - <Preference android:key="service_state" - style="?android:attr/preferenceInformationStyle" - android:title="@string/status_service_state" + <!-- This menu item is only for CDMA phone --> + <Preference android:key="min_number" + style="?android:attr/preferenceInformationStyle" + android:title="@string/status_min_number" android:summary="@string/device_info_not_available" android:persistent="false" /> - <Preference android:key="roaming_state" - style="?android:attr/preferenceInformationStyle" - android:title="@string/status_roaming" + <!-- This menu item is only for CDMA phone --> + <Preference android:key="prl_version" + style="?android:attr/preferenceInformationStyle" + android:title="@string/status_prl_version" android:summary="@string/device_info_not_available" android:persistent="false" /> - <Preference android:key="data_state" - style="?android:attr/preferenceInformationStyle" - android:title="@string/status_data_state" + <!-- This menu item is only for CDMA phone --> + <Preference android:key="meid_number" + style="?android:attr/preferenceInformationStyle" + android:title="@string/status_meid_number" android:summary="@string/device_info_not_available" android:persistent="false" /> - <Preference android:key="imei" - style="?android:attr/preferenceInformationStyle" + <Preference android:key="imei" + style="?android:attr/preferenceInformationStyle" android:title="@string/status_imei" android:summary="@string/device_info_not_available" android:persistent="false" /> - <Preference android:key="imei_sv" - style="?android:attr/preferenceInformationStyle" + <Preference android:key="imei_sv" + style="?android:attr/preferenceInformationStyle" android:title="@string/status_imei_sv" android:summary="@string/device_info_not_available" android:persistent="false" /> + <Preference android:key="icc_id" + style="?android:attr/preferenceInformationStyle" + android:title="@string/status_icc_id" + android:summary="@string/device_info_not_available" + android:persistent="false" /> <Preference android:key="wifi_ip_address" style="?android:attr/preferenceInformationStyle" android:title="@string/wifi_advanced_ip_address_title" android:summary="@string/device_info_not_available" android:persistent="false" /> <Preference android:key="wifi_mac_address" - style="?android:attr/preferenceInformationStyle" + style="?android:attr/preferenceInformationStyle" android:title="@string/status_wifi_mac_address" android:summary="@string/device_info_not_available" android:persistent="false" /> <Preference android:key="bt_address" - style="?android:attr/preferenceInformationStyle" + style="?android:attr/preferenceInformationStyle" android:title="@string/status_bt_address" android:summary="@string/device_info_not_available" android:persistent="false" /> @@ -111,7 +116,7 @@ android:summary="@string/device_info_not_available" android:persistent="false" /> <Preference android:key="up_time" - style="?android:attr/preferenceInformationStyle" + style="?android:attr/preferenceInformationStyle" android:title="@string/status_up_time" android:summary="@string/device_info_not_available" android:persistent="false" /> diff --git a/src/com/android/settings/deviceinfo/Status.java b/src/com/android/settings/deviceinfo/Status.java index 68ba354..456bc98 100644 --- a/src/com/android/settings/deviceinfo/Status.java +++ b/src/com/android/settings/deviceinfo/Status.java @@ -82,6 +82,7 @@ public class Status extends PreferenceActivity { private static final String KEY_WIFI_MAC_ADDRESS = "wifi_mac_address"; private static final String KEY_BT_ADDRESS = "bt_address"; private static final String KEY_SERIAL_NUMBER = "serial_number"; + private static final String KEY_ICC_ID = "icc_id"; private static final String[] PHONE_RELATED_ENTRIES = { KEY_DATA_STATE, @@ -95,7 +96,8 @@ public class Status extends PreferenceActivity { KEY_PRL_VERSION, KEY_MIN_NUMBER, KEY_MEID_NUMBER, - KEY_SIGNAL_STRENGTH + KEY_SIGNAL_STRENGTH, + KEY_ICC_ID }; private static final int EVENT_SIGNAL_STRENGTH_CHANGED = 200; @@ -111,7 +113,7 @@ public class Status extends PreferenceActivity { private Preference mUptime; private static String sUnknown; - + private Preference mBatteryStatus; private Preference mBatteryLevel; @@ -150,7 +152,7 @@ public class Status extends PreferenceActivity { } private BroadcastReceiver mBatteryInfoReceiver = new BroadcastReceiver() { - + @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); @@ -158,9 +160,9 @@ public class Status extends PreferenceActivity { int level = intent.getIntExtra("level", 0); int scale = intent.getIntExtra("scale", 100); - + mBatteryLevel.setSummary(String.valueOf(level * 100 / scale) + "%"); - + int plugType = intent.getIntExtra("plugged", 0); int status = intent.getIntExtra("status", BatteryManager.BATTERY_STATUS_UNKNOWN); String statusString; @@ -193,7 +195,7 @@ public class Status extends PreferenceActivity { updateNetworkType(); } }; - + @Override protected void onCreate(Bundle icicle) { super.onCreate(icicle); @@ -231,11 +233,18 @@ public class Status extends PreferenceActivity { findPreference(KEY_MIN_NUMBER).setTitle(R.string.status_msid_number); } setSummaryText(KEY_PRL_VERSION, mPhone.getCdmaPrlVersion()); - - // device is not GSM/UMTS, do not display GSM/UMTS features - // check Null in case no specified preference in overlay xml - removePreferenceFromScreen(KEY_IMEI); removePreferenceFromScreen(KEY_IMEI_SV); + + if (mPhone.getLteOnCdmaMode() == Phone.LTE_ON_CDMA_TRUE) { + // Show ICC ID and IMEI for LTE device + setSummaryText(KEY_ICC_ID, mPhone.getIccSerialNumber()); + setSummaryText(KEY_IMEI, mPhone.getImei()); + } else { + // device is not GSM/UMTS, do not display GSM/UMTS features + // check Null in case no specified preference in overlay xml + removePreferenceFromScreen(KEY_IMEI); + removePreferenceFromScreen(KEY_ICC_ID); + } } else { setSummaryText(KEY_IMEI, mPhone.getDeviceId()); @@ -248,6 +257,7 @@ public class Status extends PreferenceActivity { removePreferenceFromScreen(KEY_PRL_VERSION); removePreferenceFromScreen(KEY_MEID_NUMBER); removePreferenceFromScreen(KEY_MIN_NUMBER); + removePreferenceFromScreen(KEY_ICC_ID); } String rawNumber = mPhone.getLine1Number(); // may be null or empty @@ -291,7 +301,7 @@ public class Status extends PreferenceActivity { registerReceiver(mBatteryInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); mHandler.sendEmptyMessage(EVENT_UPDATE_STATS); } - + @Override public void onPause() { super.onPause(); @@ -325,7 +335,7 @@ public class Status extends PreferenceActivity { findPreference(preference).setSummary( SystemProperties.get(property, alt)); } catch (RuntimeException e) { - + } } @@ -338,12 +348,12 @@ public class Status extends PreferenceActivity { findPreference(preference).setSummary(text); } } - + private void updateNetworkType() { // Whether EDGE, UMTS, etc... setSummary(KEY_NETWORK_TYPE, TelephonyProperties.PROPERTY_DATA_NETWORK_TYPE, sUnknown); } - + private void updateDataState() { int state = mTelephonyManager.getDataState(); String display = mRes.getString(R.string.radioInfo_unknown); @@ -362,14 +372,14 @@ public class Status extends PreferenceActivity { display = mRes.getString(R.string.radioInfo_data_disconnected); break; } - + setSummaryText(KEY_DATA_STATE, display); } private void updateServiceState(ServiceState serviceState) { int state = serviceState.getState(); String display = mRes.getString(R.string.radioInfo_unknown); - + switch (state) { case ServiceState.STATE_IN_SERVICE: display = mRes.getString(R.string.radioInfo_service_in); @@ -382,9 +392,9 @@ public class Status extends PreferenceActivity { display = mRes.getString(R.string.radioInfo_service_off); break; } - + setSummaryText(KEY_SERVICE_STATE, display); - + if (serviceState.getRoaming()) { setSummaryText(KEY_ROAMING_STATE, mRes.getString(R.string.radioInfo_roaming_in)); } else { @@ -392,7 +402,7 @@ public class Status extends PreferenceActivity { } setSummaryText(KEY_OPERATOR_NAME, serviceState.getOperatorAlphaLong()); } - + void updateSignalStrength() { // TODO PhoneStateIntentReceiver is deprecated and PhoneStateListener // should probably used instead. @@ -429,7 +439,7 @@ public class Status extends PreferenceActivity { Preference wifiMacAddressPref = findPreference(KEY_WIFI_MAC_ADDRESS); String macAddress = wifiInfo == null ? null : wifiInfo.getMacAddress(); - wifiMacAddressPref.setSummary(!TextUtils.isEmpty(macAddress) ? macAddress + wifiMacAddressPref.setSummary(!TextUtils.isEmpty(macAddress) ? macAddress : getString(R.string.status_unavailable)); Preference wifiIpAddressPref = findPreference(KEY_WIFI_IP_ADDRESS); @@ -465,7 +475,7 @@ public class Status extends PreferenceActivity { mUptime.setSummary(convert(ut)); } - + private String pad(int n) { if (n >= 10) { return String.valueOf(n); |