Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3639012 authored by Wonsik Kim's avatar Wonsik Kim
Browse files

resource_manager: fix cross-type reclaim

When constructing MediaResource, sub-types should be supplied to get
recognized correctly.

Bug: 217948676
Test: atest android.media.misc.cts.ResourceManagerTest
Change-Id: Ideab771f5eaf89bee59b265aec42e6918f71664c
parent f0e0548b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -671,11 +671,11 @@ Status ResourceManagerService::reclaimResource(
        if (clients.size() == 0) {
            // if we are here, run the fourth pass to free one codec with the different type.
            if (secureCodec != NULL) {
                MediaResource temp(MediaResource::Type::kNonSecureCodec, 1);
                MediaResource temp(MediaResource::Type::kNonSecureCodec, secureCodec->subType, 1);
                getClientForResource_l(callingPid, &temp, &clients);
            }
            if (nonSecureCodec != NULL) {
                MediaResource temp(MediaResource::Type::kSecureCodec, 1);
                MediaResource temp(MediaResource::Type::kSecureCodec, nonSecureCodec->subType, 1);
                getClientForResource_l(callingPid, &temp, &clients);
            }
        }