Defer sleeping / waking the device on device state changes.
This is really a short-term hack to unblock development. The display
SyncRoot is above the power lock in the system lock order, which means
the current code is thoeretically safe. Unfortunately, in practice it
isn't since a a couple releases ago when DisplayManagerService started
grabbing the SyncRoot while PowerManagerService called into it. Given
how much has grown on top of that change, it's somewhat difficult to
quickly untangle in order to get everything back into a safe state. In
the interim, deferring these calls removes the one place where we have
the lock inversion happen consistently, putting everything back to how
it's worked for the last couple releases
Bug: 214872018
Test: manual fold + unfold, no ANRs
Change-Id: I8bc242dec91f59b96b1c3ed7bcf929d0798d4ba3
1 file changed