Update logging logic in AudioStream.

In destructor, it may point to a wrong virtual function for subclasses.
In that case, move the logging logic from destructor of AudioStream to
close_l.

In AudioStream::logOpen, the performance mode is the actual performance
mode instead of the requested one. In that case, log the requested
performance mode when the metric id is set.

Renamed ENCODINGREQUESTED as ENCODINGAPP to make it consitent with atom
definition.

Test: atest MediaMetricsAtomTests
Bug: 185788699
Change-Id: I35b40d7ccd7d135f79bc2c84f7cbfe73946f9d2f
diff --git a/services/mediametrics/AudioAnalytics.cpp b/services/mediametrics/AudioAnalytics.cpp
index dbc68b2..fe86264 100644
--- a/services/mediametrics/AudioAnalytics.cpp
+++ b/services/mediametrics/AudioAnalytics.cpp
@@ -987,7 +987,7 @@
 
     std::string formatAppStr;
     mAudioAnalytics.mAnalyticsState->timeMachine().get(
-            key, AMEDIAMETRICS_PROP_ENCODINGREQUESTED, &formatAppStr);
+            key, AMEDIAMETRICS_PROP_ENCODINGCLIENT, &formatAppStr);
     const auto formatApp = types::lookup<types::ENCODING, int32_t>(formatAppStr);
 
     std::string formatDeviceStr;