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

Commit 07aabcec authored by Jorge E. Moreira's avatar Jorge E. Moreira Committed by Myles Watson
Browse files

test_vendor: Move checks for vendor_manager_

Only some vendor operations use vendor_manager_.  Move the checks into
the operations that use it.

Change-Id: I8bb23d740c94df7e2081c29b1d9e062c5c012714
parent dd7760ec
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -47,8 +47,6 @@ class BtVendor {
  static int Op(bt_vendor_opcode_t opcode, void* param) {
    LOG_INFO(LOG_TAG, "Opcode received in vendor library: %d", opcode);

    CHECK(vendor_manager_);

    switch (opcode) {
      case BT_VND_OP_POWER_CTRL: {
        LOG_INFO(LOG_TAG, "Doing op: BT_VND_OP_POWER_CTRL");
@@ -63,6 +61,7 @@ class BtVendor {
      // Give the HCI its fd to communicate with the HciTransport.
      case BT_VND_OP_USERIAL_OPEN: {
        LOG_INFO(LOG_TAG, "Doing op: BT_VND_OP_USERIAL_OPEN");
        CHECK(vendor_manager_);
        int* fd_list = static_cast<int*>(param);
        fd_list[0] = vendor_manager_->GetHciFd();
        LOG_INFO(LOG_TAG, "Setting HCI's fd to: %d", fd_list[0]);
@@ -72,6 +71,7 @@ class BtVendor {
      // Close the HCI's file descriptor.
      case BT_VND_OP_USERIAL_CLOSE:
        LOG_INFO(LOG_TAG, "Doing op: BT_VND_OP_USERIAL_CLOSE");
        CHECK(vendor_manager_);
        LOG_INFO(
            LOG_TAG, "Closing HCI's fd (fd: %d)", vendor_manager_->GetHciFd());
        vendor_manager_->CloseHciFd();