blob: 3cf1b2b797947f6e3919b36a9ddea78701057d0f [file] [log] [blame]
Jeff Brown40c9e0a2013-07-15 13:27:05 -07001/*
2 * Copyright (C) 2013 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#ifndef ANDROID_INPUT_FLINGER_H
18#define ANDROID_INPUT_FLINGER_H
19
20#include <stdint.h>
21#include <sys/types.h>
22
Michael Wright6f783602015-02-13 17:35:16 -080023#include "InputHost.h"
24
Chris Ye0783e992020-06-02 21:34:49 -070025#include <android/os/BnInputFlinger.h>
Chris Ye0783e992020-06-02 21:34:49 -070026#include <binder/Binder.h>
Jeff Brown40c9e0a2013-07-15 13:27:05 -070027#include <cutils/compiler.h>
Jeff Brown40c9e0a2013-07-15 13:27:05 -070028#include <utils/String16.h>
Chris Ye0783e992020-06-02 21:34:49 -070029#include <utils/String8.h>
Michael Wright6f783602015-02-13 17:35:16 -080030#include <utils/StrongPointer.h>
Jeff Brown40c9e0a2013-07-15 13:27:05 -070031
chaviw3277faf2021-05-19 16:45:23 -050032using android::gui::FocusRequest;
Chris Ye0783e992020-06-02 21:34:49 -070033using android::os::BnInputFlinger;
Chris Ye0783e992020-06-02 21:34:49 -070034
Jeff Brown40c9e0a2013-07-15 13:27:05 -070035namespace android {
36
37class InputFlinger : public BnInputFlinger {
38public:
39 static char const* getServiceName() ANDROID_API {
40 return "inputflinger";
41 }
42
43 InputFlinger() ANDROID_API;
44
Siarhei Vishniakou7766c032021-03-02 20:32:20 +000045 status_t dump(int fd, const Vector<String16>& args) override;
Siarhei Vishniakou7766c032021-03-02 20:32:20 +000046 binder::Status createInputChannel(const std::string&, InputChannel*) override {
Garfield Tan15601662020-09-22 15:32:38 -070047 return binder::Status::ok();
48 }
Siarhei Vishniakou7766c032021-03-02 20:32:20 +000049 binder::Status removeInputChannel(const sp<IBinder>&) override { return binder::Status::ok(); }
50 binder::Status setFocusedWindow(const FocusRequest&) override { return binder::Status::ok(); }
Jeff Brown40c9e0a2013-07-15 13:27:05 -070051
Jeff Brown40c9e0a2013-07-15 13:27:05 -070052private:
Siarhei Vishniakou7766c032021-03-02 20:32:20 +000053 ~InputFlinger() override;
Jeff Brown40c9e0a2013-07-15 13:27:05 -070054
55 void dumpInternal(String8& result);
Michael Wright6f783602015-02-13 17:35:16 -080056
57 sp<InputHostInterface> mHost;
Jeff Brown40c9e0a2013-07-15 13:27:05 -070058};
59
60} // namespace android
61
62#endif // ANDROID_INPUT_FLINGER_H