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

Commit f8ef6209 authored by Android (Google) Code Review's avatar Android (Google) Code Review Committed by The Android Open Source Project
Browse files

am 7b8f782e: Merge change 6183 into donut

Merge commit '7b8f782e'

* commit '7b8f782e':
  Fix null data handling in ServiceCommand.writeCommand()
parents 605c9835 7b8f782e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -140,7 +140,7 @@ public class ServiceCommand {


    private boolean writeCommand(int cmd, String _data) {
    private boolean writeCommand(int cmd, String _data) {
        byte buf[] = new byte[8];
        byte buf[] = new byte[8];
        byte[] data = _data.getBytes();
        byte[] data = (_data == null) ? new byte[0] : _data.getBytes();
        int len = data.length;
        int len = data.length;
        // the length of data
        // the length of data
        buf[0] = (byte) (len & 0xff);
        buf[0] = (byte) (len & 0xff);