diff options
| author | Sindhu Kanathur <skanat@codeaurora.org> | 2015-03-02 16:30:51 +0530 |
|---|---|---|
| committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:29:40 -0600 |
| commit | 840e44ee6b90f71a427cffd5676af0bf4324050d (patch) | |
| tree | 62bb18d6806f33df813927d08f9bb47030eb6019 /src/com/android/dialer | |
| parent | d3bbfca9fa5db701f719618d9314625626f504db (diff) | |
| download | packages_apps_Dialer-840e44ee6b90f71a427cffd5676af0bf4324050d.tar.gz packages_apps_Dialer-840e44ee6b90f71a427cffd5676af0bf4324050d.tar.bz2 packages_apps_Dialer-840e44ee6b90f71a427cffd5676af0bf4324050d.zip | |
Dialer: Display 14 digit IMEI(Ignore Check Digit)
Show 14 digit IMEI instead of 15 digit based on the
config (ignore check digit)
Change-Id: I626d8e4c8b6bfae5ec75a303c1582d0b4ed107eb
CRs-Fixed: 808534
Diffstat (limited to 'src/com/android/dialer')
| -rw-r--r-- | src/com/android/dialer/SpecialCharSequenceMgr.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/dialer/SpecialCharSequenceMgr.java b/src/com/android/dialer/SpecialCharSequenceMgr.java index 31aa5c3c7..43672231d 100644 --- a/src/com/android/dialer/SpecialCharSequenceMgr.java +++ b/src/com/android/dialer/SpecialCharSequenceMgr.java @@ -47,6 +47,7 @@ import com.android.contacts.common.widget.SelectPhoneAccountDialogFragment; import com.android.contacts.common.widget.SelectPhoneAccountDialogFragment.SelectPhoneAccountListener; import com.android.dialer.calllog.PhoneAccountUtils; import com.android.dialer.util.TelecomUtil; +import com.android.internal.telephony.ConfigResourceUtil; import java.util.Arrays; import java.util.ArrayList; @@ -72,7 +73,7 @@ public class SpecialCharSequenceMgr { private static final String SECRET_CODE_ACTION = "android.provider.Telephony.SECRET_CODE"; private static final String MMI_IMEI_DISPLAY = "*#06#"; private static final String MMI_REGULATORY_INFO_DISPLAY = "*#07#"; - + private static final int IMEI_14_DIGIT = 14; /** * Remembers the previous {@link QueryHandler} and cancel the operation when needed, to * prevent possible crash. @@ -329,6 +330,7 @@ public class SpecialCharSequenceMgr { static boolean handleDeviceIdDisplay(Context context, String input) { TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); + ConfigResourceUtil mConfigResUtil = new ConfigResourceUtil(); if (telephonyManager != null && input.equals(MMI_IMEI_DISPLAY)) { int labelResId = (telephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) ? @@ -337,6 +339,20 @@ public class SpecialCharSequenceMgr { List<String> deviceIds = new ArrayList<String>(); for (int slot = 0; slot < telephonyManager.getPhoneCount(); slot++) { String deviceId = telephonyManager.getDeviceId(slot); + + boolean enable14DigitImei = false; + try { + enable14DigitImei = mConfigResUtil.getBooleanValue(context, + "config_enable_display_14digit_imei"); + } catch(RuntimeException ex) { + //do Nothing + Log.e(TAG, "Config for 14 digit IMEI not found: " + ex); + } + if (enable14DigitImei && deviceId != null + && deviceId.length() > IMEI_14_DIGIT) { + deviceId = deviceId.substring(0, IMEI_14_DIGIT); + } + if (!TextUtils.isEmpty(deviceId)) { deviceIds.add(deviceId); } |
