Loading bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -39,4 +39,5 @@ interface IBluetoothAudioProvider { void streamStarted(in android.hardware.bluetooth.audio.BluetoothAudioStatus status); void streamSuspended(in android.hardware.bluetooth.audio.BluetoothAudioStatus status); void updateAudioConfiguration(in android.hardware.bluetooth.audio.AudioConfiguration audioConfig); void setLowLatencyModeAllowed(in boolean allowed); } bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -82,4 +82,12 @@ interface IBluetoothAudioProvider { * encoding. */ void updateAudioConfiguration(in AudioConfiguration audioConfig); /** * Called when the supported latency mode is updated. * * @param allowed If the peripheral devices can't keep up with low latency * mode, the API will be called with supported is false. */ void setLowLatencyModeAllowed(in boolean allowed); } bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,19 @@ ndk::ScopedAStatus BluetoothAudioProvider::updateAudioConfiguration( return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus BluetoothAudioProvider::setLowLatencyModeAllowed( bool allowed) { LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_); if (stack_iface_ == nullptr) { LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_) << " has NO session"; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } LOG(INFO) << __func__ << " - allowed " << allowed; return ndk::ScopedAStatus::ok(); } void BluetoothAudioProvider::binderDiedCallbackAidl(void* ptr) { LOG(ERROR) << __func__ << " - BluetoothAudio Service died"; auto provider = static_cast<BluetoothAudioProvider*>(ptr); Loading bluetooth/audio/aidl/default/BluetoothAudioProvider.h +1 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ class BluetoothAudioProvider : public BnBluetoothAudioProvider { ndk::ScopedAStatus streamSuspended(BluetoothAudioStatus status); ndk::ScopedAStatus updateAudioConfiguration( const AudioConfiguration& audio_config); ndk::ScopedAStatus setLowLatencyModeAllowed(bool allowed); virtual bool isValid(const SessionType& sessionType) = 0; Loading Loading
bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -39,4 +39,5 @@ interface IBluetoothAudioProvider { void streamStarted(in android.hardware.bluetooth.audio.BluetoothAudioStatus status); void streamSuspended(in android.hardware.bluetooth.audio.BluetoothAudioStatus status); void updateAudioConfiguration(in android.hardware.bluetooth.audio.AudioConfiguration audioConfig); void setLowLatencyModeAllowed(in boolean allowed); }
bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -82,4 +82,12 @@ interface IBluetoothAudioProvider { * encoding. */ void updateAudioConfiguration(in AudioConfiguration audioConfig); /** * Called when the supported latency mode is updated. * * @param allowed If the peripheral devices can't keep up with low latency * mode, the API will be called with supported is false. */ void setLowLatencyModeAllowed(in boolean allowed); }
bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,19 @@ ndk::ScopedAStatus BluetoothAudioProvider::updateAudioConfiguration( return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus BluetoothAudioProvider::setLowLatencyModeAllowed( bool allowed) { LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_); if (stack_iface_ == nullptr) { LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_) << " has NO session"; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } LOG(INFO) << __func__ << " - allowed " << allowed; return ndk::ScopedAStatus::ok(); } void BluetoothAudioProvider::binderDiedCallbackAidl(void* ptr) { LOG(ERROR) << __func__ << " - BluetoothAudio Service died"; auto provider = static_cast<BluetoothAudioProvider*>(ptr); Loading
bluetooth/audio/aidl/default/BluetoothAudioProvider.h +1 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ class BluetoothAudioProvider : public BnBluetoothAudioProvider { ndk::ScopedAStatus streamSuspended(BluetoothAudioStatus status); ndk::ScopedAStatus updateAudioConfiguration( const AudioConfiguration& audio_config); ndk::ScopedAStatus setLowLatencyModeAllowed(bool allowed); virtual bool isValid(const SessionType& sessionType) = 0; Loading