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

Commit 512692ad authored by Jooyung Han's avatar Jooyung Han
Browse files

Be explicit about binderCallLogFn

As binderCallLogFn is changed to be template function, std::bind() and
placeholder::_1 don't work well about type deduction.
To make C++ compiler happy, switched to lambda.

Note that the binderCallLogFn change is about the AIDL's gen_log feature
change that callback is given a struct rather than a JSON object.

Bug: 172188290
Test: m
Test: atest resolv_integration_test
Change-Id: I0097738713416eea2b5d47b73fadd8cc2c8ee5e4
parent 1bdf3351
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -72,9 +72,9 @@ inline ::ndk::ScopedAStatus statusFromErrcode(int ret) {

DnsResolverService::DnsResolverService() {
    // register log callback to BnDnsResolver::logFunc
    BnDnsResolver::logFunc =
            std::bind(binderCallLogFn, std::placeholders::_1,
                      [](const std::string& msg) { gResNetdCallbacks.log(msg.c_str()); });
    BnDnsResolver::logFunc = [](const auto& log) {
        binderCallLogFn(log, [](const std::string& msg) { gResNetdCallbacks.log(msg.c_str()); });
    };
}

binder_status_t DnsResolverService::start() {
+1 −1
Original line number Diff line number Diff line
@@ -222,7 +222,7 @@ class DnsResolverBinderTest : public ::testing::Test {

    PossibleLogData toSetResolverConfigurationLogData(const ResolverParamsParcel& parms,
                                                      int returnCode = 0) {
        std::string outputWithParcel = "setResolverConfiguration(\"" + toString(parms) + "\")";
        std::string outputWithParcel = "setResolverConfiguration(" + toString(parms) + ")";
        std::string hintRegexWithParcel = fmt::format("setResolverConfiguration.*{}", parms.netId);

        std::string outputWithoutParcel = "setResolverConfiguration()";