Remove dead codecs from ResourceManagerService

When a codec is dead, the resources aren't always removed from
ResourceManagerService, causing MediaCodec to attempt to reclaim
resources continuously without actually doing any reclaiming. Remove the
resources from ResourceManagerService when a dead codec is identified.

Passing 10 iterations on coral-userdebug:
https://android-build.googleplex.com/builds/abtd/run/L09800000954236443

Filed b/230362034 to do further investigation as to why the resources
aren't being removed.

Bug: 229848597
Bug: 228238915
Fixes: 229848597
Fixes: 228238915
Test: atest MediaCodecResourceTest
Change-Id: I81f76742c48d5bc61f89f569a20a1dc54bb9f440
2 files changed