Fix dangerous unsafe_get() in SensorRecord
Change raw pointers to wp<> and constify relevant lines in
SensorRecord.
Bug: 30261110
Change-Id: I7f28c593366af44192991061fa5f71cf925b22a8
(cherry picked from commit ded526e8c3539b5986b46dffc1ff8ab15d7da570)
diff --git a/services/sensorservice/SensorEventConnection.h b/services/sensorservice/SensorEventConnection.h
index b796cc0..883c16e 100644
--- a/services/sensorservice/SensorEventConnection.h
+++ b/services/sensorservice/SensorEventConnection.h
@@ -52,7 +52,7 @@
bool isDataInjectionMode, const String16& opPackageName);
status_t sendEvents(sensors_event_t const* buffer, size_t count, sensors_event_t* scratch,
- SensorEventConnection const * const * mapFlushEventsToConnections = NULL);
+ wp<const SensorEventConnection> const * mapFlushEventsToConnections = NULL);
bool hasSensor(int32_t handle) const;
bool hasAnySensor() const;
bool hasOneShotSensors() const;