Fix sensor uuid, retrofit recent event logger
Fix an issue that causes uuid field not being initialzed in
sensorservice.
MostRecentEventLogger in sensorservice is migrated to use RingBuffer
instead of a custom circular buffer. This is expected to improve
readability and maintainability of code.
Dumpsys print format is retouched to offer more information in easier
to read format.
Bug: 28305085
Change-Id: I190e43350b60a22a9fccb92a95d6eab06a471560
diff --git a/include/gui/Sensor.h b/include/gui/Sensor.h
index 353003c..3f60741 100644
--- a/include/gui/Sensor.h
+++ b/include/gui/Sensor.h
@@ -52,12 +52,18 @@
TYPE_PROXIMITY = ASENSOR_TYPE_PROXIMITY
};
- typedef struct {
- uint8_t b[16];
- } uuid_t;
+ struct uuid_t{
+ union {
+ uint8_t b[16];
+ int64_t i64[2];
+ };
+ uuid_t(const uint8_t (&uuid)[16]) { memcpy(b, uuid, sizeof(b));}
+ uuid_t() : b{0} {}
+ };
Sensor(const char * name = "");
Sensor(struct sensor_t const* hwSensor, int halVersion = 0);
+ Sensor(struct sensor_t const& hwSensor, const uuid_t& uuid, int halVersion = 0);
~Sensor();
const String8& getName() const;
@@ -81,6 +87,7 @@
uint32_t getFlags() const;
bool isWakeUpSensor() const;
bool isDynamicSensor() const;
+ bool hasAdditionalInfo() const;
int32_t getReportingMode() const;
const uuid_t& getUuid() const;