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

Skip to content
Commit 64a4c4ec authored by Hui Yu's avatar Hui Yu
Browse files

The uid with the newest timestamp in mPendingStartActivityUids gets the best score.

getProcessStatesAndOomScoresForPIDs() returns the procstate and oom_adj
score of a list of uid. If OomAdjuster does not update procstate fast
enough after WindowManager switches activity to foreground, we use
mPendingStartActivityUids to save the uid that moves to foreground. Then
OomAdjuster removes the uid from mPendingStartActivityUids later.

Because OomAdjust has latencty, the uid may be delayed to be deleted
from mPendingStartActivityUids. This ends up with multiple uids in the
mPendingStartActivityUids. When these multiple uids compete for camera,
getProcessStatesAndOomScoresForPIDs() can not distinguish procstate and
scores for these uids.

This CL will compare the elapsedRealtime these uids are added
into mPendingStartActivityUids, the uid with the newest timestamp gets
the best score.

Bug: 218947003
Test: b/218947003 reproduce steps, fast swipe between Messaging and Camera
app for many times.

Change-Id: Ic28a617d234a20a3f8e33982c42e2e2c3ffd5dbd
parent c13b7d4c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment