audio policy manager: do not reapply same forced usage

Skip systematic audio path and volume reevaluation when the new
forced configuration for the selected usage is the same as current one.

Bug: 38276985
Test: try repro steps in b/38276985. Check regressions with audio routing for music
and calls over speaker, headset and Bluetooth

Test: connect BT A2DP and launch CNN
Change-Id: Id43a5270c666065e099d02d9e52de86b20cb8039
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index aaa6134..586b2fc 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -638,6 +638,9 @@
                                          audio_policy_forced_cfg_t config)
 {
     ALOGV("setForceUse() usage %d, config %d, mPhoneState %d", usage, config, mEngine->getPhoneState());
+    if (config == mEngine->getForceUse(usage)) {
+        return;
+    }
 
     if (mEngine->setForceUse(usage, config) != NO_ERROR) {
         ALOGW("setForceUse() could not set force cfg %d for usage %d", config, usage);