power: Fix race condition between Looper and destructor

1. Clean all messages before add new.
2. Insteading of using `this`, use the unique mStaleHandler sp so Looper
   can hold the sp to keep the instance alive until the last message
   done.

Test: Manual Test
Bug: 219965773
Change-Id: Ic039146f0b966c1f27d86b121d4b72b75ff360e5
2 files changed
tree: ff4b343e6cb86dbd18374ca4f96b1a5ad5f4e150
  1. aidl/
  2. alsa_utils_legacy/
  3. BesLoudness/
  4. hidl/
  5. interfaces/
  6. libmtkperf_client/
  7. Android.bp
  8. Android.mk
  9. README.md
README.md

Common hardware components for MediaTek devices