Add format value for NULL offload info

CTS case "android.media.audio.cts.DirectAudioProfilesForAttributesTest" fail due to create AudioTrack fail.
The case want to create AudioTrack with format=AUDIO_FORMAT_MP3 but no specific offload_info, AudioTrack::set() will use AUDIO_INFO_INITIALIZER as default offload_info which is_streaming is disabled, but next, SwAudioOutputDescriptor::open() will set is_streaming as enabled as default.
Not all platforms support streaming offload, may encounter create AudioTrack fail.

So, here add format value to offloadinfo in AudioTrack::set(), then is_streaming disabled value can be transmitted correctly.

Bug: 232048775
Test: cts android.media.audio.cts.DirectAudioProfilesForAttributesTest#testCreateDirectAudioTracksOnlyForGetDirectProfilesForAttributes
Change-Id: I077673aaa4d7f60dd1de280b5eab3ae4a6a45809
Merged-In: I077673aaa4d7f60dd1de280b5eab3ae4a6a45809
diff --git a/media/libaudioclient/AudioTrack.cpp b/media/libaudioclient/AudioTrack.cpp
index 36f8e10..6ab8339 100644
--- a/media/libaudioclient/AudioTrack.cpp
+++ b/media/libaudioclient/AudioTrack.cpp
@@ -728,11 +728,13 @@
     //  (b) we can support re-creation of offloaded tracks
     if (offloadInfo != NULL) {
         mOffloadInfoCopy = *offloadInfo;
-        mOffloadInfo = &mOffloadInfoCopy;
     } else {
-        mOffloadInfo = NULL;
         memset(&mOffloadInfoCopy, 0, sizeof(audio_offload_info_t));
         mOffloadInfoCopy = AUDIO_INFO_INITIALIZER;
+        mOffloadInfoCopy.format = format;
+        mOffloadInfoCopy.sample_rate = sampleRate;
+        mOffloadInfoCopy.channel_mask = channelMask;
+        mOffloadInfoCopy.stream_type = streamType;
     }
 
     mVolume[AUDIO_INTERLEAVE_LEFT] = 1.0f;