Run appcompat on vendor and product-services.

Also add some more relevant information at the beginning of each report,
to make triaging of the reports easier.

To test this I declared ExactCalculator as
LOCAL_PRODUCT_SERVICES_MODULE, and this is the resulting log:

"""
Package name: com.android.calculator2
Module name in Android tree: ExactCalculator
Local path in Android tree: packages/apps/ExactCalculator
Install path on aosp_marlin-eng: out/target/product/marlin/system/product-services/app/ExactCalculator/ExactCalculator.apk

appcompat.sh output:
NOTE: appcompat.sh is still under development. It can report
API uses that do not execute at runtime, and reflection uses
that do not exist. It can also miss on reflection uses.
1: Reflection light greylist Landroid/os/Bundle;->getIBinder use(s):
       Landroid/support/v4/app/BundleCompat$BundleCompatBaseImpl;->getBinder(Landroid/os/Bundle;Ljava/lang/String;)Landroid/os/IBinder;

2: Reflection light greylist Landroid/view/View;->mAccessibilityDelegate use(s):
       Landroid/support/v4/view/ViewCompat$ViewCompatBaseImpl;->hasAccessibilityDelegate(Landroid/view/View;)Z

3: Reflection light greylist Landroid/view/View;->mMinHeight use(s):
       Landroid/support/v4/view/ViewCompat$ViewCompatBaseImpl;->getMinimumHeight(Landroid/view/View;)I

4: Reflection light greylist Landroid/view/View;->mMinWidth use(s):
       Landroid/support/v4/view/ViewCompat$ViewCompatBaseImpl;->getMinimumWidth(Landroid/view/View;)I

4 hidden API(s) used: 0 linked against, 4 through reflection
       0 in blacklist
       0 in dark greylist
       4 in light greylist
To run an analysis that can give more reflection accesses,
but could include false positives, pass the --imprecise flag.
"""

Test: m (also on internal)
Bug: 110073830
Change-Id: I5114f51d1ab163e954fcffb159ef335abc289cf6
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 312635f..acb128c 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -592,10 +592,12 @@
 endif
 endif
 
-# Run veridex on product modules.
+# Run veridex on product, product-services and vendor modules.
 # We skip it for unbundled app builds where we cannot build veridex.
 module_run_appcompat :=
-ifdef LOCAL_PRODUCT_MODULE
+ifeq (true,$(filter true, \
+   $(LOCAL_PRODUCT_MODULE) $(LOCAL_PRODUCT_SERVICES_MODULE) \
+   $(LOCAL_VENDOR_MODULE) $(LOCAL_PROPRIETARY_MODULE)))
 ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)))  # ! unbundled app build
   module_run_appcompat := true
 endif
@@ -603,6 +605,7 @@
 
 ifeq ($(module_run_appcompat),true)
 $(LOCAL_BUILT_MODULE) : $(call intermediates-dir-for,PACKAGING,veridex,HOST)/veridex.zip
+$(LOCAL_BUILT_MODULE): PRIVATE_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE)
 endif
 
 $(LOCAL_BUILT_MODULE): PRIVATE_DONT_DELETE_JAR_DIRS := $(LOCAL_DONT_DELETE_JAR_DIRS)
@@ -647,6 +650,11 @@
 endif
 # Run appcompat before stripping the classes.dex file.
 ifeq ($(module_run_appcompat),true)
+ifeq ($(LOCAL_USE_AAPT2),true)
+	$(call appcompat-header, aapt2)
+else
+	$(appcompat-header)
+endif
 	$(run-appcompat)
 endif  # module_run_appcompat
 ifdef LOCAL_DEX_PREOPT