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

Commit 67dd5613 authored by Stanley Tng's avatar Stanley Tng
Browse files

Update SL4A for LE CoC with LE Data Length changes

Added new tests to measure data throughput performance for LE CoC where
the LE Data Length parameter is set to be the maximum.

Test: Ran the new ACTS Tests for LE CoC (BleCocTest and BleCoc2ConnTest).

Bug: 70683224
Change-Id: I8ebba81cbd6673605690e32823f4c878c2b11269
parent a28beddb
Loading
Loading
Loading
Loading
+20 −2
Original line number Diff line number Diff line
@@ -35,7 +35,8 @@ Status BluetoothSocketManagerBinderServer::connectSocket(
    std::unique_ptr<ParcelFileDescriptor>* _aidl_return) {
  if (!isCallerActiveUserOrManagedProfile()) {
    LOG(WARNING) << "connectSocket() - Not allowed for non-active users";
    return Status::ok();
    return Status::fromExceptionCode(
        Status::EX_SECURITY, String8("Not allowed for non-active users"));
  }

  ENFORCE_PERMISSION(PERMISSION_BLUETOOTH);
@@ -67,7 +68,8 @@ Status BluetoothSocketManagerBinderServer::createSocketChannel(
    std::unique_ptr<ParcelFileDescriptor>* _aidl_return) {
  if (!isCallerActiveUserOrManagedProfile()) {
    LOG(WARNING) << "createSocketChannel() - Not allowed for non-active users";
    return Status::ok();
    return Status::fromExceptionCode(
        Status::EX_SECURITY, String8("Not allowed for non-active users"));
  }

  ENFORCE_PERMISSION(PERMISSION_BLUETOOTH);
@@ -100,5 +102,21 @@ Status BluetoothSocketManagerBinderServer::createSocketChannel(
  return Status::ok();
}

Status BluetoothSocketManagerBinderServer::requestMaximumTxDataLength(
    const BluetoothDevice& device) {
  if (!isCallerActiveUserOrManagedProfile()) {
    LOG(WARNING) << __func__ << ": Not allowed for non-active users";
    return Status::fromExceptionCode(
        Status::EX_SECURITY, String8("Not allowed for non-active users"));
  }

  ENFORCE_PERMISSION(PERMISSION_BLUETOOTH);

  VLOG(1) << __func__;

  socketInterface->request_max_tx_data_length(device.address);
  return Status::ok();
}

}  // namespace bluetooth
}  // namespace android
+2 −0
Original line number Diff line number Diff line
@@ -47,6 +47,8 @@ class BluetoothSocketManagerBinderServer : public BnBluetoothSocketManager {
      std::unique_ptr<::android::os::ParcelFileDescriptor>* _aidl_return)
      override;

  Status requestMaximumTxDataLength(const BluetoothDevice& device);

 private:
  const btsock_interface_t* socketInterface;
  DISALLOW_COPY_AND_ASSIGN(BluetoothSocketManagerBinderServer);