Loading system/audio_hal_interface/aidl/client_interface_aidl.cc +7 −9 Original line number Diff line number Diff line Loading @@ -55,9 +55,8 @@ BluetoothAudioClientInterface::BluetoothAudioClientInterface( } bool BluetoothAudioClientInterface::is_aidl_available() { auto service = AServiceManager_checkService( return AServiceManager_isDeclared( kDefaultAudioProviderFactoryInterface.c_str()); return (service != nullptr); } std::vector<AudioCapabilities> Loading @@ -72,7 +71,7 @@ BluetoothAudioClientInterface::GetAudioCapabilities(SessionType session_type) { return capabilities; } auto provider_factory = IBluetoothAudioProviderFactory::fromBinder( ::ndk::SpAIBinder(AServiceManager_getService( ::ndk::SpAIBinder(AServiceManager_waitForService( kDefaultAudioProviderFactoryInterface.c_str()))); if (provider_factory == nullptr) { Loading @@ -91,16 +90,15 @@ BluetoothAudioClientInterface::GetAudioCapabilities(SessionType session_type) { } void BluetoothAudioClientInterface::FetchAudioProvider() { if (!is_aidl_available()) { LOG(ERROR) << __func__ << ": aidl is not supported on this platform."; return; } if (provider_ != nullptr) { LOG(WARNING) << __func__ << ": refetch"; } else if (!is_aidl_available()) { // AIDL availability should only be checked at the beginning. // When refetching, AIDL may not be ready *yet* but it's expected to be // available later. return; } auto provider_factory = IBluetoothAudioProviderFactory::fromBinder( ::ndk::SpAIBinder(AServiceManager_getService( ::ndk::SpAIBinder(AServiceManager_waitForService( kDefaultAudioProviderFactoryInterface.c_str()))); if (provider_factory == nullptr) { Loading Loading
system/audio_hal_interface/aidl/client_interface_aidl.cc +7 −9 Original line number Diff line number Diff line Loading @@ -55,9 +55,8 @@ BluetoothAudioClientInterface::BluetoothAudioClientInterface( } bool BluetoothAudioClientInterface::is_aidl_available() { auto service = AServiceManager_checkService( return AServiceManager_isDeclared( kDefaultAudioProviderFactoryInterface.c_str()); return (service != nullptr); } std::vector<AudioCapabilities> Loading @@ -72,7 +71,7 @@ BluetoothAudioClientInterface::GetAudioCapabilities(SessionType session_type) { return capabilities; } auto provider_factory = IBluetoothAudioProviderFactory::fromBinder( ::ndk::SpAIBinder(AServiceManager_getService( ::ndk::SpAIBinder(AServiceManager_waitForService( kDefaultAudioProviderFactoryInterface.c_str()))); if (provider_factory == nullptr) { Loading @@ -91,16 +90,15 @@ BluetoothAudioClientInterface::GetAudioCapabilities(SessionType session_type) { } void BluetoothAudioClientInterface::FetchAudioProvider() { if (!is_aidl_available()) { LOG(ERROR) << __func__ << ": aidl is not supported on this platform."; return; } if (provider_ != nullptr) { LOG(WARNING) << __func__ << ": refetch"; } else if (!is_aidl_available()) { // AIDL availability should only be checked at the beginning. // When refetching, AIDL may not be ready *yet* but it's expected to be // available later. return; } auto provider_factory = IBluetoothAudioProviderFactory::fromBinder( ::ndk::SpAIBinder(AServiceManager_getService( ::ndk::SpAIBinder(AServiceManager_waitForService( kDefaultAudioProviderFactoryInterface.c_str()))); if (provider_factory == nullptr) { Loading