summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
author Paul Ramirez <peramirez@google.com> 2024-09-18 18:23:14 +0000
committer Paul Ramirez <peramirez@google.com> 2024-09-20 14:22:50 +0000
commit87f1c01c4e9ddac9f15cbe76c819a1831b49b0de (patch)
tree1b8b14b592343dc0468802ea773c72d8fda68a8c /include
parent00cf5d01b7e51a3ea73f9032ef375c54d2068e43 (diff)
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
Diffstat (limited to 'include')
-rw-r--r--include/input/InputConsumerNoResampling.h13
-rw-r--r--include/input/LooperInterface.h39
2 files changed, 1 insertions, 51 deletions
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 <input/Input.h>
#include <input/InputTransport.h>
-#include <input/LooperInterface.h>
#include <input/Resampler.h>
#include <utils/Looper.h>
@@ -72,16 +71,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<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 @@ public:
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 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 <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