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

Commit 34d865a1 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Andre Eisenbach
Browse files

Fix NPE in permissionCheck

permissionCheck can throw NPE when notification is received before
GATT database is discovered. Assume that permission is granted when
receiving notifications for unknown characteristic.

Bug: 30853729
Change-Id: I02aab1197b036584b2021d76f290c2c57db24a19
parent 29101f7f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -183,6 +183,7 @@ public class GattService extends ProfileService {

    boolean permissionCheck(int connId, int handle) {
        List<BluetoothGattService> db = gattClientDatabases.get(connId);
        if (db == null) return true;

        for (BluetoothGattService service : db) {
            for (BluetoothGattCharacteristic characteristic: service.getCharacteristics()) {