summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanesh M <daneshm90@gmail.com>2015-06-01 15:59:16 -0700
committerMarcos Marado <mmarado@cyngn.com>2015-06-02 20:12:39 +0100
commitc9b91d0c87f8149fe6874214d8273be1b1247e2c (patch)
treebf3d8e387d4b30e8fd3272cd29edb293e492b888
parent452508c7f984c0384193688e7685983941544bea (diff)
downloadandroid_packages_apps_Dialer-c9b91d0c87f8149fe6874214d8273be1b1247e2c.tar.gz
android_packages_apps_Dialer-c9b91d0c87f8149fe6874214d8273be1b1247e2c.tar.bz2
android_packages_apps_Dialer-c9b91d0c87f8149fe6874214d8273be1b1247e2c.zip
Dialer: Ensure device ids not null
When entering sequence *#06#, if the device doesn't have any valid imei's it will crash since the array adapter uses getItem() and toString(). Ensure not to show a dialog in that case. Change-Id: Ie2d4066ff56e0e078f0d68b6c02b4af47c973f70
-rw-r--r--src/com/android/dialer/SpecialCharSequenceMgr.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/dialer/SpecialCharSequenceMgr.java b/src/com/android/dialer/SpecialCharSequenceMgr.java
index 655976690..04e7e0dfb 100644
--- a/src/com/android/dialer/SpecialCharSequenceMgr.java
+++ b/src/com/android/dialer/SpecialCharSequenceMgr.java
@@ -36,6 +36,7 @@ import android.telecom.TelecomManager;
import android.telephony.PhoneNumberUtils;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
+import android.text.TextUtils;
import android.util.Log;
import android.view.WindowManager;
import android.widget.EditText;
@@ -371,7 +372,10 @@ public class SpecialCharSequenceMgr {
List<String> deviceIds = new ArrayList<String>();
for (int slot = 0; slot < telephonyManager.getPhoneCount(); slot++) {
- deviceIds.add(telephonyManager.getDeviceId(slot));
+ String deviceId = telephonyManager.getDeviceId(slot);
+ if (!TextUtils.isEmpty(deviceId)) {
+ deviceIds.add(deviceId);
+ }
}
AlertDialog alert = new AlertDialog.Builder(context)