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

Commit 9348ada4 authored by Kensuke Miyagi's avatar Kensuke Miyagi
Browse files

Bug fix for max used num check for non-primary used frontend

The issue was that when re-assigning frontend resource (through
reclaiming) to a different client, max used number check was not done
for the frontend resources that were not inprimary use and simply
blocked as used due to exclusive group management.

Bug: 300557208
Test: atest TunerTest
Change-Id: I34a1368c39b48d765f5fcd3e9d3fccb5820fc8c9
parent 7be165fb
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1047,6 +1047,16 @@ public class TunerResourceManagerService extends SystemService implements IBinde
                    // in use frontends when no available frontend has been found.
                    int priority = getFrontendHighestClientPriority(fr.getOwnerClientId());
                    if (currentLowestPriority > priority) {
                        // we need to check the max used num if the target frontend type is not
                        // currently in primary use (and simply blocked due to exclusive group)
                        ClientProfile targetOwnerProfile = getClientProfile(fr.getOwnerClientId());
                        int primaryFeId = targetOwnerProfile.getPrimaryFrontend();
                        FrontendResource primaryFe = getFrontendResource(primaryFeId);
                        if (fr.getType() != primaryFe.getType()
                                && isFrontendMaxNumUseReached(fr.getType())) {
                            continue;
                        }
                        // update the target frontend
                        inUseLowestPriorityFrHandle = fr.getHandle();
                        currentLowestPriority = priority;
                        isRequestFromSameProcess = (requestClient.getProcessId()