Merge "WindowProcessController: optimize locking" into rvc-dev am: 345d68d164

Change-Id: Ib72347d8f4aca2512436373b5bca4dd45ee4b78c
This commit is contained in:
TreeHugger Robot
2020-05-20 05:45:49 +00:00
committed by Automerger Merge Worker

View File

@@ -1315,12 +1315,15 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio
*
* @param isCached whether or not the process is cached.
*/
@HotPath(caller = HotPath.OOM_ADJUSTMENT)
public void onProcCachedStateChanged(boolean isCached) {
synchronized (mAtm.mGlobalLock) {
if (!isCached && mPendingConfiguration != null) {
final Configuration config = mPendingConfiguration;
mPendingConfiguration = null;
dispatchConfigurationChange(config);
if (!isCached) {
synchronized (mAtm.mGlobalLockWithoutBoost) {
if (mPendingConfiguration != null) {
final Configuration config = mPendingConfiguration;
mPendingConfiguration = null;
dispatchConfigurationChange(config);
}
}
}
}