Merge "Fix race condition in WakeLocks."

This commit is contained in:
Jake Hamby
2011-06-27 14:54:24 -07:00
committed by Android (Google) Code Review

View File

@@ -313,8 +313,8 @@ public class PowerManager
*/
public void release(int flags) {
synchronized (mToken) {
mHandler.removeCallbacks(mReleaser);
if (!mRefCounted || --mCount == 0) {
mHandler.removeCallbacks(mReleaser);
try {
mService.releaseWakeLock(mToken, flags);
} catch (RemoteException e) {