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

Track process with visible activities

- A quick lookup without locking WM to provide whether a process
  or uid has visible or resumed activity.
- Move cpu usage collection from the path of resume/pause in WM
  lock to background thread.
- Do not get cpu time if the next activity is still in the same
  process, to reduce unnecessary accesses of proc file. E.g.
  if there are 3 foreground activity switches in the same process,
  it can save 6 accesses.
- Change hasForegroundActivities to use source state. It was set
  by OomAdjuster when ComputeOomAdjCallback#onVisibleActivity or
  onPausedActivity or onStoppingActivity is called, which may
  not be the latest state.

Bug: 171989664
Test: WindowProcessControllerTests#testComputeProcessActivityState
Change-Id: I3fb42e455232c8718549af5b7bb1ca638558d827
parent 11cbe5ff
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