Cleanup NATIVE_COVERAGE, PRIVATE_ARFLAGS

Disable the NATIVE_COVERAGE code when not in use. Provide the proper
PRIVATE_ variables so that the $DISPLAY environment variable isn't
encoded into the ninja file.

Remove PRIVATE_ARFLAGS, which is never set.

Test: compare build-aosp_flounder.ninja
Test: NATIVE_COVERAGE=true build-aosp_flounder.ninja, inspect
Change-Id: I2a52de440fd991cdc5761ff8bd58a474892d2dfc
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index af59756..969c115 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -172,15 +172,19 @@
 # "my_strip_module not true" because otherwise the rules are defined in dynamic_binary.mk.
 endif  # my_strip_module not true
 
+ifeq ($(NATIVE_COVERAGE),true)
 # Coverage information is needed when static lib is a dependency of another
 # coverage-enabled module.
 ifeq (STATIC_LIBRARIES, $(LOCAL_MODULE_CLASS))
 GCNO_ARCHIVE := $(LOCAL_MODULE).gcnodir
 $(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_ALL_OBJECTS :=
 $(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_ALL_WHOLE_STATIC_LIBRARIES :=
+$(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_PREFIX := $(my_prefix)
+$(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_2ND_ARCH_VAR_PREFIX := $(LOCAL_2ND_ARCH_VAR_PREFIX)
 $(intermediates)/$(GCNO_ARCHIVE) :
 	$(transform-o-to-static-lib)
 endif
+endif
 
 ifeq ($(LOCAL_MODULE_CLASS),APPS)
 PACKAGES.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES))