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

Commit cf683657 authored by Yuyang Huang's avatar Yuyang Huang
Browse files

[Pandora] throw l2cap exception out

Bug: 276370399
Test: atest pts-bot:L2CAP
Change-Id: Ice8ecbb9fc40c475f9a7a6fd91b829ca65442b0b
parent b634177f
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -117,11 +117,21 @@ class L2CAPProxy(ProfileProxy):
        tests_require_secure_connection = [
            "L2CAP/LE/CFC/BV-13-C",
        ]
        tests_connection_target_to_failed = [
            "L2CAP/LE/CFC/BV-05-C",
        ]

        if test in tests_to_open_bluetooth_server_socket:
            secure_connection = test in tests_require_secure_connection
            self.l2cap.ListenL2CAPChannel(connection=self.connection, secure=secure_connection)
            try:
                self.l2cap.AcceptL2CAPChannel(connection=self.connection)
            except Exception as e:
                if test in tests_connection_target_to_failed:
                    self.test_status_map[test] = 'OK'
                    print(test, 'connection targets to fail', file=sys.stderr)
                else:
                    raise e
        return "OK"

    @assert_description
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ class L2cap(val context: Context) : L2CAPImplBase(), Closeable {
        connectionOutStreamMap[connection] = bluetoothSocket.getOutputStream()!!
      } catch (e: IOException) {
        Log.e(TAG, "bluetoothServerSocket not accepted", e)
        return@grpcUnary AcceptL2CAPChannelResponse.newBuilder().build()
        throw e
      }

      AcceptL2CAPChannelResponse.newBuilder().build()