diff options
author | 2022-11-17 11:06:44 -0800 | |
---|---|---|
committer | 2022-11-21 11:25:58 -0800 | |
commit | ee5863e4f577b13c536a0953fc5f362c40024016 (patch) | |
tree | 6f7c5a73362385bc04aacf63f2578fffe18229c8 /libs/androidfw/AssetsProvider.cpp | |
parent | 3ed2898d28e104e8ee7aae058e7308d7ee370b9d (diff) |
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
Diffstat (limited to 'libs/androidfw/AssetsProvider.cpp')
0 files changed, 0 insertions, 0 deletions