From 87f1c01c4e9ddac9f15cbe76c819a1831b49b0de Mon Sep 17 00:00:00 2001 From: Paul Ramirez Date: Wed, 18 Sep 2024 18:23:14 +0000 Subject: Update InputConsumer_test.cpp to use getFdStateDebug Updated InputConsumer_test.cpp to use getFdStateDebug, and reverted the changes introduced by LooperInterface in InputConsumerNoResampling Bug: 297226446 Flag: EXEMPT refactor Test: TEST=libinput_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST --gtest_filter="InputConsumerTest*" Change-Id: I7621fdf0923e16794142316a126d81e5faf3d708 --- include/input/InputConsumerNoResampling.h | 13 +---------- include/input/LooperInterface.h | 39 ------------------------------- 2 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 include/input/LooperInterface.h (limited to 'include') diff --git a/include/input/InputConsumerNoResampling.h b/include/input/InputConsumerNoResampling.h index 10c2aa01f9..c98b9cf8c1 100644 --- a/include/input/InputConsumerNoResampling.h +++ b/include/input/InputConsumerNoResampling.h @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -71,16 +70,6 @@ public: */ class InputConsumerNoResampling final { public: - /** - * This constructor is exclusively for test code. Any real use of InputConsumerNoResampling must - * use the constructor that takes an sp parameter instead of - * std::shared_ptr. - */ - explicit InputConsumerNoResampling(const std::shared_ptr& channel, - std::shared_ptr looper, - InputConsumerCallbacks& callbacks, - std::unique_ptr resampler); - /** * @param callbacks are used to interact with InputConsumerNoResampling. They're called whenever * the event is ready to consume. @@ -126,7 +115,7 @@ public: private: std::shared_ptr mChannel; - std::shared_ptr mLooper; + sp mLooper; InputConsumerCallbacks& mCallbacks; std::unique_ptr mResampler; diff --git a/include/input/LooperInterface.h b/include/input/LooperInterface.h deleted file mode 100644 index 2d6719c965..0000000000 --- a/include/input/LooperInterface.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -namespace android { - -/** - * LooperInterface allows the use of TestLooper in InputConsumerNoResampling without reassigning to - * Looper. LooperInterface is needed to control how InputConsumerNoResampling consumes and batches - * InputMessages. - */ -class LooperInterface { -public: - virtual ~LooperInterface() = default; - - virtual int addFd(int fd, int ident, int events, const sp& callback, - void* data) = 0; - virtual int removeFd(int fd) = 0; - - virtual sp getLooper() const = 0; -}; -} // namespace android -- cgit v1.2.3-59-g8ed1b