audioflinger: keep wakelock during offload drain
Even if ro.audio.offload_wakelock property is false we must
keep wakelock during offload drain seuqnce due to some driver
implementations risking to let the system enter suspend.
This restores functionality in commit 078538cfc6.
Bug: 30151948
Change-Id: Ib3a3e5c7e173ad7b1776817b81427932bfd16bf0
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h
index 2fd7eeb..93e2bf1 100644
--- a/services/audioflinger/Threads.h
+++ b/services/audioflinger/Threads.h
@@ -1020,7 +1020,7 @@
virtual bool waitingAsyncCallback_l();
virtual void invalidateTracks(audio_stream_type_t streamType);
- virtual bool keepWakeLock() const { return mKeepWakeLock; }
+ virtual bool keepWakeLock() const { return (mKeepWakeLock || (mDrainSequence & 1)); }
private:
size_t mPausedWriteLength; // length in bytes of write interrupted by pause