2 * Copyright (C) 2010 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #include <sys/types.h>
20 #include <cutils/log.h>
22 #include "SensorInterface.h"
25 // ---------------------------------------------------------------------------
27 SensorInterface::~SensorInterface()
31 // ---------------------------------------------------------------------------
33 HardwareSensor::HardwareSensor(const sensor_t& sensor)
34 : mSensorDevice(SensorDevice::getInstance()),
37 LOGI("%s", sensor.name);
40 HardwareSensor::~HardwareSensor() {
43 bool HardwareSensor::process(sensors_event_t* outEvent,
44 const sensors_event_t& event) {
49 status_t HardwareSensor::activate(void* ident, bool enabled) {
50 return mSensorDevice.activate(ident, mSensor.getHandle(), enabled);
53 status_t HardwareSensor::setDelay(void* ident, int handle, int64_t ns) {
54 return mSensorDevice.setDelay(ident, handle, ns);
57 Sensor HardwareSensor::getSensor() const {
62 // ---------------------------------------------------------------------------
63 }; // namespace android