APM: Fix config de-serialization
Audio Policy Manager and EngineConfig now try to load only one
readable APM config file. Previously they could try several
until one of them parses successfully. This could result in
loading of different files by APM and EC due to use of different
parts of the config.
Centralize finding of APM config file in audio_config.h.
This allows using the same logic in AudioPolicyManager.cpp
and EngineConfig.cpp which previously got duplicated
and later diverged.
Ensure that failed attempts to de-serialize config do not leave
APM or EC in a "dirty" state.
Bug: 171339398
Test: check audio on the device
Test: atest audiopolicy_engineconfig_tests
Test: atest audiopolicy_tests
Change-Id: I98c21ab03d869eb5f4259ea12cd433632cf6da5d
diff --git a/services/audiopolicy/tests/resources/Android.bp b/services/audiopolicy/tests/resources/Android.bp
index d9476d9..4f50dad 100644
--- a/services/audiopolicy/tests/resources/Android.bp
+++ b/services/audiopolicy/tests/resources/Android.bp
@@ -3,6 +3,7 @@
srcs: [
"test_audio_policy_configuration.xml",
"test_audio_policy_primary_only_configuration.xml",
+ "test_invalid_audio_policy_configuration.xml",
"test_tv_apm_configuration.xml",
],
}