Sensor: Make getId() more varied
Apps from different developers will now receive a different
ID for the same dynamic sensor. Additionally, all apps
will now receive a different/new ID for the same dynamic
sensor after a factory reset.
Bug: 28775590, 29547335
Change-Id: I368655b0e4bdc16736a7fd163ea3f7dad2886b3b
diff --git a/services/sensorservice/SensorService.h b/services/sensorservice/SensorService.h
index 0d04478..c8de621 100644
--- a/services/sensorservice/SensorService.h
+++ b/services/sensorservice/SensorService.h
@@ -208,6 +208,17 @@
status_t resetToNormalMode();
status_t resetToNormalModeLocked();
+ // Transforms the UUIDs for all the sensors into proper IDs.
+ void makeUuidsIntoIdsForSensorList(Vector<Sensor> &sensorList) const;
+ // Gets the appropriate ID from the given UUID.
+ int32_t getIdFromUuid(const Sensor::uuid_t &uuid) const;
+ // Either read from storage or create a new one.
+ static bool initializeHmacKey();
+
+
+ static uint8_t sHmacGlobalKey[128];
+ static bool sHmacGlobalKeyIsValid;
+
SensorList mSensors;
status_t mInitCheck;