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

Commit 3e1765c5 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

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

Change-Id: I902428eb6ec1854f6fea4331f5451e4242b5d851
parents b5745de6 a21b3bae
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);
    }