diff options
-rw-r--r-- | res/values-zh-rCN/strings.xml | 2 | ||||
-rw-r--r-- | res/values/strings.xml | 1 | ||||
-rw-r--r-- | src/com/android/dialer/SpecialCharSequenceMgr.java | 33 |
3 files changed, 36 insertions, 0 deletions
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index 47ad52cb3..f9b577a62 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -201,4 +201,6 @@ <string name="respond_via_sms_setting_title" msgid="1318281521087951580">"快速回复"</string> <string name="call_settings_label" msgid="7416182166943714852">"通话设置"</string> <string name="call_settings_description" msgid="2756622428019213052">"语音信箱、来电等待及其他"</string> + + <string name="device_id">设备标识符</string> </resources> diff --git a/res/values/strings.xml b/res/values/strings.xml index beb7fe209..62818ee06 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -810,4 +810,5 @@ <!-- Label for the call settings section description [CHAR LIMIT=80]--> <string name="call_settings_description">Voicemail, call waiting, and others</string> + <string name="device_id">Device Identifier</string> </resources> diff --git a/src/com/android/dialer/SpecialCharSequenceMgr.java b/src/com/android/dialer/SpecialCharSequenceMgr.java index ba44555cb..1b91449e3 100644 --- a/src/com/android/dialer/SpecialCharSequenceMgr.java +++ b/src/com/android/dialer/SpecialCharSequenceMgr.java @@ -250,6 +250,10 @@ public class SpecialCharSequenceMgr { int phoneType; long subId = SubscriptionManager.getDefaultVoiceSubId(); phoneType = telephonyManager.getCurrentPhoneType(subId); + if (telephonyManager.isMultiSimEnabled()) { + return handleMSimIMEIDisplay(context, telephonyManager); + } + if (phoneType == TelephonyManager.PHONE_TYPE_GSM) { showIMEIPanel(context, useSystemWindow, telephonyManager); return true; @@ -262,6 +266,35 @@ public class SpecialCharSequenceMgr { return false; } + private static boolean handleMSimIMEIDisplay(Context context, + TelephonyManager telephonyManager) { + StringBuffer deviceIds = new StringBuffer(); + int titleId = R.string.device_id; + int count = telephonyManager.getPhoneCount(); + + for (int i = 0; i < count; i++) { + if (i != 0) { + deviceIds.append("\n"); + } + int phoneType = telephonyManager.getCurrentPhoneType(i); + if (phoneType != TelephonyManager.PHONE_TYPE_GSM + && phoneType != TelephonyManager.PHONE_TYPE_CDMA) { + return false; + } + deviceIds.append(context.getString(TelephonyManager.PHONE_TYPE_CDMA == phoneType + ? R.string.meid : R.string.imei) + " "); + deviceIds.append(telephonyManager.getDeviceId(i)); + } + + AlertDialog alert = new AlertDialog.Builder(context) + .setTitle(titleId) + .setMessage(deviceIds.toString()) + .setPositiveButton(android.R.string.ok, null) + .setCancelable(false) + .show(); + return true; + } + private static boolean handleRegulatoryInfoDisplay(Context context, String input) { if (input.equals(MMI_REGULATORY_INFO_DISPLAY)) { Log.d(TAG, "handleRegulatoryInfoDisplay() sending intent to settings app"); |