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

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

Merge "binder: recovery variant does not use libandroid_runtime_vm_headers"...

Merge "binder: recovery variant does not use libandroid_runtime_vm_headers" am: fc34af19 am: 4da1edd2

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

Change-Id: Ie4695faff4a8d64d90c40ed1e2e72ef98319a797
parents 5ebe49f0 4da1edd2
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -149,6 +149,11 @@ cc_library {
                "UtilsHost.cpp",
                "UtilsHost.cpp",
            ],
            ],
        },
        },
        recovery: {
            exclude_header_libs: [
                "libandroid_runtime_vm_headers",
            ],
        },
    },
    },


    aidl: {
    aidl: {
+10 −3
Original line number Original line Diff line number Diff line
@@ -29,13 +29,11 @@
#include <android-base/hex.h>
#include <android-base/hex.h>
#include <android-base/macros.h>
#include <android-base/macros.h>
#include <android-base/scopeguard.h>
#include <android-base/scopeguard.h>
#include <android_runtime/vm.h>
#include <binder/BpBinder.h>
#include <binder/BpBinder.h>
#include <binder/Parcel.h>
#include <binder/Parcel.h>
#include <binder/RpcServer.h>
#include <binder/RpcServer.h>
#include <binder/RpcTransportRaw.h>
#include <binder/RpcTransportRaw.h>
#include <binder/Stability.h>
#include <binder/Stability.h>
#include <jni.h>
#include <utils/String8.h>
#include <utils/String8.h>


#include "FdTrigger.h"
#include "FdTrigger.h"
@@ -48,6 +46,11 @@
extern "C" pid_t gettid();
extern "C" pid_t gettid();
#endif
#endif


#ifndef __ANDROID_RECOVERY__
#include <android_runtime/vm.h>
#include <jni.h>
#endif

namespace android {
namespace android {


using base::unique_fd;
using base::unique_fd;
@@ -315,6 +318,9 @@ RpcSession::PreJoinSetupResult RpcSession::preJoinSetup(
}
}


namespace {
namespace {
#ifdef __ANDROID_RECOVERY__
class JavaThreadAttacher {};
#else
// RAII object for attaching / detaching current thread to JVM if Android Runtime exists. If
// RAII object for attaching / detaching current thread to JVM if Android Runtime exists. If
// Android Runtime doesn't exist, no-op.
// Android Runtime doesn't exist, no-op.
class JavaThreadAttacher {
class JavaThreadAttacher {
@@ -367,6 +373,7 @@ private:
        return fn();
        return fn();
    }
    }
};
};
#endif
} // namespace
} // namespace


void RpcSession::join(sp<RpcSession>&& session, PreJoinSetupResult&& setupResult) {
void RpcSession::join(sp<RpcSession>&& session, PreJoinSetupResult&& setupResult) {
@@ -374,7 +381,7 @@ void RpcSession::join(sp<RpcSession>&& session, PreJoinSetupResult&& setupResult


    if (setupResult.status == OK) {
    if (setupResult.status == OK) {
        LOG_ALWAYS_FATAL_IF(!connection, "must have connection if setup succeeded");
        LOG_ALWAYS_FATAL_IF(!connection, "must have connection if setup succeeded");
        JavaThreadAttacher javaThreadAttacher;
        [[maybe_unused]] JavaThreadAttacher javaThreadAttacher;
        while (true) {
        while (true) {
            status_t status = session->state()->getAndExecuteCommand(connection, session,
            status_t status = session->state()->getAndExecuteCommand(connection, session,
                                                                     RpcState::CommandType::ANY);
                                                                     RpcState::CommandType::ANY);