Merge "aconfig: Fix missing header in the generated c/cpp code" into main
diff --git a/tools/aconfig/src/codegen_cpp.rs b/tools/aconfig/src/codegen_cpp.rs
index 177587d..5eadf2a 100644
--- a/tools/aconfig/src/codegen_cpp.rs
+++ b/tools/aconfig/src/codegen_cpp.rs
@@ -364,6 +364,7 @@
const TEST_SOURCE_FILE_EXPECTED: &str = r#"
#include "com_android_aconfig_test.h"
#include <server_configurable_flags/get_flags.h>
+#include <unordered_map>
namespace com::android::aconfig::test {
diff --git a/tools/aconfig/templates/cpp_source_file.template b/tools/aconfig/templates/cpp_source_file.template
index f373bc6..c0e7343 100644
--- a/tools/aconfig/templates/cpp_source_file.template
+++ b/tools/aconfig/templates/cpp_source_file.template
@@ -2,6 +2,9 @@
{{ if readwrite }}
#include <server_configurable_flags/get_flags.h>
{{ endif }}
+{{ if for_test }}
+#include <unordered_map>
+{{ endif }}
namespace {cpp_namespace} \{