blob: cce9190cc8badebdbdaf2218e5398b2a82b093c2 [file] [log] [blame]
Siarhei Vishniakoua0e7f732018-01-17 11:49:04 -08001/*
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 Vishniakou45c1d0c2019-01-24 10:38:02 -080024using namespace android::hardware::input::common::V1_0;
Siarhei Vishniakoua0e7f732018-01-17 11:49:04 -080025
26namespace android {
27namespace hardware {
28namespace input {
29namespace classifier {
30namespace V1_0 {
31namespace implementation {
32
33// Methods from ::android::hardware::input::classifier::V1_0::IInputClassifier follow.
Siarhei Vishniakou443e98b2019-02-07 15:42:06 -080034Return<Classification> InputClassifier::classify(const MotionEvent& /*event*/) {
Siarhei Vishniakoua0e7f732018-01-17 11:49:04 -080035 /**
Siarhei Vishniakou443e98b2019-02-07 15:42:06 -080036 * 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 Vishniakoua0e7f732018-01-17 11:49:04 -080041 */
Siarhei Vishniakoua0e7f732018-01-17 11:49:04 -080042 return Classification::NONE;
43}
44
Siarhei Vishniakouba9d3c82019-01-23 15:14:20 -080045Return<void> InputClassifier::reset() {
Siarhei Vishniakou443e98b2019-02-07 15:42:06 -080046 // We don't have any internal state, so no work needed here.
Siarhei Vishniakouba9d3c82019-01-23 15:14:20 -080047 return Void();
48}
49
50Return<void> InputClassifier::resetDevice(int32_t /*deviceId*/) {
Siarhei Vishniakou443e98b2019-02-07 15:42:06 -080051 // We don't have any internal per-device state, so no work needed here.
Siarhei Vishniakouba9d3c82019-01-23 15:14:20 -080052 return Void();
53}
54
Siarhei Vishniakoua0e7f732018-01-17 11:49:04 -080055} // namespace implementation
56} // namespace V1_0
57} // namespace classifier
58} // namespace input
59} // namespace hardware
60} // namespace android