diff options
author | Nancy Chen <nancychen@google.com> | 2015-03-25 21:41:38 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-03-25 21:41:39 +0000 |
commit | 826185d6926f6087ccca191c50c62f47c6cc3c8a (patch) | |
tree | 4c65892125b74bc1957f020a389aad76e3bd71ae /src | |
parent | 02c36528f064b1eafbd4e2432a6e09937fa5f703 (diff) | |
parent | 0f4ec2a7c965a8fa23fa32373fbdbbb3e4be1ea4 (diff) |
Merge "Fix NPE in device ID dialog."
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/SpecialCharSequenceMgr.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/dialer/SpecialCharSequenceMgr.java b/src/com/android/dialer/SpecialCharSequenceMgr.java index f466c417c..46c6de6c9 100644 --- a/src/com/android/dialer/SpecialCharSequenceMgr.java +++ b/src/com/android/dialer/SpecialCharSequenceMgr.java @@ -33,6 +33,7 @@ import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; import android.telephony.PhoneNumberUtils; import android.telephony.TelephonyManager; +import android.text.TextUtils; import android.util.Log; import android.view.WindowManager; import android.widget.EditText; @@ -310,13 +311,16 @@ 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) .setTitle(labelResId) .setItems(deviceIds.toArray(new String[deviceIds.size()]), null) - .setPositiveButton(R.string.ok, null) + .setPositiveButton(android.R.string.ok, null) .setCancelable(false) .show(); return true; |