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

Commit 6a1af21c authored by koh.changseok's avatar koh.changseok Committed by Vineeta Srivastava
Browse files

SAP: Do not send padding when packet size is mutiple of 4

Bug: 22943799
Change-Id: I48d411f4e3a79a891360a9a855c4680bea19d748
parent b75c945d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -643,10 +643,12 @@ public class SapMessage {

        /* Payload */
        os.write(value);
        for(int i = 0, n = 4 - (value.length % 4) ; i < n; i++) {
        if (value.length % 4 != 0) {
            for (int i = 0; i < (4 - (value.length % 4)); ++i) {
                os.write(0); // Padding
            }
        }
    }

    public void write(OutputStream os) throws IOException {
        /* Write the header */