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

Commit d2fddec0 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13866322 from 9b246afc to 25Q4-release

Change-Id: I43911a17ed238f92170bf65a35dbd56c3e25a59d
parents 442116ab 9b246afc
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -321,6 +321,20 @@ Status BackendUnifiedServiceManager::toBinderService(const ::std::string& name,
                        createServiceWithMetadata(nullptr, false));
                return Status::ok();
            }
            // Pre-flight check to handle transient connection errors.
            os::ParcelFileDescriptor pfd;
            if (Status status = accessor->addConnection(&pfd); !status.isOk()) {
                if (status.serviceSpecificErrorCode() ==
                    IAccessor::ERROR_FAILED_TO_CONNECT_TO_SOCKET) {
                    ALOGW("Accessor failed with transient error, returning null to retry: %s",
                          status.toString8().c_str());
                    *_out = os::Service::make<os::Service::Tag::serviceWithMetadata>(
                            createServiceWithMetadata(nullptr, false));
                    return Status::ok();
                }
                ALOGE("Failed to add connection via accessor: %s", status.toString8().c_str());
                return status;
            }
            auto request = [=] {
                os::ParcelFileDescriptor fd;
                Status ret = accessor->addConnection(&fd);
@@ -332,7 +346,8 @@ Status BackendUnifiedServiceManager::toBinderService(const ::std::string& name,
                }
            };
            auto session = RpcSession::make();
            status_t status = session->setupPreconnectedClient(base::unique_fd{}, request);
            status_t status =
                    session->setupPreconnectedClient(base::unique_fd(pfd.release()), request);
            if (status != OK) {
                ALOGE("Failed to set up preconnected binder RPC client: %s",
                      statusToString(status).c_str());
+7 −5
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <binder/unique_fd.h>
#include <poll.h>

#include "Constants.h"
#include "FdTrigger.h"
#include "RpcState.h"

@@ -60,8 +61,9 @@ status_t interruptableReadOrWrite(
        return OK;
    }

    // size to break up message - this is not reset for this read/write operation.
    constexpr size_t kChunkMax = 65536;
    // We should never break up a message by default, but we do reduce chunk size on
    // ENOMEM conditions.
    constexpr size_t kChunkMax = binder::kRpcTransactionLimitBytes;
    const size_t kChunkMin = getpagesize(); // typical allocated granularity for sockets
    size_t chunkSize = kChunkMax;

@@ -81,9 +83,9 @@ status_t interruptableReadOrWrite(

        // This block dynamically adjusts packet sizes down to work around a
        // limitation in the vsock driver where large packets are sometimes
        // dropped (b/419364025 b/399469406 b/421244320).
        // TODO: only apply this workaround on vsock ???
        // TODO: fix vsock
        // dropped (b/419364025 b/399469406 b/421244320), though since this is
        // fixed, it's only used in ENOMEM conditions to try to allocate
        // smaller packets.
        {
            size_t chunkRemaining = chunkSize;
            int i = 0;
+1 −0
Original line number Diff line number Diff line
@@ -385,6 +385,7 @@ cc_library_shared {
    },

    cflags: [
        "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
        "-Wthread-safety",
    ],
}
+1 −1
Original line number Diff line number Diff line
@@ -1553,7 +1553,7 @@ status_t BufferQueueProducer::disconnect(int api, DisconnectMode mode) {
                                IInterface::asBinder(mCore->mLinkedToDeath);
                        // This can fail if we're here because of the death
                        // notification, but we just ignore it
                        token->unlinkToDeath(static_cast<IBinder::DeathRecipient*>(this));
                        token->unlinkToDeath(wp<IBinder::DeathRecipient>::fromExisting(this));
                    }
#endif
                    mCore->mSharedBufferSlot =
+3 −3
Original line number Diff line number Diff line
@@ -155,7 +155,7 @@ void Choreographer::postFrameCallbackDelayed(AChoreographer_frameCallback cb,
        if (std::this_thread::get_id() != mThreadId) {
            if (mLooper != nullptr) {
                Message m{MSG_SCHEDULE_VSYNC};
                mLooper->sendMessage(this, m);
                mLooper->sendMessage(sp<Choreographer>::fromExisting(this), m);
            } else {
                scheduleVsync();
            }
@@ -165,7 +165,7 @@ void Choreographer::postFrameCallbackDelayed(AChoreographer_frameCallback cb,
    } else {
        if (mLooper != nullptr) {
            Message m{MSG_SCHEDULE_CALLBACKS};
            mLooper->sendMessageDelayed(delay, this, m);
            mLooper->sendMessageDelayed(delay, sp<Choreographer>::fromExisting(this), m);
        } else {
            scheduleCallbacks();
        }
@@ -229,7 +229,7 @@ void Choreographer::unregisterRefreshRateCallback(AChoreographer_refreshRateCall
void Choreographer::scheduleLatestConfigRequest() {
    if (mLooper != nullptr) {
        Message m{MSG_HANDLE_REFRESH_RATE_UPDATES};
        mLooper->sendMessage(this, m);
        mLooper->sendMessage(sp<Choreographer>::fromExisting(this), m);
    } else {
        // If the looper thread is detached from Choreographer, then refresh rate
        // changes will be handled in AChoreographer_handlePendingEvents, so we
Loading