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

Commit 7c06e695 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "gtbs: Fix crash when setting null uri" am: 1a300b10 am: a21b3bae am: 3e1765c5

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1957000

Change-Id: I92547e568bcf8b6a278578d2ec2e7712ab1eb883
parents 09f214c7 3e1765c5
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);
    }