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
diff --git a/include/input/InputConsumerNoResampling.h b/include/input/InputConsumerNoResampling.h
index 10c2aa0..c98b9cf 100644
--- a/include/input/InputConsumerNoResampling.h
+++ b/include/input/InputConsumerNoResampling.h
@@ -22,7 +22,6 @@
#include <input/Input.h>
#include <input/InputTransport.h>
-#include <input/LooperInterface.h>
#include <input/Resampler.h>
#include <utils/Looper.h>
@@ -72,16 +71,6 @@
class InputConsumerNoResampling final {
public:
/**
- * This constructor is exclusively for test code. Any real use of InputConsumerNoResampling must
- * use the constructor that takes an sp<Looper> parameter instead of
- * std::shared_ptr<LooperInterface>.
- */
- explicit InputConsumerNoResampling(const std::shared_ptr<InputChannel>& channel,
- std::shared_ptr<LooperInterface> looper,
- InputConsumerCallbacks& callbacks,
- std::unique_ptr<Resampler> resampler);
-
- /**
* @param callbacks are used to interact with InputConsumerNoResampling. They're called whenever
* the event is ready to consume.
* @param looper needs to be sp and not shared_ptr because it inherits from
@@ -126,7 +115,7 @@
private:
std::shared_ptr<InputChannel> mChannel;
- std::shared_ptr<LooperInterface> mLooper;
+ sp<Looper> mLooper;
InputConsumerCallbacks& mCallbacks;
std::unique_ptr<Resampler> mResampler;
diff --git a/include/input/LooperInterface.h b/include/input/LooperInterface.h
deleted file mode 100644
index 2d6719c..0000000
--- 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 <utils/Looper.h>
-#include <utils/StrongPointer.h>
-
-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<LooperCallback>& callback,
- void* data) = 0;
- virtual int removeFd(int fd) = 0;
-
- virtual sp<Looper> getLooper() const = 0;
-};
-} // namespace android