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

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

Snap for 13894195 from 5ee94fff to 25Q4-release

Change-Id: I51db5437c7a626a1ad84bd3206689d91e658f6b4
parents 7ac8b354 5ee94fff
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -602,9 +602,20 @@ struct PointerProperties {

std::ostream& operator<<(std::ostream& out, const PointerProperties& properties);

/*
 * Represents an ID assigned to an InputDevice by InputReader. Such a device may be a combination of
 * multiple evdev devices, each with their own RawDeviceId.
 */
// TODO(b/211379801) : Use a strong type from ftl/mixins.h instead
using DeviceId = int32_t;

/*
 * Represents an ID assigned to an individual evdev device by EventHub.
 *
 * (This is not the same as the number used by the device's /dev/input/eventX node.)
 */
using RawDeviceId = int32_t;

/*
 * Input events.
 */
+10 −0
Original line number Diff line number Diff line
@@ -248,6 +248,7 @@ cc_defaults {

    defaults: [
        "libbinder_defer_bc_request_freeze_notification_flag_default",
        "libbinder_no_flush_on_last_ref_flag_default",
    ],

    srcs: [
@@ -563,6 +564,15 @@ cc_defaults {
    }),
}

cc_defaults {
    name: "libbinder_no_flush_on_last_ref_flag_default",
    cflags: select(release_flag("RELEASE_LIBBINDER_NO_FLUSH_ON_LAST_REF"), {
        true: ["-DLIBBINDER_NO_FLUSH_ON_LAST_REF"],
        false: ["-DNO_LIBBINDER_NO_FLUSH_ON_LAST_REF"],
        default: ["-DNO_LIBBINDER_NO_FLUSH_ON_LAST_REF"],
    }),
}

cc_defaults {
    name: "libbinder_kernel_defaults",
    defaults: [
+16 −4
Original line number Diff line number Diff line
@@ -42,6 +42,14 @@ namespace {
        return true;
#else
        return false;
#endif
    }

    bool noFlushOnLastRef() {
#if defined(LIBBINDER_NO_FLUSH_ON_LAST_REF)
        return true;
#else
        return false;
#endif
    }
}
@@ -643,7 +651,8 @@ status_t BpBinder::addFrozenStateChangeCallback(const wp<FrozenStateChangeCallba
            if (!mFrozen) {
                std::ignore =
                        IPCThreadState::self()->removeFrozenStateChangeCallback(binderHandle(),
                                                                                this);
                                                                                this,
                                                                                /*flush=*/true);
                return NO_MEMORY;
            }
        }
@@ -679,7 +688,8 @@ status_t BpBinder::removeFrozenStateChangeCallback(const wp<FrozenStateChangeCal
                }
                status_t status =
                        IPCThreadState::self()->removeFrozenStateChangeCallback(binderHandle(),
                                                                                this);
                                                                                this,
                                                                                /*flush=*/true);
                if (status != NO_ERROR) {
                    ALOGE("Unexpected error from "
                          "IPCThreadState.removeFrozenStateChangeCallback: %s. "
@@ -862,17 +872,19 @@ void BpBinder::onLastStrongRef(const void* /*id*/) {
        mObituaries = nullptr;
    }
    if (mFrozen != nullptr) {
        bool flush = !noFlushOnLastRef();
        if (waitForFrozenListenerRemovalCompletion()) {
            if (!mFrozen->isPendingClear) {
                std::ignore =
                        IPCThreadState::self()->removeFrozenStateChangeCallback(binderHandle(),
                                                                                this);
                                                                                this, flush);
                mFrozen->isPendingClear = true;
            }
            mFrozen->callbacks.clear();
        } else {
            std::ignore =
                    IPCThreadState::self()->removeFrozenStateChangeCallback(binderHandle(), this);
                    IPCThreadState::self()->removeFrozenStateChangeCallback(binderHandle(), this,
                                                                            flush);
            mFrozen.reset();
        }
    }
+6 −3
Original line number Diff line number Diff line
@@ -1040,7 +1040,8 @@ status_t IPCThreadState::addFrozenStateChangeCallback(int32_t handle, BpBinder*
    return NO_ERROR;
}

status_t IPCThreadState::removeFrozenStateChangeCallback(int32_t handle, BpBinder* proxy) {
status_t IPCThreadState::removeFrozenStateChangeCallback(int32_t handle, BpBinder* proxy,
                                                         bool flush) {
    static bool isSupported =
            ProcessState::isDriverFeatureEnabled(ProcessState::DriverFeature::FREEZE_NOTIFICATION);
    if (!isSupported) {
@@ -1050,9 +1051,11 @@ status_t IPCThreadState::removeFrozenStateChangeCallback(int32_t handle, BpBinde
    mOut.writeInt32((int32_t)handle);
    mOut.writePointer((uintptr_t)proxy);

    if (flush) {
        if (status_t res = flushCommands(); res != OK) {
            LOG_ALWAYS_FATAL("%s(%d): %s", __func__, handle, statusToString(res).c_str());
        }
    }

    return NO_ERROR;
}
+2 −1
Original line number Diff line number Diff line
@@ -180,7 +180,8 @@ public:
    LIBBINDER_EXPORTED status_t requestDeathNotification(int32_t handle, BpBinder* proxy);
    LIBBINDER_EXPORTED status_t clearDeathNotification(int32_t handle, BpBinder* proxy);
    [[nodiscard]] status_t addFrozenStateChangeCallback(int32_t handle, BpBinder* proxy);
    [[nodiscard]] status_t removeFrozenStateChangeCallback(int32_t handle, BpBinder* proxy);
    [[nodiscard]] status_t removeFrozenStateChangeCallback(int32_t handle, BpBinder* proxy,
                                                           bool flush);

    // Call this to disable switching threads to background scheduling when
    // receiving incoming IPC calls.  This is specifically here for the
Loading