Loading system/btif/src/btif_sock_l2cap.cc +13 −3 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <sys/socket.h> #include <sys/types.h> #include <unistd.h> #include <com_android_bluetooth_flags.h> #include <cstdint> #include <cstring> Loading Loading @@ -646,10 +647,19 @@ static void on_l2cap_close(tBTA_JV_L2CAP_CLOSE* p_close, uint32_t id) { SOCKET_CONNECTION_STATE_DISCONNECTING, sock->server ? SOCKET_ROLE_LISTEN : SOCKET_ROLE_CONNECTION, sock->app_uid, sock->channel, 0, 0, sock->name); if (com::android::bluetooth::flags::donot_push_error_code_to_app_when_connected()) { if (!sock->connected) { if (!send_app_err_code(sock, p_close->reason)) { log::error("Unable to send l2cap socket to application socket_id:{}", sock->id); } } else { log::info("Don't push error for already connected socket:{}", sock->id); } } else { if (!send_app_err_code(sock, p_close->reason)) { log::error("Unable to send l2cap socket to application socket_id:{}", sock->id); } } // TODO: This does not seem to be called... // I'm not sure if this will be called for non-server sockets? if (sock->server) { Loading Loading
system/btif/src/btif_sock_l2cap.cc +13 −3 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <sys/socket.h> #include <sys/types.h> #include <unistd.h> #include <com_android_bluetooth_flags.h> #include <cstdint> #include <cstring> Loading Loading @@ -646,10 +647,19 @@ static void on_l2cap_close(tBTA_JV_L2CAP_CLOSE* p_close, uint32_t id) { SOCKET_CONNECTION_STATE_DISCONNECTING, sock->server ? SOCKET_ROLE_LISTEN : SOCKET_ROLE_CONNECTION, sock->app_uid, sock->channel, 0, 0, sock->name); if (com::android::bluetooth::flags::donot_push_error_code_to_app_when_connected()) { if (!sock->connected) { if (!send_app_err_code(sock, p_close->reason)) { log::error("Unable to send l2cap socket to application socket_id:{}", sock->id); } } else { log::info("Don't push error for already connected socket:{}", sock->id); } } else { if (!send_app_err_code(sock, p_close->reason)) { log::error("Unable to send l2cap socket to application socket_id:{}", sock->id); } } // TODO: This does not seem to be called... // I'm not sure if this will be called for non-server sockets? if (sock->server) { Loading