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

Commit e25833a3 authored by Sebastian Pickl's avatar Sebastian Pickl Committed by Automerger Merge Worker
Browse files

Merge changes from topic "revert-2780893-XRITMVSTFB" into main am: 271bd237...

Merge changes from topic "revert-2780893-XRITMVSTFB" into main am: 271bd237 am: 4ad3f2b2 am: e75d1259

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



Change-Id: If83584db96e59d57965a65f20b257e7c4839dde1
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 574cfcf4 e75d1259
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -22,13 +22,11 @@
#include <poll.h>

#include <android-base/macros.h>
#include <binder/Functional.h>
#include <android-base/scopeguard.h>

#include "RpcState.h"
namespace android {

using namespace android::binder::impl;

std::unique_ptr<FdTrigger> FdTrigger::make() {
    auto ret = std::make_unique<FdTrigger>();
#ifndef BINDER_RPC_SINGLE_THREADED
@@ -76,7 +74,8 @@ status_t FdTrigger::triggerablePoll(const android::RpcTransportFd& transportFd,
                        "Only one thread should be polling on Fd!");

    transportFd.setPollingState(true);
    auto pollingStateGuard = make_scope_guard([&]() { transportFd.setPollingState(false); });
    auto pollingStateGuard =
            android::base::make_scope_guard([&]() { transportFd.setPollingState(false); });

    int ret = TEMP_FAILURE_RETRY(poll(pfd, arraysize(pfd), -1));
    if (ret < 0) {
+2 −4
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@

#include <binder/Binder.h>
#include <binder/BpBinder.h>
#include <binder/Functional.h>
#include <binder/IPCThreadState.h>
#include <binder/Parcel.h>
#include <binder/ProcessState.h>
@@ -40,6 +39,7 @@
#include <binder/Status.h>
#include <binder/TextOutput.h>

#include <android-base/scopeguard.h>
#ifndef BINDER_DISABLE_BLOB
#include <cutils/ashmem.h>
#endif
@@ -98,8 +98,6 @@ static size_t pad_size(size_t s) {

namespace android {

using namespace android::binder::impl;

// many things compile this into prebuilts on the stack
#ifdef __LP64__
static_assert(sizeof(Parcel) == 120);
@@ -629,7 +627,7 @@ status_t Parcel::appendFrom(const Parcel* parcel, size_t offset, size_t len) {
        }

        const size_t savedDataPos = mDataPos;
        auto scopeGuard = make_scope_guard([&]() { mDataPos = savedDataPos; });
        base::ScopeGuard scopeGuard = [&]() { mDataPos = savedDataPos; };

        rpcFields->mObjectPositions.reserve(otherRpcFields->mObjectPositions.size());
        if (otherRpcFields->mFds != nullptr) {
+2 −4
Original line number Diff line number Diff line
@@ -19,9 +19,9 @@
#include <binder/ProcessState.h>

#include <android-base/result.h>
#include <android-base/scopeguard.h>
#include <android-base/strings.h>
#include <binder/BpBinder.h>
#include <binder/Functional.h>
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <binder/Stability.h>
@@ -60,8 +60,6 @@ const char* kDefaultDriver = "/dev/binder";

namespace android {

using namespace android::binder::impl;

class PoolThread : public Thread
{
public:
@@ -432,7 +430,7 @@ status_t ProcessState::setThreadPoolMaxThreadCount(size_t maxThreads) {

size_t ProcessState::getThreadPoolMaxTotalThreadCount() const {
    pthread_mutex_lock(&mThreadCountLock);
    auto detachGuard = make_scope_guard([&]() { pthread_mutex_unlock(&mThreadCountLock); });
    base::ScopeGuard detachGuard = [&]() { pthread_mutex_unlock(&mThreadCountLock); };

    if (mThreadPoolStarted) {
        LOG_ALWAYS_FATAL_IF(mKernelStartedThreads > mMaxThreads + 1,
+2 −3
Original line number Diff line number Diff line
@@ -16,13 +16,12 @@

#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/scopeguard.h>
#include <android-base/unique_fd.h>
#include <binder/Functional.h>
#include <binder/RecordedTransaction.h>
#include <sys/mman.h>
#include <algorithm>

using namespace android::binder::impl;
using android::Parcel;
using android::base::borrowed_fd;
using android::base::unique_fd;
@@ -219,7 +218,7 @@ std::optional<RecordedTransaction> RecordedTransaction::fromFile(const unique_fd
        size_t memoryMappedSize = chunkPayloadSize + mmapPayloadStartOffset;
        void* mappedMemory =
                mmap(NULL, memoryMappedSize, PROT_READ, MAP_SHARED, fd.get(), mmapPageAlignedStart);
        auto mmap_guard = make_scope_guard(
        auto mmap_guard = android::base::make_scope_guard(
                [mappedMemory, memoryMappedSize] { munmap(mappedMemory, memoryMappedSize); });

        transaction_checksum_t* payloadMap =
+4 −5
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
#include <thread>
#include <vector>

#include <binder/Functional.h>
#include <android-base/scopeguard.h>
#include <binder/Parcel.h>
#include <binder/RpcServer.h>
#include <binder/RpcTransportRaw.h>
@@ -45,7 +45,7 @@ namespace android {

constexpr size_t kSessionIdBytes = 32;

using namespace android::binder::impl;
using base::ScopeGuard;
using base::unique_fd;

RpcServer::RpcServer(std::unique_ptr<RpcTransportCtx> ctx) : mCtx(std::move(ctx)) {}
@@ -458,12 +458,11 @@ void RpcServer::establishConnection(
        LOG_ALWAYS_FATAL_IF(threadId == server->mConnectingThreads.end(),
                            "Must establish connection on owned thread");
        thisThread = std::move(threadId->second);
        auto detachGuardLambda = [&]() {
        ScopeGuard detachGuard = [&]() {
            thisThread.detach();
            _l.unlock();
            server->mShutdownCv.notify_all();
        };
        auto detachGuard = make_scope_guard(std::ref(detachGuardLambda));
        server->mConnectingThreads.erase(threadId);

        if (status != OK || server->mShutdownTrigger->isTriggered()) {
@@ -549,7 +548,7 @@ void RpcServer::establishConnection(
            return;
        }

        detachGuard.release();
        detachGuard.Disable();
        session->preJoinThreadOwnership(std::move(thisThread));
    }

Loading