diff options
Diffstat (limited to 'src/java/android/provider/Telephony.java')
-rwxr-xr-x | src/java/android/provider/Telephony.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/java/android/provider/Telephony.java b/src/java/android/provider/Telephony.java index b76c5f11a..46780156f 100755 --- a/src/java/android/provider/Telephony.java +++ b/src/java/android/provider/Telephony.java @@ -1164,6 +1164,18 @@ public final class Telephony { for (int i = 0; i < pduCount; i++) { byte[] pdu = (byte[]) pdus[i]; msgs[i] = SmsMessage.createFromPdu(pdu, format); + // If the originating address is null on our message + // then the format for SmsMessage createFromPdu is likely + // incorrect. SmsMessage createFromPdu(the new method) + // takes in a format parameter that it gets from the Tracker + // however, on some of our legacy devices using a legacy ril, + // since that format is derived by getting voice tech, + // we can get a bad format and no valid members. + // Thus we introduce a hack that utilizes the deprecated + // SmsMessage.createFromPdu if we get a null originating address. + if (msgs[i].getOriginatingAddress() == null) { + msgs[i] = SmsMessage.createFromPdu(pdu); + } String originatingAddress = msgs[i].getOriginatingAddress(); if (!TextUtils.isEmpty(originatingAddress)) { String normalized = normalizeDigitsOnly(originatingAddress); |