Accumulate offload bytes written in logging

Test: play music and adb shell dumpsys media.audio_flinger
Bug: 31588484
Change-Id: Ic957c06ef27132be87ff56bb7b5e03ff5165cf01
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 262bbc6..11b5a69 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2282,6 +2282,8 @@
         }
         if (ret < 0) {
             error_log_log(out->error_log, ERROR_CODE_WRITE, audio_utils_get_real_time_ns());
+        } else {
+            out->written += ret; // accumulate bytes written for offload.
         }
         pthread_mutex_unlock(&out->lock);
         // TODO: consider logging offload pcm