Merge "Force generic system image to load dex pre-opt from system" into oc-mr1-dev
diff --git a/core/Makefile b/core/Makefile
index af3c4cb..c6c9ebf 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -2740,6 +2740,26 @@
.PHONY: dalvikfiles
dalvikfiles: $(INTERNAL_DALVIK_MODULES)
+ifeq ($(BUILD_QEMU_IMAGES),true)
+INSTALLED_QEMU_SYSTEMIMAGE := $(PRODUCT_OUT)/system-qemu.img
+MK_QEMU_IMAGE_SH := device/generic/goldfish/tools/mk_qemu_image.sh
+SGDISK_HOST := $(HOST_OUT_EXECUTABLES)/sgdisk
+$(INSTALLED_QEMU_SYSTEMIMAGE): $(INSTALLED_SYSTEMIMAGE) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST)
+ @echo Create system-qemu.img
+ (export SGDISK=$(SGDISK_HOST); $(MK_QEMU_IMAGE_SH) ${PRODUCT_OUT}/system.img)
+
+systemimage: $(INSTALLED_QEMU_SYSTEMIMAGE)
+droidcore: $(INSTALLED_QEMU_SYSTEMIMAGE)
+ifeq ($(BOARD_USES_VENDORIMAGE),true)
+INSTALLED_QEMU_VENDORIMAGE := $(PRODUCT_OUT)/vendor-qemu.img
+$(INSTALLED_QEMU_VENDORIMAGE): $(INSTALLED_VENDORIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST)
+ @echo Create vendor-qemu.img
+ (export SGDISK=$(SGDISK_HOST); $(MK_QEMU_IMAGE_SH) ${PRODUCT_OUT}/vendor.img)
+
+vendorimage: $(INSTALLED_QEMU_VENDORIMAGE)
+droidcore: $(INSTALLED_QEMU_VENDORIMAGE)
+endif
+endif
# -----------------------------------------------------------------
# The emulator package
ifeq ($(BUILD_EMULATOR),true)
@@ -2835,6 +2855,7 @@
$(SYMBOLS_ZIP) \
$(COVERAGE_ZIP) \
$(INSTALLED_SYSTEMIMAGE) \
+ $(INSTALLED_QEMU_SYSTEMIMAGE) \
$(INSTALLED_USERDATAIMAGE_TARGET) \
$(INSTALLED_RAMDISK_TARGET) \
$(INSTALLED_SDK_BUILD_PROP_TARGET) \
diff --git a/core/binary.mk b/core/binary.mk
index bbc3550..000b005 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -270,7 +270,7 @@
endif
ifneq ($(LOCAL_USE_VNDK),)
- my_cflags += -D__ANDROID_API__=__ANDROID_API_FUTURE__
+ my_cflags += -D__ANDROID_API__=__ANDROID_API_FUTURE__ -D__ANDROID_VNDK__
endif
ifndef LOCAL_IS_HOST_MODULE
@@ -464,6 +464,8 @@
my_linker := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)LINKER)
endif
+# Modules from soong do not need this since the dependencies are already handled there.
+ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
include $(BUILD_SYSTEM)/config_sanitizers.mk
ifneq ($(LOCAL_NO_LIBCOMPILER_RT),true)
@@ -477,6 +479,7 @@
ifeq ($($(my_prefix)OS),windows)
my_static_libraries += libwinpthread
endif
+endif # this module is not from soong
ifneq ($(filter ../%,$(my_src_files)),)
my_soong_problems += dotdot_srcs
@@ -1324,14 +1327,9 @@
## switch all soong libraries over to the /vendor
## variant.
####################################################
- ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
- # Soong-built libraries should always use the .vendor variant
- my_whole_static_libraries := $(addsuffix .vendor,$(my_whole_static_libraries))
- my_static_libraries := $(addsuffix .vendor,$(my_static_libraries))
- my_shared_libraries := $(addsuffix .vendor,$(my_shared_libraries))
- my_system_shared_libraries := $(addsuffix .vendor,$(my_system_shared_libraries))
- my_header_libraries := $(addsuffix .vendor,$(my_header_libraries))
- else
+ ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
+ # We don't do this renaming for soong-defined modules since they already have correct
+ # names (with .vendor suffix when necessary) in their LOCAL_*_LIBRARIES.
my_whole_static_libraries := $(foreach l,$(my_whole_static_libraries),\
$(if $(SPLIT_VENDOR.STATIC_LIBRARIES.$(l)),$(l).vendor,$(l)))
my_static_libraries := $(foreach l,$(my_static_libraries),\
@@ -1375,7 +1373,7 @@
import_includes := $(intermediates)/import_includes
import_includes_deps := $(strip \
$(if $(LOCAL_USE_VNDK),\
- $(call intermediates-dir-for,HEADER_LIBRARIES,device_kernel_headers.vendor,$(my_kind),,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross))/export_includes) \
+ $(call intermediates-dir-for,HEADER_LIBRARIES,device_kernel_headers,$(my_kind),,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross))/export_includes) \
$(foreach l, $(installed_shared_library_module_names), \
$(call intermediates-dir-for,SHARED_LIBRARIES,$(l),$(my_kind),,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross))/export_includes) \
$(foreach l, $(my_static_libraries) $(my_whole_static_libraries), \
diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk
index 47fdba6..0f2bb86 100644
--- a/core/dex_preopt_libart.mk
+++ b/core/dex_preopt_libart.mk
@@ -11,9 +11,9 @@
DEX2OAT := $(HOST_OUT_EXECUTABLES)/dex2oatd$(HOST_EXECUTABLE_SUFFIX)
endif
-# Pass special classpath to skip uses library check.
+# Pass special class loader context to skip the classpath and collision check.
# Should modify build system to pass used libraries properly later.
-DEX2OAT_CLASSPATH := "&"
+DEX2OAT_CLASS_LOADER_CONTEXT := "&"
DEX2OAT_DEPENDENCY += $(DEX2OAT)
@@ -146,7 +146,7 @@
$(hide) mkdir -p $(dir $(2))
$(hide) ANDROID_LOG_TAGS="*:e" $(DEX2OAT) \
--runtime-arg -Xms$(DEX2OAT_XMS) --runtime-arg -Xmx$(DEX2OAT_XMX) \
- --runtime-arg -classpath --runtime-arg $(DEX2OAT_CLASSPATH) \
+ --class-loader-context=$(DEX2OAT_CLASS_LOADER_CONTEXT) \
--boot-image=$(PRIVATE_DEX_PREOPT_IMAGE_LOCATION) \
--dex-file=$(1) \
--dex-location=$(PRIVATE_DEX_LOCATION) \
diff --git a/core/install_jni_libs_internal.mk b/core/install_jni_libs_internal.mk
index 0e92153..b5f10cf 100644
--- a/core/install_jni_libs_internal.mk
+++ b/core/install_jni_libs_internal.mk
@@ -116,7 +116,7 @@
else
my_link_type := app:platform
my_warn_types :=
-my_allowed_types := native:ndk native:platform
+my_allowed_types := native:ndk native:platform native:vendor
endif
my_link_deps := $(addprefix SHARED_LIBRARIES:,$(LOCAL_JNI_SHARED_LIBRARIES))
diff --git a/core/link_type.mk b/core/link_type.mk
index ff525cb..f7604ff 100644
--- a/core/link_type.mk
+++ b/core/link_type.mk
@@ -10,7 +10,7 @@
# my_link_deps: the dependencies, in the form of <MODULE_CLASS>:<name>
#
-my_link_prefix := LINK_TYPE:$(call find-idf-prefix,$(my_kind),$(my_host_cross)):$(if $(my_common),$(my_common):_,_:$(if $(my_2nd_arch_prefix),$(my_2nd_arch_prefix),_))
+my_link_prefix := LINK_TYPE:$(call find-idf-prefix,$(my_kind),$(my_host_cross))$(if $(filter AUX,$(my_kind)),-$(AUX_OS_VARIANT)):$(if $(my_common),$(my_common):_,_:$(if $(my_2nd_arch_prefix),$(my_2nd_arch_prefix),_))
link_type := $(my_link_prefix):$(LOCAL_MODULE_CLASS):$(LOCAL_MODULE)
ALL_LINK_TYPES := $(ALL_LINK_TYPES) $(link_type)
$(link_type).TYPE := $(my_link_type)
diff --git a/core/main.mk b/core/main.mk
index 0aab4f4..81ab0be 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -610,7 +610,7 @@
# - TARGET
# - HOST
# - HOST_CROSS
-# - AUX
+# - AUX-<variant-name>
# 3: Whether to use the common intermediates directory or not
# - _
# - COMMON
@@ -637,9 +637,15 @@
link_type_error :=
-define link-type-prefix
+define link-type-prefix-base
$(word 2,$(subst :,$(space),$(1)))
endef
+define link-type-prefix
+$(if $(filter AUX-%,$(link-type-prefix-base)),$(patsubst AUX-%,AUX,$(link-type-prefix-base)),$(link-type-prefix-base))
+endef
+define link-type-aux-variant
+$(if $(filter AUX-%,$(link-type-prefix-base)),$(patsubst AUX-%,%,$(link-type-prefix-base)))
+endef
define link-type-common
$(patsubst _,,$(word 3,$(subst :,$(space),$(1))))
endef
@@ -729,7 +735,11 @@
# 2. The jni_link_type rule for embedded native code
# 3. The 2ND_jni_link_type for the second architecture native code
define link-type-file
-$(call intermediates-dir-for,$(link-type-class),$(link-type-name),$(filter AUX HOST HOST_CROSS,$(link-type-prefix)),$(link-type-common),$(link-type-2ndarchprefix),$(filter HOST_CROSS,$(link-type-prefix)))/$(if $(filter APPS,$(link-type-class)),$(if $(link-type-common),,$(link-type-2ndarchprefix)jni_))link_type
+$(eval _ltf_aux_variant:=$(link-type-aux-variant))\
+$(if $(_ltf_aux_variant),$(call aux-variant-load-env,$(_ltf_aux_variant)))\
+$(call intermediates-dir-for,$(link-type-class),$(link-type-name),$(filter AUX HOST HOST_CROSS,$(link-type-prefix)),$(link-type-common),$(link-type-2ndarchprefix),$(filter HOST_CROSS,$(link-type-prefix)))/$(if $(filter APPS,$(link-type-class)),$(if $(link-type-common),,$(link-type-2ndarchprefix)jni_))link_type\
+$(if $(_ltf_aux_variant),$(call aux-variant-load-env,none))\
+$(eval _ltf_aux_variant:=)
endef
# Write out the file-based link_type rules for the ALLOW_MISSING_DEPENDENCIES
diff --git a/core/pdk_config.mk b/core/pdk_config.mk
index 8c986d6..92ba8b7 100644
--- a/core/pdk_config.mk
+++ b/core/pdk_config.mk
@@ -18,6 +18,7 @@
target/common/obj/JAVA_LIBRARIES/core-oj_intermediates \
target/common/obj/JAVA_LIBRARIES/core-libart_intermediates \
target/common/obj/JAVA_LIBRARIES/legacy-test_intermediates \
+ target/common/obj/JAVA_LIBRARIES/legacy-android-test_intermediates \
target/common/obj/JAVA_LIBRARIES/ext_intermediates \
target/common/obj/JAVA_LIBRARIES/framework_intermediates \
target/common/obj/JAVA_LIBRARIES/ims-common_intermediates \
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index c12084f..de71111 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -84,7 +84,11 @@
endif
ifdef LOCAL_USE_VNDK
- SPLIT_VENDOR.$(LOCAL_MODULE_CLASS).$(patsubst %.vendor,%,$(LOCAL_MODULE)) := 1
+ name_without_suffix := $(patsubst %.vendor,%,$(LOCAL_MODULE))
+ ifneq ($(name_without_suffix),$(LOCAL_MODULE)
+ SPLIT_VENDOR.$(LOCAL_MODULE_CLASS).$(name_without_suffix) := 1
+ endif
+ name_without_suffix :=
endif
endif
@@ -172,9 +176,7 @@
# Extra shared libraries introduced by LOCAL_CXX_STL.
include $(BUILD_SYSTEM)/cxx_stl_setup.mk
ifdef LOCAL_USE_VNDK
- ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
- my_shared_libraries := $(addsuffix .vendor,$(my_shared_libraries))
- else
+ ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
my_shared_libraries := $(foreach l,$(my_shared_libraries),\
$(if $(SPLIT_VENDOR.SHARED_LIBRARIES.$(l)),$(l).vendor,$(l)))
endif
diff --git a/core/tasks/sdk-addon.mk b/core/tasks/sdk-addon.mk
index 610e0ce..e3bd47d 100644
--- a/core/tasks/sdk-addon.mk
+++ b/core/tasks/sdk-addon.mk
@@ -63,7 +63,7 @@
# Files copied in the system-image directory
files_to_copy += \
- $(addon_dir_img):$(BUILT_SYSTEMIMAGE):images/$(TARGET_CPU_ABI)/system.img \
+ $(addon_dir_img):$(INSTALLED_QEMU_SYSTEMIMAGE):images/$(TARGET_CPU_ABI)/system.img \
$(addon_dir_img):$(BUILT_USERDATAIMAGE_TARGET):images/$(TARGET_CPU_ABI)/userdata.img \
$(addon_dir_img):$(BUILT_RAMDISK_TARGET):images/$(TARGET_CPU_ABI)/ramdisk.img \
$(addon_dir_img):$(PRODUCT_OUT)/system/build.prop:images/$(TARGET_CPU_ABI)/build.prop \
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index 49f65a9..ee4a467 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -40,7 +40,7 @@
DEFAULT_PLATFORM_VERSION := OPM1
MIN_PLATFORM_VERSION := OPM1
-MAX_PLATFORM_VERSION := PPR1
+MAX_PLATFORM_VERSION := OPM1
ALLOWED_VERSIONS := $(call allowed-platform-versions,\
$(MIN_PLATFORM_VERSION),\
@@ -71,15 +71,14 @@
# frameworks/support/compat/gingerbread/android/support/v4/os/BuildCompat.java
# When you change PLATFORM_VERSION for a given PLATFORM_SDK_VERSION
-# please add that PLATFORM_VERSION to the following text file:
+# please add that PLATFORM_VERSION as well as clean up obsolete PLATFORM_VERSION's
+# in the following text file:
# cts/tests/tests/os/assets/platform_versions.txt
PLATFORM_VERSION.OPM1 := OMR1
-PLATFORM_VERSION.PPR1 := P
# These are the current development codenames, if the build is not a final
# release build. If this is a final release build, it is simply "REL".
PLATFORM_VERSION_CODENAME.OPM1 := OMR1
-PLATFORM_VERSION_CODENAME.PPR1 := P
ifndef PLATFORM_VERSION
PLATFORM_VERSION := $(PLATFORM_VERSION.$(TARGET_PLATFORM_VERSION))
diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk
index 946e480..609cf25 100644
--- a/target/board/generic/BoardConfig.mk
+++ b/target/board/generic/BoardConfig.mk
@@ -43,6 +43,7 @@
# Build OpenGLES emulation guest and host libraries
BUILD_EMULATOR_OPENGL := true
+BUILD_QEMU_IMAGES := true
# Build and enable the OpenGL ES View renderer. When running on the emulator,
# the GLES renderer disables itself if host GL acceleration isn't available.
diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk
index 5917425..56a86b8 100644
--- a/target/board/generic_arm64/BoardConfig.mk
+++ b/target/board/generic_arm64/BoardConfig.mk
@@ -74,6 +74,7 @@
# Build OpenGLES emulation host and guest libraries
BUILD_EMULATOR_OPENGL := true
+BUILD_QEMU_IMAGES := true
# Build and enable the OpenGL ES View renderer. When running on the emulator,
# the GLES renderer disables itself if host GL acceleration isn't available.
diff --git a/target/board/generic_arm_ab/BoardConfig.mk b/target/board/generic_arm_ab/BoardConfig.mk
new file mode 100644
index 0000000..58d597b
--- /dev/null
+++ b/target/board/generic_arm_ab/BoardConfig.mk
@@ -0,0 +1,68 @@
+#
+# 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.
+#
+
+# Common boardconfig settings for generic AOSP products targetting mobile
+# (phone/table) devices.
+
+# System properties
+TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop
+
+# Bootloader is not part of generic AOSP image
+TARGET_NO_BOOTLOADER := true
+
+# Kernel is also not part of generic AOSP image
+TARGET_NO_KERNEL := true
+
+# system.img is always ext4 with sparse option
+TARGET_USERIMAGES_USE_EXT4 := true
+TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false
+TARGET_USES_MKE2FS := true
+
+# Enable dex pre-opt to speed up initial boot
+ifeq ($(HOST_OS),linux)
+ ifeq ($(WITH_DEXPREOPT),)
+ WITH_DEXPREOPT := true
+ WITH_DEXPREOPT_PIC := true
+ ifneq ($(TARGET_BUILD_VARIANT),user)
+ # Retain classes.dex in APK's for non-user builds
+ DEX_PREOPT_DEFAULT := nostripping
+ endif
+ endif
+endif
+
+# Generic AOSP image always requires separate vendor.img
+TARGET_COPY_OUT_VENDOR := vendor
+
+# Generic AOSP image does NOT support HWC1
+TARGET_USES_HWC2 := true
+
+TARGET_ARCH := arm
+TARGET_ARCH_VARIANT := armv7-a-neon
+TARGET_CPU_ABI := armeabi-v7a
+TARGET_CPU_ABI2 := armeabi
+TARGET_CPU_VARIANT := generic
+
+# Enable A/B update
+TARGET_NO_RECOVERY := true
+BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
+
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736
+
+# TODO(b/35790399): remove when b/35790399 is fixed.
+BOARD_NAND_SPARE_SIZE := 0
+BOARD_FLASH_BLOCK_SIZE := 512
+
+BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
diff --git a/target/board/generic_mips/BoardConfig.mk b/target/board/generic_mips/BoardConfig.mk
index c36cc4a..cd29f35 100644
--- a/target/board/generic_mips/BoardConfig.mk
+++ b/target/board/generic_mips/BoardConfig.mk
@@ -51,6 +51,7 @@
# Build OpenGLES emulation guest and host libraries
BUILD_EMULATOR_OPENGL := true
+BUILD_QEMU_IMAGES := true
# Build and enable the OpenGL ES View renderer. When running on the emulator,
# the GLES renderer disables itself if host GL acceleration isn't available.
diff --git a/target/board/generic_mips64/BoardConfig.mk b/target/board/generic_mips64/BoardConfig.mk
index 4798e3f..17aae27 100644
--- a/target/board/generic_mips64/BoardConfig.mk
+++ b/target/board/generic_mips64/BoardConfig.mk
@@ -66,6 +66,7 @@
# Build OpenGLES emulation guest and host libraries
BUILD_EMULATOR_OPENGL := true
+BUILD_QEMU_IMAGES := true
# Build and enable the OpenGL ES View renderer. When running on the emulator,
# the GLES renderer disables itself if host GL acceleration isn't available.
diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk
index 26b2944..08bd6d1 100644
--- a/target/board/generic_x86/BoardConfig.mk
+++ b/target/board/generic_x86/BoardConfig.mk
@@ -31,6 +31,10 @@
# Build OpenGLES emulation host and guest libraries
BUILD_EMULATOR_OPENGL := true
+# Build partitioned system.img and vendor.img (if applicable)
+# for qemu, otherwise, init cannot find PART_NAME
+BUILD_QEMU_IMAGES := true
+
# Build and enable the OpenGL ES View renderer. When running on the emulator,
# the GLES renderer disables itself if host GL acceleration isn't available.
USE_OPENGL_RENDERER := true
diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk
index 9b8e5c8..2499199 100755
--- a/target/board/generic_x86_64/BoardConfig.mk
+++ b/target/board/generic_x86_64/BoardConfig.mk
@@ -36,6 +36,7 @@
# Build OpenGLES emulation host and guest libraries
BUILD_EMULATOR_OPENGL := true
+BUILD_QEMU_IMAGES := true
# Build and enable the OpenGL ES View renderer. When running on the emulator,
# the GLES renderer disables itself if host GL acceleration isn't available.
diff --git a/target/board/generic_x86_64_a/BoardConfig.mk b/target/board/generic_x86_64_a/BoardConfig.mk
new file mode 100644
index 0000000..bd1f750
--- /dev/null
+++ b/target/board/generic_x86_64_a/BoardConfig.mk
@@ -0,0 +1,68 @@
+#
+# 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.
+#
+
+# Common boardconfig settings for generic AOSP products targetting mobile
+# (phone/table) devices.
+
+# System properties
+TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop
+
+# Bootloader is not part of generic AOSP image
+TARGET_NO_BOOTLOADER := true
+
+# Kernel is also not part of generic AOSP image
+TARGET_NO_KERNEL := true
+
+# system.img is always ext4 with sparse option
+TARGET_USERIMAGES_USE_EXT4 := true
+TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false
+TARGET_USES_MKE2FS := true
+
+# Enable dex pre-opt to speed up initial boot
+ifeq ($(HOST_OS),linux)
+ ifeq ($(WITH_DEXPREOPT),)
+ WITH_DEXPREOPT := true
+ WITH_DEXPREOPT_PIC := true
+ ifneq ($(TARGET_BUILD_VARIANT),user)
+ # Retain classes.dex in APK's for non-user builds
+ DEX_PREOPT_DEFAULT := nostripping
+ endif
+ endif
+endif
+
+# Generic AOSP image always requires separate vendor.img
+TARGET_COPY_OUT_VENDOR := vendor
+
+# Generic AOSP image does NOT support HWC1
+TARGET_USES_HWC2 := true
+
+TARGET_CPU_ABI := x86_64
+TARGET_ARCH := x86_64
+TARGET_ARCH_VARIANT := x86_64
+
+TARGET_2ND_CPU_ABI := x86
+TARGET_2ND_ARCH := x86
+TARGET_2ND_ARCH_VARIANT := x86_64
+
+TARGET_USES_64_BIT_BINDER := true
+
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB
+
+# TODO(b/35790399): remove when b/35790399 is fixed.
+BOARD_NAND_SPARE_SIZE := 0
+BOARD_FLASH_BLOCK_SIZE := 512
+
+BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
diff --git a/target/board/generic_x86_64_ab/BoardConfig.mk b/target/board/generic_x86_64_ab/BoardConfig.mk
new file mode 100644
index 0000000..41bd7b7
--- /dev/null
+++ b/target/board/generic_x86_64_ab/BoardConfig.mk
@@ -0,0 +1,71 @@
+#
+# 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.
+#
+
+# Common boardconfig settings for generic AOSP products targetting mobile
+# (phone/table) devices.
+
+# System properties
+TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop
+
+# Bootloader is not part of generic AOSP image
+TARGET_NO_BOOTLOADER := true
+
+# Kernel is also not part of generic AOSP image
+TARGET_NO_KERNEL := true
+
+# system.img is always ext4 with sparse option
+TARGET_USERIMAGES_USE_EXT4 := true
+TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false
+TARGET_USES_MKE2FS := true
+
+# Enable dex pre-opt to speed up initial boot
+ifeq ($(HOST_OS),linux)
+ ifeq ($(WITH_DEXPREOPT),)
+ WITH_DEXPREOPT := true
+ WITH_DEXPREOPT_PIC := true
+ ifneq ($(TARGET_BUILD_VARIANT),user)
+ # Retain classes.dex in APK's for non-user builds
+ DEX_PREOPT_DEFAULT := nostripping
+ endif
+ endif
+endif
+
+# Generic AOSP image always requires separate vendor.img
+TARGET_COPY_OUT_VENDOR := vendor
+
+# Generic AOSP image does NOT support HWC1
+TARGET_USES_HWC2 := true
+
+TARGET_CPU_ABI := x86_64
+TARGET_ARCH := x86_64
+TARGET_ARCH_VARIANT := x86_64
+
+TARGET_2ND_CPU_ABI := x86
+TARGET_2ND_ARCH := x86
+TARGET_2ND_ARCH_VARIANT := x86_64
+
+TARGET_USES_64_BIT_BINDER := true
+
+# Enable A/B update
+BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
+
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB
+
+# TODO(b/35790399): remove when b/35790399 is fixed.
+BOARD_NAND_SPARE_SIZE := 0
+BOARD_FLASH_BLOCK_SIZE := 512
+
+BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
diff --git a/target/board/generic_x86_a/BoardConfig.mk b/target/board/generic_x86_a/BoardConfig.mk
new file mode 100644
index 0000000..4ca6ebe
--- /dev/null
+++ b/target/board/generic_x86_a/BoardConfig.mk
@@ -0,0 +1,62 @@
+#
+# 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.
+#
+
+# Common boardconfig settings for generic AOSP products targetting mobile
+# (phone/table) devices.
+
+# System properties
+TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop
+
+# Bootloader is not part of generic AOSP image
+TARGET_NO_BOOTLOADER := true
+
+# Kernel is also not part of generic AOSP image
+TARGET_NO_KERNEL := true
+
+# system.img is always ext4 with sparse option
+TARGET_USERIMAGES_USE_EXT4 := true
+TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false
+TARGET_USES_MKE2FS := true
+
+# Enable dex pre-opt to speed up initial boot
+ifeq ($(HOST_OS),linux)
+ ifeq ($(WITH_DEXPREOPT),)
+ WITH_DEXPREOPT := true
+ WITH_DEXPREOPT_PIC := true
+ ifneq ($(TARGET_BUILD_VARIANT),user)
+ # Retain classes.dex in APK's for non-user builds
+ DEX_PREOPT_DEFAULT := nostripping
+ endif
+ endif
+endif
+
+# Generic AOSP image always requires separate vendor.img
+TARGET_COPY_OUT_VENDOR := vendor
+
+# Generic AOSP image does NOT support HWC1
+TARGET_USES_HWC2 := true
+
+TARGET_CPU_ABI := x86
+TARGET_ARCH := x86
+TARGET_ARCH_VARIANT := x86
+
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB
+
+# TODO(b/35790399): remove when b/35790399 is fixed.
+BOARD_NAND_SPARE_SIZE := 0
+BOARD_FLASH_BLOCK_SIZE := 512
+
+BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
diff --git a/target/board/generic_x86_ab/BoardConfig.mk b/target/board/generic_x86_ab/BoardConfig.mk
new file mode 100644
index 0000000..6a28667
--- /dev/null
+++ b/target/board/generic_x86_ab/BoardConfig.mk
@@ -0,0 +1,65 @@
+#
+# 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.
+#
+
+# Common boardconfig settings for generic AOSP products targetting mobile
+# (phone/table) devices.
+
+# System properties
+TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop
+
+# Bootloader is not part of generic AOSP image
+TARGET_NO_BOOTLOADER := true
+
+# Kernel is also not part of generic AOSP image
+TARGET_NO_KERNEL := true
+
+# system.img is always ext4 with sparse option
+TARGET_USERIMAGES_USE_EXT4 := true
+TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false
+TARGET_USES_MKE2FS := true
+
+# Enable dex pre-opt to speed up initial boot
+ifeq ($(HOST_OS),linux)
+ ifeq ($(WITH_DEXPREOPT),)
+ WITH_DEXPREOPT := true
+ WITH_DEXPREOPT_PIC := true
+ ifneq ($(TARGET_BUILD_VARIANT),user)
+ # Retain classes.dex in APK's for non-user builds
+ DEX_PREOPT_DEFAULT := nostripping
+ endif
+ endif
+endif
+
+# Generic AOSP image always requires separate vendor.img
+TARGET_COPY_OUT_VENDOR := vendor
+
+# Generic AOSP image does NOT support HWC1
+TARGET_USES_HWC2 := true
+
+TARGET_CPU_ABI := x86
+TARGET_ARCH := x86
+TARGET_ARCH_VARIANT := x86
+
+# Enable A/B update
+BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
+
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB
+
+# TODO(b/35790399): remove when b/35790399 is fixed.
+BOARD_NAND_SPARE_SIZE := 0
+BOARD_FLASH_BLOCK_SIZE := 512
+
+BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
diff --git a/target/product/AndroidProducts.mk b/target/product/AndroidProducts.mk
index 285fc39..9e2adee 100644
--- a/target/product/AndroidProducts.mk
+++ b/target/product/AndroidProducts.mk
@@ -52,8 +52,11 @@
$(LOCAL_DIR)/generic_mips.mk \
$(LOCAL_DIR)/aosp_arm.mk \
$(LOCAL_DIR)/aosp_arm_a.mk \
+ $(LOCAL_DIR)/aosp_arm_ab.mk \
$(LOCAL_DIR)/full.mk \
$(LOCAL_DIR)/aosp_x86.mk \
+ $(LOCAL_DIR)/aosp_x86_a.mk \
+ $(LOCAL_DIR)/aosp_x86_ab.mk \
$(LOCAL_DIR)/aosp_x86_arm.mk \
$(LOCAL_DIR)/full_x86.mk \
$(LOCAL_DIR)/aosp_mips.mk \
@@ -63,6 +66,8 @@
$(LOCAL_DIR)/aosp_arm64_ab.mk \
$(LOCAL_DIR)/aosp_mips64.mk \
$(LOCAL_DIR)/aosp_x86_64.mk \
+ $(LOCAL_DIR)/aosp_x86_64_a.mk \
+ $(LOCAL_DIR)/aosp_x86_64_ab.mk \
$(LOCAL_DIR)/sdk_phone_armv7.mk \
$(LOCAL_DIR)/sdk_phone_x86.mk \
$(LOCAL_DIR)/sdk_phone_mips.mk \
diff --git a/target/product/aosp_arm_ab.mk b/target/product/aosp_arm_ab.mk
new file mode 100644
index 0000000..423d38f
--- /dev/null
+++ b/target/product/aosp_arm_ab.mk
@@ -0,0 +1,35 @@
+#
+# 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_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
+# /vendor/[build|default].prop when build split is on. In order to have sysprops
+# on the generic system image, place them in build/make/target/board/generic_arm_a/
+# system.prop.
+
+include build/make/target/product/treble_common.mk
+
+AB_OTA_UPDATER := true
+AB_OTA_PARTITIONS := system
+PRODUCT_PACKAGES += \
+ update_engine \
+ update_verifier
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
+
+PRODUCT_NAME := aosp_arm_ab
+PRODUCT_DEVICE := generic_arm_ab
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP on ARM32
diff --git a/target/product/aosp_x86_64_a.mk b/target/product/aosp_x86_64_a.mk
new file mode 100644
index 0000000..eab8b4a
--- /dev/null
+++ b/target/product/aosp_x86_64_a.mk
@@ -0,0 +1,30 @@
+#
+# 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_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
+# /vendor/[build|default].prop when build split is on. In order to have sysprops
+# on the generic system image, place them in build/make/target/board/generic_arm64_a/
+# system.prop.
+
+include build/make/target/product/treble_common.mk
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
+
+PRODUCT_NAME := aosp_x86_64_a
+PRODUCT_DEVICE := generic_x86_64_a
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP on x86_64
diff --git a/target/product/aosp_x86_64_ab.mk b/target/product/aosp_x86_64_ab.mk
new file mode 100644
index 0000000..4fb2acf
--- /dev/null
+++ b/target/product/aosp_x86_64_ab.mk
@@ -0,0 +1,36 @@
+#
+# 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_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
+# /vendor/[build|default].prop when build split is on. In order to have sysprops
+# on the generic system image, place them in build/make/target/board/generic_arm64_a/
+# system.prop.
+
+include build/make/target/product/treble_common.mk
+
+AB_OTA_UPDATER := true
+AB_OTA_PARTITIONS := system
+PRODUCT_PACKAGES += \
+ update_engine \
+ update_verifier
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
+
+PRODUCT_NAME := aosp_x86_64_ab
+PRODUCT_DEVICE := generic_x86_64_ab
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP on x86_64
diff --git a/target/product/aosp_x86_a.mk b/target/product/aosp_x86_a.mk
new file mode 100644
index 0000000..df84107
--- /dev/null
+++ b/target/product/aosp_x86_a.mk
@@ -0,0 +1,29 @@
+#
+# 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_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
+# /vendor/[build|default].prop when build split is on. In order to have sysprops
+# on the generic system image, place them in build/make/target/board/generic_arm64_a/
+# system.prop.
+
+include build/make/target/product/treble_common.mk
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
+
+PRODUCT_NAME := aosp_x86_a
+PRODUCT_DEVICE := generic_x86_a
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP on x86
diff --git a/target/product/aosp_x86_ab.mk b/target/product/aosp_x86_ab.mk
new file mode 100644
index 0000000..4bd63ab
--- /dev/null
+++ b/target/product/aosp_x86_ab.mk
@@ -0,0 +1,35 @@
+#
+# 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_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
+# /vendor/[build|default].prop when build split is on. In order to have sysprops
+# on the generic system image, place them in build/make/target/board/generic_arm64_a/
+# system.prop.
+
+include build/make/target/product/treble_common.mk
+
+AB_OTA_UPDATER := true
+AB_OTA_PARTITIONS := system
+PRODUCT_PACKAGES += \
+ update_engine \
+ update_verifier
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
+
+PRODUCT_NAME := aosp_x86_ab
+PRODUCT_DEVICE := generic_x86_ab
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP on x86
diff --git a/target/product/core_minimal.mk b/target/product/core_minimal.mk
index e9fbbb1..a40f216 100644
--- a/target/product/core_minimal.mk
+++ b/target/product/core_minimal.mk
@@ -72,6 +72,7 @@
libfilterfw \
libkeystore \
libgatekeeper \
+ libneuralnetworks \
libwebviewchromium_loader \
libwebviewchromium_plat_support \
libwilhelm \
diff --git a/target/product/embedded.mk b/target/product/embedded.mk
index 22c6112..aefba43 100644
--- a/target/product/embedded.mk
+++ b/target/product/embedded.mk
@@ -76,6 +76,7 @@
shell_and_utilities \
storaged \
surfaceflinger \
+ thermalserviced \
tombstoned \
tzdatacheck \
vndservice \
diff --git a/target/product/languages_full.mk b/target/product/languages_full.mk
index 36c3de8..846cd70 100644
--- a/target/product/languages_full.mk
+++ b/target/product/languages_full.mk
@@ -15,10 +15,91 @@
#
# This is a build configuration that just contains a list of languages.
-# It helps in situations where languages must come first in the list,
-# mostly because screen densities interfere with the list of locales and
-# the system misbehaves when a density is the first locale.
-
-# These are all the locales that have translations and are displayable
-# by TextView in this branch.
-PRODUCT_LOCALES := en_US en_AU en_IN fr_FR it_IT es_ES et_EE de_DE nl_NL cs_CZ pl_PL ja_JP zh_TW zh_CN zh_HK ru_RU ko_KR nb_NO es_US da_DK el_GR tr_TR pt_PT pt_BR sv_SE bg_BG ca_ES en_GB fi_FI hi_IN hr_HR hu_HU in_ID iw_IL lt_LT lv_LV ro_RO sk_SK sl_SI sr_RS uk_UA vi_VN tl_PH ar_EG fa_IR th_TH sw_TZ ms_MY af_ZA zu_ZA am_ET en_XA ar_XB fr_CA km_KH lo_LA ne_NP si_LK mn_MN hy_AM az_AZ ka_GE my_MM mr_IN ml_IN is_IS mk_MK ky_KG eu_ES gl_ES bn_BD ta_IN kn_IN te_IN uz_UZ ur_PK kk_KZ sq_AL gu_IN pa_IN be_BY bs_BA sr_Latn_RS
+#
+# These are all the locales that have translations.
+PRODUCT_LOCALES := \
+ en_US \
+ af_ZA \
+ am_ET \
+ ar_EG \
+ ar_XB \
+ az_AZ \
+ be_BY \
+ bg_BG \
+ bn_BD \
+ bs_BA \
+ ca_ES \
+ cs_CZ \
+ da_DK \
+ de_DE \
+ el_GR \
+ en_AU \
+ en_CA \
+ en_GB \
+ en_IN \
+ en_XA \
+ en_XC \
+ es_ES \
+ es_US \
+ et_EE \
+ eu_ES \
+ fa_IR \
+ fi_FI \
+ fr_CA \
+ fr_FR \
+ gl_ES \
+ gu_IN \
+ hi_IN \
+ hr_HR \
+ hu_HU \
+ hy_AM \
+ in_ID \
+ is_IS \
+ it_IT \
+ iw_IL \
+ ja_JP \
+ ka_GE \
+ kk_KZ \
+ km_KH \
+ kn_IN \
+ ko_KR \
+ ky_KG \
+ lo_LA \
+ lt_LT \
+ lv_LV \
+ mk_MK \
+ ml_IN \
+ mn_MN \
+ mr_IN \
+ ms_MY \
+ my_MM \
+ nb_NO \
+ ne_NP \
+ nl_NL \
+ pa_IN \
+ pl_PL \
+ pt_BR \
+ pt_PT \
+ ro_RO \
+ ru_RU \
+ si_LK \
+ sk_SK \
+ sl_SI \
+ sq_AL \
+ sr_Latn_RS \
+ sr_RS \
+ sv_SE \
+ sw_TZ \
+ ta_IN \
+ te_IN \
+ th_TH \
+ tl_PH \
+ tr_TR \
+ uk_UA \
+ ur_PK \
+ uz_UZ \
+ vi_VN \
+ zh_CN \
+ zh_HK \
+ zh_TW \
+ zu_ZA
diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk
index 52e2441..f31e9ac 100644
--- a/target/product/treble_common.mk
+++ b/target/product/treble_common.mk
@@ -75,6 +75,7 @@
android.hardware.tetheroffload.config@1.0 \
android.hardware.tetheroffload.control@1.0 \
android.hardware.thermal@1.0 \
+ android.hardware.thermal@1.1 \
android.hardware.tv.cec@1.0 \
android.hardware.tv.input@1.0 \
android.hardware.usb@1.0 \
@@ -89,6 +90,7 @@
android.hidl.manager@1.0 \
android.hidl.memory@1.0 \
android.hidl.token@1.0 \
+ android.system.net.netd@1.0 \
android.system.wifi.keystore@1.0 \
# VNDK: