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

Commit b3915adc authored by Yifan Hong's avatar Yifan Hong Committed by Automerger Merge Worker
Browse files

Merge "binder: skip BinderRpc.Java test on non-debuggable builds." am:...

Merge "binder: skip BinderRpc.Java test on non-debuggable builds." am: e50adf3c am: e75248b6 am: aa2abab4

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1885272

Change-Id: Ia49343d3d512d2786d953a26a3def784c634da65
parents 2850b7d8 aa2abab4
Loading
Loading
Loading
Loading
+12 −1
Original line number Original line Diff line number Diff line
@@ -22,6 +22,7 @@
#include <aidl/IBinderRpcTest.h>
#include <aidl/IBinderRpcTest.h>
#include <android-base/file.h>
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/logging.h>
#include <android-base/properties.h>
#include <android/binder_auto_utils.h>
#include <android/binder_auto_utils.h>
#include <android/binder_libbinder.h>
#include <android/binder_libbinder.h>
#include <binder/Binder.h>
#include <binder/Binder.h>
@@ -1514,7 +1515,17 @@ TEST(BinderRpc, Java) {
    auto socket = rpcServer->releaseServer();
    auto socket = rpcServer->releaseServer();


    auto keepAlive = sp<BBinder>::make();
    auto keepAlive = sp<BBinder>::make();
    ASSERT_EQ(OK, binder->setRpcClientDebug(std::move(socket), keepAlive));
    auto setRpcClientDebugStatus = binder->setRpcClientDebug(std::move(socket), keepAlive);

    if (!android::base::GetBoolProperty("ro.debuggable", false)) {
        ASSERT_EQ(INVALID_OPERATION, setRpcClientDebugStatus)
                << "setRpcClientDebug should return INVALID_OPERATION on non-debuggable builds, "
                   "but get "
                << statusToString(setRpcClientDebugStatus);
        GTEST_SKIP();
    }

    ASSERT_EQ(OK, setRpcClientDebugStatus);


    auto rpcSession = RpcSession::make();
    auto rpcSession = RpcSession::make();
    ASSERT_EQ(OK, rpcSession->setupInetClient("127.0.0.1", port));
    ASSERT_EQ(OK, rpcSession->setupInetClient("127.0.0.1", port));