Files
frameworks_base/core/java/android/app
Makoto Onuki ee5863e4f5 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
2022-11-21 11:25:58 -08:00
..
2022-11-15 14:08:08 -08:00
…
2022-11-17 17:51:36 +00:00
2022-09-12 23:53:24 +00:00
2022-11-18 11:44:53 -08:00
2022-10-20 13:55:09 +00:00