Loading services/inputflinger/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ package { cc_defaults { name: "inputflinger_defaults", cpp_std: "c++20", cflags: [ "-Wall", "-Wextra", Loading services/inputflinger/BlockingQueue.h +1 −2 Original line number Diff line number Diff line Loading @@ -71,8 +71,7 @@ public: void erase(const std::function<bool(const T&)>& lambda) { std::scoped_lock lock(mLock); mQueue.erase(std::remove_if(mQueue.begin(), mQueue.end(), [&lambda](const T& t) { return lambda(t); }), mQueue.end()); std::erase_if(mQueue, [&lambda](const auto& t) { return lambda(t); }); } /** Loading services/inputflinger/dispatcher/TouchState.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -106,10 +106,8 @@ void TouchState::filterNonAsIsTouchWindows() { } void TouchState::filterWindowsExcept(const sp<IBinder>& token) { auto it = std::remove_if(windows.begin(), windows.end(), [&token](const TouchedWindow& w) { return w.windowHandle->getToken() != token; }); windows.erase(it, windows.end()); std::erase_if(windows, [&token](const TouchedWindow& w) { return w.windowHandle->getToken() != token; }); } sp<WindowInfoHandle> TouchState::getFirstForegroundWindowHandle() const { Loading services/inputflinger/reader/EventHub.cpp +4 −7 Original line number Diff line number Diff line Loading @@ -2344,13 +2344,10 @@ void EventHub::closeVideoDeviceByPathLocked(const std::string& devicePath) { return; } } mUnattachedVideoDevices .erase(std::remove_if(mUnattachedVideoDevices.begin(), mUnattachedVideoDevices.end(), [&devicePath]( const std::unique_ptr<TouchVideoDevice>& videoDevice) { std::erase_if(mUnattachedVideoDevices, [&devicePath](const std::unique_ptr<TouchVideoDevice>& videoDevice) { return videoDevice->getPath() == devicePath; }), mUnattachedVideoDevices.end()); }); } void EventHub::closeAllDevicesLocked() { Loading services/inputflinger/reader/InputReader.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -237,9 +237,7 @@ void InputReader::removeDeviceLocked(nsecs_t when, int32_t eventHubId) { auto mapIt = mDeviceToEventHubIdsMap.find(device); if (mapIt != mDeviceToEventHubIdsMap.end()) { std::vector<int32_t>& eventHubIds = mapIt->second; eventHubIds.erase(std::remove_if(eventHubIds.begin(), eventHubIds.end(), [eventHubId](int32_t eId) { return eId == eventHubId; }), eventHubIds.end()); std::erase_if(eventHubIds, [eventHubId](int32_t eId) { return eId == eventHubId; }); if (eventHubIds.size() == 0) { mDeviceToEventHubIdsMap.erase(mapIt); } Loading Loading
services/inputflinger/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ package { cc_defaults { name: "inputflinger_defaults", cpp_std: "c++20", cflags: [ "-Wall", "-Wextra", Loading
services/inputflinger/BlockingQueue.h +1 −2 Original line number Diff line number Diff line Loading @@ -71,8 +71,7 @@ public: void erase(const std::function<bool(const T&)>& lambda) { std::scoped_lock lock(mLock); mQueue.erase(std::remove_if(mQueue.begin(), mQueue.end(), [&lambda](const T& t) { return lambda(t); }), mQueue.end()); std::erase_if(mQueue, [&lambda](const auto& t) { return lambda(t); }); } /** Loading
services/inputflinger/dispatcher/TouchState.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -106,10 +106,8 @@ void TouchState::filterNonAsIsTouchWindows() { } void TouchState::filterWindowsExcept(const sp<IBinder>& token) { auto it = std::remove_if(windows.begin(), windows.end(), [&token](const TouchedWindow& w) { return w.windowHandle->getToken() != token; }); windows.erase(it, windows.end()); std::erase_if(windows, [&token](const TouchedWindow& w) { return w.windowHandle->getToken() != token; }); } sp<WindowInfoHandle> TouchState::getFirstForegroundWindowHandle() const { Loading
services/inputflinger/reader/EventHub.cpp +4 −7 Original line number Diff line number Diff line Loading @@ -2344,13 +2344,10 @@ void EventHub::closeVideoDeviceByPathLocked(const std::string& devicePath) { return; } } mUnattachedVideoDevices .erase(std::remove_if(mUnattachedVideoDevices.begin(), mUnattachedVideoDevices.end(), [&devicePath]( const std::unique_ptr<TouchVideoDevice>& videoDevice) { std::erase_if(mUnattachedVideoDevices, [&devicePath](const std::unique_ptr<TouchVideoDevice>& videoDevice) { return videoDevice->getPath() == devicePath; }), mUnattachedVideoDevices.end()); }); } void EventHub::closeAllDevicesLocked() { Loading
services/inputflinger/reader/InputReader.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -237,9 +237,7 @@ void InputReader::removeDeviceLocked(nsecs_t when, int32_t eventHubId) { auto mapIt = mDeviceToEventHubIdsMap.find(device); if (mapIt != mDeviceToEventHubIdsMap.end()) { std::vector<int32_t>& eventHubIds = mapIt->second; eventHubIds.erase(std::remove_if(eventHubIds.begin(), eventHubIds.end(), [eventHubId](int32_t eId) { return eId == eventHubId; }), eventHubIds.end()); std::erase_if(eventHubIds, [eventHubId](int32_t eId) { return eId == eventHubId; }); if (eventHubIds.size() == 0) { mDeviceToEventHubIdsMap.erase(mapIt); } Loading