Keep the death recipient alive
Binder doesn't hold on to the death recipient.
This caused audio server to miss notifications about system server
death.
Fixes: 153080001
Test: Manual verification of killing the system process.
Change-Id: Iad1b2d4c5348d3d9917efc6838e86b736fa33094
diff --git a/services/audiopolicy/service/CaptureStateNotifier.h b/services/audiopolicy/service/CaptureStateNotifier.h
index 4ca6601..166de2a 100644
--- a/services/audiopolicy/service/CaptureStateNotifier.h
+++ b/services/audiopolicy/service/CaptureStateNotifier.h
@@ -17,6 +17,7 @@
#pragma once
#include <mutex>
+#include <binder/IBinder.h>
#include <utils/StrongPointer.h>
namespace android {
@@ -63,6 +64,7 @@
private:
std::mutex mMutex;
sp<media::ICaptureStateListener> mListener;
+ sp<IBinder::DeathRecipient> mDeathRecipient;
bool mActive;
class DeathRecipient;