Avoid returning value on stack

AMediaFormat_getString() returnes a string not guaranteed to live beyond
the call. The underlying implementation of String8 seems to have made
this safe by using SharedBuffers, but that's luck of the implementatoon,
not a guarantee of the API.  We instead get our value by chasing through
where we just added it to the longer-lived vector.

Bug: 193904641
Test: atest libmedkandk_test
Test: atest android.mediav2.cts.MediaFormatUnitTest (master)
Change-Id: I7df35b7dbccf24c72cfd977a6b13d85aee8ae555
1 file changed