Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7b1b9ad authored by Chris Elliott's avatar Chris Elliott Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE audioflinger: dont release wakelock during offload drain...

Merge "DO NOT MERGE audioflinger: dont release wakelock during offload drain sequence" into cw-d-mr1-dev
parents ee1c50d7 b0063fec
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -2467,13 +2467,23 @@ bool AudioFlinger::PlaybackThread::threadLoop()
                if (exitPending()) {
                    break;
                }
                bool released = false;
                // The following works around a bug in the offload driver. Ideally we would release
                // the wake lock every time, but that causes the last offload buffer(s) to be
                // dropped while the device is on battery, so we need to hold a wake lock during
                // the drain phase.
                if (mBytesRemaining && !(mDrainSequence & 1)) {
                    releaseWakeLock_l();
                    released = true;
                }
                mWakeLockUids.clear();
                mActiveTracksGeneration++;
                ALOGV("wait async completion");
                mWaitWorkCV.wait(mLock);
                ALOGV("async completion/wake");
                if (released) {
                    acquireWakeLock_l();
                }
                standbyTime = systemTime() + standbyDelay;
                sleepTime = 0;