power-libperfmgr: Fix use-after-free crash

The main problem is the timer thread could be woken after the session
was destroyed. We did have a closed flag which was set in destructor and the flag would be checked before handleMessage accessing the session
instance. To fix the problem, the operations of flag checking and session instance accessing should be guarded by the lock.

Bug: 236674672
Test: manual test
Change-Id: I49a18efbc135b1bc070b101038a8a0bcc6e19fec
(cherry picked from commit 5c75978f530b27bd976d8695ed79acd336c24776)
Merged-In: I49a18efbc135b1bc070b101038a8a0bcc6e19fec
2 files changed
tree: e42a9f117606c0d29ad6b999290968f11dc2d326
  1. aidl/
  2. alsa_utils_legacy/
  3. BesLoudness/
  4. bootctrl/
  5. hidl/
  6. interfaces/
  7. libmtk_bsg/
  8. libmtkperf_client/
  9. Android.bp
  10. Android.mk
  11. README.md
README.md

Common hardware components for MediaTek devices