Merge "Fix handling format based on API level accordingly." am: d626bcaf0c
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Messaging/+/1343463 Change-Id: I71a236a34be90808809c85bbe062e6452fb06afa
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user