Refreshed UX for Audio Formats Setting [Backend]
This CL modifies getSurroundSound(reported=true) to always return formats
supported by device irrespective of mode.
This also adds unit tests to verify the APIs getSurroundSound and
setSurroundFormatEnabled.
Bug:171785330
Test: atest audiopolicy_tests
Test: Tested manually
Change-Id: Id309cc864fd380d7600c19e1839a63dd5756879f
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h
index 217013f..012ed6e 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.h
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
@@ -813,6 +813,9 @@
std::unordered_set<audio_format_t> mManualSurroundFormats;
std::unordered_map<uid_t, audio_flags_mask_t> mAllowedCapturePolicies;
+
+ // The map of device descriptor and formats reported by the device.
+ std::map<wp<DeviceDescriptor>, FormatVector> mReportedFormatsMap;
private:
void onNewAudioModulesAvailableInt(DeviceVector *newDevices);