ISensorEventConnection.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  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. #ifndef ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H
  17. #define ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H
  18. #include <stdint.h>
  19. #include <sys/types.h>
  20. #include <utils/Errors.h>
  21. #include <utils/RefBase.h>
  22. #include <binder/IInterface.h>
  23. namespace android {
  24. // ----------------------------------------------------------------------------
  25. class BitTube;
  26. class ISensorEventConnection : public IInterface
  27. {
  28. public:
  29. DECLARE_META_INTERFACE(SensorEventConnection);
  30. virtual sp<BitTube> getSensorChannel() const = 0;
  31. virtual status_t enableDisable(int handle, bool enabled, nsecs_t samplingPeriodNs,
  32. nsecs_t maxBatchReportLatencyNs, int reservedFlags) = 0;
  33. virtual status_t setEventRate(int handle, nsecs_t ns) = 0;
  34. virtual status_t flush() = 0;
  35. };
  36. // ----------------------------------------------------------------------------
  37. class BnSensorEventConnection : public BnInterface<ISensorEventConnection>
  38. {
  39. public:
  40. virtual status_t onTransact( uint32_t code,
  41. const Parcel& data,
  42. Parcel* reply,
  43. uint32_t flags = 0);
  44. };
  45. // ----------------------------------------------------------------------------
  46. }; // namespace android
  47. #endif // ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H