Loading policy_hal/AudioPolicyManager.cpp +27 −0 Original line number Diff line number Diff line Loading @@ -1076,4 +1076,31 @@ non_direct_output: return output; } audio_devices_t AudioPolicyManagerCustom::getDeviceForStrategy(routing_strategy strategy, bool fromCache) { audio_devices_t availableOutputDeviceTypes = mAvailableOutputDevices.types(); audio_devices_t device = AUDIO_DEVICE_NONE; switch (strategy) { case STRATEGY_SONIFICATION: case STRATEGY_ENFORCED_AUDIBLE: case STRATEGY_ACCESSIBILITY: case STRATEGY_REROUTING: case STRATEGY_MEDIA: if (strategy != STRATEGY_SONIFICATION){ // no sonification on WFD sink device |= availableOutputDeviceTypes & AUDIO_DEVICE_OUT_PROXY; if (device != AUDIO_DEVICE_NONE) { ALOGV("Found proxy for strategy %d", strategy); return device; } } break; default: ALOGV("getDeviceForStrategy() unknown strategy: %d", strategy); break; } device = AudioPolicyManager::getDeviceForStrategy(strategy, fromCache); return device; } } policy_hal/AudioPolicyManager.h +3 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ namespace android { #endif #ifndef AFE_PROXY_ENABLED #define AUDIO_DEVICE_OUT_PROXY 0x40000 #define AUDIO_DEVICE_OUT_PROXY 0x1000000 #endif // ---------------------------------------------------------------------------- Loading @@ -67,6 +67,8 @@ public: virtual bool isOffloadSupported(const audio_offload_info_t& offloadInfo); // true if given state represents a device in a telephony or VoIP call virtual audio_devices_t getDeviceForStrategy(routing_strategy strategy, bool fromCache); protected: status_t checkAndSetVolume(audio_stream_type_t stream, Loading Loading
policy_hal/AudioPolicyManager.cpp +27 −0 Original line number Diff line number Diff line Loading @@ -1076,4 +1076,31 @@ non_direct_output: return output; } audio_devices_t AudioPolicyManagerCustom::getDeviceForStrategy(routing_strategy strategy, bool fromCache) { audio_devices_t availableOutputDeviceTypes = mAvailableOutputDevices.types(); audio_devices_t device = AUDIO_DEVICE_NONE; switch (strategy) { case STRATEGY_SONIFICATION: case STRATEGY_ENFORCED_AUDIBLE: case STRATEGY_ACCESSIBILITY: case STRATEGY_REROUTING: case STRATEGY_MEDIA: if (strategy != STRATEGY_SONIFICATION){ // no sonification on WFD sink device |= availableOutputDeviceTypes & AUDIO_DEVICE_OUT_PROXY; if (device != AUDIO_DEVICE_NONE) { ALOGV("Found proxy for strategy %d", strategy); return device; } } break; default: ALOGV("getDeviceForStrategy() unknown strategy: %d", strategy); break; } device = AudioPolicyManager::getDeviceForStrategy(strategy, fromCache); return device; } }
policy_hal/AudioPolicyManager.h +3 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ namespace android { #endif #ifndef AFE_PROXY_ENABLED #define AUDIO_DEVICE_OUT_PROXY 0x40000 #define AUDIO_DEVICE_OUT_PROXY 0x1000000 #endif // ---------------------------------------------------------------------------- Loading @@ -67,6 +67,8 @@ public: virtual bool isOffloadSupported(const audio_offload_info_t& offloadInfo); // true if given state represents a device in a telephony or VoIP call virtual audio_devices_t getDeviceForStrategy(routing_strategy strategy, bool fromCache); protected: status_t checkAndSetVolume(audio_stream_type_t stream, Loading