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

Commit d3cd9cee authored by Stanley Tng's avatar Stanley Tng
Browse files

Add function to update LE connection parameters

As part of new SL4A tests for LE CoC to measure data throughput
performance, this commit will add a function to enable the CoC Facade
to modify the LE Connection Parameters especially the Connection
Intervals.

Test: Ran the new ACTS Tests for LE CoC
Bug: 70683224
Change-Id: I3aed497cd221aad6bdd593890eb61273cac6ab47
parent b0e640c4
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -648,6 +648,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();
@@ -2450,6 +2463,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
     *************************************************************************/