diff options
author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2014-04-07 13:24:49 +0700 |
---|---|---|
committer | Abhisek Devkota <ciwrl@cyanogenmod.com> | 2014-04-16 19:36:42 +0000 |
commit | 1c82f1c5fd6ca9e864ea1b2ebd3c5c2659982e87 (patch) | |
tree | 99a5df2720bada641a6d5ee6a29cdb4d52498691 | |
parent | ecbe7b2e348df810e2150b65d8db9d11419e3965 (diff) | |
download | android_packages_apps_Dialer-1c82f1c5fd6ca9e864ea1b2ebd3c5c2659982e87.tar.gz android_packages_apps_Dialer-1c82f1c5fd6ca9e864ea1b2ebd3c5c2659982e87.tar.bz2 android_packages_apps_Dialer-1c82f1c5fd6ca9e864ea1b2ebd3c5c2659982e87.zip |
Dialer (MSIM): display all IMEI/MEID for *#06#
The current implementation display the IMEI/MEID for the active
voice line. However, users would normally expect all IMEI/MEIDs to
be displayed.
Change-Id: I24ca425a8c9fc954f9d79d29577b275e6e332ab0
-rw-r--r-- | src/com/android/dialer/SpecialCharSequenceMgr.java | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/com/android/dialer/SpecialCharSequenceMgr.java b/src/com/android/dialer/SpecialCharSequenceMgr.java index 9540f691c..02deb66c6 100644 --- a/src/com/android/dialer/SpecialCharSequenceMgr.java +++ b/src/com/android/dialer/SpecialCharSequenceMgr.java @@ -319,11 +319,7 @@ public class SpecialCharSequenceMgr { private static void showIMEIPanel(Context context, boolean useSystemWindow) { String imeiStr; if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { - int subscription = MSimTelephonyManager.getDefault(). - getPreferredVoiceSubscription(); - - imeiStr = ((MSimTelephonyManager)context. - getSystemService(Context.MSIM_TELEPHONY_SERVICE)).getDeviceId(subscription); + imeiStr = getMSimDeviceIds(context); } else { imeiStr = ((TelephonyManager)context. getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId(); @@ -340,11 +336,7 @@ public class SpecialCharSequenceMgr { private static void showMEIDPanel(Context context, boolean useSystemWindow) { String meidStr; if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { - int subscription = MSimTelephonyManager.getDefault(). - getPreferredVoiceSubscription(); - - meidStr = ((MSimTelephonyManager)context. - getSystemService(Context.MSIM_TELEPHONY_SERVICE)).getDeviceId(subscription); + meidStr = getMSimDeviceIds(context); } else { meidStr = ((TelephonyManager)context. getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId(); @@ -358,6 +350,22 @@ public class SpecialCharSequenceMgr { .show(); } + private static String getMSimDeviceIds(Context context) { + // Show all IMEI/MEIDs for Multi-SIM + int numPhones = MSimTelephonyManager.getDefault().getPhoneCount(); + + MSimTelephonyManager telephony = (MSimTelephonyManager)context. + getSystemService(Context.MSIM_TELEPHONY_SERVICE); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < numPhones; i++) { + if (i != 0) { + sb.append("\n"); + } + sb.append(telephony.getDeviceId(i)); + } + return sb.toString(); + } + /******* * This code is used to handle SIM Contact queries *******/ |