1f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian/*
2f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * Copyright (C) 2010 The Android Open Source Project
3f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian *
4f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * Licensed under the Apache License, Version 2.0 (the "License");
5f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * you may not use this file except in compliance with the License.
6f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * You may obtain a copy of the License at
7f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian *
8f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian *      http://www.apache.org/licenses/LICENSE-2.0
9f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian *
10f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * Unless required by applicable law or agreed to in writing, software
11f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * distributed under the License is distributed on an "AS IS" BASIS,
12f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * See the License for the specific language governing permissions and
14f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian * limitations under the License.
15f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian */
16f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian
17f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian#ifndef ANDROID_GRAVITY_SENSOR_H
18f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian#define ANDROID_GRAVITY_SENSOR_H
19f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian
20f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian#include <stdint.h>
21f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian#include <sys/types.h>
22f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian
23f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian#include <gui/Sensor.h>
24f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian
25f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian#include "SensorInterface.h"
26f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian
27f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian// ---------------------------------------------------------------------------
28f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopiannamespace android {
29f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian// ---------------------------------------------------------------------------
30f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian
31984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopianclass SensorDevice;
32984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopianclass SensorFusion;
33984826cc158193e61e3a00359ef4f6699c7d748aMathias Agopian
34755c451c7861a029e26e5f16e319b629169e656dPeng Xuclass GravitySensor : public VirtualSensor {
35f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian    Sensor mAccelerometer;
36f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian
37f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopianpublic:
38f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian    GravitySensor(sensor_t const* list, size_t count);
390cc8f809924706c7d683da30605f432635dd5bb6Peng Xu    virtual bool process(sensors_event_t* outEvent, const sensors_event_t& event) override;
400cc8f809924706c7d683da30605f432635dd5bb6Peng Xu    virtual status_t activate(void* ident, bool enabled) override;
410cc8f809924706c7d683da30605f432635dd5bb6Peng Xu    virtual status_t setDelay(void* ident, int handle, int64_t ns) override;
42f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian};
43f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian
44f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian// ---------------------------------------------------------------------------
45f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian}; // namespace android
46f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian
47f001c92436b4a66eb7687286325ced7f10c9f917Mathias Agopian#endif // ANDROID_GRAVITY_SENSOR_H
48