Merge 8d1bfc839a7c8ac230e03f902cbf073c9e69f1d6 on remote branch

Change-Id: I094733eb337c76fc0c3e56d538a27694e39adb3e
diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp
index 38f427b..0301e85 100644
--- a/policy_hal/AudioPolicyManager.cpp
+++ b/policy_hal/AudioPolicyManager.cpp
@@ -266,12 +266,18 @@
                 sp<SwAudioOutputDescriptor> desc = mOutputs.valueFor(output);
                 sp<AudioPolicyMix> policyMix = desc->mPolicyMix.promote();
                 if (policyMix != nullptr
-                        && policyMix->mMixType == MIX_TYPE_RECORDERS
                         && strncmp(device_address,
                                    policyMix->mDeviceAddress.string(),
                                    AUDIO_DEVICE_MAX_ADDRESS_LEN) == 0) {
-                    doCheckForDeviceAndOutputChanges = false;
-                    break;
+                    if (policyMix->mMixType == MIX_TYPE_RECORDERS) {
+                        doCheckForDeviceAndOutputChanges = false;
+                    } else if (policyMix->mMixType == MIX_TYPE_PLAYERS) {
+                        // needs to invalidate music stream to route to remote submix because it
+                        // can't pass playback client route evaluation when connecting a remote
+                        // submix output device used by a dynamic policy of type player whatever
+                        // its address is.
+                        mpClientInterface->invalidateStream(AUDIO_STREAM_MUSIC);
+                    }
                 }
             }
         }