Loading Experiments.h +2 −2 Original line number Diff line number Diff line Loading @@ -17,10 +17,10 @@ #pragma once #include <climits> #include <map> #include <mutex> #include <string> #include <string_view> #include <unordered_map> #include <android-base/thread_annotations.h> #include <netdutils/DumpWriter.h> Loading @@ -45,7 +45,7 @@ class Experiments { Experiments() = delete; void updateInternal() EXCLUDES(mMutex); mutable std::mutex mMutex; std::unordered_map<std::string_view, int> mFlagsMapInt GUARDED_BY(mMutex); std::map<std::string_view, int> mFlagsMapInt GUARDED_BY(mMutex); // TODO: Migrate other experiment flags to here. // (retry_count, retransmission_time_interval) static constexpr const char* const kExperimentFlagKeyList[] = { Loading ExperimentsTest.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -14,10 +14,10 @@ * limitations under the License. */ #include <map> #include <mutex> #include <string> #include <string_view> #include <unordered_map> #include <android-base/format.h> #include <android-base/test_utils.h> Loading Loading @@ -72,7 +72,7 @@ class ExperimentsTest : public ::testing::Test { } void expectGetDnsExperimentFlagInt() { std::unordered_map<std::string_view, int> tempMap; std::map<std::string_view, int> tempMap; for (const auto& key : Experiments::kExperimentFlagKeyList) { tempMap[key] = mExperiments.getFlag(key, 0); } Loading Loading @@ -102,11 +102,11 @@ class ExperimentsTest : public ::testing::Test { EXPECT_EQ(dumpString.substr(startPos), "\n"); } static std::unordered_map<std::string_view, int> sFakeFlagsMapInt; static std::map<std::string_view, int> sFakeFlagsMapInt; Experiments mExperiments; }; std::unordered_map<std::string_view, int> ExperimentsTest::sFakeFlagsMapInt; std::map<std::string_view, int> ExperimentsTest::sFakeFlagsMapInt; TEST_F(ExperimentsTest, update) { std::vector<int> testValues = {50, 3, 5, 0}; Loading OWNERS +2 −1 Original line number Diff line number Diff line include platform/system/netd:/OWNERS set noparent file:platform/packages/modules/Connectivity:master:/OWNERS_core_networking tests/tun_forwarder.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -143,7 +143,7 @@ bool TunForwarder::addForwardingRule(const std::array<std::string, 2>& from, unique_fd TunForwarder::createTun(const std::string& ifname) { unique_fd fd(open("/dev/tun", O_RDWR | O_NONBLOCK | O_CLOEXEC)); if (!fd.ok() == -1) { if (!fd.ok()) { return {}; } Loading Loading
Experiments.h +2 −2 Original line number Diff line number Diff line Loading @@ -17,10 +17,10 @@ #pragma once #include <climits> #include <map> #include <mutex> #include <string> #include <string_view> #include <unordered_map> #include <android-base/thread_annotations.h> #include <netdutils/DumpWriter.h> Loading @@ -45,7 +45,7 @@ class Experiments { Experiments() = delete; void updateInternal() EXCLUDES(mMutex); mutable std::mutex mMutex; std::unordered_map<std::string_view, int> mFlagsMapInt GUARDED_BY(mMutex); std::map<std::string_view, int> mFlagsMapInt GUARDED_BY(mMutex); // TODO: Migrate other experiment flags to here. // (retry_count, retransmission_time_interval) static constexpr const char* const kExperimentFlagKeyList[] = { Loading
ExperimentsTest.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -14,10 +14,10 @@ * limitations under the License. */ #include <map> #include <mutex> #include <string> #include <string_view> #include <unordered_map> #include <android-base/format.h> #include <android-base/test_utils.h> Loading Loading @@ -72,7 +72,7 @@ class ExperimentsTest : public ::testing::Test { } void expectGetDnsExperimentFlagInt() { std::unordered_map<std::string_view, int> tempMap; std::map<std::string_view, int> tempMap; for (const auto& key : Experiments::kExperimentFlagKeyList) { tempMap[key] = mExperiments.getFlag(key, 0); } Loading Loading @@ -102,11 +102,11 @@ class ExperimentsTest : public ::testing::Test { EXPECT_EQ(dumpString.substr(startPos), "\n"); } static std::unordered_map<std::string_view, int> sFakeFlagsMapInt; static std::map<std::string_view, int> sFakeFlagsMapInt; Experiments mExperiments; }; std::unordered_map<std::string_view, int> ExperimentsTest::sFakeFlagsMapInt; std::map<std::string_view, int> ExperimentsTest::sFakeFlagsMapInt; TEST_F(ExperimentsTest, update) { std::vector<int> testValues = {50, 3, 5, 0}; Loading
OWNERS +2 −1 Original line number Diff line number Diff line include platform/system/netd:/OWNERS set noparent file:platform/packages/modules/Connectivity:master:/OWNERS_core_networking
tests/tun_forwarder.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -143,7 +143,7 @@ bool TunForwarder::addForwardingRule(const std::array<std::string, 2>& from, unique_fd TunForwarder::createTun(const std::string& ifname) { unique_fd fd(open("/dev/tun", O_RDWR | O_NONBLOCK | O_CLOEXEC)); if (!fd.ok() == -1) { if (!fd.ok()) { return {}; } Loading