Direct report mode support in sensor service and client
Added SensorDirectConnection to represent the direct channel.
The life-cycle is similar to that of SensorEventConnection.
Modified SensorDevice and SensorDeviceTreble to support new
HAL API. Added support in SensorManager, SensorService, binder
classes. Also added related helper functions in Sensor and dumpsys
support in SensorList.
Test: manual test with demo app
Bug: 30985702
Change-Id: I8750294b6aab717ed7f525299be642f1f0b85558
diff --git a/services/sensorservice/SensorEventConnection.cpp b/services/sensorservice/SensorEventConnection.cpp
index f2f1444..d84d36e 100644
--- a/services/sensorservice/SensorEventConnection.cpp
+++ b/services/sensorservice/SensorEventConnection.cpp
@@ -23,6 +23,8 @@
#include "SensorEventConnection.h"
#include "SensorDevice.h"
+#define UNUSED(x) (void)(x)
+
namespace android {
SensorService::SensorEventConnection::SensorEventConnection(
@@ -524,6 +526,13 @@
return mService->flushSensor(this, mOpPackageName);
}
+int32_t SensorService::SensorEventConnection::configureChannel(int handle, int rateLevel) {
+ // SensorEventConnection does not support configureChannel, parameters not used
+ UNUSED(handle);
+ UNUSED(rateLevel);
+ return INVALID_OPERATION;
+}
+
int SensorService::SensorEventConnection::handleEvent(int fd, int events, void* /*data*/) {
if (events & ALOOPER_EVENT_HANGUP || events & ALOOPER_EVENT_ERROR) {
{