Convert KeyedVector to std::ordered_map
KeyedVector is not recommended per doc.
Bug: 74395023
Test: Compile
Change-Id: I7d7b1e43291677d3723e497d8e44a206ebb9a825
diff --git a/services/sensorservice/SensorEventConnection.h b/services/sensorservice/SensorEventConnection.h
index caf5d7c..1ca35c0 100644
--- a/services/sensorservice/SensorEventConnection.h
+++ b/services/sensorservice/SensorEventConnection.h
@@ -23,7 +23,6 @@
#include <utils/Vector.h>
#include <utils/SortedVector.h>
-#include <utils/KeyedVector.h>
#include <utils/threads.h>
#include <utils/AndroidThreads.h>
#include <utils/RefBase.h>
@@ -60,6 +59,7 @@
bool hasOneShotSensors() const;
bool addSensor(int32_t handle);
bool removeSensor(int32_t handle);
+ std::vector<int32_t> getActiveSensorHandles() const;
void setFirstFlushPending(int32_t handle, bool value);
void dump(String8& result);
void dump(util::ProtoOutputStream* proto) const;
@@ -169,8 +169,8 @@
FlushInfo() : mPendingFlushEventsToSend(0), mFirstFlushPending(false) {}
};
- // protected by SensorService::mLock. Key for this vector is the sensor handle.
- KeyedVector<int, FlushInfo> mSensorInfo;
+ // protected by SensorService::mLock. Key for this map is the sensor handle.
+ std::unordered_map<int32_t, FlushInfo> mSensorInfo;
sensors_event_t *mEventCache;
int mCacheSize, mMaxCacheSize;