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

Commit ff29733c authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by android-build-merger
Browse files

Merge "GATT: put include declarations before characteristics in service"

am: 1a0c93dd

Change-Id: Ib728ed69834935b591aff82b6b9cd4c45e86d4f2
parents b7f0052e 1a0c93dd
Loading
Loading
Loading
Loading
+11 −11
Original line number Original line Diff line number Diff line
@@ -2888,6 +2888,17 @@ public class GattService extends ProfileService {
            db.add(GattDbElement.createSecondaryService(service.getUuid()));
            db.add(GattDbElement.createSecondaryService(service.getUuid()));
        }
        }


        for (BluetoothGattService includedService : service.getIncludedServices()) {
            int inclSrvcHandle = includedService.getInstanceId();

            if (mHandleMap.checkServiceExists(includedService.getUuid(), inclSrvcHandle)) {
                db.add(GattDbElement.createIncludedService(inclSrvcHandle));
            } else {
                Log.e(TAG,
                        "included service with UUID " + includedService.getUuid() + " not found!");
            }
        }

        for (BluetoothGattCharacteristic characteristic : service.getCharacteristics()) {
        for (BluetoothGattCharacteristic characteristic : service.getCharacteristics()) {
            int permission =
            int permission =
                    ((characteristic.getKeySize() - 7) << 12) + characteristic.getPermissions();
                    ((characteristic.getKeySize() - 7) << 12) + characteristic.getPermissions();
@@ -2901,17 +2912,6 @@ public class GattService extends ProfileService {
            }
            }
        }
        }


        for (BluetoothGattService includedService : service.getIncludedServices()) {
            int inclSrvcHandle = includedService.getInstanceId();

            if (mHandleMap.checkServiceExists(includedService.getUuid(), inclSrvcHandle)) {
                db.add(GattDbElement.createIncludedService(inclSrvcHandle));
            } else {
                Log.e(TAG,
                        "included service with UUID " + includedService.getUuid() + " not found!");
            }
        }

        gattServerAddServiceNative(serverIf, db);
        gattServerAddServiceNative(serverIf, db);
    }
    }