emulator: Add AOSP varient for car emulators

Current version of Car emulators are now renamed to aosp_<target>.
New targets inherit aosp_<target>.

bug: 38007152
Test: Local build
Change-Id: I2283c0a75e1f5e1052755eb2a89740a9944cad62
diff --git a/car-arm64/AndroidProducts.mk b/car-arm64/AndroidProducts.mk
index a11b8bd..8082350 100644
--- a/car-arm64/AndroidProducts.mk
+++ b/car-arm64/AndroidProducts.mk
@@ -15,4 +15,5 @@
 #
 
 PRODUCT_MAKEFILES := \
+    $(LOCAL_DIR)/aosp_car_emu_arm64.mk \
     $(LOCAL_DIR)/car_emu_arm64.mk
diff --git a/car-arm64/aosp_car_emu_arm64.mk b/car-arm64/aosp_car_emu_arm64.mk
new file mode 100644
index 0000000..e56b1b7
--- /dev/null
+++ b/car-arm64/aosp_car_emu_arm64.mk
@@ -0,0 +1,50 @@
+#
+#Copyright (C) 2017 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 += \
+    device/generic/car/common/bootanimations/bootanimation-832.zip:system/media/bootanimation.zip \
+    device/generic/car/common/init.car-emulator.rc:root/init.goldfish.rc
+
+$(call inherit-product, device/generic/car/common/product/aosp_arm64.mk)
+$(call inherit-product, packages/services/Car/car_product/build/car.mk)
+PRODUCT_PACKAGE_OVERLAYS := packages/services/Car/car_product/overlay
+
+# Overrides
+PRODUCT_BRAND := google
+PRODUCT_MODEL := Car on ARM emulator
+PRODUCT_NAME := aosp_car_emu_arm64
+PRODUCT_DEVICE := car-arm64
+
+PRODUCT_RESTRICT_VENDOR_FILES := false
+
+PRODUCT_PACKAGES += \
+   vehicle.default
+# Replace framework versions with dummy one, which is essentially
+# the same as removing the xml. Needs this as there is no easy
+# way to remove PRODUCT_COPY_FILES from inherited products.
+PRODUCT_COPY_FILES += \
+    device/generic/car/common/android.hardware.dummy.xml:system/etc/permissions/handheld_core_hardware.xml \
+    packages/services/Car/car_product/init/init.car.rc:root/init.car.rc \
+    packages/services/Car/car_product/init/init.bootstat.rc:root/init.bootstat.rc
+
+PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/android.hardware.type.automotive.xml:system/etc/permissions/android.hardware.type.automotive.xml \
+    frameworks/native/data/etc/android.hardware.screen.landscape.xml:system/etc/permissions/android.hardware.screen.landscape.xml
+
+PRODUCT_PROPERTY_OVERRIDES += \
+    android.car.drawer.unlimited=true \
+    android.car.hvac.demo=true \
+    com.android.car.radio.demo=true \
+    com.android.car.radio.demo.dual=true
diff --git a/car-arm64/car_emu_arm64.mk b/car-arm64/car_emu_arm64.mk
index 363a1a1..3e3cae9 100644
--- a/car-arm64/car_emu_arm64.mk
+++ b/car-arm64/car_emu_arm64.mk
@@ -13,38 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-PRODUCT_COPY_FILES += \
-    device/generic/car/common/bootanimations/bootanimation-832.zip:system/media/bootanimation.zip \
-    device/generic/car/common/init.car-emulator.rc:root/init.goldfish.rc
+$(call inherit-product, device/generic/car/car-arm64/aosp_car_emu_arm64.mk)
 
-$(call inherit-product, device/generic/car/common/product/aosp_arm64.mk)
-$(call inherit-product, packages/services/Car/car_product/build/car.mk)
-PRODUCT_PACKAGE_OVERLAYS := packages/services/Car/car_product/overlay
-
-# Overrides
-PRODUCT_BRAND := google
-PRODUCT_MODEL := Car on ARM emulator
 PRODUCT_NAME := car_emu_arm64
-PRODUCT_DEVICE := car-arm64
-
-PRODUCT_RESTRICT_VENDOR_FILES := false
-
-PRODUCT_PACKAGES += \
-   vehicle.default
-# Replace framework versions with dummy one, which is essentially
-# the same as removing the xml. Needs this as there is no easy
-# way to remove PRODUCT_COPY_FILES from inherited products.
-PRODUCT_COPY_FILES += \
-    device/generic/car/common/android.hardware.dummy.xml:system/etc/permissions/handheld_core_hardware.xml \
-    packages/services/Car/car_product/init/init.car.rc:root/init.car.rc \
-    packages/services/Car/car_product/init/init.bootstat.rc:root/init.bootstat.rc
-
-PRODUCT_COPY_FILES += \
-    frameworks/native/data/etc/android.hardware.type.automotive.xml:system/etc/permissions/android.hardware.type.automotive.xml \
-    frameworks/native/data/etc/android.hardware.screen.landscape.xml:system/etc/permissions/android.hardware.screen.landscape.xml
-
-PRODUCT_PROPERTY_OVERRIDES += \
-    android.car.drawer.unlimited=true \
-    android.car.hvac.demo=true \
-    com.android.car.radio.demo=true \
-    com.android.car.radio.demo.dual=true
diff --git a/car-arm64/vendorsetup.sh b/car-arm64/vendorsetup.sh
index 63d6503..584b8e0 100644
--- a/car-arm64/vendorsetup.sh
+++ b/car-arm64/vendorsetup.sh
@@ -21,3 +21,4 @@
 # function: add_lunch_combo generic-eng
 
 add_lunch_combo car_emu_arm64-userdebug
+add_lunch_combo aosp_car_emu_arm64-userdebug
diff --git a/car-armv7-a-neon/AndroidProducts.mk b/car-armv7-a-neon/AndroidProducts.mk
index 5e8836a..dbf3dc0 100644
--- a/car-armv7-a-neon/AndroidProducts.mk
+++ b/car-armv7-a-neon/AndroidProducts.mk
@@ -15,4 +15,5 @@
 #
 
 PRODUCT_MAKEFILES := \
-    $(LOCAL_DIR)/car_emu_arm.mk
+    $(LOCAL_DIR)/car_emu_arm.mk \
+    $(LOCAL_DIR)/aosp_car_emu_arm.mk
diff --git a/car-armv7-a-neon/aosp_car_emu_arm.mk b/car-armv7-a-neon/aosp_car_emu_arm.mk
new file mode 100644
index 0000000..f7f2fe5
--- /dev/null
+++ b/car-armv7-a-neon/aosp_car_emu_arm.mk
@@ -0,0 +1,51 @@
+#
+#Copyright (C) 2016 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 += \
+    device/generic/car/common/bootanimations/bootanimation-832.zip:system/media/bootanimation.zip \
+    device/generic/car/common/init.car-emulator.rc:root/init.goldfish.rc
+
+$(call inherit-product, device/generic/car/common/product/aosp_arm.mk)
+$(call inherit-product, packages/services/Car/car_product/build/car.mk)
+PRODUCT_PACKAGE_OVERLAYS := packages/services/Car/car_product/overlay
+
+# Overrides
+PRODUCT_BRAND := google
+PRODUCT_MODEL := Car on ARM emulator
+PRODUCT_NAME := aosp_car_emu_arm
+PRODUCT_DEVICE := car-armv7-a-neon
+
+PRODUCT_RESTRICT_VENDOR_FILES := false
+
+PRODUCT_PACKAGES += \
+   vehicle.default
+# Replace framework versions with dummy one, which is essentially
+# the same as removing the xml. Needs this as there is no easy
+# way to remove PRODUCT_COPY_FILES from inherited products.
+PRODUCT_COPY_FILES += \
+    device/generic/car/common/android.hardware.dummy.xml:system/etc/permissions/handheld_core_hardware.xml \
+    packages/services/Car/car_product/init/init.car.rc:root/init.car.rc \
+    packages/services/Car/car_product/init/init.bootstat.rc:root/init.bootstat.rc
+
+PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/android.hardware.type.automotive.xml:system/etc/permissions/android.hardware.type.automotive.xml \
+    frameworks/native/data/etc/android.hardware.screen.landscape.xml:system/etc/permissions/android.hardware.screen.landscape.xml \
+    frameworks/native/data/etc/android.software.freeform_window_management.xml:system/etc/permissions/android.software.freeform_window_management.xml
+
+PRODUCT_PROPERTY_OVERRIDES += \
+    android.car.drawer.unlimited=true \
+    android.car.hvac.demo=true \
+    com.android.car.radio.demo=true \
+    com.android.car.radio.demo.dual=true
diff --git a/car-armv7-a-neon/car_emu_arm.mk b/car-armv7-a-neon/car_emu_arm.mk
index 7e83ddf..047ff5f 100644
--- a/car-armv7-a-neon/car_emu_arm.mk
+++ b/car-armv7-a-neon/car_emu_arm.mk
@@ -13,39 +13,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-PRODUCT_COPY_FILES += \
-    device/generic/car/common/bootanimations/bootanimation-832.zip:system/media/bootanimation.zip \
-    device/generic/car/common/init.car-emulator.rc:root/init.goldfish.rc
-
-$(call inherit-product, device/generic/car/common/product/aosp_arm.mk)
-$(call inherit-product, packages/services/Car/car_product/build/car.mk)
-PRODUCT_PACKAGE_OVERLAYS := packages/services/Car/car_product/overlay
-
-# Overrides
-PRODUCT_BRAND := google
-PRODUCT_MODEL := Car on ARM emulator
+$(call inherit-product, device/generic/car/car-armv7-a-neon/aosp_car_emu_arm.mk)
 PRODUCT_NAME := car_emu_arm
-PRODUCT_DEVICE := car-armv7-a-neon
-
-PRODUCT_RESTRICT_VENDOR_FILES := false
-
-PRODUCT_PACKAGES += \
-   vehicle.default
-# Replace framework versions with dummy one, which is essentially
-# the same as removing the xml. Needs this as there is no easy
-# way to remove PRODUCT_COPY_FILES from inherited products.
-PRODUCT_COPY_FILES += \
-    device/generic/car/common/android.hardware.dummy.xml:system/etc/permissions/handheld_core_hardware.xml \
-    packages/services/Car/car_product/init/init.car.rc:root/init.car.rc \
-    packages/services/Car/car_product/init/init.bootstat.rc:root/init.bootstat.rc
-
-PRODUCT_COPY_FILES += \
-    frameworks/native/data/etc/android.hardware.type.automotive.xml:system/etc/permissions/android.hardware.type.automotive.xml \
-    frameworks/native/data/etc/android.hardware.screen.landscape.xml:system/etc/permissions/android.hardware.screen.landscape.xml \
-    frameworks/native/data/etc/android.software.freeform_window_management.xml:system/etc/permissions/android.software.freeform_window_management.xml
-
-PRODUCT_PROPERTY_OVERRIDES += \
-    android.car.drawer.unlimited=true \
-    android.car.hvac.demo=true \
-    com.android.car.radio.demo=true \
-    com.android.car.radio.demo.dual=true
diff --git a/car-armv7-a-neon/vendorsetup.sh b/car-armv7-a-neon/vendorsetup.sh
index 89fd301..b6f5de7 100644
--- a/car-armv7-a-neon/vendorsetup.sh
+++ b/car-armv7-a-neon/vendorsetup.sh
@@ -21,3 +21,4 @@
 # function: add_lunch_combo generic-eng
 
 add_lunch_combo car_emu_arm-userdebug
+add_lunch_combo aosp_car_emu_arm-userdebug
diff --git a/car-x86_64/AndroidProducts.mk b/car-x86_64/AndroidProducts.mk
index 5e1957a..b565847 100644
--- a/car-x86_64/AndroidProducts.mk
+++ b/car-x86_64/AndroidProducts.mk
@@ -15,4 +15,5 @@
 #
 
 PRODUCT_MAKEFILES := \
-    $(LOCAL_DIR)/car_emu_x86_64.mk
+    $(LOCAL_DIR)/car_emu_x86_64.mk \
+    $(LOCAL_DIR)/aosp_car_emu_x86_64.mk
diff --git a/car-x86_64/aosp_car_emu_x86_64.mk b/car-x86_64/aosp_car_emu_x86_64.mk
new file mode 100644
index 0000000..e568bd0
--- /dev/null
+++ b/car-x86_64/aosp_car_emu_x86_64.mk
@@ -0,0 +1,50 @@
+#
+#Copyright (C) 2017 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 += \
+    device/generic/car/common/bootanimations/bootanimation-832.zip:system/media/bootanimation.zip \
+    device/generic/car/common/init.car-emulator.rc:root/init.goldfish.rc
+
+$(call inherit-product, device/generic/car/common/product/aosp_x86_64.mk)
+$(call inherit-product, packages/services/Car/car_product/build/car.mk)
+PRODUCT_PACKAGE_OVERLAYS := packages/services/Car/car_product/overlay
+
+# Overrides
+PRODUCT_BRAND := google
+PRODUCT_MODEL := Car on x86 emulator
+PRODUCT_NAME := aosp_car_emu_x86_64
+PRODUCT_DEVICE := car-x86_64
+
+PRODUCT_RESTRICT_VENDOR_FILES := false
+
+PRODUCT_PACKAGES += \
+   vehicle.default
+# Replace framework versions with dummy one, which is essentially
+# the same as removing the xml. Needs this as there is no easy
+# way to remove PRODUCT_COPY_FILES from inherited products.
+PRODUCT_COPY_FILES += \
+    device/generic/car/common/android.hardware.dummy.xml:system/etc/permissions/handheld_core_hardware.xml \
+    packages/services/Car/car_product/init/init.car.rc:root/init.car.rc \
+    packages/services/Car/car_product/init/init.bootstat.rc:root/init.bootstat.rc
+
+PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/android.hardware.type.automotive.xml:system/etc/permissions/android.hardware.type.automotive.xml \
+    frameworks/native/data/etc/android.hardware.screen.landscape.xml:system/etc/permissions/android.hardware.screen.landscape.xml
+
+PRODUCT_PROPERTY_OVERRIDES += \
+    android.car.drawer.unlimited=true \
+    android.car.hvac.demo=true \
+    com.android.car.radio.demo=true \
+    com.android.car.radio.demo.dual=true
diff --git a/car-x86_64/car_emu_x86_64.mk b/car-x86_64/car_emu_x86_64.mk
index a3c6e65..583eb68 100644
--- a/car-x86_64/car_emu_x86_64.mk
+++ b/car-x86_64/car_emu_x86_64.mk
@@ -13,38 +13,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-PRODUCT_COPY_FILES += \
-    device/generic/car/common/bootanimations/bootanimation-832.zip:system/media/bootanimation.zip \
-    device/generic/car/common/init.car-emulator.rc:root/init.goldfish.rc
-
-$(call inherit-product, device/generic/car/common/product/aosp_x86_64.mk)
-$(call inherit-product, packages/services/Car/car_product/build/car.mk)
-PRODUCT_PACKAGE_OVERLAYS := packages/services/Car/car_product/overlay
-
-# Overrides
-PRODUCT_BRAND := google
-PRODUCT_MODEL := Car on x86 emulator
+$(call inherit-product, device/generic/car/car-x86_64/aosp_car_emu_x86_64.mk)
 PRODUCT_NAME := car_emu_x86_64
-PRODUCT_DEVICE := car-x86_64
-
-PRODUCT_RESTRICT_VENDOR_FILES := false
-
-PRODUCT_PACKAGES += \
-   vehicle.default
-# Replace framework versions with dummy one, which is essentially
-# the same as removing the xml. Needs this as there is no easy
-# way to remove PRODUCT_COPY_FILES from inherited products.
-PRODUCT_COPY_FILES += \
-    device/generic/car/common/android.hardware.dummy.xml:system/etc/permissions/handheld_core_hardware.xml \
-    packages/services/Car/car_product/init/init.car.rc:root/init.car.rc \
-    packages/services/Car/car_product/init/init.bootstat.rc:root/init.bootstat.rc
-
-PRODUCT_COPY_FILES += \
-    frameworks/native/data/etc/android.hardware.type.automotive.xml:system/etc/permissions/android.hardware.type.automotive.xml \
-    frameworks/native/data/etc/android.hardware.screen.landscape.xml:system/etc/permissions/android.hardware.screen.landscape.xml
-
-PRODUCT_PROPERTY_OVERRIDES += \
-    android.car.drawer.unlimited=true \
-    android.car.hvac.demo=true \
-    com.android.car.radio.demo=true \
-    com.android.car.radio.demo.dual=true
diff --git a/car-x86_64/vendorsetup.sh b/car-x86_64/vendorsetup.sh
index 5f16636..1c5c623 100644
--- a/car-x86_64/vendorsetup.sh
+++ b/car-x86_64/vendorsetup.sh
@@ -21,3 +21,4 @@
 # function: add_lunch_combo generic-eng
 
 add_lunch_combo car_emu_x86_64-userdebug
+add_lunch_combo aosp_car_emu_x86_64-userdebug