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

Commit d58940b3 authored by Austin Borger's avatar Austin Borger Committed by Automerger Merge Worker
Browse files

Merge "CameraService: Consider pids before priority when evicting a client."...

Merge "CameraService: Consider pids before priority when evicting a client." into tm-dev am: e1c25ccd am: 15da1158

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/18604200



Change-Id: I72ad2cbcb7aa3064231b4c3ce289151d1ab5de7f
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 2b1b3f82 15da1158
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -527,12 +527,7 @@ ClientManager<KEY, VALUE, LISTENER>::wouldEvictLocked(
        if (!returnIncompatibleClients) {
            // Find evicted clients

            if (conflicting && curPriority < priority) {
                // Pre-existing conflicting client with higher priority exists
                evictList.clear();
                evictList.push_back(client);
                return evictList;
            } else if (conflicting && owner == curOwner) {
            if (conflicting && owner == curOwner) {
                // Pre-existing conflicting client with the same client owner exists
                // Open the same device twice -> most recent open wins
                // Otherwise let the existing client wins to avoid behaviors difference
@@ -546,6 +541,11 @@ ClientManager<KEY, VALUE, LISTENER>::wouldEvictLocked(
                    evictList.push_back(client);
                    return evictList;
                }
            } else if (conflicting && curPriority < priority) {
                // Pre-existing conflicting client with higher priority exists
                evictList.clear();
                evictList.push_back(client);
                return evictList;
            } else if (conflicting || ((totalCost > mMaxCost && curCost > 0) &&
                    (curPriority >= priority) &&
                    !(highestPriorityOwner == owner && owner == curOwner))) {