Loading include/input/Input.h +11 −0 Original line number Diff line number Diff line Loading @@ -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. */ Loading libs/binder/Android.bp +10 −0 Original line number Diff line number Diff line Loading @@ -248,6 +248,7 @@ cc_defaults { defaults: [ "libbinder_defer_bc_request_freeze_notification_flag_default", "libbinder_no_flush_on_last_ref_flag_default", ], srcs: [ Loading Loading @@ -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: [ Loading libs/binder/BpBinder.cpp +16 −4 Original line number Diff line number Diff line Loading @@ -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 } } Loading Loading @@ -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; } } Loading Loading @@ -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. " Loading Loading @@ -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(); } } Loading libs/binder/IPCThreadState.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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; } Loading libs/binder/include/binder/IPCThreadState.h +2 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
include/input/Input.h +11 −0 Original line number Diff line number Diff line Loading @@ -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. */ Loading
libs/binder/Android.bp +10 −0 Original line number Diff line number Diff line Loading @@ -248,6 +248,7 @@ cc_defaults { defaults: [ "libbinder_defer_bc_request_freeze_notification_flag_default", "libbinder_no_flush_on_last_ref_flag_default", ], srcs: [ Loading Loading @@ -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: [ Loading
libs/binder/BpBinder.cpp +16 −4 Original line number Diff line number Diff line Loading @@ -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 } } Loading Loading @@ -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; } } Loading Loading @@ -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. " Loading Loading @@ -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(); } } Loading
libs/binder/IPCThreadState.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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; } Loading
libs/binder/include/binder/IPCThreadState.h +2 −1 Original line number Diff line number Diff line Loading @@ -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