Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56c949de authored by Huanze Lan's avatar Huanze Lan Committed by Johan Redestig
Browse files

Handle the case when TP-PI reserved bits are set

Discard settings according to 3GPP TS 23.040,
9.2.3.27 TP-Parameter-Indicator (TP-PI).

Usually operators will set this byte to 0 to indicate
there is no more data, but a few operators sets a
reserved bit to 1 to indicate there is no more data instead,
so we need to handle this case also.

Change-Id: I58abc2473c79b65795be186182927c603b35305e
parent 5b7a88ea
Loading
Loading
Loading
Loading
+16 −12
Original line number Diff line number Diff line
@@ -966,6 +966,9 @@ public class SmsMessage extends SmsMessageBase {
                // additional TP-PI octets.
                moreExtraParams = p.getByte();
            }
            // As per 3GPP 23.040 section 9.2.3.27 TP-Parameter-Indicator,
            // only process the byte if the reserved bits (bits3 to 6) are zero.
            if ((extraParams & 0x78) == 0) {
                // TP-Protocol-Identifier
                if ((extraParams & 0x01) != 0) {
                    protocolIdentifier = p.getByte();
@@ -981,6 +984,7 @@ public class SmsMessage extends SmsMessageBase {
                }
            }
        }
    }

    private void parseSmsDeliver(PduParser p, int firstByte) {
        replyPathPresent = (firstByte & 0x80) == 0x80;