resourcemanagerservice: make a copy of client config

The cases when the codec is release without stopping, the
resource manager calls notifyClientStopped from notifyClientReleased.
But while doing so, it passes a reference from mClientConfigMap map’s
entry.
This could potentially cause use-after-free situation as
notifyClientStopped removes the entry from the map and uses it
later.
To fix this, make a copy of ClientConfigParcel from the mClientConfigMap
map’s entry. Also, update the timestamp of codec::stop

Bug: 274883119
Test: atest cts/tests/media/misc/src/android/media/misc/cts/ResourceManagerTest.java
      /data/nativetest64/ResourceManagerService_test/ResourceManagerService_test
      /data/nativetest64/ResourceObserverService_test/ResourceObserverService_test
Merged-In: I00cb69a276b80e8ef7a196f62d9816541878b222
Change-Id: I00cb69a276b80e8ef7a196f62d9816541878b222
1 file changed