Files
frameworks_base/core/java/android/os
Henrik Baard 8d475ca058 Prevent WakeLock count ending up in an incorrect state
WakeLock can end up in a bad state if the following sequence
is executed:

1. mWakeLock =  mPowerManager.newWakeLock(...)
2. mWakeLock.acquire(TIMEOUT_MS);
3. timeout TIMEOUT_MS occurs before release() is called
4. release is called()

[1] mInternalCount = mExternalCount = 0
[2] mInternalCount = 1, mExternalCount = 1
[3] mInternalCount = 0, mExternalCount = 1
[4] mInternalCount = -1, mExternalCount = 0

If acquireLocked is called on the same object after this sequence,
mInternalCount is incremented to 0 which results in no wakelock
being requested from PowerManagerService.

Bug: 64676694
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.PowerManager_WakeLockTest
Change-Id: I133812aefb5d92eec2e2dde1a36f81dc9ffd7625
2017-10-03 14:45:34 -06:00
..
2017-09-28 11:32:57 -06:00
2017-08-31 18:06:26 +00:00
2017-08-01 11:26:18 +09:00
2017-04-27 16:24:26 -07:00
2017-05-10 15:58:09 -07:00
2017-08-07 15:36:10 -07:00
2017-09-21 21:41:14 -07:00
2017-04-24 13:20:46 -06:00
2017-06-28 16:49:12 -07:00
2017-08-07 15:36:10 -07:00