aapt2: use clean-path on paths to resource files

The aapt2 rules need to generate an output path for each resource
file.  Use $(call clean-path) on the input path so the output path
doesn't contain "..".

Bug: 112037828
Test: m checkbuild
Change-Id: Ib4e255e7a7f1d069cd3871a12ac232f231f19646
diff --git a/core/definitions.mk b/core/definitions.mk
index 3512598..6fb2cd1 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2114,7 +2114,9 @@
 # $(2): the base dir of the output file path
 # Returns: the compiled output file path
 define aapt2-compiled-resource-out-file
-$(eval _p_w := $(strip $(subst /,$(space),$(dir $(1)))))$(2)/$(subst $(space),/,$(_p_w))_$(if $(filter values%,$(lastword $(_p_w))),$(patsubst %.xml,%.arsc,$(notdir $(1))),$(notdir $(1))).flat
+$(strip \
+  $(eval _p_w := $(strip $(subst /,$(space),$(dir $(call clean-path,$(1))))))
+  $(2)/$(subst $(space),/,$(_p_w))_$(if $(filter values%,$(lastword $(_p_w))),$(patsubst %.xml,%.arsc,$(notdir $(1))),$(notdir $(1))).flat)
 endef
 
 define aapt2-link