Skip to content
Commit 09dbf1fd authored by Tim Murray's avatar Tim Murray
Browse files

Add support for modern trim memory dispatch.

This CL adds flagged implementation of onTrimMemory dispatch to
improve consistency of dispatch and prevent unnecessary work from
unnecessary onTrimMemory calls. When the flag is enabled, trim level
dispatch is coupled to process state and completely decoupled from
memory state.

- When an app becomes eligible for freezing, TRIM_MEMORY_BACKGROUND
  will be triggered.

- Due to the likelihood of causing additional memory pressure when the
  device is already under memory pressure, no other TRIM_MEMORY
  constants will be used.

This implementation is behind the ActivityManager "use_modern_trim"
flag, which is currently set to false.

Test: atest android.app.cts.ActivityManagerTest
Bug: 253914117
Change-Id: I2c5b7db4b322723c2cc608d5f67946b8ccf77efb
parent 74da091e
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