ATest: GTest auto gen config support run-test-as.

Feature request from developer, support setting uid in makefile.

Bug: 113359343
Test: apply aosp/757329
      make -j hello_world_test_mk (w/ UID setting in config)
      make -j hello_world_test_mk2 (w/o UID setting in config)
      check test config of host's hello_world_test_mk (w/o UID setting in config)

Change-Id: I167c737098fa906e401769c6a8838f46b03bd33c
diff --git a/core/autogen_test_config.mk b/core/autogen_test_config.mk
index a01d80f..4b912fb 100644
--- a/core/autogen_test_config.mk
+++ b/core/autogen_test_config.mk
@@ -34,9 +34,16 @@
 endif
 # Auto generating test config file for native test
 $(autogen_test_config_file): PRIVATE_MODULE_NAME := $(LOCAL_MODULE)
+$(autogen_test_config_file): PRIVATE_RUN_UID := $(LOCAL_RUN_TEST_AS)
 $(autogen_test_config_file) : $(autogen_test_config_template)
 	@echo "Auto generating test config $(notdir $@)"
 	$(hide) sed 's&{MODULE}&$(PRIVATE_MODULE_NAME)&g' $< > $@
+ifneq ($(LOCAL_RUN_TEST_AS),)
+	$(hide) sed -i 's&{UID_OPTION}&<option name="run-test-as" value="$(PRIVATE_RUN_UID)" />&g' $@
+else
+	$(hide) sed -i '/{UID_OPTION}/d' $@
+endif
+
 my_auto_generate_config := true
 else
 # Auto generating test config file for instrumentation test