Adds logging of audio sessions status on the recording side in ADM for Android.

Goal is to be able to retrieve more details about possible microphone conflicts in
cases where Init/Start of audio recording fails.

Only supported on Android N and higher.

Also adds new boolean UMA histogram called WebRTC.Audio.SourceMatchesRecordingSession.
Its value is stored after the recording session has been stopped.

Does not affect the media flow or functionality of the ADM. Time to start audio should
not be affected either since the new check and logging takes place on a separate
ExecutorService thread.

See go/webrtc-adm-android for more details and examples.

Bug: webrtc:10971
Change-Id: Ia80c1534e326907a1582824225d5f58caa016922
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150793
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29236}
This commit is contained in:
henrika
2019-09-19 13:01:29 +02:00
committed by Commit Bot
parent 86873f0cd3
commit 14137a1064
4 changed files with 371 additions and 62 deletions

View File

@ -158,6 +158,13 @@ int32_t AudioRecordJni::StopRecording() {
if (!initialized_ || !recording_) {
return 0;
}
const bool session_was_ok =
Java_WebRtcAudioRecord_isAudioSourceMatchingRecordingSession(
env_, j_audio_record_);
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.SourceMatchesRecordingSession",
session_was_ok);
RTC_LOG(INFO) << "HISTOGRAM(WebRTC.Audio.SourceMatchesRecordingSession): "
<< session_was_ok;
if (!Java_WebRtcAudioRecord_stopRecording(env_, j_audio_record_)) {
RTC_LOG(LS_ERROR) << "StopRecording failed";
return -1;