Set PAUSING state when start pausing a stream.

When the stream is pausing, the data callback is already stopped. In
that case, there is not more data written by the client. The aaudio
service need to set the state as PAUSING so that it allows underflow in
the mixer. That can avoid misreporting underrun.

Bug: 336233924
Test: atest AAudioTests --instant
Change-Id: I128aa73a5c9a77eb6c5f11d0bf71b8325b1d4d0d
diff --git a/services/oboeservice/AAudioServiceEndpointPlay.cpp b/services/oboeservice/AAudioServiceEndpointPlay.cpp
index 637405d..5d6e2ae 100644
--- a/services/oboeservice/AAudioServiceEndpointPlay.cpp
+++ b/services/oboeservice/AAudioServiceEndpointPlay.cpp
@@ -88,7 +88,8 @@
                 }
 
                 aaudio_stream_state_t state = clientStream->getState();
-                if (state == AAUDIO_STREAM_STATE_STOPPING) {
+                if (state == AAUDIO_STREAM_STATE_STOPPING ||
+                    state == AAUDIO_STREAM_STATE_PAUSING) {
                     allowUnderflow = false; // just read what is already in the FIFO
                 } else if (state != AAUDIO_STREAM_STATE_STARTED) {
                     continue; // this stream is not running so skip it.