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

Commit 2f341f1a authored by Ted Wang's avatar Ted Wang Committed by android-build-merger
Browse files

L2CAP: Fix configuration_request timeout am: 7022c09c am: d69d6663

am: ea073cca

Change-Id: I69e2a81a99d569c3ec947577099df315afaf2041
parents 8562d217 ea073cca
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -287,10 +287,14 @@ class SimpleL2capTest(GdBaseTestClass):
        self._setup_link()
        scid = 0x0101
        psm = 1
        self._open_channel(scid=0x0101, psm=0x1)

        self.device_under_test.l2cap.SetDynamicChannel(l2cap_facade_pb2.SetEnableDynamicChannelRequest(psm=psm))

        # Don't send configuration request
        def handle_connection_response(log):
            log = log.connection_response
            self.scid_dcid_map[log.scid] = log.dcid
        self.event_handler.on(is_connection_response, handle_connection_response)
        # Don't send configuration response back
        self.event_handler.on(is_configuration_request, lambda _: True)
        self.cert_device.l2cap.SendConnectionRequest(l2cap_cert_pb2.ConnectionRequest(scid=scid, psm=psm))
@@ -301,9 +305,17 @@ class SimpleL2capTest(GdBaseTestClass):
            # DUT should not send configuration response due to timeout
            assert False
        self.event_handler.on(is_configuration_response, handle_configuration_response)
        disconnect_request_received = []
        def handle_disconnection_request(log):
            log = log.disconnection_request
            disconnect_request_received.append((log.scid, log.dcid))
        self.event_handler.on(is_disconnection_request, handle_disconnection_request)
        logs = self.cert_device.l2cap.FetchL2capLog(l2cap_cert_pb2.FetchL2capLogRequest())
        self.event_handler.execute(logs)

        # Note: DUT may not support sending disconnect request so this should be optional
        assert (self.scid_dcid_map[scid], scid) in disconnect_request_received

    def test_basic_operation_request_connection(self):
        """
        L2CAP/COS/CED/BV-01-C [Request Connection]
+2 −1
Original line number Diff line number Diff line
@@ -650,7 +650,8 @@ void ClassicSignallingManager::on_command_timeout() {
      break;
    }
    case CommandCode::CONFIGURATION_REQUEST: {
      SendDisconnectionRequest(command_just_sent_.source_cid_, command_just_sent_.destination_cid_);
      auto channel = channel_allocator_->FindChannelByRemoteCid(command_just_sent_.destination_cid_);
      SendDisconnectionRequest(channel->GetCid(), channel->GetRemoteCid());
      break;
    }
    default: