Avoid deadlock between ActivityManagerService and ProcessStatsService.
Root Cause:
Case 1
getStatsOverTime(#483) // lock mWriteLock, wait AMS
async performWriteState(#269) // lock mPendingWriteLock, wait mWriteLock
writeStateLocked(#218) // lock AMS, wait mPendingWriteLock
Case 2
getStatsOverTime(#483) // lock mWriteLock, wait AMS
writeStateSyncLocked,writeStateLocked(#269) // lock AMS, wait mWriteLock
Solution:
Reduce nested lock.
Others also post the same solution:
I437a5cedceb34292a6bd1d9e7610f52b1478e424
Change-Id: Ie9395f3f6359fe59e2282674fcfec9d123e53f25
1 file changed