Merge "[generate-self-extracting-archive] Cleanup and improve error handling"
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index 7006667..ef1471d 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -51,7 +51,7 @@
   include $(BUILD_SYSTEM)/java_prebuilt_internal.mk
 else ifneq ($(filter STATIC_LIBRARIES SHARED_LIBRARIES EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),)
   include $(BUILD_SYSTEM)/cc_prebuilt_internal.mk
-else ifneq ($(filter SCRIPT ETC DATA,$(LOCAL_MODULE_CLASS)),)
+else ifneq ($(filter SCRIPT ETC DATA RENDERSCRIPT_BITCODE,$(LOCAL_MODULE_CLASS)),)
   include $(BUILD_SYSTEM)/misc_prebuilt_internal.mk
 else
   $(error $(LOCAL_MODULE) : unexpected LOCAL_MODULE_CLASS for prebuilts: $(LOCAL_MODULE_CLASS))
diff --git a/target/product/base.mk b/target/product/base.mk
index 804a2ee..d3250d4 100644
--- a/target/product/base.mk
+++ b/target/product/base.mk
@@ -17,5 +17,6 @@
 # This makefile is suitable to inherit by products that don't need to be split
 # up by partition.
 $(call inherit-product, $(SRC_TARGET_DIR)/product/base_system.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/base_system_ext.mk)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/base_vendor.mk)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/base_product.mk)
diff --git a/target/product/base_system_ext.mk b/target/product/base_system_ext.mk
new file mode 100644
index 0000000..df859cd
--- /dev/null
+++ b/target/product/base_system_ext.mk
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 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.
+#
+
+# Base modules and settings for the system_ext partition.
+PRODUCT_PACKAGES += \
diff --git a/target/product/core_minimal.mk b/target/product/core_minimal.mk
index 9718dc6..6fb1173 100644
--- a/target/product/core_minimal.mk
+++ b/target/product/core_minimal.mk
@@ -22,6 +22,7 @@
 # handheld_<x>.mk.
 
 $(call inherit-product, $(SRC_TARGET_DIR)/product/media_system.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/media_system_ext.mk)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/media_vendor.mk)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/media_product.mk)
 
diff --git a/target/product/generic_no_telephony.mk b/target/product/generic_no_telephony.mk
index 324d36f..eb12872 100644
--- a/target/product/generic_no_telephony.mk
+++ b/target/product/generic_no_telephony.mk
@@ -21,6 +21,7 @@
 # base_<x>.mk or media_<x>.mk.
 
 $(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system_ext.mk)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_vendor.mk)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_product.mk)
 
diff --git a/target/product/handheld_product.mk b/target/product/handheld_product.mk
index 54dcaf2..36b740a 100644
--- a/target/product/handheld_product.mk
+++ b/target/product/handheld_product.mk
@@ -17,7 +17,7 @@
 # This makefile contains the product partition contents for
 # a generic phone or tablet device. Only add something here if
 # it definitely doesn't belong on other types of devices (if it
-# does, use base_vendor.mk).
+# does, use base_product.mk).
 $(call inherit-product, $(SRC_TARGET_DIR)/product/media_product.mk)
 
 # /product packages
diff --git a/target/product/handheld_system_ext.mk b/target/product/handheld_system_ext.mk
new file mode 100644
index 0000000..bda4be6
--- /dev/null
+++ b/target/product/handheld_system_ext.mk
@@ -0,0 +1,24 @@
+#
+# Copyright (C) 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.
+#
+
+# This makefile contains the system_ext partition contents for
+# a generic phone or tablet device. Only add something here if
+# it definitely doesn't belong on other types of devices (if it
+# does, use base_system_ext.mk).
+$(call inherit-product, $(SRC_TARGET_DIR)/product/media_system_ext.mk)
+
+# /system_ext packages
+PRODUCT_PACKAGES += \
diff --git a/target/product/mainline.mk b/target/product/mainline.mk
index 7900cdf..22436e6 100644
--- a/target/product/mainline.mk
+++ b/target/product/mainline.mk
@@ -16,11 +16,13 @@
 
 # This makefile is intended to serve as a base for completely AOSP based
 # mainline devices, It contain the mainline system partition and sensible
-# defaults for the product and vendor partition.
+# defaults for the system_ext, product and vendor partitions.
 $(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk)
 
+$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system_ext.mk)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_vendor.mk)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_product.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system_ext.mk)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_vendor.mk)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_product.mk)
 
diff --git a/target/product/media_product.mk b/target/product/media_product.mk
index 17c24ee..76cb311 100644
--- a/target/product/media_product.mk
+++ b/target/product/media_product.mk
@@ -17,7 +17,7 @@
 # This makefile contains the product partition contents for
 # media-capable devices (non-wearables). Only add something here
 # if it definitely doesn't belong on wearables. Otherwise, choose
-# base_vendor.mk.
+# base_product.mk.
 $(call inherit-product, $(SRC_TARGET_DIR)/product/base_product.mk)
 
 # /product packages
diff --git a/target/product/media_system_ext.mk b/target/product/media_system_ext.mk
new file mode 100644
index 0000000..78cc6aa
--- /dev/null
+++ b/target/product/media_system_ext.mk
@@ -0,0 +1,24 @@
+#
+# Copyright (C) 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.
+#
+
+# This makefile contains the system_ext partition contents for
+# media-capable devices (non-wearables). Only add something here
+# if it definitely doesn't belong on wearables. Otherwise, choose
+# base_system_ext.mk.
+$(call inherit-product, $(SRC_TARGET_DIR)/product/base_system_ext.mk)
+
+# /system_ext packages
+PRODUCT_PACKAGES += \
diff --git a/target/product/telephony.mk b/target/product/telephony.mk
index e0eb159..3ad7a1f 100644
--- a/target/product/telephony.mk
+++ b/target/product/telephony.mk
@@ -16,5 +16,6 @@
 
 # All modules for telephony
 $(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system_ext.mk)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_vendor.mk)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_product.mk)
diff --git a/target/product/telephony_system_ext.mk b/target/product/telephony_system_ext.mk
new file mode 100644
index 0000000..1b9ee98
--- /dev/null
+++ b/target/product/telephony_system_ext.mk
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 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.
+#
+
+# This is the list of modules that are specific to products that have telephony
+# hardware, and install to the system_ext partition.
+
+# /system_ext packages
+PRODUCT_PACKAGES += \