Fix handling format based on API level accordingly.

Use SmsMessage#createFromPdu(pdu, format) at least on M and replace
SmsMessage#FORMAT_3GPP2 with "3gpp2".
 - SmsMessage#createFromPdu(pdu, format) is added in API level 23.
 - SmsMessage#FORMAT_3GPP2 is added in API level 28.

Test: Manual

Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: Icab2c6c3c86ee8b6597881bfac6066fed60db4d2
This commit is contained in:
Taesu Lee
2020-06-19 18:34:20 +09:00
parent dcfe928ff3
commit bd3b711aca
3 changed files with 8 additions and 7 deletions
@@ -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) {