Prevent mEventCache UAF in SensorEventConnection
Since there is no check to see if SensorEventConnection has been
destroyed, the mEventCache pointer can still be used even after it
Test: Run test code that attempts to enable a sensor after destroying
the SensorEventConnection, and verify no system_server crash occurs.
(cherry picked from commit bbf3b377482aeac64c23556bcb2a129d944629ed)
2 files changed