Loading services/audioflinger/Threads.cpp +3 −6 Original line number Diff line number Diff line Loading @@ -2928,11 +2928,7 @@ bool AudioFlinger::PlaybackThread::threadLoop() 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)) { if (!keepWakeLock()) { releaseWakeLock_l(); released = true; } Loading Loading @@ -5169,10 +5165,11 @@ AudioFlinger::OffloadThread::OffloadThread(const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output, audio_io_handle_t id, uint32_t device, bool systemReady, uint32_t bitRate) : DirectOutputThread(audioFlinger, output, id, device, OFFLOAD, systemReady, bitRate), mPausedBytesRemaining(0) mPausedWriteLength(0), mPausedBytesRemaining(0), mKeepWakeLock(true) { //FIXME: mStandby should be set to true by ThreadBase constructor mStandby = true; mKeepWakeLock = property_get_bool("ro.audio.offload_wakelock", true /* default_value */); } void AudioFlinger::OffloadThread::threadLoop_exit() Loading services/audioflinger/Threads.h +5 −0 Original line number Diff line number Diff line Loading @@ -527,6 +527,8 @@ protected: // ThreadBase virtuals virtual void preExit(); virtual bool keepWakeLock() const { return true; } public: virtual status_t initCheck() const { return (mOutput == NULL) ? NO_INIT : NO_ERROR; } Loading Loading @@ -996,9 +998,12 @@ protected: virtual bool waitingAsyncCallback(); virtual bool waitingAsyncCallback_l(); virtual bool keepWakeLock() const { return mKeepWakeLock; } private: size_t mPausedWriteLength; // length in bytes of write interrupted by pause size_t mPausedBytesRemaining; // bytes still waiting in mixbuffer after resume bool mKeepWakeLock; // keep wake lock while waiting for write callback }; class AsyncCallbackThread : public Thread { Loading Loading
services/audioflinger/Threads.cpp +3 −6 Original line number Diff line number Diff line Loading @@ -2928,11 +2928,7 @@ bool AudioFlinger::PlaybackThread::threadLoop() 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)) { if (!keepWakeLock()) { releaseWakeLock_l(); released = true; } Loading Loading @@ -5169,10 +5165,11 @@ AudioFlinger::OffloadThread::OffloadThread(const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output, audio_io_handle_t id, uint32_t device, bool systemReady, uint32_t bitRate) : DirectOutputThread(audioFlinger, output, id, device, OFFLOAD, systemReady, bitRate), mPausedBytesRemaining(0) mPausedWriteLength(0), mPausedBytesRemaining(0), mKeepWakeLock(true) { //FIXME: mStandby should be set to true by ThreadBase constructor mStandby = true; mKeepWakeLock = property_get_bool("ro.audio.offload_wakelock", true /* default_value */); } void AudioFlinger::OffloadThread::threadLoop_exit() Loading
services/audioflinger/Threads.h +5 −0 Original line number Diff line number Diff line Loading @@ -527,6 +527,8 @@ protected: // ThreadBase virtuals virtual void preExit(); virtual bool keepWakeLock() const { return true; } public: virtual status_t initCheck() const { return (mOutput == NULL) ? NO_INIT : NO_ERROR; } Loading Loading @@ -996,9 +998,12 @@ protected: virtual bool waitingAsyncCallback(); virtual bool waitingAsyncCallback_l(); virtual bool keepWakeLock() const { return mKeepWakeLock; } private: size_t mPausedWriteLength; // length in bytes of write interrupted by pause size_t mPausedBytesRemaining; // bytes still waiting in mixbuffer after resume bool mKeepWakeLock; // keep wake lock while waiting for write callback }; class AsyncCallbackThread : public Thread { Loading