summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorqqzhou <qqzhou@codeaurora.org>2014-07-24 17:12:42 +0800
committerMatt Garnes <matt@cyngn.com>2014-11-13 17:47:21 -0800
commitb38a11a56e133405856b180db2098d6f00fc3d69 (patch)
treeb68aca9ea35a6c4e2177b2449ffe53bafb858cf6 /src
parent8af5d47dbc2b258d99b4645e651d5ae84535d69e (diff)
downloadandroid_packages_apps_Dialer-b38a11a56e133405856b180db2098d6f00fc3d69.tar.gz
android_packages_apps_Dialer-b38a11a56e133405856b180db2098d6f00fc3d69.tar.bz2
android_packages_apps_Dialer-b38a11a56e133405856b180db2098d6f00fc3d69.zip
Dialer: support to show multiple device ids
Show all device IDs for multiple SIM cards when dial "*#06#" in dialpad. Change-Id: I1654c5949831bb3faba19f4ce87147dfef6df048
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/SpecialCharSequenceMgr.java33
1 files changed, 33 insertions, 0 deletions
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");