Snap for 8564071 from 5d4826c180190e08fddcdbef4f7fb2b00baa39ac to mainline-documentsui-release

Change-Id: Ida5cb2fe15f00327beedf78baf83fa69cf394a2b
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index f2dfec8..1ff137f 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -21,6 +21,10 @@
 
 TARGET_CPU_SMP := true
 
-# Flatten APEX packages to make them simpler to use in
-# ART testing/benchmarking environments.
-TARGET_FLATTEN_APEX := true
+# Enable ART Module top level apex/sdk/module_export modules. When they are
+# enabled the ART Module prebuilts (packages/modules/ArtPrebuilt and
+# prebuilts/module_sdk/art) cannot be present with prefer:true in the build
+# tree.
+# TODO(b/174997203): Clean this up when there is a better way to switch between
+# prebuilts and sources.
+$(call soong_config_set,art_module,source_build,true)
diff --git a/METADATA b/METADATA
new file mode 100644
index 0000000..d97975c
--- /dev/null
+++ b/METADATA
@@ -0,0 +1,3 @@
+third_party {
+  license_type: NOTICE
+}
diff --git a/armv8/BoardConfig.mk b/armv8/BoardConfig.mk
index 1375c33..1f41722 100644
--- a/armv8/BoardConfig.mk
+++ b/armv8/BoardConfig.mk
@@ -22,7 +22,4 @@
 TARGET_CPU_VARIANT := generic
 TARGET_ARCH_VARIANT := armv8-a
 
-TARGET_PREFER_32_BIT_APPS :=
-TARGET_SUPPORTS_32_BIT_APPS :=
 TARGET_SUPPORTS_64_BIT_APPS := true
-
diff --git a/armv8_cortex_a55/AndroidProducts.mk b/armv8_cortex_a55/AndroidProducts.mk
new file mode 100644
index 0000000..7275325
--- /dev/null
+++ b/armv8_cortex_a55/AndroidProducts.mk
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 2020 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+PRODUCT_MAKEFILES := \
+    $(LOCAL_DIR)/armv8_cortex_a55.mk
+
+COMMON_LUNCH_CHOICES := \
+    armv8_cortex_a55-eng
diff --git a/armv8_cortex_a55/BoardConfig.mk b/armv8_cortex_a55/BoardConfig.mk
new file mode 100644
index 0000000..ea49fbc
--- /dev/null
+++ b/armv8_cortex_a55/BoardConfig.mk
@@ -0,0 +1,26 @@
+
+# Copyright (C) 2020 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include device/generic/art/BoardConfigCommon.mk
+
+TARGET_ARCH := arm64
+
+TARGET_CPU_ABI := arm64-v8a
+TARGET_CPU_VARIANT := cortex-a55
+TARGET_ARCH_VARIANT := armv8-2a-dotprod
+
+TARGET_SUPPORTS_64_BIT_APPS := true
+
diff --git a/armv8_cortex_a55/armv8_cortex_a55.mk b/armv8_cortex_a55/armv8_cortex_a55.mk
new file mode 100644
index 0000000..efabf4e
--- /dev/null
+++ b/armv8_cortex_a55/armv8_cortex_a55.mk
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2020 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+PRODUCT_COPY_FILES += \
+    art/tools/public.libraries.buildbot.txt:system/etc/public.libraries.txt
+
+$(call inherit-product, build/target/product/core_minimal.mk)
+
+PRODUCT_NAME := armv8_cortex_a55
+PRODUCT_DEVICE := armv8_cortex_a55
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := Cortex A55
+
+# Force 64bits executables.
+PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.zygote=zygote64
diff --git a/armv8_kryo385/BoardConfig.mk b/armv8_kryo385/BoardConfig.mk
index 967dc29..b2f7a85 100644
--- a/armv8_kryo385/BoardConfig.mk
+++ b/armv8_kryo385/BoardConfig.mk
@@ -22,7 +22,4 @@
 TARGET_CPU_VARIANT := kryo385
 TARGET_ARCH_VARIANT := armv8-2a
 
-TARGET_PREFER_32_BIT_APPS :=
-TARGET_SUPPORTS_32_BIT_APPS :=
 TARGET_SUPPORTS_64_BIT_APPS := true
-
diff --git a/art_module/AndroidProducts.mk b/art_module/AndroidProducts.mk
new file mode 100644
index 0000000..cb219cb
--- /dev/null
+++ b/art_module/AndroidProducts.mk
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+PRODUCT_MAKEFILES := \
+    $(LOCAL_DIR)/art_module_arm.mk \
+    $(LOCAL_DIR)/art_module_arm64.mk \
+    $(LOCAL_DIR)/art_module_x86.mk \
+    $(LOCAL_DIR)/art_module_x86_64.mk \
diff --git a/art_module/art_module.mk b/art_module/art_module.mk
new file mode 100644
index 0000000..39bda5b
--- /dev/null
+++ b/art_module/art_module.mk
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Enable ART Module top level apex/sdk/module_export modules. When they are
+# enabled the ART Module prebuilts (packages/modules/ArtPrebuilt and
+# prebuilts/module_sdk/art) cannot be present with prefer:true in the build
+# tree.
+# TODO(b/174997203): Clean up the art_module_* products when there is a better
+# way to switch between prebuilts and sources.
+$(call soong_config_set,art_module,source_build,true)
diff --git a/art_module/art_module_arm.mk b/art_module/art_module_arm.mk
new file mode 100644
index 0000000..2811bf1
--- /dev/null
+++ b/art_module/art_module_arm.mk
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/module_arm.mk)
+$(call inherit-product, device/generic/art/art_module/art_module.mk)
+
+PRODUCT_NAME := art_module_arm
diff --git a/art_module/art_module_arm64.mk b/art_module/art_module_arm64.mk
new file mode 100644
index 0000000..933d5a6
--- /dev/null
+++ b/art_module/art_module_arm64.mk
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/module_arm64.mk)
+$(call inherit-product, device/generic/art/art_module/art_module.mk)
+
+PRODUCT_NAME := art_module_arm64
diff --git a/art_module/art_module_x86.mk b/art_module/art_module_x86.mk
new file mode 100644
index 0000000..3b4da4c
--- /dev/null
+++ b/art_module/art_module_x86.mk
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/module_x86.mk)
+$(call inherit-product, device/generic/art/art_module/art_module.mk)
+
+PRODUCT_NAME := art_module_x86
diff --git a/art_module/art_module_x86_64.mk b/art_module/art_module_x86_64.mk
new file mode 100644
index 0000000..d55be8a
--- /dev/null
+++ b/art_module/art_module_x86_64.mk
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/module_x86_64.mk)
+$(call inherit-product, device/generic/art/art_module/art_module.mk)
+
+PRODUCT_NAME := art_module_x86_64