Display IMEI and ICCID for LTE device.
Display IMEI nad ICCID in About tablet / Status for LTE devices. bug:4983512 bug:5001888 Change-Id: I4c418b159b49bef96acd5ef300c9b71379821d1b
This commit is contained in:
@@ -1550,8 +1550,10 @@
|
||||
<string name="status_min_number">MIN</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" -->
|
||||
|
@@ -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,18 +17,48 @@
|
||||
<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"
|
||||
<Preference android:key="operator_name"
|
||||
style="?android:attr/preferenceInformationStyle"
|
||||
android:title="@string/status_operator"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
android:summary="@string/device_info_not_available"
|
||||
android:persistent="false" />
|
||||
<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="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="number"
|
||||
style="?android:attr/preferenceInformationStyle"
|
||||
android:title="@string/status_number"
|
||||
android:summary="@string/device_info_not_available"
|
||||
android:persistent="false" />
|
||||
@@ -50,58 +80,33 @@
|
||||
android:title="@string/status_meid_number"
|
||||
android:summary="@string/device_info_not_available"
|
||||
android:persistent="false" />
|
||||
<Preference android:key="operator_name"
|
||||
style="?android:attr/preferenceInformationStyle"
|
||||
android:title="@string/status_operator"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
android:summary="@string/device_info_not_available"
|
||||
android:persistent="false" />
|
||||
<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="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="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" />
|
||||
|
@@ -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);
|
||||
@@ -228,11 +230,18 @@ public class Status extends PreferenceActivity {
|
||||
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());
|
||||
|
||||
@@ -245,6 +254,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
|
||||
@@ -288,7 +298,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();
|
||||
@@ -322,7 +332,7 @@ public class Status extends PreferenceActivity {
|
||||
findPreference(preference).setSummary(
|
||||
SystemProperties.get(property, alt));
|
||||
} catch (RuntimeException e) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,12 +345,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);
|
||||
@@ -359,14 +369,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);
|
||||
@@ -379,9 +389,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 {
|
||||
@@ -389,7 +399,7 @@ public class Status extends PreferenceActivity {
|
||||
}
|
||||
setSummaryText(KEY_OPERATOR_NAME, serviceState.getOperatorAlphaLong());
|
||||
}
|
||||
|
||||
|
||||
void updateSignalStrength() {
|
||||
// TODO PhoneStateIntentReceiver is deprecated and PhoneStateListener
|
||||
// should probably used instead.
|
||||
@@ -426,7 +436,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);
|
||||
@@ -462,7 +472,7 @@ public class Status extends PreferenceActivity {
|
||||
|
||||
mUptime.setSummary(convert(ut));
|
||||
}
|
||||
|
||||
|
||||
private String pad(int n) {
|
||||
if (n >= 10) {
|
||||
return String.valueOf(n);
|
||||
|
Reference in New Issue
Block a user