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

Commit b66aa91a authored by Stanley Tng's avatar Stanley Tng Committed by android-build-merger
Browse files

Merge "Add function to update LE connection parameters" am: a28beddb

am: cfab9997

Change-Id: I48b6f054fc1d1c3bb40c5f4ea3c95a62885aec1a
parents 4fe402a1 cfab9997
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
     *************************************************************************/