stagefright: fix unreleased OMX handle
- Ensure OMX handle is freed even if binder death notification comes
first.
- Add DeathRecipient in ResourceManagerService so that it could
handle dead clients properly.
Fix: 28824626
Fix: 34252788
Test: adb shell am instrument -e size small -w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Change-Id: Ifc441a2771b5674749ff65a4520177dda115b292
diff --git a/services/mediaresourcemanager/ResourceManagerService.h b/services/mediaresourcemanager/ResourceManagerService.h
index 2a4a6b2..9e97ac0 100644
--- a/services/mediaresourcemanager/ResourceManagerService.h
+++ b/services/mediaresourcemanager/ResourceManagerService.h
@@ -36,6 +36,7 @@
struct ResourceInfo {
int64_t clientId;
sp<IResourceManagerClient> client;
+ sp<IBinder::DeathRecipient> deathNotifier;
Vector<MediaResource> resources;
};
@@ -70,6 +71,8 @@
// Returns true if any resource has been reclaimed, otherwise returns false.
virtual bool reclaimResource(int callingPid, const Vector<MediaResource> &resources);
+ void removeResource(int pid, int64_t clientId, bool checkValid);
+
protected:
virtual ~ResourceManagerService();