hal: don't allow track offload if there's active sw effect
Incorrect condition check causes direct output still being chosen even
if there's none offload effect enabled. Hence, sw only effect
implementation is bypassed and won't work.
Don't allow track offload if there's active sw effect.
CRs-Fixed: 979125
Change-Id: I79d54581f4347475d347f164b6471744c1301032
diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp
index cbebf42..3c3686f 100644
--- a/policy_hal/AudioPolicyManager.cpp
+++ b/policy_hal/AudioPolicyManager.cpp
@@ -1626,7 +1626,7 @@
// This may prevent offloading in rare situations where effects are left active by apps
// in the background.
- if (((flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) == 0) ||
+ if (((flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) == 0) &&
!mEffects.isNonOffloadableEffectEnabled()) {
profile = getProfileForDirectOutput(device,
samplingRate,