1/* 2 * Copyright (C) 2017 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_FRAMEWORKS_SENSORSERVICE_V1_0_DIRECTREPORTCHANNEL_H 18#define ANDROID_FRAMEWORKS_SENSORSERVICE_V1_0_DIRECTREPORTCHANNEL_H 19 20#include <android/frameworks/sensorservice/1.0/IDirectReportChannel.h> 21#include <android/frameworks/sensorservice/1.0/types.h> 22#include <hidl/MQDescriptor.h> 23#include <hidl/Status.h> 24#include <sensor/SensorManager.h> 25 26namespace android { 27namespace frameworks { 28namespace sensorservice { 29namespace V1_0 { 30namespace implementation { 31 32using ::android::frameworks::sensorservice::V1_0::IDirectReportChannel; 33using ::android::hardware::sensors::V1_0::RateLevel; 34using ::android::hidl::base::V1_0::DebugInfo; 35using ::android::hidl::base::V1_0::IBase; 36using ::android::hardware::hidl_array; 37using ::android::hardware::hidl_memory; 38using ::android::hardware::hidl_string; 39using ::android::hardware::hidl_vec; 40using ::android::hardware::Return; 41using ::android::hardware::Void; 42using ::android::sp; 43 44struct DirectReportChannel final : public IDirectReportChannel { 45 46 DirectReportChannel(::android::SensorManager& manager, int channelId); 47 ~DirectReportChannel(); 48 49 // Methods from ::android::frameworks::sensorservice::V1_0::IDirectReportChannel follow. 50 Return<void> configure(int32_t sensorHandle, RateLevel rate, 51 configure_cb _hidl_cb) override; 52 53private: 54 ::android::SensorManager& mManager; 55 const int mId; 56}; 57 58} // namespace implementation 59} // namespace V1_0 60} // namespace sensorservice 61} // namespace frameworks 62} // namespace android 63 64#endif // ANDROID_FRAMEWORKS_SENSORSERVICE_V1_0_DIRECTREPORTCHANNEL_H 65