Siarhei Vishniakou | a0e7f73 | 2018-01-17 11:49:04 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 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 "InputClassifierHAL" |
| 18 | |
| 19 | #include "InputClassifier.h" |
| 20 | #include <inttypes.h> |
| 21 | #include <log/log.h> |
| 22 | #include <utils/Timers.h> |
| 23 | |
Siarhei Vishniakou | 45c1d0c | 2019-01-24 10:38:02 -0800 | [diff] [blame] | 24 | using namespace android::hardware::input::common::V1_0; |
Siarhei Vishniakou | a0e7f73 | 2018-01-17 11:49:04 -0800 | [diff] [blame] | 25 | |
| 26 | namespace android { |
| 27 | namespace hardware { |
| 28 | namespace input { |
| 29 | namespace classifier { |
| 30 | namespace V1_0 { |
| 31 | namespace implementation { |
| 32 | |
| 33 | // Methods from ::android::hardware::input::classifier::V1_0::IInputClassifier follow. |
Siarhei Vishniakou | 443e98b | 2019-02-07 15:42:06 -0800 | [diff] [blame] | 34 | Return<Classification> InputClassifier::classify(const MotionEvent& /*event*/) { |
Siarhei Vishniakou | a0e7f73 | 2018-01-17 11:49:04 -0800 | [diff] [blame] | 35 | /** |
Siarhei Vishniakou | 443e98b | 2019-02-07 15:42:06 -0800 | [diff] [blame] | 36 | * The touchscreen data is highly device-dependent. |
| 37 | * As a result, the implementation of this method will likely be hardware-specific. |
| 38 | * Here we just report gesture as not having any classification, which means that the |
| 39 | * default action will be taken in the framework. |
| 40 | * This is equivalent to not having the InputClassifier HAL at all. |
Siarhei Vishniakou | a0e7f73 | 2018-01-17 11:49:04 -0800 | [diff] [blame] | 41 | */ |
Siarhei Vishniakou | a0e7f73 | 2018-01-17 11:49:04 -0800 | [diff] [blame] | 42 | return Classification::NONE; |
| 43 | } |
| 44 | |
Siarhei Vishniakou | ba9d3c8 | 2019-01-23 15:14:20 -0800 | [diff] [blame] | 45 | Return<void> InputClassifier::reset() { |
Siarhei Vishniakou | 443e98b | 2019-02-07 15:42:06 -0800 | [diff] [blame] | 46 | // We don't have any internal state, so no work needed here. |
Siarhei Vishniakou | ba9d3c8 | 2019-01-23 15:14:20 -0800 | [diff] [blame] | 47 | return Void(); |
| 48 | } |
| 49 | |
| 50 | Return<void> InputClassifier::resetDevice(int32_t /*deviceId*/) { |
Siarhei Vishniakou | 443e98b | 2019-02-07 15:42:06 -0800 | [diff] [blame] | 51 | // We don't have any internal per-device state, so no work needed here. |
Siarhei Vishniakou | ba9d3c8 | 2019-01-23 15:14:20 -0800 | [diff] [blame] | 52 | return Void(); |
| 53 | } |
| 54 | |
Siarhei Vishniakou | a0e7f73 | 2018-01-17 11:49:04 -0800 | [diff] [blame] | 55 | } // namespace implementation |
| 56 | } // namespace V1_0 |
| 57 | } // namespace classifier |
| 58 | } // namespace input |
| 59 | } // namespace hardware |
| 60 | } // namespace android |