Loading system/main/shim/acl.cc +3 −1 Original line number Diff line number Diff line Loading @@ -1110,7 +1110,9 @@ void DumpsysAcl(int fd) { LOG_DUMPSYS_TITLE(fd, DUMPSYS_TAG); if (shim::Stack::GetInstance()->IsRunning()) { shim::Stack::GetInstance()->GetAcl()->DumpConnectionHistory(fd); } for (int i = 0; i < MAX_L2CAP_LINKS; i++) { const tACL_CONN& link = acl_cb.acl_db[i]; Loading system/main/test/main_shim_test.cc +25 −1 Original line number Diff line number Diff line Loading @@ -14,10 +14,12 @@ * limitations under the License. */ #include <fcntl.h> #include <gmock/gmock.h> #include <gtest/gtest.h> #include <cstddef> #include <cstdio> #include <future> #include <map> Loading Loading @@ -87,7 +89,25 @@ struct bluetooth::hci::LeScanningManager::impl namespace { std::map<std::string, std::promise<uint16_t>> mock_function_handle_promise_map; // Utility to provide a file descriptor for /dev/null when possible, but // defaulting to STDERR when not possible. class DevNullOrStdErr { public: DevNullOrStdErr() { fd_ = open("/dev/null", O_CLOEXEC | O_WRONLY); } ~DevNullOrStdErr() { if (fd_ != -1) { close(fd_); } fd_ = -1; } int Fd() const { return (fd_ == -1) ? STDERR_FILENO : fd_; } private: int fd_{-1}; }; } // namespace uint8_t mock_get_ble_acceptlist_size() { return 123; } Loading Loading @@ -728,3 +748,7 @@ TEST_F(MainShimTestWithClassicConnection, read_extended_feature) { raw_connection_->read_remote_extended_features_function_ = {}; } TEST_F(MainShimTest, acl_dumpsys) { MakeAcl()->Dump(std::make_unique<DevNullOrStdErr>()->Fd()); } Loading
system/main/shim/acl.cc +3 −1 Original line number Diff line number Diff line Loading @@ -1110,7 +1110,9 @@ void DumpsysAcl(int fd) { LOG_DUMPSYS_TITLE(fd, DUMPSYS_TAG); if (shim::Stack::GetInstance()->IsRunning()) { shim::Stack::GetInstance()->GetAcl()->DumpConnectionHistory(fd); } for (int i = 0; i < MAX_L2CAP_LINKS; i++) { const tACL_CONN& link = acl_cb.acl_db[i]; Loading
system/main/test/main_shim_test.cc +25 −1 Original line number Diff line number Diff line Loading @@ -14,10 +14,12 @@ * limitations under the License. */ #include <fcntl.h> #include <gmock/gmock.h> #include <gtest/gtest.h> #include <cstddef> #include <cstdio> #include <future> #include <map> Loading Loading @@ -87,7 +89,25 @@ struct bluetooth::hci::LeScanningManager::impl namespace { std::map<std::string, std::promise<uint16_t>> mock_function_handle_promise_map; // Utility to provide a file descriptor for /dev/null when possible, but // defaulting to STDERR when not possible. class DevNullOrStdErr { public: DevNullOrStdErr() { fd_ = open("/dev/null", O_CLOEXEC | O_WRONLY); } ~DevNullOrStdErr() { if (fd_ != -1) { close(fd_); } fd_ = -1; } int Fd() const { return (fd_ == -1) ? STDERR_FILENO : fd_; } private: int fd_{-1}; }; } // namespace uint8_t mock_get_ble_acceptlist_size() { return 123; } Loading Loading @@ -728,3 +748,7 @@ TEST_F(MainShimTestWithClassicConnection, read_extended_feature) { raw_connection_->read_remote_extended_features_function_ = {}; } TEST_F(MainShimTest, acl_dumpsys) { MakeAcl()->Dump(std::make_unique<DevNullOrStdErr>()->Fd()); }