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

Fix process state of top app while device is sleeping

The assumption of commit 550ec7d7 is wrong. The top app record
is still needed for assigning PROCESS_STATE_TOP_SLEEPING while
device is sleeping.

Because this change reverts 550ec7d7, to fix original problem
(171060345) that top app is not updated if there is an order
change of activity while device is sleeping, a new invocation
of updateTopApp is added for the case both mResumedActivity
and prevTopActivity are null. So the process of the next top
non-resumed activity can still be set as top app.

Bug: 159104503
Bug: 171060345
Fixes: 171383274
Test: ActivityTaskManagerServiceTests#testUpdateSleep
  CtsStatsdAtomHostTestCases:ProcStateAtomTests#testTopSleeping
  CtsAppTestCases:ActivityManagerTest#testKillingPidsOnImperceptible

Change-Id: I9e6d530b3be9a73f281a8e1dfa135259853a380c
parent 95e87963
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