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 3b27b3b3bb36274171a9abb31f3e3f6b53036cf0)
2 files changed