Add function to determine if SensorDevice support direct report
Added a function to SensorDevice to indicate if direct report is
supported. This avoided a crash condition in non-HIDL implementation.
Test: test with demo app on a HAL w/ and w/o direct report support
Change-Id: If68497bb8890b9e6003c2afeec38d16daf81f237
diff --git a/services/sensorservice/SensorDevice.h b/services/sensorservice/SensorDevice.h
index b6886a2..7dd256a 100644
--- a/services/sensorservice/SensorDevice.h
+++ b/services/sensorservice/SensorDevice.h
@@ -59,6 +59,7 @@
status_t flush(void* ident, int handle);
status_t setMode(uint32_t mode);
+ bool isDirectReportSupported() const;
int32_t registerDirectChannel(const sensors_direct_mem_t *memory);
void unregisterDirectChannel(int32_t channelHandle);
int32_t configureDirectChannel(int32_t sensorHandle,
@@ -147,6 +148,8 @@
const hardware::hidl_vec<Event> &src,
const hardware::hidl_vec<SensorInfo> &dynamicSensorsAdded,
sensors_event_t *dst);
+
+ bool mIsDirectReportSupported;
#endif // ENABLE_TREBLE
};