Merge "Fix handling format based on API level accordingly." am: d626bcaf0c am: ea97b36d27 am: f33a0d0823

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Messaging/+/1343463

Change-Id: I03c2befd38b5e2d998b77d2e0a642278b01e0d05
This commit is contained in:
Treehugger Robot
2020-06-19 17:30:45 +00:00
committed by Automerger Merge Worker
3 changed files with 8 additions and 7 deletions

View File

@@ -87,7 +87,7 @@ public class SendStatusReceiver extends BroadcastReceiver {
final String format = intent.getStringExtra("format");
status = smsMessage.getStatus();
// Simple matching up CDMA status with GSM status.
if (SmsMessage.FORMAT_3GPP2.equals(format)) {
if ("3gpp2".equals(format)) {
final int errorClass = (status >> 24) & 0x03;
final int statusCode = (status >> 16) & 0x3f;
switch (errorClass) {

View File

@@ -1156,7 +1156,9 @@ public class MmsUtils {
public static SmsMessage getSmsMessageFromDeliveryReport(final Intent intent) {
final byte[] pdu = intent.getByteArrayExtra("pdu");
final String format = intent.getStringExtra("format");
return SmsMessage.createFromPdu(pdu, format);
return OsUtil.isAtLeastM()
? SmsMessage.createFromPdu(pdu, format)
: SmsMessage.createFromPdu(pdu);
}
/**

View File

@@ -302,11 +302,10 @@ public class DebugUtils {
final int length = dis.readInt();
final byte[] pdu = new byte[length];
dis.read(pdu, 0, length);
if (format == null) {
messagesTemp[i] = SmsMessage.createFromPdu(pdu);
} else {
messagesTemp[i] = SmsMessage.createFromPdu(pdu, format);
}
messagesTemp[i] =
OsUtil.isAtLeastM()
? SmsMessage.createFromPdu(pdu, format)
: SmsMessage.createFromPdu(pdu);
}
messages = messagesTemp;
} catch (final FileNotFoundException e) {