Loading audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IBluetoothLe.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -36,4 +36,6 @@ package android.hardware.audio.core; interface IBluetoothLe { boolean isEnabled(); void setEnabled(boolean enabled); boolean supportsOffloadReconfiguration(); void reconfigureOffload(in android.hardware.audio.core.VendorParameter[] parameters); } audio/aidl/android/hardware/audio/core/IBluetoothA2dp.aidl +3 −3 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ interface IBluetoothA2dp { /** * Indicates whether the module supports reconfiguration of offloaded codecs. * * Offloaded coded implementations may need to be reconfigured when the * Offloaded codec implementations may need to be reconfigured when the * active A2DP device changes. This method indicates whether the HAL module * supports the reconfiguration event. The result returned from this method * must not change over time. Loading @@ -67,11 +67,11 @@ interface IBluetoothA2dp { /** * Instructs the HAL module to reconfigure offloaded codec. * * Offloaded coded implementations may need to be reconfigured when the * Offloaded codec implementations may need to be reconfigured when the * active A2DP device changes. This method is a notification for the HAL * module to commence reconfiguration. * * Note that 'EX_UNSUPPORTED_OPERATION' may only be thrown when * Note that 'EX_UNSUPPORTED_OPERATION' must be thrown if and only if * 'supportsOffloadReconfiguration' returns 'false'. * * @param parameter Optional vendor-specific parameters, can be left empty. Loading audio/aidl/android/hardware/audio/core/IBluetoothLe.aidl +31 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.hardware.audio.core; import android.hardware.audio.core.VendorParameter; /** * An instance of IBluetoothLe manages settings for the LE (Low Energy) * profiles. This interface is optional to implement by the vendor. It needs to Loading Loading @@ -48,4 +50,33 @@ interface IBluetoothLe { * @throws EX_ILLEGAL_STATE If there was an error performing the operation. */ void setEnabled(boolean enabled); /** * Indicates whether the module supports reconfiguration of offloaded codecs. * * Offloaded codec implementations may need to be reconfigured when the * active LE device changes. This method indicates whether the HAL module * supports the reconfiguration event. The result returned from this method * must not change over time. * * @return Whether reconfiguration offload of offloaded codecs is supported. */ boolean supportsOffloadReconfiguration(); /** * Instructs the HAL module to reconfigure offloaded codec. * * Offloaded codec implementations may need to be reconfigured when the * active LE device changes. This method is a notification for the HAL * module to commence reconfiguration. * * Note that 'EX_UNSUPPORTED_OPERATION' must be thrown if and only if * 'supportsOffloadReconfiguration' returns 'false'. * * @param parameter Optional vendor-specific parameters, can be left empty. * @throws EX_ILLEGAL_STATE If there was an error performing the operation, * or the operation can not be commenced in the current state. * @throws EX_UNSUPPORTED_OPERATION If the module does not support codec reconfiguration. */ void reconfigureOffload(in VendorParameter[] parameters); } audio/aidl/common/include/Utils.h +13 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <algorithm> #include <array> #include <initializer_list> #include <regex> #include <type_traits> #include <aidl/android/media/audio/common/AudioChannelLayout.h> Loading Loading @@ -133,6 +134,18 @@ constexpr bool isValidAudioMode(::aidl::android::media::audio::common::AudioMode kValidAudioModes.end(); } static inline bool maybeVendorExtension(const std::string& s) { // Only checks whether the string starts with the "vendor prefix". static const std::string vendorPrefix = "VX_"; return s.size() > vendorPrefix.size() && s.substr(0, vendorPrefix.size()) == vendorPrefix; } static inline bool isVendorExtension(const std::string& s) { // Must be the same as defined in {Playback|Record}TrackMetadata.aidl static const std::regex vendorExtension("VX_[A-Z0-9]{3,}_[_A-Z0-9]+"); return std::regex_match(s.begin(), s.end(), vendorExtension); } // The helper functions defined below are only applicable to the case when an enum type // specifies zero-based bit positions, not bit masks themselves. This is why instantiation // is restricted to certain enum types. Loading audio/aidl/default/Bluetooth.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -117,4 +117,17 @@ ndk::ScopedAStatus BluetoothLe::setEnabled(bool in_enabled) { return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus BluetoothLe::supportsOffloadReconfiguration(bool* _aidl_return) { *_aidl_return = true; LOG(DEBUG) << __func__ << ": returning " << *_aidl_return; return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus BluetoothLe::reconfigureOffload( const std::vector<::aidl::android::hardware::audio::core::VendorParameter>& in_parameters __unused) { LOG(DEBUG) << __func__ << ": " << ::android::internal::ToString(in_parameters); return ndk::ScopedAStatus::ok(); } } // namespace aidl::android::hardware::audio::core Loading
audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IBluetoothLe.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -36,4 +36,6 @@ package android.hardware.audio.core; interface IBluetoothLe { boolean isEnabled(); void setEnabled(boolean enabled); boolean supportsOffloadReconfiguration(); void reconfigureOffload(in android.hardware.audio.core.VendorParameter[] parameters); }
audio/aidl/android/hardware/audio/core/IBluetoothA2dp.aidl +3 −3 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ interface IBluetoothA2dp { /** * Indicates whether the module supports reconfiguration of offloaded codecs. * * Offloaded coded implementations may need to be reconfigured when the * Offloaded codec implementations may need to be reconfigured when the * active A2DP device changes. This method indicates whether the HAL module * supports the reconfiguration event. The result returned from this method * must not change over time. Loading @@ -67,11 +67,11 @@ interface IBluetoothA2dp { /** * Instructs the HAL module to reconfigure offloaded codec. * * Offloaded coded implementations may need to be reconfigured when the * Offloaded codec implementations may need to be reconfigured when the * active A2DP device changes. This method is a notification for the HAL * module to commence reconfiguration. * * Note that 'EX_UNSUPPORTED_OPERATION' may only be thrown when * Note that 'EX_UNSUPPORTED_OPERATION' must be thrown if and only if * 'supportsOffloadReconfiguration' returns 'false'. * * @param parameter Optional vendor-specific parameters, can be left empty. Loading
audio/aidl/android/hardware/audio/core/IBluetoothLe.aidl +31 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.hardware.audio.core; import android.hardware.audio.core.VendorParameter; /** * An instance of IBluetoothLe manages settings for the LE (Low Energy) * profiles. This interface is optional to implement by the vendor. It needs to Loading Loading @@ -48,4 +50,33 @@ interface IBluetoothLe { * @throws EX_ILLEGAL_STATE If there was an error performing the operation. */ void setEnabled(boolean enabled); /** * Indicates whether the module supports reconfiguration of offloaded codecs. * * Offloaded codec implementations may need to be reconfigured when the * active LE device changes. This method indicates whether the HAL module * supports the reconfiguration event. The result returned from this method * must not change over time. * * @return Whether reconfiguration offload of offloaded codecs is supported. */ boolean supportsOffloadReconfiguration(); /** * Instructs the HAL module to reconfigure offloaded codec. * * Offloaded codec implementations may need to be reconfigured when the * active LE device changes. This method is a notification for the HAL * module to commence reconfiguration. * * Note that 'EX_UNSUPPORTED_OPERATION' must be thrown if and only if * 'supportsOffloadReconfiguration' returns 'false'. * * @param parameter Optional vendor-specific parameters, can be left empty. * @throws EX_ILLEGAL_STATE If there was an error performing the operation, * or the operation can not be commenced in the current state. * @throws EX_UNSUPPORTED_OPERATION If the module does not support codec reconfiguration. */ void reconfigureOffload(in VendorParameter[] parameters); }
audio/aidl/common/include/Utils.h +13 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <algorithm> #include <array> #include <initializer_list> #include <regex> #include <type_traits> #include <aidl/android/media/audio/common/AudioChannelLayout.h> Loading Loading @@ -133,6 +134,18 @@ constexpr bool isValidAudioMode(::aidl::android::media::audio::common::AudioMode kValidAudioModes.end(); } static inline bool maybeVendorExtension(const std::string& s) { // Only checks whether the string starts with the "vendor prefix". static const std::string vendorPrefix = "VX_"; return s.size() > vendorPrefix.size() && s.substr(0, vendorPrefix.size()) == vendorPrefix; } static inline bool isVendorExtension(const std::string& s) { // Must be the same as defined in {Playback|Record}TrackMetadata.aidl static const std::regex vendorExtension("VX_[A-Z0-9]{3,}_[_A-Z0-9]+"); return std::regex_match(s.begin(), s.end(), vendorExtension); } // The helper functions defined below are only applicable to the case when an enum type // specifies zero-based bit positions, not bit masks themselves. This is why instantiation // is restricted to certain enum types. Loading
audio/aidl/default/Bluetooth.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -117,4 +117,17 @@ ndk::ScopedAStatus BluetoothLe::setEnabled(bool in_enabled) { return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus BluetoothLe::supportsOffloadReconfiguration(bool* _aidl_return) { *_aidl_return = true; LOG(DEBUG) << __func__ << ": returning " << *_aidl_return; return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus BluetoothLe::reconfigureOffload( const std::vector<::aidl::android::hardware::audio::core::VendorParameter>& in_parameters __unused) { LOG(DEBUG) << __func__ << ": " << ::android::internal::ToString(in_parameters); return ndk::ScopedAStatus::ok(); } } // namespace aidl::android::hardware::audio::core