Merge "MediaMetrics: Track AudioTrack and AudioRecord callers" into rvc-dev

This commit is contained in:
Andy Hung
2020-04-27 22:51:15 +00:00
committed by Android (Google) Code Review
3 changed files with 9 additions and 1 deletions

View File

@@ -307,6 +307,9 @@ android_media_AudioRecord_setup(JNIEnv *env, jobject thiz, jobject weak_this,
status); status);
goto native_init_failure; goto native_init_failure;
} }
// Set caller name so it can be logged in destructor.
// MediaMetricsConstants.h: AMEDIAMETRICS_PROP_CALLERNAME_VALUE_JAVA
lpRecorder->setCallerName("java");
} else { // end if nativeRecordInJavaObj == 0) } else { // end if nativeRecordInJavaObj == 0)
lpRecorder = (AudioRecord*)nativeRecordInJavaObj; lpRecorder = (AudioRecord*)nativeRecordInJavaObj;
// TODO: We need to find out which members of the Java AudioRecord might need to be // TODO: We need to find out which members of the Java AudioRecord might need to be

View File

@@ -425,6 +425,9 @@ static jint android_media_AudioTrack_setup(JNIEnv *env, jobject thiz, jobject we
ALOGE("Error %d initializing AudioTrack", status); ALOGE("Error %d initializing AudioTrack", status);
goto native_init_failure; goto native_init_failure;
} }
// Set caller name so it can be logged in destructor.
// MediaMetricsConstants.h: AMEDIAMETRICS_PROP_CALLERNAME_VALUE_JAVA
lpTrack->setCallerName("java");
} else { // end if (nativeAudioTrack == 0) } else { // end if (nativeAudioTrack == 0)
lpTrack = (AudioTrack*)nativeAudioTrack; lpTrack = (AudioTrack*)nativeAudioTrack;
// TODO: We need to find out which members of the Java AudioTrack might // TODO: We need to find out which members of the Java AudioTrack might

View File

@@ -330,7 +330,9 @@ void Stream::play_l(const std::shared_ptr<Sound>& sound, int32_t nextStreamID,
AudioTrack::TRANSFER_DEFAULT, AudioTrack::TRANSFER_DEFAULT,
nullptr /*offloadInfo*/, -1 /*uid*/, -1 /*pid*/, nullptr /*offloadInfo*/, -1 /*uid*/, -1 /*pid*/,
mStreamManager->getAttributes()); mStreamManager->getAttributes());
// Set caller name so it can be logged in destructor.
// MediaMetricsConstants.h: AMEDIAMETRICS_PROP_CALLERNAME_VALUE_SOUNDPOOL
newTrack->setCallerName("soundpool");
oldTrack = mAudioTrack; oldTrack = mAudioTrack;
status = newTrack->initCheck(); status = newTrack->initCheck();
if (status != NO_ERROR) { if (status != NO_ERROR) {