Loading services/inputflinger/InputThread.cpp +13 −13 Original line number Diff line number Diff line Loading @@ -26,6 +26,16 @@ namespace input_flags = com::android::input::flags; namespace { bool applyInputEventProfile(const Thread& thread) { #if defined(__ANDROID__) return SetTaskProfiles(thread.getTid(), {"InputPolicy"}); #else // Since thread information is not available and there's no benefit of // applying the task profile on host, return directly. return true; #endif } // Implementation of Thread from libutils. class InputThreadImpl : public Thread { public: Loading @@ -47,11 +57,11 @@ private: InputThread::InputThread(std::string name, std::function<void()> loop, std::function<void()> wake, bool isInCriticalPath) : mName(name), mThreadWake(wake) { : mThreadWake(wake) { mThread = sp<InputThreadImpl>::make(loop); mThread->run(mName.c_str(), ANDROID_PRIORITY_URGENT_DISPLAY); mThread->run(name.c_str(), ANDROID_PRIORITY_URGENT_DISPLAY); if (input_flags::enable_input_policy_profile() && isInCriticalPath) { if (!applyInputEventProfile()) { if (!applyInputEventProfile(*mThread)) { LOG(ERROR) << "Couldn't apply input policy profile for " << name; } } Loading @@ -75,14 +85,4 @@ bool InputThread::isCallingThread() { #endif } bool InputThread::applyInputEventProfile() { #if defined(__ANDROID__) return SetTaskProfiles(mThread->getTid(), {"InputPolicy"}); #else // Since thread information is not available and there's no benefit of // applying the task profile on host, return directly. return true; #endif } } // namespace android services/inputflinger/include/InputThread.h +0 −2 Original line number Diff line number Diff line Loading @@ -35,10 +35,8 @@ public: bool isCallingThread(); private: std::string mName; std::function<void()> mThreadWake; sp<Thread> mThread; bool applyInputEventProfile(); }; } // namespace android Loading
services/inputflinger/InputThread.cpp +13 −13 Original line number Diff line number Diff line Loading @@ -26,6 +26,16 @@ namespace input_flags = com::android::input::flags; namespace { bool applyInputEventProfile(const Thread& thread) { #if defined(__ANDROID__) return SetTaskProfiles(thread.getTid(), {"InputPolicy"}); #else // Since thread information is not available and there's no benefit of // applying the task profile on host, return directly. return true; #endif } // Implementation of Thread from libutils. class InputThreadImpl : public Thread { public: Loading @@ -47,11 +57,11 @@ private: InputThread::InputThread(std::string name, std::function<void()> loop, std::function<void()> wake, bool isInCriticalPath) : mName(name), mThreadWake(wake) { : mThreadWake(wake) { mThread = sp<InputThreadImpl>::make(loop); mThread->run(mName.c_str(), ANDROID_PRIORITY_URGENT_DISPLAY); mThread->run(name.c_str(), ANDROID_PRIORITY_URGENT_DISPLAY); if (input_flags::enable_input_policy_profile() && isInCriticalPath) { if (!applyInputEventProfile()) { if (!applyInputEventProfile(*mThread)) { LOG(ERROR) << "Couldn't apply input policy profile for " << name; } } Loading @@ -75,14 +85,4 @@ bool InputThread::isCallingThread() { #endif } bool InputThread::applyInputEventProfile() { #if defined(__ANDROID__) return SetTaskProfiles(mThread->getTid(), {"InputPolicy"}); #else // Since thread information is not available and there's no benefit of // applying the task profile on host, return directly. return true; #endif } } // namespace android
services/inputflinger/include/InputThread.h +0 −2 Original line number Diff line number Diff line Loading @@ -35,10 +35,8 @@ public: bool isCallingThread(); private: std::string mName; std::function<void()> mThreadWake; sp<Thread> mThread; bool applyInputEventProfile(); }; } // namespace android