audioflinger: add setCallerName() to AudioTrack

And also to AudioRecord.
Then log the callerName using MediaMetrics from the destructor.

This can be used to tell whether AAudio or OpenSL ES
or Java created the object.

Bug: 154543374
Test: adb shell dumpsys media.metrics --clear
Test: Run an app that uses audio.
Test: adb shell dumpsys media.metrics
Test: Look for "callerName" in the dump.
Change-Id: I000346e72f581d2e40ef4fd0410b579d2a1224e2
diff --git a/media/libmediametrics/include/MediaMetricsConstants.h b/media/libmediametrics/include/MediaMetricsConstants.h
index 73dd2de..315ad62 100644
--- a/media/libmediametrics/include/MediaMetricsConstants.h
+++ b/media/libmediametrics/include/MediaMetricsConstants.h
@@ -90,6 +90,7 @@
 #define AMEDIAMETRICS_PROP_BUFFERSIZEFRAMES "bufferSizeFrames" // int32
 #define AMEDIAMETRICS_PROP_BUFFERCAPACITYFRAMES "bufferCapacityFrames" // int32
 #define AMEDIAMETRICS_PROP_BURSTFRAMES    "burstFrames"    // int32
+#define AMEDIAMETRICS_PROP_CALLERNAME     "callerName"     // string, eg. "aaudio"
 #define AMEDIAMETRICS_PROP_CHANNELCOUNT   "channelCount"   // int32
 #define AMEDIAMETRICS_PROP_CHANNELMASK    "channelMask"    // int32
 #define AMEDIAMETRICS_PROP_CONTENTTYPE    "contentType"    // string attributes (AudioTrack)
@@ -132,6 +133,8 @@
 #define AMEDIAMETRICS_PROP_VOLUME_RIGHT   "volume.right"   // double (AudioTrack)
 #define AMEDIAMETRICS_PROP_WHERE          "where"          // string value
 
+#define AMEDIAMETRICS_PROP_VALUE_UNKNOWN  "unknown"         // string for callerName
+
 // Timing values: millisecond values are suffixed with MS and the type is double
 // nanosecond values are suffixed with NS and the type is int64.