8000 oboe: warn user of permission errors · google/oboe@1f62387 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1f62387

Browse files
committed
oboe: warn user of permission errors
AAudio returns confusing error codes when an open fails due to permission errors. Suggest a possible reason. Related to #888
1 parent cb01be5 commit 1f62387

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/aaudio/AudioStreamAAudio.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ Result AudioStreamAAudio::open() {
239239
mAAudioStream.store(stream);
240240
}
241241
if (result != Result::OK) {
242+
// Warn developer because ErrorInternal is not very informative.
243+
if (result == Result::ErrorInternal && mDirection == Direction::Input) {
244+
LOGW("AudioStreamAAudio.open() may have failed due to lack of "
245+
"audio recording permission.");
246+
}
242247
goto error2;
243248
}
244249

0 commit comments

Comments
 (0)
0