Call clean-path in more places

When an Android.mk specifies a local path that is outside the current
directory, it uses '..', since we prepend $(LOCAL_PATH)/ to the given
path.

This path ('a/b/../c') gets inserted into command lines and
dependencies. For dependencies, when it gets to Ninja, Ninja calls
CanonicalizePath and removes those references ('a/c'), but the command
line is preserved.

So we've got a command line that references 'a/b', but no dependency on
it. Usually that's not a big problem, but it's an issue if we're trying
to only expose dependencies to the rule, like with RBE only sending the
dependencies to the remote workers. So use our 'clean-path' macro to
collapse the '..' references in Kati so that they don't show up in the
command line either.

Test: treehugger
Test: build a system image with RBE
Change-Id: I0706faa2ac15e9c12c720f43c7bb8171c5efd97c
diff --git a/core/definitions.mk b/core/definitions.mk
index e1977ba..717e10b 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1012,7 +1012,7 @@
 # You must call this with $(eval).
 define define-aidl-java-rule
 define-aidl-java-rule-src := $(patsubst %.aidl,%.java,$(subst ../,dotdot/,$(addprefix $(2)/,$(1))))
-$$(define-aidl-java-rule-src) : $(LOCAL_PATH)/$(1) $(AIDL)
+$$(define-aidl-java-rule-src) : $(call clean-path,$(LOCAL_PATH)/$(1)) $(AIDL)
 	$$(transform-aidl-to-java)
 $(3) += $$(define-aidl-java-rule-src)
 endef
@@ -1025,7 +1025,7 @@
 # You must call this with $(eval).
 define define-aidl-cpp-rule
 define-aidl-cpp-rule-src := $(patsubst %.aidl,%$(LOCAL_CPP_EXTENSION),$(subst ../,dotdot/,$(addprefix $(2)/,$(1))))
-$$(define-aidl-cpp-rule-src) : $(LOCAL_PATH)/$(1) $(AIDL_CPP)
+$$(define-aidl-cpp-rule-src) : $(call clean-path,$(LOCAL_PATH)/$(1)) $(AIDL_CPP)
 	$$(transform-aidl-to-cpp)
 $(3) += $$(define-aidl-cpp-rule-src)
 endef
@@ -1925,7 +1925,7 @@
   $(addprefix --manifest ,$(PRIVATE_ANDROID_MANIFEST)) \
   $(addprefix -I ,$(PRIVATE_AAPT_INCLUDES)) \
   $(addprefix -I ,$(PRIVATE_SHARED_ANDROID_LIBRARIES)) \
-  $(addprefix -A ,$(PRIVATE_ASSET_DIR)) \
+  $(addprefix -A ,$(foreach d,$(PRIVATE_ASSET_DIR),$(call clean-path,$(d)))) \
   $(addprefix --java ,$(PRIVATE_JAVA_GEN_DIR)) \
   $(addprefix --proguard ,$(PRIVATE_PROGUARD_OPTIONS_FILE)) \
   $(addprefix --min-sdk-version ,$(PRIVATE_DEFAULT_APP_TARGET_SDK)) \