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

Commit 1a300b10 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "gtbs: Fix crash when setting null uri"

parents 9e695017 9b1510cc
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -596,9 +596,17 @@ public class TbsGatt {
        if (DBG) {
            Log.d(TAG, "setIncomingCall: callIndex=" + callIndex + " uri=" + uri);
        }
        byte[] value = new byte[uri.length() + 1];
        int uri_len = 0;
        if (uri != null) {
            uri_len = uri.length();
        }

        byte[] value = new byte[uri_len + 1];
        value[0] = (byte) (callIndex & 0xff);
        System.arraycopy(uri.getBytes(), 0, value, 1, uri.length());

        if (uri_len > 0) {
            System.arraycopy(uri.getBytes(), 0, value, 1, uri_len);
        }

        return mIncomingCallCharacteristic.setValue(value);
    }