Loading media/libaudioclient/AudioSystem.cpp +13 −4 Original line number Diff line number Diff line Loading @@ -2459,21 +2459,30 @@ status_t AudioSystem::getSupportedLatencyModes(audio_io_handle_t output, return af->getSupportedLatencyModes(output, modes); } status_t AudioSystem::setBluetoothLatencyModesEnabled(bool enabled) { status_t AudioSystem::setBluetoothVariableLatencyEnabled(bool enabled) { const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger(); if (af == nullptr) { return PERMISSION_DENIED; } return af->setBluetoothLatencyModesEnabled(enabled); return af->setBluetoothVariableLatencyEnabled(enabled); } status_t AudioSystem::supportsBluetoothLatencyModes( status_t AudioSystem::isBluetoothVariableLatencyEnabled( bool *enabled) { const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger(); if (af == nullptr) { return PERMISSION_DENIED; } return af->isBluetoothVariableLatencyEnabled(enabled); } status_t AudioSystem::supportsBluetoothVariableLatency( bool *support) { const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger(); if (af == nullptr) { return PERMISSION_DENIED; } return af->supportsBluetoothLatencyModes(support); return af->supportsBluetoothVariableLatency(support); } class CaptureStateListenerImpl : public media::BnCaptureStateListener, Loading media/libaudioclient/IAudioFlinger.cpp +23 −8 Original line number Diff line number Diff line Loading @@ -846,17 +846,28 @@ status_t AudioFlingerClientAdapter::getSupportedLatencyModes( return NO_ERROR; } status_t AudioFlingerClientAdapter::setBluetoothLatencyModesEnabled(bool enabled) { return statusTFromBinderStatus(mDelegate->setBluetoothLatencyModesEnabled(enabled)); status_t AudioFlingerClientAdapter::setBluetoothVariableLatencyEnabled(bool enabled) { return statusTFromBinderStatus(mDelegate->setBluetoothVariableLatencyEnabled(enabled)); } status_t AudioFlingerClientAdapter::supportsBluetoothLatencyModes(bool* support) { status_t AudioFlingerClientAdapter::isBluetoothVariableLatencyEnabled(bool* enabled) { if (enabled == nullptr) { return BAD_VALUE; } RETURN_STATUS_IF_ERROR(statusTFromBinderStatus( mDelegate->isBluetoothVariableLatencyEnabled(enabled))); return NO_ERROR; } status_t AudioFlingerClientAdapter::supportsBluetoothVariableLatency(bool* support) { if (support == nullptr) { return BAD_VALUE; } RETURN_STATUS_IF_ERROR(statusTFromBinderStatus( mDelegate->supportsBluetoothLatencyModes(support))); mDelegate->supportsBluetoothVariableLatency(support))); return NO_ERROR; } Loading Loading @@ -1389,12 +1400,16 @@ Status AudioFlingerServerAdapter::getSupportedLatencyModes( return Status::ok(); } Status AudioFlingerServerAdapter::setBluetoothLatencyModesEnabled(bool enabled) { return Status::fromStatusT(mDelegate->setBluetoothLatencyModesEnabled(enabled)); Status AudioFlingerServerAdapter::setBluetoothVariableLatencyEnabled(bool enabled) { return Status::fromStatusT(mDelegate->setBluetoothVariableLatencyEnabled(enabled)); } Status AudioFlingerServerAdapter::isBluetoothVariableLatencyEnabled(bool *enabled) { return Status::fromStatusT(mDelegate->isBluetoothVariableLatencyEnabled(enabled)); } Status AudioFlingerServerAdapter::supportsBluetoothLatencyModes(bool *support) { return Status::fromStatusT(mDelegate->supportsBluetoothLatencyModes(support)); Status AudioFlingerServerAdapter::supportsBluetoothVariableLatency(bool *support) { return Status::fromStatusT(mDelegate->supportsBluetoothVariableLatency(support)); } Status AudioFlingerServerAdapter::getSoundDoseInterface( Loading media/libaudioclient/aidl/android/media/IAudioFlingerService.aidl +9 −4 Original line number Diff line number Diff line Loading @@ -248,18 +248,23 @@ interface IAudioFlingerService { /** * Requests if the implementation supports controlling the latency modes * over the Bleutooth A2DP or LE Audio links. If it does, * over the Bluetooth A2DP or LE Audio links. If it does, * setRequestedLatencyMode() and getSupportedLatencyModes() APIs can also be used * for streams routed to Bluetooth and not just for the spatializer output. */ boolean supportsBluetoothLatencyModes(); boolean supportsBluetoothVariableLatency(); /** * Enables or disables the variable Bluetooth latency control mechanism in the * audio framework and the audio HAL. This does not apply to the latency mode control * on the spatializer output with is a built-in feature. * on the spatializer output as this is a built-in feature. */ void setBluetoothLatencyModesEnabled(boolean enabled); void setBluetoothVariableLatencyEnabled(boolean enabled); /** * Indicates if the variable Bluetooth latency control mechanism is enabled or disabled. */ boolean isBluetoothVariableLatencyEnabled(); /** * Registers the sound dose callback and returns the interface for executing Loading media/libaudioclient/include/media/AudioSystem.h +4 −2 Original line number Diff line number Diff line Loading @@ -629,9 +629,11 @@ public: static status_t getSupportedLatencyModes(audio_io_handle_t output, std::vector<audio_latency_mode_t>* modes); static status_t setBluetoothLatencyModesEnabled(bool enabled); static status_t setBluetoothVariableLatencyEnabled(bool enabled); static status_t supportsBluetoothLatencyModes(bool *support); static status_t isBluetoothVariableLatencyEnabled(bool *enabled); static status_t supportsBluetoothVariableLatency(bool *support); static status_t getSupportedMixerAttributes(audio_port_handle_t portId, std::vector<audio_mixer_attributes_t> *mixerAttrs); Loading media/libaudioclient/include/media/IAudioFlinger.h +16 −10 Original line number Diff line number Diff line Loading @@ -375,9 +375,11 @@ public: virtual status_t invalidateTracks(const std::vector<audio_port_handle_t>& portIds) = 0; virtual status_t setBluetoothLatencyModesEnabled(bool enabled) = 0; virtual status_t setBluetoothVariableLatencyEnabled(bool enabled) = 0; virtual status_t supportsBluetoothLatencyModes(bool* support) = 0; virtual status_t isBluetoothVariableLatencyEnabled(bool* enabled) = 0; virtual status_t supportsBluetoothVariableLatency(bool* support) = 0; }; /** Loading Loading @@ -483,8 +485,9 @@ public: audio_latency_mode_t mode) override; status_t getSupportedLatencyModes( audio_io_handle_t output, std::vector<audio_latency_mode_t>* modes) override; status_t setBluetoothLatencyModesEnabled(bool enabled) override; status_t supportsBluetoothLatencyModes(bool* support) override; status_t setBluetoothVariableLatencyEnabled(bool enabled) override; status_t isBluetoothVariableLatencyEnabled(bool* enabled) override; status_t supportsBluetoothVariableLatency(bool* support) override; status_t getSoundDoseInterface(const sp<media::ISoundDoseCallback>& callback, sp<media::ISoundDose>* soundDose) override; status_t invalidateTracks(const std::vector<audio_port_handle_t>& portIds) override; Loading Loading @@ -578,10 +581,12 @@ public: SET_DEVICE_CONNECTED_STATE = media::BnAudioFlingerService::TRANSACTION_setDeviceConnectedState, SET_REQUESTED_LATENCY_MODE = media::BnAudioFlingerService::TRANSACTION_setRequestedLatencyMode, GET_SUPPORTED_LATENCY_MODES = media::BnAudioFlingerService::TRANSACTION_getSupportedLatencyModes, SET_BLUETOOTH_LATENCY_MODES_ENABLED = media::BnAudioFlingerService::TRANSACTION_setBluetoothLatencyModesEnabled, SUPPORTS_BLUETOOTH_LATENCY_MODES = media::BnAudioFlingerService::TRANSACTION_supportsBluetoothLatencyModes, SET_BLUETOOTH_VARIABLE_LATENCY_ENABLED = media::BnAudioFlingerService::TRANSACTION_setBluetoothVariableLatencyEnabled, IS_BLUETOOTH_VARIABLE_LATENCY_ENABLED = media::BnAudioFlingerService::TRANSACTION_isBluetoothVariableLatencyEnabled, SUPPORTS_BLUETOOTH_VARIABLE_LATENCY = media::BnAudioFlingerService::TRANSACTION_supportsBluetoothVariableLatency, GET_SOUND_DOSE_INTERFACE = media::BnAudioFlingerService::TRANSACTION_getSoundDoseInterface, INVALIDATE_TRACKS = media::BnAudioFlingerService::TRANSACTION_invalidateTracks, }; Loading Loading @@ -707,8 +712,9 @@ public: Status setRequestedLatencyMode(int output, media::LatencyMode mode) override; Status getSupportedLatencyModes(int output, std::vector<media::LatencyMode>* _aidl_return) override; Status setBluetoothLatencyModesEnabled(bool enabled) override; Status supportsBluetoothLatencyModes(bool* support) override; Status setBluetoothVariableLatencyEnabled(bool enabled) override; Status isBluetoothVariableLatencyEnabled(bool* enabled) override; Status supportsBluetoothVariableLatency(bool* support) override; Status getSoundDoseInterface(const sp<media::ISoundDoseCallback>& callback, sp<media::ISoundDose>* _aidl_return) override; Status invalidateTracks(const std::vector<int32_t>& portIds) override; Loading Loading
media/libaudioclient/AudioSystem.cpp +13 −4 Original line number Diff line number Diff line Loading @@ -2459,21 +2459,30 @@ status_t AudioSystem::getSupportedLatencyModes(audio_io_handle_t output, return af->getSupportedLatencyModes(output, modes); } status_t AudioSystem::setBluetoothLatencyModesEnabled(bool enabled) { status_t AudioSystem::setBluetoothVariableLatencyEnabled(bool enabled) { const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger(); if (af == nullptr) { return PERMISSION_DENIED; } return af->setBluetoothLatencyModesEnabled(enabled); return af->setBluetoothVariableLatencyEnabled(enabled); } status_t AudioSystem::supportsBluetoothLatencyModes( status_t AudioSystem::isBluetoothVariableLatencyEnabled( bool *enabled) { const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger(); if (af == nullptr) { return PERMISSION_DENIED; } return af->isBluetoothVariableLatencyEnabled(enabled); } status_t AudioSystem::supportsBluetoothVariableLatency( bool *support) { const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger(); if (af == nullptr) { return PERMISSION_DENIED; } return af->supportsBluetoothLatencyModes(support); return af->supportsBluetoothVariableLatency(support); } class CaptureStateListenerImpl : public media::BnCaptureStateListener, Loading
media/libaudioclient/IAudioFlinger.cpp +23 −8 Original line number Diff line number Diff line Loading @@ -846,17 +846,28 @@ status_t AudioFlingerClientAdapter::getSupportedLatencyModes( return NO_ERROR; } status_t AudioFlingerClientAdapter::setBluetoothLatencyModesEnabled(bool enabled) { return statusTFromBinderStatus(mDelegate->setBluetoothLatencyModesEnabled(enabled)); status_t AudioFlingerClientAdapter::setBluetoothVariableLatencyEnabled(bool enabled) { return statusTFromBinderStatus(mDelegate->setBluetoothVariableLatencyEnabled(enabled)); } status_t AudioFlingerClientAdapter::supportsBluetoothLatencyModes(bool* support) { status_t AudioFlingerClientAdapter::isBluetoothVariableLatencyEnabled(bool* enabled) { if (enabled == nullptr) { return BAD_VALUE; } RETURN_STATUS_IF_ERROR(statusTFromBinderStatus( mDelegate->isBluetoothVariableLatencyEnabled(enabled))); return NO_ERROR; } status_t AudioFlingerClientAdapter::supportsBluetoothVariableLatency(bool* support) { if (support == nullptr) { return BAD_VALUE; } RETURN_STATUS_IF_ERROR(statusTFromBinderStatus( mDelegate->supportsBluetoothLatencyModes(support))); mDelegate->supportsBluetoothVariableLatency(support))); return NO_ERROR; } Loading Loading @@ -1389,12 +1400,16 @@ Status AudioFlingerServerAdapter::getSupportedLatencyModes( return Status::ok(); } Status AudioFlingerServerAdapter::setBluetoothLatencyModesEnabled(bool enabled) { return Status::fromStatusT(mDelegate->setBluetoothLatencyModesEnabled(enabled)); Status AudioFlingerServerAdapter::setBluetoothVariableLatencyEnabled(bool enabled) { return Status::fromStatusT(mDelegate->setBluetoothVariableLatencyEnabled(enabled)); } Status AudioFlingerServerAdapter::isBluetoothVariableLatencyEnabled(bool *enabled) { return Status::fromStatusT(mDelegate->isBluetoothVariableLatencyEnabled(enabled)); } Status AudioFlingerServerAdapter::supportsBluetoothLatencyModes(bool *support) { return Status::fromStatusT(mDelegate->supportsBluetoothLatencyModes(support)); Status AudioFlingerServerAdapter::supportsBluetoothVariableLatency(bool *support) { return Status::fromStatusT(mDelegate->supportsBluetoothVariableLatency(support)); } Status AudioFlingerServerAdapter::getSoundDoseInterface( Loading
media/libaudioclient/aidl/android/media/IAudioFlingerService.aidl +9 −4 Original line number Diff line number Diff line Loading @@ -248,18 +248,23 @@ interface IAudioFlingerService { /** * Requests if the implementation supports controlling the latency modes * over the Bleutooth A2DP or LE Audio links. If it does, * over the Bluetooth A2DP or LE Audio links. If it does, * setRequestedLatencyMode() and getSupportedLatencyModes() APIs can also be used * for streams routed to Bluetooth and not just for the spatializer output. */ boolean supportsBluetoothLatencyModes(); boolean supportsBluetoothVariableLatency(); /** * Enables or disables the variable Bluetooth latency control mechanism in the * audio framework and the audio HAL. This does not apply to the latency mode control * on the spatializer output with is a built-in feature. * on the spatializer output as this is a built-in feature. */ void setBluetoothLatencyModesEnabled(boolean enabled); void setBluetoothVariableLatencyEnabled(boolean enabled); /** * Indicates if the variable Bluetooth latency control mechanism is enabled or disabled. */ boolean isBluetoothVariableLatencyEnabled(); /** * Registers the sound dose callback and returns the interface for executing Loading
media/libaudioclient/include/media/AudioSystem.h +4 −2 Original line number Diff line number Diff line Loading @@ -629,9 +629,11 @@ public: static status_t getSupportedLatencyModes(audio_io_handle_t output, std::vector<audio_latency_mode_t>* modes); static status_t setBluetoothLatencyModesEnabled(bool enabled); static status_t setBluetoothVariableLatencyEnabled(bool enabled); static status_t supportsBluetoothLatencyModes(bool *support); static status_t isBluetoothVariableLatencyEnabled(bool *enabled); static status_t supportsBluetoothVariableLatency(bool *support); static status_t getSupportedMixerAttributes(audio_port_handle_t portId, std::vector<audio_mixer_attributes_t> *mixerAttrs); Loading
media/libaudioclient/include/media/IAudioFlinger.h +16 −10 Original line number Diff line number Diff line Loading @@ -375,9 +375,11 @@ public: virtual status_t invalidateTracks(const std::vector<audio_port_handle_t>& portIds) = 0; virtual status_t setBluetoothLatencyModesEnabled(bool enabled) = 0; virtual status_t setBluetoothVariableLatencyEnabled(bool enabled) = 0; virtual status_t supportsBluetoothLatencyModes(bool* support) = 0; virtual status_t isBluetoothVariableLatencyEnabled(bool* enabled) = 0; virtual status_t supportsBluetoothVariableLatency(bool* support) = 0; }; /** Loading Loading @@ -483,8 +485,9 @@ public: audio_latency_mode_t mode) override; status_t getSupportedLatencyModes( audio_io_handle_t output, std::vector<audio_latency_mode_t>* modes) override; status_t setBluetoothLatencyModesEnabled(bool enabled) override; status_t supportsBluetoothLatencyModes(bool* support) override; status_t setBluetoothVariableLatencyEnabled(bool enabled) override; status_t isBluetoothVariableLatencyEnabled(bool* enabled) override; status_t supportsBluetoothVariableLatency(bool* support) override; status_t getSoundDoseInterface(const sp<media::ISoundDoseCallback>& callback, sp<media::ISoundDose>* soundDose) override; status_t invalidateTracks(const std::vector<audio_port_handle_t>& portIds) override; Loading Loading @@ -578,10 +581,12 @@ public: SET_DEVICE_CONNECTED_STATE = media::BnAudioFlingerService::TRANSACTION_setDeviceConnectedState, SET_REQUESTED_LATENCY_MODE = media::BnAudioFlingerService::TRANSACTION_setRequestedLatencyMode, GET_SUPPORTED_LATENCY_MODES = media::BnAudioFlingerService::TRANSACTION_getSupportedLatencyModes, SET_BLUETOOTH_LATENCY_MODES_ENABLED = media::BnAudioFlingerService::TRANSACTION_setBluetoothLatencyModesEnabled, SUPPORTS_BLUETOOTH_LATENCY_MODES = media::BnAudioFlingerService::TRANSACTION_supportsBluetoothLatencyModes, SET_BLUETOOTH_VARIABLE_LATENCY_ENABLED = media::BnAudioFlingerService::TRANSACTION_setBluetoothVariableLatencyEnabled, IS_BLUETOOTH_VARIABLE_LATENCY_ENABLED = media::BnAudioFlingerService::TRANSACTION_isBluetoothVariableLatencyEnabled, SUPPORTS_BLUETOOTH_VARIABLE_LATENCY = media::BnAudioFlingerService::TRANSACTION_supportsBluetoothVariableLatency, GET_SOUND_DOSE_INTERFACE = media::BnAudioFlingerService::TRANSACTION_getSoundDoseInterface, INVALIDATE_TRACKS = media::BnAudioFlingerService::TRANSACTION_invalidateTracks, }; Loading Loading @@ -707,8 +712,9 @@ public: Status setRequestedLatencyMode(int output, media::LatencyMode mode) override; Status getSupportedLatencyModes(int output, std::vector<media::LatencyMode>* _aidl_return) override; Status setBluetoothLatencyModesEnabled(bool enabled) override; Status supportsBluetoothLatencyModes(bool* support) override; Status setBluetoothVariableLatencyEnabled(bool enabled) override; Status isBluetoothVariableLatencyEnabled(bool* enabled) override; Status supportsBluetoothVariableLatency(bool* support) override; Status getSoundDoseInterface(const sp<media::ISoundDoseCallback>& callback, sp<media::ISoundDose>* _aidl_return) override; Status invalidateTracks(const std::vector<int32_t>& portIds) override; Loading