blob: e1b1a7be45fb9cb121748c7b6ede7c2f5f7402d5 [file] [log] [blame]
Mathias Agopianb957b9d2010-07-13 22:21:56 -07001/*
2 * Copyright (C) 2010 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#ifndef ANDROID_GUI_SENSOR_MANAGER_H
18#define ANDROID_GUI_SENSOR_MANAGER_H
19
20#include <stdint.h>
21#include <sys/types.h>
22
23#include <utils/Errors.h>
24#include <utils/RefBase.h>
25#include <utils/Singleton.h>
26#include <utils/Vector.h>
27
28#include <gui/SensorEventQueue.h>
29
30// ----------------------------------------------------------------------------
31// Concrete types for the NDK
32struct ASensorManager { };
33
34// ----------------------------------------------------------------------------
35namespace android {
36// ----------------------------------------------------------------------------
37
38class ISensorServer;
39class Sensor;
40class SensorEventQueue;
41
42// ----------------------------------------------------------------------------
43
44class SensorManager : public ASensorManager, public Singleton<SensorManager>
45{
46public:
47 SensorManager();
48 ~SensorManager();
49
Mathias Agopian1bf79782010-07-14 23:41:37 -070050 ssize_t getSensorList(Sensor const* const** list) const;
51 Sensor const* getDefaultSensor(int type);
Mathias Agopianb957b9d2010-07-13 22:21:56 -070052 sp<SensorEventQueue> createEventQueue();
53
54private:
55 sp<ISensorServer> mSensorServer;
Mathias Agopian1bf79782010-07-14 23:41:37 -070056 Sensor const** mSensorList;
Mathias Agopianb957b9d2010-07-13 22:21:56 -070057 Vector<Sensor> mSensors;
58};
59
60// ----------------------------------------------------------------------------
61}; // namespace android
62
63#endif // ANDROID_GUI_SENSOR_MANAGER_H