Mark ab/7061308 as merged in stage.

Bug: 180401296
Merged-In: Ia469b8a9ac0433c6e1691ae34478bd7c57eea104
Change-Id: I7f3b06d6e67228c2f23413bc72d85fe9a3a0d1a2
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
new file mode 100644
index 0000000..b002607
--- /dev/null
+++ b/AndroidProducts.mk
@@ -0,0 +1,29 @@
+#
+# Copyright (C) 2021 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)/gsi_arm.mk \
+    $(LOCAL_DIR)/gsi_arm64.mk \
+    $(LOCAL_DIR)/gsi_x86.mk \
+    $(LOCAL_DIR)/gsi_x86_64.mk \
+    $(LOCAL_DIR)/mgsi/csi_arm.mk \
+    $(LOCAL_DIR)/mgsi/csi_arm64.mk \
+    $(LOCAL_DIR)/mgsi/csi_x86.mk \
+    $(LOCAL_DIR)/mgsi/csi_x86_64.mk \
+    $(LOCAL_DIR)/mgsi/mgsi_arm.mk \
+    $(LOCAL_DIR)/mgsi/mgsi_arm64.mk \
+    $(LOCAL_DIR)/mgsi/mgsi_x86.mk \
+    $(LOCAL_DIR)/mgsi/mgsi_x86_64.mk
diff --git a/gsi_arm.mk b/gsi_arm.mk
new file mode 100644
index 0000000..1a28cc8
--- /dev/null
+++ b/gsi_arm.mk
@@ -0,0 +1,51 @@
+#
+# Copyright (C) 2021 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.
+#
+
+# The system image of gsi_arm-userdebug is the GSI for devices with:
+# - ARM 32-bit userspace
+# - 64-bit binder interface
+# - system-as-root
+# - VNDK enforcement
+# - compatible property override enabled
+
+#
+# All components inherited here go to system image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk)
+
+# Enable mainline checking
+PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true
+
+#
+# All components inherited here go to system_ext image
+#
+$(call inherit-product, device/generic/common/gsi_system_ext.mk)
+
+#
+# All components inherited here go to product image
+#
+$(call inherit-product, device/generic/common/gsi_product.mk)
+
+#
+# Special settings for GSI releasing
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk)
+
+
+PRODUCT_NAME := gsi_arm
+PRODUCT_DEVICE := generic
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := GSI on ARM
diff --git a/gsi_arm64.mk b/gsi_arm64.mk
new file mode 100644
index 0000000..53c8300
--- /dev/null
+++ b/gsi_arm64.mk
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2021 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.
+#
+
+# The system image of gsi_arm64-userdebug is the GSI for devices with:
+# - ARM 64-bit userspace
+# - 64-bit binder interface
+# - system-as-root
+# - VNDK enforcement
+# - compatible property override enabled
+
+#
+# All components inherited here go to system image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk)
+
+# Enable mainline checking
+PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true
+
+#
+# All components inherited here go to system_ext image
+#
+$(call inherit-product, device/generic/common/gsi_system_ext.mk)
+
+#
+# All components inherited here go to product image
+#
+$(call inherit-product, device/generic/common/gsi_product.mk)
+
+#
+# All components inherited here go to boot image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk)
+
+#
+# Special settings for GSI releasing
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk)
+
+
+PRODUCT_NAME := gsi_arm64
+PRODUCT_DEVICE := generic_arm64
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := GSI on ARM64
diff --git a/gsi_product.mk b/gsi_product.mk
new file mode 100644
index 0000000..aad06d2
--- /dev/null
+++ b/gsi_product.mk
@@ -0,0 +1,38 @@
+#
+# Copyright (C) 2021 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.
+#
+
+# This makefile contains the product partition contents for CTS on
+# GSI compliance testing. Only add something here for this purpose.
+$(call inherit-product, $(SRC_TARGET_DIR)/product/media_product.mk)
+
+PRODUCT_PACKAGES += \
+    Browser2 \
+    Camera2 \
+    Dialer \
+    LatinIME \
+    messaging \
+
+# Default AOSP sounds
+$(call inherit-product-if-exists, frameworks/base/data/sounds/AllAudio.mk)
+
+# Additional settings used in all AOSP builds
+PRODUCT_PRODUCT_PROPERTIES += \
+    ro.config.ringtone?=Ring_Synth_04.ogg \
+    ro.config.notification_sound?=pixiedust.ogg \
+    ro.com.android.dataroaming?=true \
+
+PRODUCT_COPY_FILES += \
+    device/sample/etc/apns-full-conf.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/apns-conf.xml
diff --git a/gsi_system_ext.mk b/gsi_system_ext.mk
new file mode 100644
index 0000000..45ff91f
--- /dev/null
+++ b/gsi_system_ext.mk
@@ -0,0 +1,31 @@
+#
+# Copyright (C) 2021 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.
+#
+
+# This makefile contains the system_ext partition contents for CTS on
+# GSI compliance testing. Only add something here for this purpose.
+$(call inherit-product, $(SRC_TARGET_DIR)/product/media_system_ext.mk)
+
+#  handheld packages
+PRODUCT_PACKAGES += \
+    Launcher3QuickStep \
+    Provision \
+    Settings \
+    StorageManager \
+    SystemUI
+
+#  telephony packages
+PRODUCT_PACKAGES += \
+    CarrierConfig
diff --git a/gsi_x86.mk b/gsi_x86.mk
new file mode 100644
index 0000000..0dfde63
--- /dev/null
+++ b/gsi_x86.mk
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2021 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.
+#
+
+#
+# All components inherited here go to system image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk)
+
+# Enable mainline checking
+PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true
+
+#
+# All components inherited here go to system_ext image
+#
+$(call inherit-product, device/generic/common/gsi_system_ext.mk)
+
+#
+# All components below go to product image
+#
+$(call inherit-product, device/generic/common/gsi_product.mk)
+
+#
+# Special settings to skip mount product and system_ext on the device,
+# so this product can be tested isolated from those partitions.
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk)
+
+# Needed to build mk_combined_img used for creating mixed GSI/emu image
+PRODUCT_SOONG_NAMESPACES += device/generic/goldfish
+
+PRODUCT_NAME := gsi_x86
+PRODUCT_DEVICE := generic_x86
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := GSI on x86
diff --git a/gsi_x86_64.mk b/gsi_x86_64.mk
new file mode 100644
index 0000000..eb5bd97
--- /dev/null
+++ b/gsi_x86_64.mk
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2021 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.
+#
+
+#
+# All components inherited here go to system image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk)
+
+# Enable mainline checking
+PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true
+
+#
+# All components inherited here go to system_ext image
+#
+$(call inherit-product, device/generic/common/gsi_system_ext.mk)
+
+#
+# All components below go to product image
+#
+$(call inherit-product, device/generic/common/gsi_product.mk)
+
+#
+# Special settings to skip mount product and system_ext on the device,
+# so this product can be tested isolated from those partitions.
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk)
+
+# Needed to build mk_combined_img used for creating mixed GSI/emu image
+PRODUCT_SOONG_NAMESPACES += device/generic/goldfish
+
+PRODUCT_NAME := gsi_x86_64
+PRODUCT_DEVICE := generic_x86_64
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := GSI on x86_64
diff --git a/mgsi/AndroidProducts.mk b/mgsi/AndroidProducts.mk
deleted file mode 100644
index f6b0bfc..0000000
--- a/mgsi/AndroidProducts.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# Copyright 2019 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 := \
-	device/generic/common/mgsi/csi_arm64.mk \
-	device/generic/common/mgsi/csi_x86.mk \
-	device/generic/common/mgsi/mgsi_arm.mk \
-	device/generic/common/mgsi/mgsi_arm64.mk \
-	device/generic/common/mgsi/mgsi_x86.mk \
-	device/generic/common/mgsi/mgsi_x86_64.mk \
diff --git a/mgsi/csi_arm.mk b/mgsi/csi_arm.mk
new file mode 100644
index 0000000..2739ec1
--- /dev/null
+++ b/mgsi/csi_arm.mk
@@ -0,0 +1,54 @@
+#
+# Copyright (C) 2021 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.
+#
+
+#
+# All components inherited here go to system image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk)
+
+# Enable mainline checking
+PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed
+
+#
+# All components inherited here go to system_ext image
+#
+# VNDK snapshot is needed to support older vendor images
+$(call inherit-product, $(SRC_TARGET_DIR)/product/media_system_ext.mk)
+
+#
+# All components below go to product image
+#
+
+#
+# Special settings to skip mount product and system_ext on the device,
+# so this product can be tested isolated from those partitions.
+#
+$(call inherit-product, device/generic/common/mgsi/mgsi_release.mk)
+
+# Don't build super.img.
+PRODUCT_BUILD_SUPER_PARTITION := false
+
+# Instruct AM to enable framework's fallback home activity
+PRODUCT_SYSTEM_EXT_PROPERTIES += ro.system_user_home_needed=true
+# Add RRO needed by CSI
+PRODUCT_PACKAGE_OVERLAYS := device/generic/common/mgsi/overlay
+
+PRODUCT_SOONG_NAMESPACES += device/generic/goldfish
+
+PRODUCT_NAME := csi_arm
+PRODUCT_DEVICE := dummy_arm
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := arm CSI
diff --git a/mgsi/csi_x86_64.mk b/mgsi/csi_x86_64.mk
new file mode 100644
index 0000000..cceed35
--- /dev/null
+++ b/mgsi/csi_x86_64.mk
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2021 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.
+#
+
+#
+# All components inherited here go to system image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk)
+
+# Enable mainline checking
+PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed
+
+#
+# All components inherited here go to system_ext image
+#
+# VNDK snapshot is needed to support older vendor images
+$(call inherit-product, $(SRC_TARGET_DIR)/product/media_system_ext.mk)
+
+#
+# All components below go to product image
+#
+
+#
+# Special settings to skip mount product and system_ext on the device,
+# so this product can be tested isolated from those partitions.
+#
+$(call inherit-product, device/generic/common/mgsi/mgsi_release.mk)
+
+# Don't build super.img.
+PRODUCT_BUILD_SUPER_PARTITION := false
+
+# Instruct AM to enable framework's fallback home activity
+PRODUCT_SYSTEM_EXT_PROPERTIES += ro.system_user_home_needed=true
+# Add RRO needed by CSI
+PRODUCT_PACKAGE_OVERLAYS := device/generic/common/mgsi/overlay
+
+PRODUCT_SOONG_NAMESPACES += device/generic/goldfish
+
+PRODUCT_NAME := csi_x86_64
+PRODUCT_DEVICE := dummy_x86_64
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := x86_64 CSI