Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9b91d0c authored by Danesh M's avatar Danesh M Committed by Marcos Marado
Browse files

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
parent 452508c7
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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)