Loading services/inputflinger/InputFilterCallbacks.cpp +2 −1 Original line number Original line Diff line number Diff line Loading @@ -44,7 +44,8 @@ public: InputFilterThread(std::shared_ptr<IInputThreadCallback> callback) : mCallback(callback) { InputFilterThread(std::shared_ptr<IInputThreadCallback> callback) : mCallback(callback) { mLooper = sp<Looper>::make(/*allowNonCallbacks=*/false); mLooper = sp<Looper>::make(/*allowNonCallbacks=*/false); mThread = std::make_unique<InputThread>( mThread = std::make_unique<InputThread>( "InputFilter", [this]() { loopOnce(); }, [this]() { mLooper->wake(); }); "InputFilter", [this]() { loopOnce(); }, [this]() { mLooper->wake(); }, /*isInCriticalPath=*/false); } } ndk::ScopedAStatus finish() override { ndk::ScopedAStatus finish() override { Loading services/inputflinger/InputThread.cpp +4 −3 Original line number Original line Diff line number Diff line Loading @@ -45,11 +45,12 @@ private: } // namespace } // namespace InputThread::InputThread(std::string name, std::function<void()> loop, std::function<void()> wake) InputThread::InputThread(std::string name, std::function<void()> loop, std::function<void()> wake, bool isInCriticalPath) : mName(name), mThreadWake(wake) { : mName(name), mThreadWake(wake) { mThread = sp<InputThreadImpl>::make(loop); mThread = sp<InputThreadImpl>::make(loop); mThread->run(mName.c_str(), ANDROID_PRIORITY_URGENT_DISPLAY); mThread->run(mName.c_str(), ANDROID_PRIORITY_URGENT_DISPLAY); if (input_flags::enable_input_policy_profile()) { if (input_flags::enable_input_policy_profile() && isInCriticalPath) { if (!applyInputEventProfile()) { if (!applyInputEventProfile()) { LOG(ERROR) << "Couldn't apply input policy profile for " << name; LOG(ERROR) << "Couldn't apply input policy profile for " << name; } } Loading services/inputflinger/dispatcher/InputDispatcher.cpp +2 −1 Original line number Original line Diff line number Diff line Loading @@ -993,7 +993,8 @@ status_t InputDispatcher::start() { return ALREADY_EXISTS; return ALREADY_EXISTS; } } mThread = std::make_unique<InputThread>( mThread = std::make_unique<InputThread>( "InputDispatcher", [this]() { dispatchOnce(); }, [this]() { mLooper->wake(); }); "InputDispatcher", [this]() { dispatchOnce(); }, [this]() { mLooper->wake(); }, /*isInCriticalPath=*/true); return OK; return OK; } } Loading services/inputflinger/dispatcher/trace/ThreadedBackend.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -41,7 +41,7 @@ ThreadedBackend<Backend>::ThreadedBackend(Backend&& innerBackend) : mBackend(std::move(innerBackend)), : mBackend(std::move(innerBackend)), mTracerThread( mTracerThread( "InputTracer", [this]() { threadLoop(); }, "InputTracer", [this]() { threadLoop(); }, [this]() { mThreadWakeCondition.notify_all(); }) {} [this]() { mThreadWakeCondition.notify_all(); }, /*isInCriticalPath=*/false) {} template <typename Backend> template <typename Backend> ThreadedBackend<Backend>::~ThreadedBackend() { ThreadedBackend<Backend>::~ThreadedBackend() { Loading services/inputflinger/include/InputThread.h +2 −2 Original line number Original line Diff line number Diff line Loading @@ -28,8 +28,8 @@ namespace android { */ */ class InputThread { class InputThread { public: public: explicit InputThread(std::string name, std::function<void()> loop, explicit InputThread(std::string name, std::function<void()> loop, std::function<void()> wake, std::function<void()> wake = nullptr); bool isInCriticalPath); virtual ~InputThread(); virtual ~InputThread(); bool isCallingThread(); bool isCallingThread(); Loading Loading
services/inputflinger/InputFilterCallbacks.cpp +2 −1 Original line number Original line Diff line number Diff line Loading @@ -44,7 +44,8 @@ public: InputFilterThread(std::shared_ptr<IInputThreadCallback> callback) : mCallback(callback) { InputFilterThread(std::shared_ptr<IInputThreadCallback> callback) : mCallback(callback) { mLooper = sp<Looper>::make(/*allowNonCallbacks=*/false); mLooper = sp<Looper>::make(/*allowNonCallbacks=*/false); mThread = std::make_unique<InputThread>( mThread = std::make_unique<InputThread>( "InputFilter", [this]() { loopOnce(); }, [this]() { mLooper->wake(); }); "InputFilter", [this]() { loopOnce(); }, [this]() { mLooper->wake(); }, /*isInCriticalPath=*/false); } } ndk::ScopedAStatus finish() override { ndk::ScopedAStatus finish() override { Loading
services/inputflinger/InputThread.cpp +4 −3 Original line number Original line Diff line number Diff line Loading @@ -45,11 +45,12 @@ private: } // namespace } // namespace InputThread::InputThread(std::string name, std::function<void()> loop, std::function<void()> wake) InputThread::InputThread(std::string name, std::function<void()> loop, std::function<void()> wake, bool isInCriticalPath) : mName(name), mThreadWake(wake) { : mName(name), mThreadWake(wake) { mThread = sp<InputThreadImpl>::make(loop); mThread = sp<InputThreadImpl>::make(loop); mThread->run(mName.c_str(), ANDROID_PRIORITY_URGENT_DISPLAY); mThread->run(mName.c_str(), ANDROID_PRIORITY_URGENT_DISPLAY); if (input_flags::enable_input_policy_profile()) { if (input_flags::enable_input_policy_profile() && isInCriticalPath) { if (!applyInputEventProfile()) { if (!applyInputEventProfile()) { LOG(ERROR) << "Couldn't apply input policy profile for " << name; LOG(ERROR) << "Couldn't apply input policy profile for " << name; } } Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +2 −1 Original line number Original line Diff line number Diff line Loading @@ -993,7 +993,8 @@ status_t InputDispatcher::start() { return ALREADY_EXISTS; return ALREADY_EXISTS; } } mThread = std::make_unique<InputThread>( mThread = std::make_unique<InputThread>( "InputDispatcher", [this]() { dispatchOnce(); }, [this]() { mLooper->wake(); }); "InputDispatcher", [this]() { dispatchOnce(); }, [this]() { mLooper->wake(); }, /*isInCriticalPath=*/true); return OK; return OK; } } Loading
services/inputflinger/dispatcher/trace/ThreadedBackend.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -41,7 +41,7 @@ ThreadedBackend<Backend>::ThreadedBackend(Backend&& innerBackend) : mBackend(std::move(innerBackend)), : mBackend(std::move(innerBackend)), mTracerThread( mTracerThread( "InputTracer", [this]() { threadLoop(); }, "InputTracer", [this]() { threadLoop(); }, [this]() { mThreadWakeCondition.notify_all(); }) {} [this]() { mThreadWakeCondition.notify_all(); }, /*isInCriticalPath=*/false) {} template <typename Backend> template <typename Backend> ThreadedBackend<Backend>::~ThreadedBackend() { ThreadedBackend<Backend>::~ThreadedBackend() { Loading
services/inputflinger/include/InputThread.h +2 −2 Original line number Original line Diff line number Diff line Loading @@ -28,8 +28,8 @@ namespace android { */ */ class InputThread { class InputThread { public: public: explicit InputThread(std::string name, std::function<void()> loop, explicit InputThread(std::string name, std::function<void()> loop, std::function<void()> wake, std::function<void()> wake = nullptr); bool isInCriticalPath); virtual ~InputThread(); virtual ~InputThread(); bool isCallingThread(); bool isCallingThread(); Loading