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
Loading
Please register or sign in to comment