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

Commit dda37999 authored by Harshavardhan Nalajala's avatar Harshavardhan Nalajala Committed by Rakesh Goyal
Browse files

Correct message length calculation while sending SMS

Messages are supposed to be sent with correct
length which is obtained from the "LENGTH:" field
in the line received. Current implementation
is sending a message with invalid length causing
NegativeNumberException when the message is read.

Change-Id: Ieb4239562f8d049ee001ebc547105df44ee70f08
parent 919973d1
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -746,8 +746,7 @@ public abstract class BluetoothMapbMessage {
                 * END:MSG in the actual message content, it is now safe to use the END:MSG tag
                 * as terminator, and simply ignore the length field.*/

                /* 2 added to compensate for the removed \r\n */
                byte[] rawData = reader.getDataBytes(mBMsgLength - (line.getBytes().length + 2));
                byte[] rawData = reader.getDataBytes(mBMsgLength);
                String data;
                try {
                    data = new String(rawData, "UTF-8");