Request Android record permission when needed
This commit is contained in:
parent
a38bf5287a
commit
b22cf46fdb
12 changed files with 83 additions and 5 deletions
|
|
@ -230,7 +230,7 @@ void AudioDriverOpenSL::_record_buffer_callbacks(SLAndroidSimpleBufferQueueItf q
|
|||
ad->_record_buffer_callback(queueItf);
|
||||
}
|
||||
|
||||
Error AudioDriverOpenSL::capture_start() {
|
||||
Error AudioDriverOpenSL::capture_init_device() {
|
||||
|
||||
SLDataLocator_IODevice loc_dev = {
|
||||
SL_DATALOCATOR_IODEVICE,
|
||||
|
|
@ -298,6 +298,15 @@ Error AudioDriverOpenSL::capture_start() {
|
|||
return OK;
|
||||
}
|
||||
|
||||
Error AudioDriverOpenSL::capture_start() {
|
||||
|
||||
if (OS::get_singleton()->request_permission("RECORD_AUDIO")) {
|
||||
return capture_init_device();
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
Error AudioDriverOpenSL::capture_stop() {
|
||||
|
||||
SLuint32 state;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue