blob: 0c36c9920f462513baf4b453611bca4db63db579 [file] [log] [blame]
Mathias Agopian589ce852010-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_ISENSORSERVER_H
18#define ANDROID_GUI_ISENSORSERVER_H
19
20#include <stdint.h>
21#include <sys/types.h>
22
23#include <utils/Errors.h>
24#include <utils/RefBase.h>
25
26#include <binder/IInterface.h>
27
Peng Xue36e3472016-11-03 11:57:10 -070028struct native_handle;
29typedef struct native_handle native_handle_t;
Mathias Agopian589ce852010-07-13 22:21:56 -070030namespace android {
31// ----------------------------------------------------------------------------
32
33class Sensor;
34class ISensorEventConnection;
Aravind Akella4949c502015-02-11 15:54:35 -080035class String8;
Mathias Agopian589ce852010-07-13 22:21:56 -070036
37class ISensorServer : public IInterface
38{
39public:
Colin Cross17576de2016-09-26 13:07:06 -070040 DECLARE_META_INTERFACE(SensorServer)
Mathias Agopian589ce852010-07-13 22:21:56 -070041
Svetoslavb412f6e2015-04-29 16:50:41 -070042 virtual Vector<Sensor> getSensorList(const String16& opPackageName) = 0;
Peng Xu2576cb62016-01-20 00:22:09 -080043 virtual Vector<Sensor> getDynamicSensorList(const String16& opPackageName) = 0;
44
Aravind Akellaa9e6cc32015-04-16 18:57:31 -070045 virtual sp<ISensorEventConnection> createSensorEventConnection(const String8& packageName,
Svetoslavb412f6e2015-04-29 16:50:41 -070046 int mode, const String16& opPackageName) = 0;
Aravind Akella5c538052015-06-29 12:37:48 -070047 virtual int32_t isDataInjectionEnabled() = 0;
Peng Xue36e3472016-11-03 11:57:10 -070048
49 virtual sp<ISensorEventConnection> createSensorDirectConnection(const String16& opPackageName,
50 uint32_t size, int32_t type, int32_t format, const native_handle_t *resource) = 0;
Mathias Agopian589ce852010-07-13 22:21:56 -070051};
52
53// ----------------------------------------------------------------------------
54
55class BnSensorServer : public BnInterface<ISensorServer>
56{
57public:
58 virtual status_t onTransact( uint32_t code,
59 const Parcel& data,
60 Parcel* reply,
61 uint32_t flags = 0);
62};
63
64// ----------------------------------------------------------------------------
65}; // namespace android
66
67#endif // ANDROID_GUI_ISENSORSERVER_H