Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 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 | #define LOG_TAG "InputManager" |
| 18 | |
| 19 | //#define LOG_NDEBUG 0 |
| 20 | |
| 21 | #include "InputManager.h" |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 22 | #include "InputDispatcherFactory.h" |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 23 | #include "InputReaderFactory.h" |
Siarhei Vishniakou | ba0a875 | 2021-09-14 14:43:25 -0700 | [diff] [blame] | 24 | #include "UnwantedInteractionBlocker.h" |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 25 | |
Prabir Pradhan | 44e6e83 | 2023-06-06 00:03:25 +0000 | [diff] [blame] | 26 | #include <aidl/com/android/server/inputflinger/IInputFlingerRust.h> |
| 27 | #include <android/binder_interface_utils.h> |
Prabir Pradhan | addf8e9 | 2023-04-06 00:28:48 +0000 | [diff] [blame] | 28 | #include <android/sysprop/InputProperties.sysprop.h> |
Robert Carr | 1c4c559 | 2018-09-24 13:18:43 -0700 | [diff] [blame] | 29 | #include <binder/IPCThreadState.h> |
Prabir Pradhan | 678405c | 2023-09-08 17:18:32 +0000 | [diff] [blame] | 30 | #include <com_android_input_flags.h> |
Prabir Pradhan | 44e6e83 | 2023-06-06 00:03:25 +0000 | [diff] [blame] | 31 | #include <inputflinger_bootstrap.rs.h> |
Mark Salyzyn | 7823e12 | 2016-09-29 08:08:05 -0700 | [diff] [blame] | 32 | #include <log/log.h> |
Robert Carr | 1c4c559 | 2018-09-24 13:18:43 -0700 | [diff] [blame] | 33 | #include <private/android_filesystem_config.h> |
| 34 | |
Prabir Pradhan | 678405c | 2023-09-08 17:18:32 +0000 | [diff] [blame] | 35 | namespace input_flags = com::android::input::flags; |
| 36 | |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 37 | namespace android { |
| 38 | |
Prabir Pradhan | 44e6e83 | 2023-06-06 00:03:25 +0000 | [diff] [blame] | 39 | namespace { |
| 40 | |
| 41 | const bool ENABLE_INPUT_DEVICE_USAGE_METRICS = |
Prabir Pradhan | 7adabad | 2023-06-28 16:16:27 +0000 | [diff] [blame] | 42 | sysprop::InputProperties::enable_input_device_usage_metrics().value_or(true); |
Prabir Pradhan | addf8e9 | 2023-04-06 00:28:48 +0000 | [diff] [blame] | 43 | |
Vaibhav Devmurari | 5766aee | 2023-11-03 17:21:25 +0000 | [diff] [blame] | 44 | const bool ENABLE_INPUT_FILTER_RUST = input_flags::enable_input_filter_rust_impl(); |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 45 | |
Prabir Pradhan | 44e6e83 | 2023-06-06 00:03:25 +0000 | [diff] [blame] | 46 | int32_t exceptionCodeFromStatusT(status_t status) { |
Garfield Tan | 1560166 | 2020-09-22 15:32:38 -0700 | [diff] [blame] | 47 | switch (status) { |
| 48 | case OK: |
| 49 | return binder::Status::EX_NONE; |
| 50 | case INVALID_OPERATION: |
| 51 | return binder::Status::EX_UNSUPPORTED_OPERATION; |
| 52 | case BAD_VALUE: |
| 53 | case BAD_TYPE: |
| 54 | case NAME_NOT_FOUND: |
| 55 | return binder::Status::EX_ILLEGAL_ARGUMENT; |
| 56 | case NO_INIT: |
| 57 | return binder::Status::EX_ILLEGAL_STATE; |
| 58 | case PERMISSION_DENIED: |
| 59 | return binder::Status::EX_SECURITY; |
| 60 | default: |
| 61 | return binder::Status::EX_TRANSACTION_FAILED; |
| 62 | } |
| 63 | } |
| 64 | |
Prabir Pradhan | 44e6e83 | 2023-06-06 00:03:25 +0000 | [diff] [blame] | 65 | // Convert a binder interface into a raw pointer to an AIBinder. |
| 66 | using IInputFlingerRustBootstrapCallback = aidl::com::android::server::inputflinger:: |
| 67 | IInputFlingerRust::IInputFlingerRustBootstrapCallback; |
| 68 | IInputFlingerRustBootstrapCallbackAIBinder* binderToPointer( |
| 69 | IInputFlingerRustBootstrapCallback& interface) { |
| 70 | ndk::SpAIBinder spAIBinder = interface.asBinder(); |
| 71 | auto* ptr = spAIBinder.get(); |
| 72 | AIBinder_incStrong(ptr); |
| 73 | return ptr; |
| 74 | } |
| 75 | |
| 76 | // Create the Rust component of InputFlinger that uses AIDL interfaces as a the foreign function |
| 77 | // interface (FFI). The bootstraping process for IInputFlingerRust is as follows: |
| 78 | // - Create BnInputFlingerRustBootstrapCallback in C++. |
| 79 | // - Use the cxxbridge ffi interface to call the Rust function `create_inputflinger_rust()`, and |
| 80 | // pass the callback binder object as a raw pointer. |
| 81 | // - The Rust implementation will create the implementation of IInputFlingerRust, and pass it |
| 82 | // to C++ through the callback. |
| 83 | // - After the Rust function returns, the binder interface provided to the callback will be the |
| 84 | // only strong reference to the IInputFlingerRust. |
| 85 | std::shared_ptr<IInputFlingerRust> createInputFlingerRust() { |
| 86 | using namespace aidl::com::android::server::inputflinger; |
| 87 | |
| 88 | class Callback : public IInputFlingerRust::BnInputFlingerRustBootstrapCallback { |
| 89 | ndk::ScopedAStatus onProvideInputFlingerRust( |
| 90 | const std::shared_ptr<IInputFlingerRust>& inputFlingerRust) override { |
| 91 | mService = inputFlingerRust; |
| 92 | return ndk::ScopedAStatus::ok(); |
| 93 | } |
| 94 | |
| 95 | public: |
| 96 | std::shared_ptr<IInputFlingerRust> consumeInputFlingerRust() { |
| 97 | auto service = mService; |
| 98 | mService.reset(); |
| 99 | return service; |
| 100 | } |
| 101 | |
| 102 | private: |
| 103 | std::shared_ptr<IInputFlingerRust> mService; |
| 104 | }; |
| 105 | |
| 106 | auto callback = ndk::SharedRefBase::make<Callback>(); |
| 107 | create_inputflinger_rust(binderToPointer(*callback)); |
| 108 | auto service = callback->consumeInputFlingerRust(); |
| 109 | LOG_ALWAYS_FATAL_IF(!service, |
| 110 | "create_inputflinger_rust did not provide the IInputFlingerRust " |
| 111 | "implementation through the callback."); |
| 112 | return service; |
| 113 | } |
| 114 | |
| 115 | } // namespace |
| 116 | |
Siarhei Vishniakou | ba0a875 | 2021-09-14 14:43:25 -0700 | [diff] [blame] | 117 | /** |
| 118 | * The event flow is via the "InputListener" interface, as follows: |
Prabir Pradhan | addf8e9 | 2023-04-06 00:28:48 +0000 | [diff] [blame] | 119 | * InputReader |
| 120 | * -> UnwantedInteractionBlocker |
Vaibhav Devmurari | 5766aee | 2023-11-03 17:21:25 +0000 | [diff] [blame] | 121 | * -> InputFilter |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 122 | * -> PointerChoreographer |
Prabir Pradhan | addf8e9 | 2023-04-06 00:28:48 +0000 | [diff] [blame] | 123 | * -> InputProcessor |
| 124 | * -> InputDeviceMetricsCollector |
| 125 | * -> InputDispatcher |
Siarhei Vishniakou | ba0a875 | 2021-09-14 14:43:25 -0700 | [diff] [blame] | 126 | */ |
Prabir Pradhan | a41d244 | 2023-04-20 21:30:40 +0000 | [diff] [blame] | 127 | InputManager::InputManager(const sp<InputReaderPolicyInterface>& readerPolicy, |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 128 | InputDispatcherPolicyInterface& dispatcherPolicy, |
Vaibhav Devmurari | e948d4b | 2023-12-28 13:41:32 +0000 | [diff] [blame] | 129 | PointerChoreographerPolicyInterface& choreographerPolicy, |
| 130 | InputFilterPolicyInterface& inputFilterPolicy) { |
Prabir Pradhan | 44e6e83 | 2023-06-06 00:03:25 +0000 | [diff] [blame] | 131 | mInputFlingerRust = createInputFlingerRust(); |
| 132 | |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 133 | mDispatcher = createInputDispatcher(dispatcherPolicy); |
Prabir Pradhan | 274aa2c | 2023-08-18 17:27:07 +0000 | [diff] [blame] | 134 | mTracingStages.emplace_back( |
| 135 | std::make_unique<TracedInputListener>("InputDispatcher", *mDispatcher)); |
Prabir Pradhan | addf8e9 | 2023-04-06 00:28:48 +0000 | [diff] [blame] | 136 | |
Vaibhav Devmurari | 5766aee | 2023-11-03 17:21:25 +0000 | [diff] [blame] | 137 | if (ENABLE_INPUT_FILTER_RUST) { |
Vaibhav Devmurari | e948d4b | 2023-12-28 13:41:32 +0000 | [diff] [blame] | 138 | mInputFilter = std::make_unique<InputFilter>(*mTracingStages.back(), *mInputFlingerRust, |
| 139 | inputFilterPolicy); |
Vaibhav Devmurari | 5766aee | 2023-11-03 17:21:25 +0000 | [diff] [blame] | 140 | mTracingStages.emplace_back( |
| 141 | std::make_unique<TracedInputListener>("InputFilter", *mInputFilter)); |
| 142 | } |
| 143 | |
Prabir Pradhan | addf8e9 | 2023-04-06 00:28:48 +0000 | [diff] [blame] | 144 | if (ENABLE_INPUT_DEVICE_USAGE_METRICS) { |
Prabir Pradhan | 274aa2c | 2023-08-18 17:27:07 +0000 | [diff] [blame] | 145 | mCollector = std::make_unique<InputDeviceMetricsCollector>(*mTracingStages.back()); |
| 146 | mTracingStages.emplace_back( |
| 147 | std::make_unique<TracedInputListener>("MetricsCollector", *mCollector)); |
Prabir Pradhan | addf8e9 | 2023-04-06 00:28:48 +0000 | [diff] [blame] | 148 | } |
| 149 | |
Prabir Pradhan | 274aa2c | 2023-08-18 17:27:07 +0000 | [diff] [blame] | 150 | mProcessor = std::make_unique<InputProcessor>(*mTracingStages.back()); |
| 151 | mTracingStages.emplace_back( |
| 152 | std::make_unique<TracedInputListener>("InputProcessor", *mProcessor)); |
| 153 | |
Prabir Pradhan | 657786c | 2024-05-03 23:19:01 +0000 | [diff] [blame] | 154 | mChoreographer = |
| 155 | std::make_unique<PointerChoreographer>(*mTracingStages.back(), choreographerPolicy); |
| 156 | mTracingStages.emplace_back( |
| 157 | std::make_unique<TracedInputListener>("PointerChoreographer", *mChoreographer)); |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 158 | |
Prabir Pradhan | 274aa2c | 2023-08-18 17:27:07 +0000 | [diff] [blame] | 159 | mBlocker = std::make_unique<UnwantedInteractionBlocker>(*mTracingStages.back()); |
| 160 | mTracingStages.emplace_back( |
| 161 | std::make_unique<TracedInputListener>("UnwantedInteractionBlocker", *mBlocker)); |
| 162 | |
| 163 | mReader = createInputReader(readerPolicy, *mTracingStages.back()); |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 164 | } |
| 165 | |
| 166 | InputManager::~InputManager() { |
| 167 | stop(); |
| 168 | } |
| 169 | |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 170 | status_t InputManager::start() { |
Prabir Pradhan | 3608aad | 2019-10-02 17:08:26 -0700 | [diff] [blame] | 171 | status_t result = mDispatcher->start(); |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 172 | if (result) { |
| 173 | ALOGE("Could not start InputDispatcher thread due to error %d.", result); |
| 174 | return result; |
| 175 | } |
| 176 | |
Prabir Pradhan | 28efc19 | 2019-11-05 01:10:04 +0000 | [diff] [blame] | 177 | result = mReader->start(); |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 178 | if (result) { |
Prabir Pradhan | 28efc19 | 2019-11-05 01:10:04 +0000 | [diff] [blame] | 179 | ALOGE("Could not start InputReader due to error %d.", result); |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 180 | |
Prabir Pradhan | 3608aad | 2019-10-02 17:08:26 -0700 | [diff] [blame] | 181 | mDispatcher->stop(); |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 182 | return result; |
| 183 | } |
| 184 | |
| 185 | return OK; |
| 186 | } |
| 187 | |
| 188 | status_t InputManager::stop() { |
Prabir Pradhan | 3608aad | 2019-10-02 17:08:26 -0700 | [diff] [blame] | 189 | status_t status = OK; |
| 190 | |
Prabir Pradhan | 28efc19 | 2019-11-05 01:10:04 +0000 | [diff] [blame] | 191 | status_t result = mReader->stop(); |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 192 | if (result) { |
Prabir Pradhan | 28efc19 | 2019-11-05 01:10:04 +0000 | [diff] [blame] | 193 | ALOGW("Could not stop InputReader due to error %d.", result); |
Prabir Pradhan | 3608aad | 2019-10-02 17:08:26 -0700 | [diff] [blame] | 194 | status = result; |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 195 | } |
| 196 | |
Prabir Pradhan | 3608aad | 2019-10-02 17:08:26 -0700 | [diff] [blame] | 197 | result = mDispatcher->stop(); |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 198 | if (result) { |
| 199 | ALOGW("Could not stop InputDispatcher thread due to error %d.", result); |
Prabir Pradhan | 3608aad | 2019-10-02 17:08:26 -0700 | [diff] [blame] | 200 | status = result; |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 201 | } |
| 202 | |
Prabir Pradhan | 3608aad | 2019-10-02 17:08:26 -0700 | [diff] [blame] | 203 | return status; |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 204 | } |
| 205 | |
Siarhei Vishniakou | 1805009 | 2021-09-01 13:32:49 -0700 | [diff] [blame] | 206 | InputReaderInterface& InputManager::getReader() { |
| 207 | return *mReader; |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 208 | } |
| 209 | |
Prabir Pradhan | b56e92c | 2023-06-09 23:40:37 +0000 | [diff] [blame] | 210 | PointerChoreographerInterface& InputManager::getChoreographer() { |
| 211 | return *mChoreographer; |
| 212 | } |
| 213 | |
Siarhei Vishniakou | 9899603 | 2022-08-03 11:54:47 -0700 | [diff] [blame] | 214 | InputProcessorInterface& InputManager::getProcessor() { |
| 215 | return *mProcessor; |
Siarhei Vishniakou | a028c44 | 2019-02-04 14:33:23 -0800 | [diff] [blame] | 216 | } |
| 217 | |
Prabir Pradhan | 8ede1d1 | 2023-05-08 19:37:44 +0000 | [diff] [blame] | 218 | InputDeviceMetricsCollectorInterface& InputManager::getMetricsCollector() { |
| 219 | return *mCollector; |
| 220 | } |
| 221 | |
Siarhei Vishniakou | 1805009 | 2021-09-01 13:32:49 -0700 | [diff] [blame] | 222 | InputDispatcherInterface& InputManager::getDispatcher() { |
| 223 | return *mDispatcher; |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 224 | } |
| 225 | |
Vaibhav Devmurari | 953e6a4 | 2023-11-21 18:24:19 +0000 | [diff] [blame] | 226 | InputFilterInterface& InputManager::getInputFilter() { |
| 227 | return *mInputFilter; |
| 228 | } |
| 229 | |
Siarhei Vishniakou | 9f330c5 | 2022-05-17 05:03:42 -0700 | [diff] [blame] | 230 | void InputManager::monitor() { |
| 231 | mReader->monitor(); |
| 232 | mBlocker->monitor(); |
Siarhei Vishniakou | 9899603 | 2022-08-03 11:54:47 -0700 | [diff] [blame] | 233 | mProcessor->monitor(); |
Prabir Pradhan | 95019ac | 2023-12-06 22:38:21 +0000 | [diff] [blame] | 234 | if (ENABLE_INPUT_DEVICE_USAGE_METRICS) { |
| 235 | mCollector->monitor(); |
| 236 | } |
Siarhei Vishniakou | 9f330c5 | 2022-05-17 05:03:42 -0700 | [diff] [blame] | 237 | mDispatcher->monitor(); |
| 238 | } |
| 239 | |
Prabir Pradhan | 370dbc9 | 2023-04-06 00:02:05 +0000 | [diff] [blame] | 240 | void InputManager::dump(std::string& dump) { |
| 241 | mReader->dump(dump); |
| 242 | dump += '\n'; |
| 243 | mBlocker->dump(dump); |
| 244 | dump += '\n'; |
Prabir Pradhan | 657786c | 2024-05-03 23:19:01 +0000 | [diff] [blame] | 245 | mChoreographer->dump(dump); |
| 246 | dump += '\n'; |
Prabir Pradhan | 370dbc9 | 2023-04-06 00:02:05 +0000 | [diff] [blame] | 247 | mProcessor->dump(dump); |
| 248 | dump += '\n'; |
Prabir Pradhan | addf8e9 | 2023-04-06 00:28:48 +0000 | [diff] [blame] | 249 | if (ENABLE_INPUT_DEVICE_USAGE_METRICS) { |
| 250 | mCollector->dump(dump); |
| 251 | dump += '\n'; |
| 252 | } |
Vaibhav Devmurari | 6eb2160 | 2024-09-02 19:24:40 +0000 | [diff] [blame^] | 253 | if (ENABLE_INPUT_FILTER_RUST) { |
| 254 | mInputFilter->dump(dump); |
| 255 | dump += '\n'; |
| 256 | } |
Prabir Pradhan | 370dbc9 | 2023-04-06 00:02:05 +0000 | [diff] [blame] | 257 | mDispatcher->dump(dump); |
| 258 | dump += '\n'; |
| 259 | } |
| 260 | |
Robert Carr | 1c4c559 | 2018-09-24 13:18:43 -0700 | [diff] [blame] | 261 | // Used by tests only. |
Siarhei Vishniakou | 8d66013 | 2024-01-11 16:48:44 -0800 | [diff] [blame] | 262 | binder::Status InputManager::createInputChannel(const std::string& name, |
| 263 | android::os::InputChannelCore* outChannel) { |
Robert Carr | 1c4c559 | 2018-09-24 13:18:43 -0700 | [diff] [blame] | 264 | IPCThreadState* ipc = IPCThreadState::self(); |
Siarhei Vishniakou | 8d66013 | 2024-01-11 16:48:44 -0800 | [diff] [blame] | 265 | const uid_t uid = ipc->getCallingUid(); |
Robert Carr | 1c4c559 | 2018-09-24 13:18:43 -0700 | [diff] [blame] | 266 | if (uid != AID_SHELL && uid != AID_ROOT) { |
Siarhei Vishniakou | 8d66013 | 2024-01-11 16:48:44 -0800 | [diff] [blame] | 267 | LOG(ERROR) << __func__ << " can only be called by SHELL or ROOT users, " |
| 268 | << "but was called from UID " << uid; |
| 269 | return binder::Status:: |
| 270 | fromExceptionCode(EX_SECURITY, |
| 271 | "This uid is not allowed to call createInputChannel"); |
Robert Carr | 1c4c559 | 2018-09-24 13:18:43 -0700 | [diff] [blame] | 272 | } |
Siarhei Vishniakou | ce5ab08 | 2020-07-09 17:03:21 -0500 | [diff] [blame] | 273 | |
Garfield Tan | 1560166 | 2020-09-22 15:32:38 -0700 | [diff] [blame] | 274 | base::Result<std::unique_ptr<InputChannel>> channel = mDispatcher->createInputChannel(name); |
Bernie Innocenti | 189c0f8 | 2020-12-22 19:45:18 +0900 | [diff] [blame] | 275 | if (!channel.ok()) { |
Garfield Tan | 1560166 | 2020-09-22 15:32:38 -0700 | [diff] [blame] | 276 | return binder::Status::fromExceptionCode(exceptionCodeFromStatusT(channel.error().code()), |
| 277 | channel.error().message().c_str()); |
| 278 | } |
Siarhei Vishniakou | 7b9f4f5 | 2024-02-02 13:07:16 -0800 | [diff] [blame] | 279 | InputChannel::moveChannel(std::move(*channel), *outChannel); |
Chris Ye | 0783e99 | 2020-06-02 21:34:49 -0700 | [diff] [blame] | 280 | return binder::Status::ok(); |
Robert Carr | 1c4c559 | 2018-09-24 13:18:43 -0700 | [diff] [blame] | 281 | } |
| 282 | |
Garfield Tan | 1560166 | 2020-09-22 15:32:38 -0700 | [diff] [blame] | 283 | binder::Status InputManager::removeInputChannel(const sp<IBinder>& connectionToken) { |
| 284 | mDispatcher->removeInputChannel(connectionToken); |
Chris Ye | 0783e99 | 2020-06-02 21:34:49 -0700 | [diff] [blame] | 285 | return binder::Status::ok(); |
| 286 | } |
| 287 | |
| 288 | status_t InputManager::dump(int fd, const Vector<String16>& args) { |
| 289 | std::string dump; |
| 290 | |
| 291 | dump += " InputFlinger dump\n"; |
| 292 | |
Siarhei Vishniakou | cac8427 | 2023-06-28 14:43:25 -0700 | [diff] [blame] | 293 | TEMP_FAILURE_RETRY(::write(fd, dump.c_str(), dump.size())); |
Chris Ye | 0783e99 | 2020-06-02 21:34:49 -0700 | [diff] [blame] | 294 | return NO_ERROR; |
Robert Carr | 1c4c559 | 2018-09-24 13:18:43 -0700 | [diff] [blame] | 295 | } |
| 296 | |
Prabir Pradhan | 44e6e83 | 2023-06-06 00:03:25 +0000 | [diff] [blame] | 297 | binder::Status InputManager::setFocusedWindow(const gui::FocusRequest& request) { |
Vishnu Nair | e798b47 | 2020-07-23 13:52:21 -0700 | [diff] [blame] | 298 | mDispatcher->setFocusedWindow(request); |
| 299 | return binder::Status::ok(); |
| 300 | } |
| 301 | |
Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 302 | } // namespace android |