Skip to content
Commit 550ec7d7 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Fix that the top process is not cleared after device sleeps

Commit 8f7dd599 makes getTopApp lock-free by the field mTopApp.
And it is updated when the top activity is changed. When making
device sleep, the given top resumed activity is null and the
pausing activity is chosen. But there won't be next top activity
change to replace the mTopApp of previous pausing activity.
That causes the process stays on top state.

This change clears mTopApp when pausing the top activity for
sleeping. This also aligns the condition in OomAdjuster that if
the current top state is not PROCESS_STATE_TOP, there won't be
a top process.

Fixes: 171060345
Test: atest ActivityTaskManagerServiceTests#testUpdateSleep
      CtsStatsdAtomHostTestCases:ProcStateAtomTests#testTopSleeping
Change-Id: Ie96113ab4002a559a5af974f83b36f56f28ff438
parent a3eea61e
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