Fix race condition resulting in unbalanced wakelock calls
Because we release the lock during threadLoop(), we might actually
make the queue empty more than once during a cycle, but only release
the wakelock once in the end.
This change makes sure we release once for every time we make the
queue empty, just like we acquire once for every time we make it non-
empty.
Test: No good way to repro. Will submit and wait for the power monitor
results.
Bug: 228012293
Change-Id: I740b438dbddb6aace41263427bde95f902ed25a0
Loading
Please register or sign in to comment