From 5113aff7e2a8540cc3f6364b8c730f853784e2ff Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Fri, 13 Feb 2015 17:31:41 -0800 Subject: Add input HAL header. Change-Id: Ia959dd1d1adf024459d2423fc9d59a811466e53c --- modules/Android.mk | 2 +- modules/input/Android.mk | 19 +++++++++++ modules/input/evdev/Android.mk | 29 ++++++++++++++++ modules/input/evdev/EvdevModule.cpp | 66 +++++++++++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 modules/input/Android.mk create mode 100644 modules/input/evdev/Android.mk create mode 100644 modules/input/evdev/EvdevModule.cpp (limited to 'modules') diff --git a/modules/Android.mk b/modules/Android.mk index 13a0b5b..9f7e5f0 100644 --- a/modules/Android.mk +++ b/modules/Android.mk @@ -1,4 +1,4 @@ hardware_modules := gralloc hwcomposer audio nfc nfc-nci local_time \ power usbaudio audio_remote_submix camera usbcamera consumerir sensors vibrator \ - tv_input fingerprint + tv_input fingerprint input include $(call all-named-subdir-makefiles,$(hardware_modules)) diff --git a/modules/input/Android.mk b/modules/input/Android.mk new file mode 100644 index 0000000..3011b2e --- /dev/null +++ b/modules/input/Android.mk @@ -0,0 +1,19 @@ +# Copyright (C) 2015 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/modules/input/evdev/Android.mk b/modules/input/evdev/Android.mk new file mode 100644 index 0000000..ad05af3 --- /dev/null +++ b/modules/input/evdev/Android.mk @@ -0,0 +1,29 @@ +# Copyright (C) 2015 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := input.evdev.default +LOCAL_MODULE_RELATIVE_PATH := hw + +LOCAL_SRC_FILES := \ + EvdevModule.cpp + +LOCAL_SHARED_LIBRARIES := liblog + +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) diff --git a/modules/input/evdev/EvdevModule.cpp b/modules/input/evdev/EvdevModule.cpp new file mode 100644 index 0000000..f56842a --- /dev/null +++ b/modules/input/evdev/EvdevModule.cpp @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2015 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_NDEBUG 0 +#define LOG_TAG "EvdevModule" + +#include +#include +#include + +namespace input { + +extern "C" { + +static int dummy_open(const hw_module_t __unused *module, const char __unused *id, + hw_device_t __unused **device) { + assert(false); + return 0; +} + +static void input_init(const input_module_t* module, + input_host_t* host, input_host_callbacks_t cb) { + return; +} + +static void input_notify_report(input_report_t* r) { + return; +} + +static struct hw_module_methods_t input_module_methods = { + .open = dummy_open, +}; + +input_module_t HAL_MODULE_INFO_SYM = { + .common = { + .tag = HARDWARE_MODULE_TAG, + .module_api_version = INPUT_MODULE_API_VERSION_1_0, + .hal_api_version = HARDWARE_HAL_API_VERSION, + .id = INPUT_HARDWARE_MODULE_ID, + .name = "Input evdev HAL", + .author = "The Android Open Source Project", + .methods = &input_module_methods, + .dso = NULL, + .reserved = {0}, + }, + + .init = input_init, + .notify_report = input_notify_report, +}; + +} // extern "C" + +} // namespace input -- cgit v1.1