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

Skip to content
Commit ee5863e4 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Set proper procstate and oom-adj for SHORT_SERVICE FGS.

We use:
- PROCESS_STATE_IMPORTANT_FOREGROUND
- ProcessList.PERCEPTIBLE_MEDIUM_APP_ADJ + 1

- Oom-adj will be PERCEPTIBLE_RECENT_FOREGROUND_APP_ADJ + 1
  for the first N seconds when started from TOP.

The "+1" is so we can tell apart short-FGS from regular FGS and EJ.

Also, we slightly the oom-adj for EJ -- +2 to the original values -- so
we can tell them apart from FGS / short-FGS.

- Other restrictions of short-FGS aren't implemented yet.

Test: atest FrameworksServicesTests:OomAdjusterTests MockingOomAdjusterTests
Test: Manual test using the test app, monitoring `dumpsys activity processes| grep PACKAGE`

... First N seconds after started from TOP:
```
Proc # 1: fg +51 F/S/IMPF ---N  t: 0 8851:com.google.omakoto.testapp/u0a252 (fg-service-short-act)
```
After that:
```
Proc # 1: prcm  + 1 R/S/IMPF ---N  t: 0 8851:com.google.omakoto.testapp/u0a252 (fg-service-short)
```

Bug: 257270313
Change-Id: I75e9295fd34871a70f6a5db23d701601c1b12622
parent 3ed2898d
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