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

Commit 7080d4d6 authored by Jakub Tyszkowski's avatar Jakub Tyszkowski Committed by Automerger Merge Worker
Browse files

Merge "TMAP: Fix characteristic permissions" into main am: 5cbca17d

parents 04e4c3dc 5cbca17d
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -84,10 +84,11 @@ public class LeAudioTmapGattServer {
                new BluetoothGattService(BluetoothUuid.TMAP.getUuid(),
                BluetoothGattService.SERVICE_TYPE_PRIMARY);

        BluetoothGattCharacteristic characteristic = new BluetoothGattCharacteristic(
        BluetoothGattCharacteristic characteristic =
                new BluetoothGattCharacteristic(
                        UUID_TMAP_ROLE,
                        BluetoothGattCharacteristic.PROPERTY_READ,
                BluetoothGattCharacteristic.PERMISSION_READ_ENCRYPTED);
                        BluetoothGattCharacteristic.PERMISSION_READ);

        characteristic.setValue(roleMask, BluetoothGattCharacteristic.FORMAT_UINT16, 0);
        service.addCharacteristic(characteristic);
+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
package com.android.bluetooth.le_audio;

import static android.bluetooth.BluetoothGattCharacteristic.FORMAT_UINT16;
import static android.bluetooth.BluetoothGattCharacteristic.PERMISSION_READ_ENCRYPTED;
import static android.bluetooth.BluetoothGattCharacteristic.PERMISSION_READ;
import static android.bluetooth.BluetoothGattCharacteristic.PROPERTY_READ;

import static com.google.common.truth.Truth.assertThat;
@@ -86,7 +86,7 @@ public class LeAudioTmapGattServerTest {
                service.getCharacteristic(LeAudioTmapGattServer.UUID_TMAP_ROLE);
        assertThat(characteristic).isNotNull();
        assertThat(characteristic.getProperties()).isEqualTo(PROPERTY_READ);
        assertThat(characteristic.getPermissions()).isEqualTo(PERMISSION_READ_ENCRYPTED);
        assertThat(characteristic.getPermissions()).isEqualTo(PERMISSION_READ);

        // verify characteristic value
        int value = characteristic.getIntValue(FORMAT_UINT16, 0);