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.
<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" />
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" />
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,
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;
private Preference mUptime;
private static String sUnknown;
-
+
private Preference mBatteryStatus;
private Preference mBatteryLevel;
}
private BroadcastReceiver mBatteryInfoReceiver = new BroadcastReceiver() {
-
+
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
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;
updateNetworkType();
}
};
-
+
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setSummaryText(KEY_MEID_NUMBER, mPhone.getMeid());
setSummaryText(KEY_MIN_NUMBER, mPhone.getCdmaMin());
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());
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
registerReceiver(mBatteryInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
mHandler.sendEmptyMessage(EVENT_UPDATE_STATS);
}
-
+
@Override
public void onPause() {
super.onPause();
findPreference(preference).setSummary(
SystemProperties.get(property, alt));
} catch (RuntimeException e) {
-
+
}
}
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);
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);
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 {
}
setSummaryText(KEY_OPERATOR_NAME, serviceState.getOperatorAlphaLong());
}
-
+
void updateSignalStrength() {
// TODO PhoneStateIntentReceiver is deprecated and PhoneStateListener
// should probably used instead.
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);
mUptime.setSummary(convert(ut));
}
-
+
private String pad(int n) {
if (n >= 10) {
return String.valueOf(n);