audioflinger: Fix battery accounting for offload tracks am: e94c27a17f
am: 7cba7beec4

Change-Id: Id5d5b2e5ac25a167583243d84fd060698c18930f
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index bfda3d3..bba4fcd 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -3106,9 +3106,9 @@
                 if (!keepWakeLock()) {
                     releaseWakeLock_l();
                     released = true;
+                    mWakeLockUids.clear();
+                    mActiveTracksGeneration++;
                 }
-                mWakeLockUids.clear();
-                mActiveTracksGeneration++;
                 ALOGV("wait async completion");
                 mWaitWorkCV.wait(mLock);
                 ALOGV("async completion/wake");