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:
@@ -87,7 +87,7 @@ public class SendStatusReceiver extends BroadcastReceiver {
|
|||||||
final String format = intent.getStringExtra("format");
|
final String format = intent.getStringExtra("format");
|
||||||
status = smsMessage.getStatus();
|
status = smsMessage.getStatus();
|
||||||
// Simple matching up CDMA status with GSM status.
|
// 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 errorClass = (status >> 24) & 0x03;
|
||||||
final int statusCode = (status >> 16) & 0x3f;
|
final int statusCode = (status >> 16) & 0x3f;
|
||||||
switch (errorClass) {
|
switch (errorClass) {
|
||||||
|
|||||||
@@ -1156,7 +1156,9 @@ public class MmsUtils {
|
|||||||
public static SmsMessage getSmsMessageFromDeliveryReport(final Intent intent) {
|
public static SmsMessage getSmsMessageFromDeliveryReport(final Intent intent) {
|
||||||
final byte[] pdu = intent.getByteArrayExtra("pdu");
|
final byte[] pdu = intent.getByteArrayExtra("pdu");
|
||||||
final String format = intent.getStringExtra("format");
|
final String format = intent.getStringExtra("format");
|
||||||
return SmsMessage.createFromPdu(pdu, format);
|
return OsUtil.isAtLeastM()
|
||||||
|
? SmsMessage.createFromPdu(pdu, format)
|
||||||
|
: SmsMessage.createFromPdu(pdu);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -302,11 +302,10 @@ public class DebugUtils {
|
|||||||
final int length = dis.readInt();
|
final int length = dis.readInt();
|
||||||
final byte[] pdu = new byte[length];
|
final byte[] pdu = new byte[length];
|
||||||
dis.read(pdu, 0, length);
|
dis.read(pdu, 0, length);
|
||||||
if (format == null) {
|
messagesTemp[i] =
|
||||||
messagesTemp[i] = SmsMessage.createFromPdu(pdu);
|
OsUtil.isAtLeastM()
|
||||||
} else {
|
? SmsMessage.createFromPdu(pdu, format)
|
||||||
messagesTemp[i] = SmsMessage.createFromPdu(pdu, format);
|
: SmsMessage.createFromPdu(pdu);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
messages = messagesTemp;
|
messages = messagesTemp;
|
||||||
} catch (final FileNotFoundException e) {
|
} catch (final FileNotFoundException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user