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

Commit a28beddb authored by Stanley Tng's avatar Stanley Tng Committed by Gerrit Code Review
Browse files

Merge "Add function to update LE connection parameters"

parents bbb03027 d3cd9cee
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -643,6 +643,19 @@ public class GattService extends ProfileService {
            service.connectionParameterUpdate(clientIf, address, connectionPriority);
        }

        @Override
        public void leConnectionUpdate(int clientIf, String address,
                int minConnectionInterval, int maxConnectionInterval,
                int slaveLatency, int supervisionTimeout) {
            GattService service = getService();
            if (service == null) {
                return;
            }
            service.leConnectionUpdate(clientIf, address, minConnectionInterval,
                                                    maxConnectionInterval, slaveLatency,
                                                    supervisionTimeout);
        }

        @Override
        public void registerServer(ParcelUuid uuid, IBluetoothGattServerCallback callback) {
            GattService service = getService();
@@ -2445,6 +2458,20 @@ public class GattService extends ProfileService {
                timeout);
    }

    void leConnectionUpdate(int clientIf, String address, int minInterval,
                                         int maxInterval, int slaveLatency,
                                         int supervisionTimeout) {
        enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");

        if (DBG) {
            Log.d(TAG, "leConnectionUpdate() - address=" + address + ", intervals="
                        + minInterval + "/" + maxInterval + ", latency=" + slaveLatency
                        + ", timeout=" + supervisionTimeout);
        }
        gattConnectionParameterUpdateNative(clientIf, address, minInterval, maxInterval,
                                            slaveLatency, supervisionTimeout);
    }

    /**************************************************************************
     * Callback functions - SERVER
     *************************************************************************/