blob: 2d6719c965570adfb2efbd005d441ddbb86a80c1 [file] [log] [blame]
Paul Ramireze2bb1872024-08-12 20:21:13 +00001/**
2 * Copyright 2024 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <utils/Looper.h>
20#include <utils/StrongPointer.h>
21
22namespace android {
23
24/**
25 * LooperInterface allows the use of TestLooper in InputConsumerNoResampling without reassigning to
26 * Looper. LooperInterface is needed to control how InputConsumerNoResampling consumes and batches
27 * InputMessages.
28 */
29class LooperInterface {
30public:
31 virtual ~LooperInterface() = default;
32
33 virtual int addFd(int fd, int ident, int events, const sp<LooperCallback>& callback,
34 void* data) = 0;
35 virtual int removeFd(int fd) = 0;
36
37 virtual sp<Looper> getLooper() const = 0;
38};
39} // namespace android