Merge "Prevent WakeLock count ending up in an incorrect state"
This commit is contained in:
committed by
Android (Google) Code Review
commit
bac998a0cb
@@ -1412,7 +1412,11 @@ public final class PowerManager {
|
||||
*/
|
||||
public void release(int flags) {
|
||||
synchronized (mToken) {
|
||||
mInternalCount--;
|
||||
if (mInternalCount > 0) {
|
||||
// internal count must only be decreased if it is > 0 or state of
|
||||
// the WakeLock object is broken.
|
||||
mInternalCount--;
|
||||
}
|
||||
if ((flags & RELEASE_FLAG_TIMEOUT) == 0) {
|
||||
mExternalCount--;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user