• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Settings


Commit MetaInfo

Revisãod7b2dccbe60a02965186d28f0b671ef1c419a2a8 (tree)
Hora2011-07-14 02:25:29
AutorJohn Wang <johnwang@goog...>
CommiterJohn Wang

Mensagem de Log

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

Mudança Sumário

Diff

--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1550,8 +1550,10 @@
15501550 <string name="status_min_number">MIN</string>
15511551 <!-- About phone, status item title. The phone PRL Version of the current device.-->
15521552 <string name="status_prl_version">PRL Version</string>
1553- <!-- About phone, status item title. The phone IMEI/MEID number of the current LTE/CDMA device.-->
1554- <string name="status_meid_number">IMEI / MEID</string>
1553+ <!-- About phone, status item title. The phone MEID number of the current LTE/CDMA device. [CHAR LIMIT=30] -->
1554+ <string name="status_meid_number">MEID</string>
1555+ <!-- About phone, status item title. The ICCID of the current LTE device. [CHAR LIMIT=30] -->
1556+ <string name="status_icc_id">ICCID</string>
15551557 <!-- About phone, status item title for the type of data phone network we're connected to, for example 3G or Edge or GPRS -->
15561558 <string name="status_network_type">Mobile network type</string>
15571559 <!-- About phone, status item title. The status of data access. For example, the value may be "Connected" -->
--- a/res/xml/device_info_status.xml
+++ b/res/xml/device_info_status.xml
@@ -4,9 +4,9 @@
44 Licensed under the Apache License, Version 2.0 (the "License");
55 you may not use this file except in compliance with the License.
66 You may obtain a copy of the License at
7-
7+
88 http://www.apache.org/licenses/LICENSE-2.0
9-
9+
1010 Unless required by applicable law or agreed to in writing, software
1111 distributed under the License is distributed on an "AS IS" BASIS,
1212 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,91 +17,96 @@
1717 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
1818 android:title="@string/device_status_activity_title">
1919
20- <Preference android:key="battery_status"
21- style="?android:attr/preferenceInformationStyle"
20+ <Preference android:key="battery_status"
21+ style="?android:attr/preferenceInformationStyle"
2222 android:title="@string/battery_status_title"
2323 android:summary="@string/device_info_not_available"
2424 android:persistent="false" />
25- <Preference android:key="battery_level"
26- style="?android:attr/preferenceInformationStyle"
25+ <Preference android:key="battery_level"
26+ style="?android:attr/preferenceInformationStyle"
2727 android:title="@string/battery_level_title"
2828 android:summary="@string/device_info_not_available"
2929 android:persistent="false" />
30- <Preference android:key="number"
31- style="?android:attr/preferenceInformationStyle"
32- android:title="@string/status_number"
30+ <Preference android:key="operator_name"
31+ style="?android:attr/preferenceInformationStyle"
32+ android:title="@string/status_operator"
3333 android:summary="@string/device_info_not_available"
3434 android:persistent="false" />
35- <!-- This menu item is only for CDMA phone -->
36- <Preference android:key="min_number"
35+ <Preference android:key="signal_strength"
3736 style="?android:attr/preferenceInformationStyle"
38- android:title="@string/status_min_number"
37+ android:title="@string/status_signal_strength"
3938 android:summary="@string/device_info_not_available"
4039 android:persistent="false" />
41- <!-- This menu item is only for CDMA phone -->
42- <Preference android:key="prl_version"
40+ <Preference android:key="network_type"
4341 style="?android:attr/preferenceInformationStyle"
44- android:title="@string/status_prl_version"
42+ android:title="@string/status_network_type"
4543 android:summary="@string/device_info_not_available"
4644 android:persistent="false" />
47- <!-- This menu item is only for CDMA phone -->
48- <Preference android:key="meid_number"
45+ <Preference android:key="service_state"
4946 style="?android:attr/preferenceInformationStyle"
50- android:title="@string/status_meid_number"
47+ android:title="@string/status_service_state"
5148 android:summary="@string/device_info_not_available"
5249 android:persistent="false" />
53- <Preference android:key="operator_name"
54- style="?android:attr/preferenceInformationStyle"
55- android:title="@string/status_operator"
50+ <Preference android:key="roaming_state"
51+ style="?android:attr/preferenceInformationStyle"
52+ android:title="@string/status_roaming"
5653 android:summary="@string/device_info_not_available"
5754 android:persistent="false" />
58- <Preference android:key="signal_strength"
59- style="?android:attr/preferenceInformationStyle"
60- android:title="@string/status_signal_strength"
55+ <Preference android:key="data_state"
56+ style="?android:attr/preferenceInformationStyle"
57+ android:title="@string/status_data_state"
6158 android:summary="@string/device_info_not_available"
6259 android:persistent="false" />
63- <Preference android:key="network_type"
64- style="?android:attr/preferenceInformationStyle"
65- android:title="@string/status_network_type"
60+ <Preference android:key="number"
61+ style="?android:attr/preferenceInformationStyle"
62+ android:title="@string/status_number"
6663 android:summary="@string/device_info_not_available"
6764 android:persistent="false" />
68- <Preference android:key="service_state"
69- style="?android:attr/preferenceInformationStyle"
70- android:title="@string/status_service_state"
65+ <!-- This menu item is only for CDMA phone -->
66+ <Preference android:key="min_number"
67+ style="?android:attr/preferenceInformationStyle"
68+ android:title="@string/status_min_number"
7169 android:summary="@string/device_info_not_available"
7270 android:persistent="false" />
73- <Preference android:key="roaming_state"
74- style="?android:attr/preferenceInformationStyle"
75- android:title="@string/status_roaming"
71+ <!-- This menu item is only for CDMA phone -->
72+ <Preference android:key="prl_version"
73+ style="?android:attr/preferenceInformationStyle"
74+ android:title="@string/status_prl_version"
7675 android:summary="@string/device_info_not_available"
7776 android:persistent="false" />
78- <Preference android:key="data_state"
79- style="?android:attr/preferenceInformationStyle"
80- android:title="@string/status_data_state"
77+ <!-- This menu item is only for CDMA phone -->
78+ <Preference android:key="meid_number"
79+ style="?android:attr/preferenceInformationStyle"
80+ android:title="@string/status_meid_number"
8181 android:summary="@string/device_info_not_available"
8282 android:persistent="false" />
83- <Preference android:key="imei"
84- style="?android:attr/preferenceInformationStyle"
83+ <Preference android:key="imei"
84+ style="?android:attr/preferenceInformationStyle"
8585 android:title="@string/status_imei"
8686 android:summary="@string/device_info_not_available"
8787 android:persistent="false" />
88- <Preference android:key="imei_sv"
89- style="?android:attr/preferenceInformationStyle"
88+ <Preference android:key="imei_sv"
89+ style="?android:attr/preferenceInformationStyle"
9090 android:title="@string/status_imei_sv"
9191 android:summary="@string/device_info_not_available"
9292 android:persistent="false" />
93+ <Preference android:key="icc_id"
94+ style="?android:attr/preferenceInformationStyle"
95+ android:title="@string/status_icc_id"
96+ android:summary="@string/device_info_not_available"
97+ android:persistent="false" />
9398 <Preference android:key="wifi_ip_address"
9499 style="?android:attr/preferenceInformationStyle"
95100 android:title="@string/wifi_advanced_ip_address_title"
96101 android:summary="@string/device_info_not_available"
97102 android:persistent="false" />
98103 <Preference android:key="wifi_mac_address"
99- style="?android:attr/preferenceInformationStyle"
104+ style="?android:attr/preferenceInformationStyle"
100105 android:title="@string/status_wifi_mac_address"
101106 android:summary="@string/device_info_not_available"
102107 android:persistent="false" />
103108 <Preference android:key="bt_address"
104- style="?android:attr/preferenceInformationStyle"
109+ style="?android:attr/preferenceInformationStyle"
105110 android:title="@string/status_bt_address"
106111 android:summary="@string/device_info_not_available"
107112 android:persistent="false" />
@@ -111,7 +116,7 @@
111116 android:summary="@string/device_info_not_available"
112117 android:persistent="false" />
113118 <Preference android:key="up_time"
114- style="?android:attr/preferenceInformationStyle"
119+ style="?android:attr/preferenceInformationStyle"
115120 android:title="@string/status_up_time"
116121 android:summary="@string/device_info_not_available"
117122 android:persistent="false" />
--- 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 {
8282 private static final String KEY_WIFI_MAC_ADDRESS = "wifi_mac_address";
8383 private static final String KEY_BT_ADDRESS = "bt_address";
8484 private static final String KEY_SERIAL_NUMBER = "serial_number";
85+ private static final String KEY_ICC_ID = "icc_id";
8586
8687 private static final String[] PHONE_RELATED_ENTRIES = {
8788 KEY_DATA_STATE,
@@ -95,7 +96,8 @@ public class Status extends PreferenceActivity {
9596 KEY_PRL_VERSION,
9697 KEY_MIN_NUMBER,
9798 KEY_MEID_NUMBER,
98- KEY_SIGNAL_STRENGTH
99+ KEY_SIGNAL_STRENGTH,
100+ KEY_ICC_ID
99101 };
100102
101103 private static final int EVENT_SIGNAL_STRENGTH_CHANGED = 200;
@@ -111,7 +113,7 @@ public class Status extends PreferenceActivity {
111113 private Preference mUptime;
112114
113115 private static String sUnknown;
114-
116+
115117 private Preference mBatteryStatus;
116118 private Preference mBatteryLevel;
117119
@@ -150,7 +152,7 @@ public class Status extends PreferenceActivity {
150152 }
151153
152154 private BroadcastReceiver mBatteryInfoReceiver = new BroadcastReceiver() {
153-
155+
154156 @Override
155157 public void onReceive(Context context, Intent intent) {
156158 String action = intent.getAction();
@@ -158,9 +160,9 @@ public class Status extends PreferenceActivity {
158160
159161 int level = intent.getIntExtra("level", 0);
160162 int scale = intent.getIntExtra("scale", 100);
161-
163+
162164 mBatteryLevel.setSummary(String.valueOf(level * 100 / scale) + "%");
163-
165+
164166 int plugType = intent.getIntExtra("plugged", 0);
165167 int status = intent.getIntExtra("status", BatteryManager.BATTERY_STATUS_UNKNOWN);
166168 String statusString;
@@ -193,7 +195,7 @@ public class Status extends PreferenceActivity {
193195 updateNetworkType();
194196 }
195197 };
196-
198+
197199 @Override
198200 protected void onCreate(Bundle icicle) {
199201 super.onCreate(icicle);
@@ -228,11 +230,18 @@ public class Status extends PreferenceActivity {
228230 setSummaryText(KEY_MEID_NUMBER, mPhone.getMeid());
229231 setSummaryText(KEY_MIN_NUMBER, mPhone.getCdmaMin());
230232 setSummaryText(KEY_PRL_VERSION, mPhone.getCdmaPrlVersion());
231-
232- // device is not GSM/UMTS, do not display GSM/UMTS features
233- // check Null in case no specified preference in overlay xml
234- removePreferenceFromScreen(KEY_IMEI);
235233 removePreferenceFromScreen(KEY_IMEI_SV);
234+
235+ if (mPhone.getLteOnCdmaMode() == Phone.LTE_ON_CDMA_TRUE) {
236+ // Show ICC ID and IMEI for LTE device
237+ setSummaryText(KEY_ICC_ID, mPhone.getIccSerialNumber());
238+ setSummaryText(KEY_IMEI, mPhone.getImei());
239+ } else {
240+ // device is not GSM/UMTS, do not display GSM/UMTS features
241+ // check Null in case no specified preference in overlay xml
242+ removePreferenceFromScreen(KEY_IMEI);
243+ removePreferenceFromScreen(KEY_ICC_ID);
244+ }
236245 } else {
237246 setSummaryText(KEY_IMEI, mPhone.getDeviceId());
238247
@@ -245,6 +254,7 @@ public class Status extends PreferenceActivity {
245254 removePreferenceFromScreen(KEY_PRL_VERSION);
246255 removePreferenceFromScreen(KEY_MEID_NUMBER);
247256 removePreferenceFromScreen(KEY_MIN_NUMBER);
257+ removePreferenceFromScreen(KEY_ICC_ID);
248258 }
249259
250260 String rawNumber = mPhone.getLine1Number(); // may be null or empty
@@ -288,7 +298,7 @@ public class Status extends PreferenceActivity {
288298 registerReceiver(mBatteryInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
289299 mHandler.sendEmptyMessage(EVENT_UPDATE_STATS);
290300 }
291-
301+
292302 @Override
293303 public void onPause() {
294304 super.onPause();
@@ -322,7 +332,7 @@ public class Status extends PreferenceActivity {
322332 findPreference(preference).setSummary(
323333 SystemProperties.get(property, alt));
324334 } catch (RuntimeException e) {
325-
335+
326336 }
327337 }
328338
@@ -335,12 +345,12 @@ public class Status extends PreferenceActivity {
335345 findPreference(preference).setSummary(text);
336346 }
337347 }
338-
348+
339349 private void updateNetworkType() {
340350 // Whether EDGE, UMTS, etc...
341351 setSummary(KEY_NETWORK_TYPE, TelephonyProperties.PROPERTY_DATA_NETWORK_TYPE, sUnknown);
342352 }
343-
353+
344354 private void updateDataState() {
345355 int state = mTelephonyManager.getDataState();
346356 String display = mRes.getString(R.string.radioInfo_unknown);
@@ -359,14 +369,14 @@ public class Status extends PreferenceActivity {
359369 display = mRes.getString(R.string.radioInfo_data_disconnected);
360370 break;
361371 }
362-
372+
363373 setSummaryText(KEY_DATA_STATE, display);
364374 }
365375
366376 private void updateServiceState(ServiceState serviceState) {
367377 int state = serviceState.getState();
368378 String display = mRes.getString(R.string.radioInfo_unknown);
369-
379+
370380 switch (state) {
371381 case ServiceState.STATE_IN_SERVICE:
372382 display = mRes.getString(R.string.radioInfo_service_in);
@@ -379,9 +389,9 @@ public class Status extends PreferenceActivity {
379389 display = mRes.getString(R.string.radioInfo_service_off);
380390 break;
381391 }
382-
392+
383393 setSummaryText(KEY_SERVICE_STATE, display);
384-
394+
385395 if (serviceState.getRoaming()) {
386396 setSummaryText(KEY_ROAMING_STATE, mRes.getString(R.string.radioInfo_roaming_in));
387397 } else {
@@ -389,7 +399,7 @@ public class Status extends PreferenceActivity {
389399 }
390400 setSummaryText(KEY_OPERATOR_NAME, serviceState.getOperatorAlphaLong());
391401 }
392-
402+
393403 void updateSignalStrength() {
394404 // TODO PhoneStateIntentReceiver is deprecated and PhoneStateListener
395405 // should probably used instead.
@@ -426,7 +436,7 @@ public class Status extends PreferenceActivity {
426436
427437 Preference wifiMacAddressPref = findPreference(KEY_WIFI_MAC_ADDRESS);
428438 String macAddress = wifiInfo == null ? null : wifiInfo.getMacAddress();
429- wifiMacAddressPref.setSummary(!TextUtils.isEmpty(macAddress) ? macAddress
439+ wifiMacAddressPref.setSummary(!TextUtils.isEmpty(macAddress) ? macAddress
430440 : getString(R.string.status_unavailable));
431441
432442 Preference wifiIpAddressPref = findPreference(KEY_WIFI_IP_ADDRESS);
@@ -462,7 +472,7 @@ public class Status extends PreferenceActivity {
462472
463473 mUptime.setSummary(convert(ut));
464474 }
465-
475+
466476 private String pad(int n) {
467477 if (n >= 10) {
468478 return String.valueOf(n);