audio: Add initial support for clip transition reporting

For offloaded playback, provide separate reporting for
the moment when the HAL is ready to receive data for the next
clip, and the moment when the playback of the previous clip
has ended. See the updated state transition diagram for
details.

Enhance the stream state model with extra internal states
to support proper indication of the "previous clip has
finished playback" event.

HALs implementing Core API V3 (FRC 202504) can indicate
support for this behavior by exposing 'aosp.clipTransitionSupport'
vendor property. In Core API V4 this will be default behavior.

Bug: 373872271
Bug: 384431822
Test: VtsHalAudioCoreTargetTest
Change-Id: Ib912c507978eb6045d889d6d9cd27b5661b64f49
diff --git a/audio/aidl/default/Module.cpp b/audio/aidl/default/Module.cpp
index 077d80b..e67d6d7 100644
--- a/audio/aidl/default/Module.cpp
+++ b/audio/aidl/default/Module.cpp
@@ -1546,6 +1546,7 @@
 
 const std::string Module::VendorDebug::kForceTransientBurstName = "aosp.forceTransientBurst";
 const std::string Module::VendorDebug::kForceSynchronousDrainName = "aosp.forceSynchronousDrain";
+const std::string Module::kClipTransitionSupportName = "aosp.clipTransitionSupport";
 
 ndk::ScopedAStatus Module::getVendorParameters(const std::vector<std::string>& in_ids,
                                                std::vector<VendorParameter>* _aidl_return) {
@@ -1560,6 +1561,10 @@
             VendorParameter forceSynchronousDrain{.id = id};
             forceSynchronousDrain.ext.setParcelable(Boolean{mVendorDebug.forceSynchronousDrain});
             _aidl_return->push_back(std::move(forceSynchronousDrain));
+        } else if (id == kClipTransitionSupportName) {
+            VendorParameter clipTransitionSupport{.id = id};
+            clipTransitionSupport.ext.setParcelable(Boolean{true});
+            _aidl_return->push_back(std::move(clipTransitionSupport));
         } else {
             allParametersKnown = false;
             LOG(VERBOSE) << __func__ << ": " << mType << ": unrecognized parameter \"" << id << "\"";