audioflinger: OffloadThread state fix

When switching from one offload session to another that
reuses the same offload output, audio HAL is paused & flushed in
preparation for the new track

OffloadThread must reset mHwPaused to allow proper state transitions
for the second track. In addition, Offload thread need not
explicitly call resume on HAL while handling a flush.

Bug: 12530661
Change-Id: I8173845e1782b5a8b372a82c7d337299a61e0efe
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 24df473..00d14e8 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -4146,9 +4146,6 @@
     // if resume is received before pause is executed.
     if (!mStandby && (doHwPause || (mFlushPending && !mHwPaused && (count != 0)))) {
         mOutput->stream->pause(mOutput->stream);
-        if (!doHwPause) {
-            doHwResume = true;
-        }
     }
     if (mFlushPending) {
         flushHw_l();
@@ -4209,6 +4206,8 @@
     mBytesRemaining = 0;
     mPausedWriteLength = 0;
     mPausedBytesRemaining = 0;
+    mHwPaused = false;
+
     if (mUseAsyncWrite) {
         // discard any pending drain or write ack by incrementing sequence
         mWriteAckSequence = (mWriteAckSequence + 2) & ~1;