Hold onto linked binder.
unlinkToDeath is no longer required, (this change in behavior is to
avoid leaks) so holding onto ActivityManager here (still calling
unlinkToDeath to avoid a log, but may for instance remove all
unlinkToDeath calls in the future).
Exempt-From-Owner-Approval: approval received on AOSP CL, only
whitespace difference here.
Bug: 134576445
Test: boot
Change-Id: I273f77aac2b80ba9be70197cc3842f83a11bbd1c
diff --git a/services/audiopolicy/service/AudioPolicyService.h b/services/audiopolicy/service/AudioPolicyService.h
index e467f70..74aea0d 100644
--- a/services/audiopolicy/service/AudioPolicyService.h
+++ b/services/audiopolicy/service/AudioPolicyService.h
@@ -23,6 +23,7 @@
#include <utils/String8.h>
#include <utils/Vector.h>
#include <utils/SortedVector.h>
+#include <binder/ActivityManager.h>
#include <binder/BinderService.h>
#include <binder/IUidObserver.h>
#include <system/audio.h>
@@ -387,6 +388,7 @@
wp<AudioPolicyService> mService;
Mutex mLock;
+ ActivityManager mAm;
bool mObserverRegistered;
std::unordered_map<uid_t, std::pair<bool, int>> mOverrideUids;
std::unordered_map<uid_t, std::pair<bool, int>> mCachedUids;