diff --git a/art/0001-hybris-Silence-some-build-errors-to-let-the-systemim.patch b/art/0001-hybris-Silence-some-build-errors-to-let-the-systemim.patch index 04c6037..6bd61ad 100644 --- a/art/0001-hybris-Silence-some-build-errors-to-let-the-systemim.patch +++ b/art/0001-hybris-Silence-some-build-errors-to-let-the-systemim.patch @@ -1,4 +1,4 @@ -From 1a27bd48255a96853e49d25c82a0fe47dd477f83 Mon Sep 17 00:00:00 2001 +From b7aef38b325eed4897bdae1d39ae4683e4f9f509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= Date: Fri, 3 Jul 2020 22:15:49 +0200 Subject: [PATCH] (hybris) Silence some build errors to let the systemimage @@ -14,22 +14,64 @@ them and insert dummy data to allow the building of the systemimage. Signed-off-by: Björn Bidar Change-Id: Ide41188b6263a22c371ec28786bbc1ef1ee62df7 --- - runtime/thread-current-inl.h | 4 ++-- - runtime/thread.cc | 4 ++-- - runtime/thread_list.cc | 2 +- - 3 files changed, 5 insertions(+), 5 deletions(-) + build/Android.gtest.mk | 20 ++++++++++---------- + runtime/thread-current-inl.h | 2 +- + runtime/thread.cc | 4 ++++ + runtime/thread_list.cc | 2 ++ + 4 files changed, 17 insertions(+), 11 deletions(-) +diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk +index 2249b1b750..4b5ec87ca0 100644 +--- a/build/Android.gtest.mk ++++ b/build/Android.gtest.mk +@@ -74,28 +74,28 @@ $(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval $(call build-art-test-dex,art-gte + + # Create rules for MainStripped, a copy of Main with the classes.dex stripped + # for the oat file assistant tests. +-ART_TEST_HOST_GTEST_MainStripped_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_HOST_GTEST_Main_DEX)) +-ART_TEST_TARGET_GTEST_MainStripped_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX)) ++ART_TEST_HOST_GTEST_MainStripped_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))$(suffix $(ART_TEST_HOST_GTEST_Main_DEX)) ++ART_TEST_TARGET_GTEST_MainStripped_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX)) + + # Create rules for MainUncompressed, a copy of Main with the classes.dex uncompressed + # for the dex2oat tests. +-ART_TEST_HOST_GTEST_MainUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))Uncompressed$(suffix $(ART_TEST_HOST_GTEST_Main_DEX)) +-ART_TEST_TARGET_GTEST_MainUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))Uncompressed$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX)) ++ART_TEST_HOST_GTEST_MainUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))$(suffix $(ART_TEST_HOST_GTEST_Main_DEX)) ++ART_TEST_TARGET_GTEST_MainUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX)) + + # Create rules for UncompressedEmpty, a classes.dex that is empty and uncompressed + # for the dex2oat tests. +-ART_TEST_HOST_GTEST_EmptyUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))EmptyUncompressed$(suffix $(ART_TEST_HOST_GTEST_Main_DEX)) +-ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))EmptyUncompressed$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX)) ++ART_TEST_HOST_GTEST_EmptyUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))$(suffix $(ART_TEST_HOST_GTEST_Main_DEX)) ++ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX)) + + # Create rules for UncompressedEmptyAligned, a classes.dex that is empty, uncompressed, + # and 4 byte aligned for the dex2oat tests. +-ART_TEST_HOST_GTEST_EmptyUncompressedAligned_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))EmptyUncompressedAligned$(suffix $(ART_TEST_HOST_GTEST_Main_DEX)) +-ART_TEST_TARGET_GTEST_EmptyUncompressedAligned_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))EmptyUncompressedAligned$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX)) ++ART_TEST_HOST_GTEST_EmptyUncompressedAligned_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))$(suffix $(ART_TEST_HOST_GTEST_Main_DEX)) ++ART_TEST_TARGET_GTEST_EmptyUncompressedAligned_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX)) + + # Create rules for MultiDexUncompressed, a copy of MultiDex with the classes.dex uncompressed + # for the OatFile tests. +-ART_TEST_HOST_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_MultiDex_DEX))Uncompressed$(suffix $(ART_TEST_HOST_GTEST_MultiDex_DEX)) +-ART_TEST_TARGET_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_MultiDex_DEX))Uncompressed$(suffix $(ART_TEST_TARGET_GTEST_MultiDex_DEX)) ++ART_TEST_HOST_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_MultiDex_DEX))$(suffix $(ART_TEST_HOST_GTEST_MultiDex_DEX)) ++ART_TEST_TARGET_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_MultiDex_DEX))(suffix $(ART_TEST_TARGET_GTEST_MultiDex_DEX)) + + ifdef ART_TEST_HOST_GTEST_Main_DEX + $(ART_TEST_HOST_GTEST_MainStripped_DEX): $(ART_TEST_HOST_GTEST_Main_DEX) diff --git a/runtime/thread-current-inl.h b/runtime/thread-current-inl.h index 9241b1f875..a3e0520423 100644 --- a/runtime/thread-current-inl.h +++ b/runtime/thread-current-inl.h -@@ -33,8 +33,8 @@ inline Thread* Thread::Current() { - if (!is_started_) { +@@ -34,7 +34,7 @@ inline Thread* Thread::Current() { return nullptr; } else { --#ifdef ART_TARGET_ANDROID + #ifdef ART_TARGET_ANDROID - void* thread = __get_tls()[TLS_SLOT_ART_THREAD_SELF]; -+#ifdef DISABLED_FOR_HYBRIS_SUPPORT + void* thread = nullptr; //__get_tls()[TLS_SLOT_ART_THREAD_SELF]; #else void* thread = pthread_getspecific(Thread::pthread_key_self_); @@ -38,37 +80,40 @@ diff --git a/runtime/thread.cc b/runtime/thread.cc index be0e30ad11..da112e19c9 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc -@@ -932,7 +932,7 @@ bool Thread::Init(ThreadList* thread_list, JavaVMExt* java_vm, JNIEnvExt* jni_en - interpreter::InitInterpreterTls(this); +@@ -933,7 +933,9 @@ bool Thread::Init(ThreadList* thread_list, JavaVMExt* java_vm, JNIEnvExt* jni_en } --#ifdef ART_TARGET_ANDROID + #ifdef ART_TARGET_ANDROID +#ifdef DISABLED_FOR_HYBRIS_SUPPORT __get_tls()[TLS_SLOT_ART_THREAD_SELF] = this; ++#endif #else CHECK_PTHREAD_CALL(pthread_setspecific, (Thread::pthread_key_self_, this), "attach self"); -@@ -2198,7 +2198,7 @@ void Thread::ThreadExitCallback(void* arg) { - LOG(WARNING) << "Native thread exiting without having called DetachCurrentThread (maybe it's " + #endif +@@ -2199,7 +2201,9 @@ void Thread::ThreadExitCallback(void* arg) { "going to use a pthread_key_create destructor?): " << *self; CHECK(is_started_); --#ifdef ART_TARGET_ANDROID + #ifdef ART_TARGET_ANDROID +#ifdef DISABLED_FOR_HYBRIS_SUPPORT __get_tls()[TLS_SLOT_ART_THREAD_SELF] = self; ++#endif #else CHECK_PTHREAD_CALL(pthread_setspecific, (Thread::pthread_key_self_, self), "reattach self"); + #endif diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc index ed6b2c91e5..37a2bd6911 100644 --- a/runtime/thread_list.cc +++ b/runtime/thread_list.cc -@@ -1481,7 +1481,7 @@ void ThreadList::Unregister(Thread* self) { - +@@ -1482,7 +1482,9 @@ void ThreadList::Unregister(Thread* self) { // Clear the TLS data, so that the underlying native thread is recognizably detached. // (It may wish to reattach later.) --#ifdef ART_TARGET_ANDROID + #ifdef ART_TARGET_ANDROID +#ifdef DISABLED_FOR_HYBRIS_SUPPORT __get_tls()[TLS_SLOT_ART_THREAD_SELF] = nullptr; ++#endif #else CHECK_PTHREAD_CALL(pthread_setspecific, (Thread::pthread_key_self_, nullptr), "detach self"); + #endif -- -2.27.0 +2.35.1 diff --git a/build/make/0002-hybris-build-minimization-might-be-improveable-but-t.patch b/build/make/0002-hybris-build-minimization-might-be-improveable-but-t.patch new file mode 100644 index 0000000..633baa6 --- /dev/null +++ b/build/make/0002-hybris-build-minimization-might-be-improveable-but-t.patch @@ -0,0 +1,1010 @@ +From 42ae763c7aa79c3cc250933826be5d74903f7da9 Mon Sep 17 00:00:00 2001 +From: Franz-Josef Haider +Date: Thu, 7 Jun 2018 15:32:40 +0000 +Subject: [PATCH 1/2] (hybris) build minimization (might be improveable, but + this version doesn't break dependancies) + +Change-Id: Ic862dc084f5f4e3fa7ccd90b0757deff0f17b802 +--- + core/dex_preopt.mk | 49 ----- + core/envsetup.mk | 4 +- + core/host_dalvik_java_library.mk | 191 ------------------ + core/host_dalvik_static_java_library.mk | 28 --- + core/host_java_library.mk | 128 ------------ + core/java_library.mk | 100 ---------- + core/main.mk | 5 +- + core/package.mk | 86 --------- + core/soong_droiddoc_prebuilt.mk | 40 ---- + core/static_java_library.mk | 247 ------------------------ + target/product/base_system.mk | 6 +- + target/product/runtime_libart.mk | 6 +- + 12 files changed, 11 insertions(+), 879 deletions(-) + +diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk +index 180edafbbb..e69de29bb2 100644 +--- a/core/dex_preopt.mk ++++ b/core/dex_preopt.mk +@@ -1,49 +0,0 @@ +-#################################### +-# dexpreopt support - typically used on user builds to run dexopt (for Dalvik) or dex2oat (for ART) ahead of time +-# +-#################################### +- +-include $(BUILD_SYSTEM)/dex_preopt_config.mk +- +-# Method returning whether the install path $(1) should be for system_other. +-# Under SANITIZE_LITE, we do not want system_other. Just put things under /data/asan. +-ifeq ($(SANITIZE_LITE),true) +-install-on-system-other = +-else +-install-on-system-other = $(filter-out $(PRODUCT_DEXPREOPT_SPEED_APPS) $(PRODUCT_SYSTEM_SERVER_APPS),$(basename $(notdir $(filter $(foreach f,$(SYSTEM_OTHER_ODEX_FILTER),$(TARGET_OUT)/$(f)),$(1))))) +-endif +- +-# We want to install the profile even if we are not using preopt since it is required to generate +-# the image on the device. +-ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(DEXPREOPT_IMAGE_PROFILE_BUILT_INSTALLED),$(PRODUCT_OUT)) +- +-# Install boot images. Note that there can be multiple. +-DEFAULT_DEX_PREOPT_INSTALLED_IMAGE := +-$(TARGET_2ND_ARCH_VAR_PREFIX)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE := +-$(foreach my_boot_image_name,$(DEXPREOPT_IMAGE_NAMES),$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk)) +- +-# Build the boot.zip which contains the boot jars and their compilation output +-# We can do this only if preopt is enabled and if the product uses libart config (which sets the +-# default properties for preopting). +-ifeq ($(WITH_DEXPREOPT), true) +-ifeq ($(PRODUCT_USES_ART), true) +- +-boot_zip := $(PRODUCT_OUT)/boot.zip +-bootclasspath_jars := $(DEXPREOPT_BOOTCLASSPATH_DEX_FILES) +-system_server_jars := $(foreach m,$(PRODUCT_SYSTEM_SERVER_JARS),$(PRODUCT_OUT)/system/framework/$(m).jar) +- +-$(boot_zip): PRIVATE_BOOTCLASSPATH_JARS := $(bootclasspath_jars) +-$(boot_zip): PRIVATE_SYSTEM_SERVER_JARS := $(system_server_jars) +-$(boot_zip): $(bootclasspath_jars) $(system_server_jars) $(SOONG_ZIP) $(MERGE_ZIPS) $(DEXPREOPT_IMAGE_ZIP_boot) +- @echo "Create boot package: $@" +- rm -f $@ +- $(SOONG_ZIP) -o $@.tmp \ +- -C $(dir $(firstword $(PRIVATE_BOOTCLASSPATH_JARS)))/.. $(addprefix -f ,$(PRIVATE_BOOTCLASSPATH_JARS)) \ +- -C $(PRODUCT_OUT) $(addprefix -f ,$(PRIVATE_SYSTEM_SERVER_JARS)) +- $(MERGE_ZIPS) $@ $@.tmp $(DEXPREOPT_IMAGE_ZIP_boot) +- rm -f $@.tmp +- +-$(call dist-for-goals, droidcore, $(boot_zip)) +- +-endif #PRODUCT_USES_ART +-endif #WITH_DEXPREOPT +diff --git a/core/envsetup.mk b/core/envsetup.mk +index 9e722bd5c1..6110ae8f92 100644 +--- a/core/envsetup.mk ++++ b/core/envsetup.mk +@@ -250,8 +250,8 @@ endef + # java code with dalvikvm/art. + # Jars present in the runtime apex. These should match exactly the list of + # Java libraries in the runtime apex build rule. +-RUNTIME_APEX_JARS := core-oj core-libart okhttp bouncycastle apache-xml +-TARGET_CORE_JARS := $(RUNTIME_APEX_JARS) conscrypt ++#RUNTIME_APEX_JARS := core-oj core-libart okhttp bouncycastle apache-xml ++TARGET_CORE_JARS := + ifeq ($(EMMA_INSTRUMENT),true) + ifneq ($(EMMA_INSTRUMENT_STATIC),true) + # For instrumented build, if Jacoco is not being included statically +diff --git a/core/host_dalvik_java_library.mk b/core/host_dalvik_java_library.mk +index 2a251e84e5..8b13789179 100644 +--- a/core/host_dalvik_java_library.mk ++++ b/core/host_dalvik_java_library.mk +@@ -1,192 +1 @@ +-# +-# Copyright (C) 2013 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 record-module-type,HOST_DALVIK_JAVA_LIBRARY) + +-# +-# Rules for building a host dalvik java library. These libraries +-# are meant to be used by a dalvik VM instance running on the host. +-# They will be compiled against libcore and not the host JRE. +-# +- +-ifeq ($(HOST_OS),linux) +-USE_CORE_LIB_BOOTCLASSPATH := true +- +-####################################### +-include $(BUILD_SYSTEM)/host_java_library_common.mk +-####################################### +- +-full_classes_turbine_jar := $(intermediates.COMMON)/classes-turbine.jar +-full_classes_header_jarjar := $(intermediates.COMMON)/classes-header-jarjar.jar +-full_classes_header_jar := $(intermediates.COMMON)/classes-header.jar +-full_classes_compiled_jar := $(intermediates.COMMON)/classes-full-debug.jar +-full_classes_combined_jar := $(intermediates.COMMON)/classes-combined.jar +-full_classes_jarjar_jar := $(intermediates.COMMON)/classes-jarjar.jar +-full_classes_jar := $(intermediates.COMMON)/classes.jar +-built_dex := $(intermediates.COMMON)/classes.dex +-java_source_list_file := $(intermediates.COMMON)/java-source-list +- +-LOCAL_INTERMEDIATE_TARGETS += \ +- $(full_classes_turbine_jar) \ +- $(full_classes_compiled_jar) \ +- $(full_classes_combined_jar) \ +- $(full_classes_jarjar_jar) \ +- $(full_classes_jar) \ +- $(built_dex) \ +- $(java_source_list_file) +- +-# See comment in java.mk +-ifndef LOCAL_CHECKED_MODULE +-ifeq ($(LOCAL_IS_STATIC_JAVA_LIBRARY),true) +-LOCAL_CHECKED_MODULE := $(full_classes_compiled_jar) +-else +-LOCAL_CHECKED_MODULE := $(built_dex) +-endif +-endif +- +-####################################### +-include $(BUILD_SYSTEM)/base_rules.mk +-####################################### +-java_sources := $(addprefix $(LOCAL_PATH)/, $(filter %.java,$(LOCAL_SRC_FILES))) \ +- $(filter %.java,$(LOCAL_GENERATED_SOURCES)) +-all_java_sources := $(java_sources) +- +-include $(BUILD_SYSTEM)/java_common.mk +- +-include $(BUILD_SYSTEM)/sdk_check.mk +- +-$(cleantarget): PRIVATE_CLEAN_FILES += $(intermediates.COMMON) +- +-# List of dependencies for anything that needs all java sources in place +-java_sources_deps := \ +- $(java_sources) \ +- $(java_resource_sources) \ +- $(proto_java_sources_file_stamp) \ +- $(LOCAL_SRCJARS) \ +- $(LOCAL_ADDITIONAL_DEPENDENCIES) +- +-$(java_source_list_file): $(java_sources_deps) +- $(write-java-source-list) +- +-$(full_classes_compiled_jar): PRIVATE_JAVA_LAYERS_FILE := $(layers_file) +-$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags) +-$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_FILES := +-$(full_classes_compiled_jar): PRIVATE_JAR_PACKAGES := +-$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_PACKAGES := +-$(full_classes_compiled_jar): PRIVATE_SRCJARS := $(LOCAL_SRCJARS) +-$(full_classes_compiled_jar): PRIVATE_SRCJAR_LIST_FILE := $(intermediates.COMMON)/srcjar-list +-$(full_classes_compiled_jar): PRIVATE_SRCJAR_INTERMEDIATES_DIR := $(intermediates.COMMON)/srcjars +-$(full_classes_compiled_jar): \ +- $(java_source_list_file) \ +- $(java_sources_deps) \ +- $(full_java_header_libs) \ +- $(full_java_bootclasspath_libs) \ +- $(full_java_system_modules_deps) \ +- $(annotation_processor_deps) \ +- $(NORMALIZE_PATH) \ +- $(JAR_ARGS) \ +- $(ZIPSYNC) \ +- | $(SOONG_JAVAC_WRAPPER) +- $(transform-host-java-to-dalvik-package) +- +-ifneq ($(TURBINE_ENABLED),false) +- +-$(full_classes_turbine_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags) +-$(full_classes_turbine_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF) +-$(full_classes_turbine_jar): PRIVATE_SRCJARS := $(LOCAL_SRCJARS) +-$(full_classes_turbine_jar): \ +- $(java_source_list_file) \ +- $(java_sources_deps) \ +- $(full_java_header_libs) \ +- $(full_java_bootclasspath_libs) \ +- $(NORMALIZE_PATH) \ +- $(JAR_ARGS) \ +- $(ZIPTIME) \ +- | $(TURBINE) \ +- $(MERGE_ZIPS) +- $(transform-java-to-header.jar) +- +-.KATI_RESTAT: $(full_classes_turbine_jar) +- +-# Run jarjar before generate classes-header.jar if necessary. +-ifneq ($(strip $(LOCAL_JARJAR_RULES)),) +-$(full_classes_header_jarjar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES) +-$(full_classes_header_jarjar): $(full_classes_turbine_jar) $(LOCAL_JARJAR_RULES) | $(JARJAR) +- @echo Header JarJar: $@ +- $(hide) $(JAVA) -jar $(JARJAR) process $(PRIVATE_JARJAR_RULES) $< $@ +-else +-full_classes_header_jarjar := $(full_classes_turbine_jar) +-endif +- +-$(eval $(call copy-one-file,$(full_classes_header_jarjar),$(full_classes_header_jar))) +- +-endif # TURBINE_ENABLED != false +- +-$(full_classes_combined_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF) +-$(full_classes_combined_jar): $(full_classes_compiled_jar) \ +- $(jar_manifest_file) \ +- $(full_static_java_libs) | $(MERGE_ZIPS) +- $(if $(PRIVATE_JAR_MANIFEST), $(hide) sed -e "s/%BUILD_NUMBER%/$(BUILD_NUMBER_FROM_FILE)/" \ +- $(PRIVATE_JAR_MANIFEST) > $(dir $@)/manifest.mf) +- $(MERGE_ZIPS) -j --ignore-duplicates $(if $(PRIVATE_JAR_MANIFEST),-m $(dir $@)/manifest.mf) \ +- $(if $(PRIVATE_DONT_DELETE_JAR_META_INF),,-stripDir META-INF -zipToNotStrip $<) \ +- $@ $< $(call reverse-list,$(PRIVATE_STATIC_JAVA_LIBRARIES)) +- +-# Run jarjar if necessary, otherwise just copy the file. +-ifneq ($(strip $(LOCAL_JARJAR_RULES)),) +-$(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES) +-$(full_classes_jarjar_jar): $(full_classes_combined_jar) $(LOCAL_JARJAR_RULES) | $(JARJAR) +- @echo JarJar: $@ +- $(hide) $(JAVA) -jar $(JARJAR) process $(PRIVATE_JARJAR_RULES) $< $@ +-else +-full_classes_jarjar_jar := $(full_classes_combined_jar) +-endif +- +-$(eval $(call copy-one-file,$(full_classes_jarjar_jar),$(full_classes_jar))) +- +-ifeq ($(LOCAL_IS_STATIC_JAVA_LIBRARY),true) +-# No dex; all we want are the .class files with resources. +-$(LOCAL_BUILT_MODULE) : $(java_resource_sources) +-$(LOCAL_BUILT_MODULE) : $(full_classes_jar) +- @echo "host Static Jar: $(PRIVATE_MODULE) ($@)" +- $(copy-file-to-target) +- +-else # !LOCAL_IS_STATIC_JAVA_LIBRARY +-$(built_dex): PRIVATE_INTERMEDIATES_DIR := $(intermediates.COMMON) +-$(built_dex): PRIVATE_DX_FLAGS := $(LOCAL_DX_FLAGS) +-$(built_dex): $(full_classes_jar) $(DX) $(ZIP2ZIP) +- $(transform-classes.jar-to-dex) +- +-$(LOCAL_BUILT_MODULE): PRIVATE_DEX_FILE := $(built_dex) +-$(LOCAL_BUILT_MODULE): PRIVATE_SOURCE_ARCHIVE := $(full_classes_jarjar_jar) +-$(LOCAL_BUILT_MODULE): $(MERGE_ZIPS) $(SOONG_ZIP) $(ZIP2ZIP) +-$(LOCAL_BUILT_MODULE): $(built_dex) $(java_resource_sources) +- @echo "Host Jar: $(PRIVATE_MODULE) ($@)" +- rm -rf $@.parts +- mkdir -p $@.parts +- $(call create-dex-jar,$@.parts/dex.zip,$(PRIVATE_DEX_FILE)) +- $(call extract-resources-jar,$@.parts/res.zip,$(PRIVATE_SOURCE_ARCHIVE)) +- $(MERGE_ZIPS) -j $@ $@.parts/dex.zip $@.parts/res.zip +- rm -rf $@.parts +- +-endif # !LOCAL_IS_STATIC_JAVA_LIBRARY +- +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_DEFAULT_APP_TARGET_SDK := $(call module-target-sdk-version) +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_SDK_VERSION := $(call module-sdk-version) +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_MIN_SDK_VERSION := $(call codename-or-sdk-to-sdk,$(call module-min-sdk-version)) +- +-USE_CORE_LIB_BOOTCLASSPATH := +- +-endif +diff --git a/core/host_dalvik_static_java_library.mk b/core/host_dalvik_static_java_library.mk +index 78faf73a56..e69de29bb2 100644 +--- a/core/host_dalvik_static_java_library.mk ++++ b/core/host_dalvik_static_java_library.mk +@@ -1,28 +0,0 @@ +-# +-# Copyright (C) 2013 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 record-module-type,HOST_DALVIK_STATIC_JAVA_LIBRARY) +- +-# +-# Rules for building a host dalvik static java library. +-# These libraries will be compiled against libcore and not the host +-# JRE. +-# +-LOCAL_UNINSTALLABLE_MODULE := true +-LOCAL_IS_STATIC_JAVA_LIBRARY := true +- +-include $(BUILD_SYSTEM)/host_dalvik_java_library.mk +- +-LOCAL_IS_STATIC_JAVA_LIBRARY := +diff --git a/core/host_java_library.mk b/core/host_java_library.mk +index c8d2ee78c2..e69de29bb2 100644 +--- a/core/host_java_library.mk ++++ b/core/host_java_library.mk +@@ -1,128 +0,0 @@ +-# +-# Copyright (C) 2008 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 record-module-type,HOST_JAVA_LIBRARY) +- +-# +-# Standard rules for building a host java library. +-# +- +-####################################### +-include $(BUILD_SYSTEM)/host_java_library_common.mk +-####################################### +- +-# Enable emma instrumentation only if the module asks so. +-ifeq (true,$(LOCAL_EMMA_INSTRUMENT)) +-ifneq (true,$(EMMA_INSTRUMENT)) +-LOCAL_EMMA_INSTRUMENT := +-endif +-endif +- +-full_classes_compiled_jar := $(intermediates.COMMON)/classes-full-debug.jar +-full_classes_jarjar_jar := $(intermediates.COMMON)/classes-jarjar.jar +-full_classes_jar := $(intermediates.COMMON)/classes.jar +-java_source_list_file := $(intermediates.COMMON)/java-source-list +-full_classes_header_jar := $(intermediates.COMMON)/classes-header.jar +-full_classes_combined_jar := $(intermediates.COMMON)/classes-combined.jar +- +-LOCAL_INTERMEDIATE_TARGETS += \ +- $(full_classes_compiled_jar) \ +- $(full_classes_jarjar_jar) \ +- $(java_source_list_file) \ +- $(full_classes_combined_jar) +- +-####################################### +-include $(BUILD_SYSTEM)/base_rules.mk +-####################################### +- +-java_sources := $(addprefix $(LOCAL_PATH)/, $(filter %.java,$(LOCAL_SRC_FILES))) \ +- $(filter %.java,$(LOCAL_GENERATED_SOURCES)) +-all_java_sources := $(java_sources) +- +-include $(BUILD_SYSTEM)/java_common.mk +- +-# The layers file allows you to enforce a layering between java packages. +-# Run build/make/tools/java-layers.py for more details. +-layers_file := $(addprefix $(LOCAL_PATH)/, $(LOCAL_JAVA_LAYERS_FILE)) +- +-# List of dependencies for anything that needs all java sources in place +-java_sources_deps := \ +- $(java_sources) \ +- $(java_resource_sources) \ +- $(proto_java_sources_file_stamp) \ +- $(LOCAL_SRCJARS) \ +- $(LOCAL_ADDITIONAL_DEPENDENCIES) +- +-$(java_source_list_file): $(java_sources_deps) +- $(write-java-source-list) +- +-$(full_classes_compiled_jar): PRIVATE_JAVA_LAYERS_FILE := $(layers_file) +-$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags) +-$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_FILES := +-$(full_classes_compiled_jar): PRIVATE_JAR_PACKAGES := +-$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_PACKAGES := +-$(full_classes_compiled_jar): PRIVATE_SRCJARS := $(LOCAL_SRCJARS) +-$(full_classes_compiled_jar): PRIVATE_SRCJAR_LIST_FILE := $(intermediates.COMMON)/srcjar-list +-$(full_classes_compiled_jar): PRIVATE_SRCJAR_INTERMEDIATES_DIR := $(intermediates.COMMON)/srcjars +-$(full_classes_compiled_jar): \ +- $(java_source_list_file) \ +- $(java_sources_deps) \ +- $(full_java_libs) \ +- $(full_java_bootclasspath_libs) \ +- $(annotation_processor_deps) \ +- $(NORMALIZE_PATH) \ +- $(ZIPTIME) \ +- $(JAR_ARGS) \ +- $(ZIPSYNC) \ +- | $(SOONG_JAVAC_WRAPPER) +- $(transform-host-java-to-package) +- $(remove-timestamps-from-package) +- +-javac-check : $(full_classes_compiled_jar) +-javac-check-$(LOCAL_MODULE) : $(full_classes_compiled_jar) +-.PHONY: javac-check-$(LOCAL_MODULE) +- +-$(full_classes_combined_jar): $(full_classes_compiled_jar) \ +- $(jar_manifest_file) \ +- $(full_static_java_libs) | $(MERGE_ZIPS) +- $(if $(PRIVATE_JAR_MANIFEST), $(hide) sed -e "s/%BUILD_NUMBER%/$(BUILD_NUMBER_FROM_FILE)/" \ +- $(PRIVATE_JAR_MANIFEST) > $(dir $@)/manifest.mf) +- $(MERGE_ZIPS) -j --ignore-duplicates $(if $(PRIVATE_JAR_MANIFEST),-m $(dir $@)/manifest.mf) \ +- -stripDir META-INF -zipToNotStrip $< $@ $< $(call reverse-list,$(PRIVATE_STATIC_JAVA_LIBRARIES)) +- +-# Run jarjar if necessary, otherwise just copy the file. +-ifneq ($(strip $(LOCAL_JARJAR_RULES)),) +-$(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES) +-$(full_classes_jarjar_jar): $(full_classes_combined_jar) $(LOCAL_JARJAR_RULES) | $(JARJAR) +- @echo JarJar: $@ +- $(hide) $(JAVA) -jar $(JARJAR) process $(PRIVATE_JARJAR_RULES) $< $@ +-else +-full_classes_jarjar_jar := $(full_classes_combined_jar) +-endif +- +- +-####################################### +-LOCAL_FULL_CLASSES_PRE_JACOCO_JAR := $(full_classes_jarjar_jar) +- +-include $(BUILD_SYSTEM)/jacoco.mk +-####################################### +- +-$(eval $(call copy-one-file,$(LOCAL_FULL_CLASSES_JACOCO_JAR),$(LOCAL_BUILT_MODULE))) +-$(eval $(call copy-one-file,$(LOCAL_FULL_CLASSES_JACOCO_JAR),$(full_classes_jar))) +- +-ifeq ($(TURBINE_ENABLED),false) +-$(eval $(call copy-one-file,$(LOCAL_FULL_CLASSES_JACOCO_JAR),$(full_classes_header_jar))) +-endif +diff --git a/core/java_library.mk b/core/java_library.mk +index c706cea724..e69de29bb2 100644 +--- a/core/java_library.mk ++++ b/core/java_library.mk +@@ -1,100 +0,0 @@ +-########################################################### +-## Standard rules for building a java library. +-## +-########################################################### +-$(call record-module-type,JAVA_LIBRARY) +- +-ifdef LOCAL_IS_HOST_MODULE +-$(error $(LOCAL_PATH): Host java libraries must use BUILD_HOST_JAVA_LIBRARY) +-endif +- +-LOCAL_MODULE_SUFFIX := $(COMMON_JAVA_PACKAGE_SUFFIX) +-LOCAL_MODULE_CLASS := JAVA_LIBRARIES +- +-ifneq (,$(LOCAL_ASSET_DIR)) +-$(error $(LOCAL_PATH): Target java libraries may not set LOCAL_ASSET_DIR) +-endif +- +-ifneq (true,$(LOCAL_IS_STATIC_JAVA_LIBRARY)) +-ifneq (,$(LOCAL_RESOURCE_DIR)) +-$(error $(LOCAL_PATH): Target java libraries may not set LOCAL_RESOURCE_DIR) +-endif +-# base_rules.mk looks at this +-all_res_assets := +-endif +- +-LOCAL_BUILT_MODULE_STEM := javalib.jar +- +-# For java libraries, other modules should depend on +-# out/target/common/obj/JAVA_LIBRARIES/.../classes.jar. +-# There are some dependencies outside the build system that assume static +-# java libraries produce javalib.jar, so we will copy classes.jar there too. +-intermediates.COMMON := $(call local-intermediates-dir,COMMON) +-common_javalib.jar := $(intermediates.COMMON)/javalib.jar +-dex_preopt_profile_src_file := $(common_javalib.jar) +-LOCAL_INTERMEDIATE_TARGETS += $(common_javalib.jar) +- +-ifeq ($(LOCAL_PROGUARD_ENABLED),disabled) +- LOCAL_PROGUARD_ENABLED := +-endif +- +-ifeq (true,$(EMMA_INSTRUMENT)) +-ifeq (true,$(LOCAL_EMMA_INSTRUMENT)) +-ifeq (true,$(EMMA_INSTRUMENT_STATIC)) +-LOCAL_STATIC_JAVA_LIBRARIES += jacocoagent +-# Exclude jacoco classes from proguard +-LOCAL_PROGUARD_FLAGS += -include $(BUILD_SYSTEM)/proguard.jacoco.flags +-endif # LOCAL_EMMA_INSTRUMENT +-endif # EMMA_INSTRUMENT_STATIC +-else +-LOCAL_EMMA_INSTRUMENT := false +-endif # EMMA_INSTRUMENT +- +-my_dex_jar := $(common_javalib.jar) +- +-################################# +-include $(BUILD_SYSTEM)/java.mk +-################################# +- +-ifeq ($(LOCAL_IS_STATIC_JAVA_LIBRARY),true) +-# There are some dependencies outside the build system that assume classes.jar +-# is available as javalib.jar so copy it there too. +-$(eval $(call copy-one-file,$(full_classes_pre_proguard_jar),$(common_javalib.jar))) +- +-$(eval $(call copy-one-file,$(full_classes_pre_proguard_jar),$(LOCAL_BUILT_MODULE))) +- +-else # !LOCAL_IS_STATIC_JAVA_LIBRARY +- +-$(common_javalib.jar): PRIVATE_DEX_FILE := $(built_dex) +-$(common_javalib.jar): PRIVATE_SOURCE_ARCHIVE := $(full_classes_pre_proguard_jar) +-$(common_javalib.jar): $(MERGE_ZIPS) $(SOONG_ZIP) $(ZIP2ZIP) +-$(common_javalib.jar) : $(built_dex) $(java_resource_sources) | $(ZIPTIME) $(ZIPALIGN) +- @echo "target Jar: $(PRIVATE_MODULE) ($@)" +- rm -rf $@.parts && mkdir -p $@.parts +- $(call create-dex-jar,$@.parts/dex.zip,$(PRIVATE_DEX_FILE)) +- $(call extract-resources-jar,$@.parts/res.zip,$(PRIVATE_SOURCE_ARCHIVE)) +- $(MERGE_ZIPS) -j $@.tmp $@.parts/dex.zip $@.parts/res.zip +- rm -rf $@.parts +- $(hide) $(ZIPTIME) $@.tmp +- $(call commit-change-for-toc,$@) +-ifeq (true, $(LOCAL_UNCOMPRESS_DEX)) +- $(uncompress-dexs) +- $(align-package) +-endif # LOCAL_UNCOMPRESS_DEX +- +-.KATI_RESTAT: $(common_javalib.jar) +- +-ifdef LOCAL_DEX_PREOPT +- +-$(LOCAL_BUILT_MODULE): PRIVATE_STRIP_SCRIPT := $(intermediates)/strip.sh +-$(LOCAL_BUILT_MODULE): $(intermediates)/strip.sh +-$(LOCAL_BUILT_MODULE): | $(DEXPREOPT_STRIP_DEPS) +-$(LOCAL_BUILT_MODULE): .KATI_DEPFILE := $(LOCAL_BUILT_MODULE).d +-$(LOCAL_BUILT_MODULE): $(common_javalib.jar) +- $(PRIVATE_STRIP_SCRIPT) $< $@ +- +-else # LOCAL_DEX_PREOPT +-$(eval $(call copy-one-file,$(common_javalib.jar),$(LOCAL_BUILT_MODULE))) +- +-endif # LOCAL_DEX_PREOPT +-endif # !LOCAL_IS_STATIC_JAVA_LIBRARY +diff --git a/core/main.mk b/core/main.mk +index e8a1c4f8ae..57e92f1e41 100644 +--- a/core/main.mk ++++ b/core/main.mk +@@ -181,8 +181,6 @@ endif + # Bring in standard build system definitions. + include $(BUILD_SYSTEM)/definitions.mk + +-# Bring in dex_preopt.mk +-include $(BUILD_SYSTEM)/dex_preopt.mk + + ifneq ($(filter user userdebug eng,$(MAKECMDGOALS)),) + $(info ***************************************************************) +@@ -446,6 +444,9 @@ subdir_makefiles_total := $(words int $(subdir_makefiles) post finish) + + $(foreach mk,$(subdir_makefiles),$(info [$(call inc_and_print,subdir_makefiles_inc)/$(subdir_makefiles_total)] including $(mk) ...)$(eval include $(mk))) + ++ALL_MODULES := $(HYBRIS_TARGETS) ++ALL_LINK_TYPES := $(foreach r,$(ALL_MODULES),$(shell echo $(filter %:%:$(r),$(ALL_LINK_TYPES)))) ++ + ifneq (,$(PDK_FUSION_PLATFORM_ZIP)$(PDK_FUSION_PLATFORM_DIR)) + # Bring in the PDK platform.zip modules. + include $(BUILD_SYSTEM)/pdk_fusion_modules.mk +diff --git a/core/package.mk b/core/package.mk +index 854e0093c6..e69de29bb2 100644 +--- a/core/package.mk ++++ b/core/package.mk +@@ -1,86 +0,0 @@ +-# We don't automatically set up rules to build packages for both +-# TARGET_ARCH and TARGET_2ND_ARCH. +-# To build it for TARGET_2ND_ARCH in a 64bit product, use "LOCAL_MULTILIB := 32". +- +-$(call record-module-type,PACKAGE) +- +-my_prefix := TARGET_ +-include $(BUILD_SYSTEM)/multilib.mk +- +-ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true) +- ifeq ($(TARGET_SUPPORTS_64_BIT_APPS),true) +- my_module_multilib := first +- else ifneq ($(my_module_multilib),64) +- my_module_multilib := first +- endif +-endif +- +-ifeq ($(TARGET_SUPPORTS_32_BIT_APPS)|$(TARGET_SUPPORTS_64_BIT_APPS),true|true) +- # packages default to building for either architecture, +- # the preferred if its supported, otherwise the non-preferred. +-else ifeq ($(TARGET_SUPPORTS_64_BIT_APPS),true) +- # only 64-bit apps supported +- ifeq ($(filter $(my_module_multilib),64 both first),$(my_module_multilib)) +- # if my_module_multilib was 64, both, first, or unset, build for 64-bit +- my_module_multilib := 64 +- else +- # otherwise don't build this app +- my_module_multilib := none +- endif +-else +- # only 32-bit apps supported +- ifeq ($(filter $(my_module_multilib),32 both),$(my_module_multilib)) +- # if my_module_multilib was 32, both, or unset, build for 32-bit +- my_module_multilib := 32 +- else ifeq ($(my_module_multilib),first) +- ifndef TARGET_IS_64_BIT +- # if my_module_multilib was first and this is a 32-bit build, build for +- # 32-bit +- my_module_multilib := 32 +- else +- # if my_module_multilib was first and this is a 64-bit build, don't build +- # this app +- my_module_multilib := none +- endif +- else +- # my_module_mulitlib was 64 or none, don't build this app +- my_module_multilib := none +- endif +-endif +- +-LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := true +- +-# if TARGET_PREFER_32_BIT_APPS is set, try to build 32-bit first +-ifdef TARGET_2ND_ARCH +-ifeq ($(TARGET_PREFER_32_BIT_APPS),true) +-LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX) +-else +-LOCAL_2ND_ARCH_VAR_PREFIX := +-endif +-endif +- +-# check if preferred arch is supported +-include $(BUILD_SYSTEM)/module_arch_supported.mk +-ifeq ($(my_module_arch_supported),true) +-# first arch is supported +-include $(BUILD_SYSTEM)/package_internal.mk +-else ifneq (,$(TARGET_2ND_ARCH)) +-# check if the non-preferred arch is the primary or secondary +-ifeq ($(TARGET_PREFER_32_BIT_APPS),true) +-LOCAL_2ND_ARCH_VAR_PREFIX := +-else +-LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX) +-endif +- +-# check if non-preferred arch is supported +-include $(BUILD_SYSTEM)/module_arch_supported.mk +-ifeq ($(my_module_arch_supported),true) +-# secondary arch is supported +-include $(BUILD_SYSTEM)/package_internal.mk +-endif +-endif # TARGET_2ND_ARCH +- +-LOCAL_2ND_ARCH_VAR_PREFIX := +-LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := +- +-my_module_arch_supported := +diff --git a/core/soong_droiddoc_prebuilt.mk b/core/soong_droiddoc_prebuilt.mk +index c0467df2be..4969299637 100644 +--- a/core/soong_droiddoc_prebuilt.mk ++++ b/core/soong_droiddoc_prebuilt.mk +@@ -1,43 +1,3 @@ +-# Droiddoc prebuilt coming from Soong. +- +-ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) +- $(call pretty-error,soong_droiddoc_prebuilt.mk may only be used from Soong) +-endif +- +-ifdef LOCAL_DROIDDOC_STUBS_SRCJAR +-$(eval $(call copy-one-file,$(LOCAL_DROIDDOC_STUBS_SRCJAR),$(OUT_DOCS)/$(LOCAL_MODULE)-stubs.srcjar)) +-ALL_DOCS += $(OUT_DOCS)/$(LOCAL_MODULE)-stubs.srcjar +- +-.PHONY: $(LOCAL_MODULE) +-$(LOCAL_MODULE) : $(OUT_DOCS)/$(LOCAL_MODULE)-stubs.srcjar +-endif +- +-ifdef LOCAL_DROIDDOC_DOC_ZIP +-$(eval $(call copy-one-file,$(LOCAL_DROIDDOC_DOC_ZIP),$(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip)) +-$(call dist-for-goals,docs,$(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip) +- +-.PHONY: $(LOCAL_MODULE) $(LOCAL_MODULE)-docs.zip +-$(LOCAL_MODULE) $(LOCAL_MODULE)-docs.zip : $(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip +-ALL_DOCS += $(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip +-endif +- +-ifdef LOCAL_DROIDDOC_ANNOTATIONS_ZIP +-$(eval $(call copy-one-file,$(LOCAL_DROIDDOC_ANNOTATIONS_ZIP),$(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(LOCAL_MODULE)_annotations.zip)) +-endif +- +-ifdef LOCAL_DROIDDOC_API_VERSIONS_XML +-$(eval $(call copy-one-file,$(LOCAL_DROIDDOC_API_VERSIONS_XML),$(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(LOCAL_MODULE)_generated-api-versions.xml)) +-endif +- +-ifdef LOCAL_DROIDDOC_JDIFF_DOC_ZIP +-$(eval $(call copy-one-file,$(LOCAL_DROIDDOC_JDIFF_DOC_ZIP),$(OUT_DOCS)/$(LOCAL_MODULE)-jdiff-docs.zip)) +-$(call dist-for-goals,docs,$(OUT_DOCS)/$(LOCAL_MODULE)-jdiff-docs.zip) +- +-ALL_DOCS += $(OUT_DOCS)/$(LOCAL_MODULE)-jdiff-docs.zip +- +-.PHONY: $(LOCAL_MODULE) $(LOCAL_MODULE)-jdiff +-$(LOCAL_MODULE) $(LOCAL_MODULE)-jdiff : $(OUT_DOCS)/$(LOCAL_MODULE)-jdiff-docs.zip +-endif + + ifdef LOCAL_DROIDDOC_METADATA_ZIP + $(eval $(call copy-one-file,$(LOCAL_DROIDDOC_METADATA_ZIP),$(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(LOCAL_MODULE)-metadata.zip)) +diff --git a/core/static_java_library.mk b/core/static_java_library.mk +index ee759b9d8e..e69de29bb2 100644 +--- a/core/static_java_library.mk ++++ b/core/static_java_library.mk +@@ -1,247 +0,0 @@ +-# +-# Copyright (C) 2008 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. +-# +- +-# Standard rules for building a "static" java library. +-# Static java libraries are not installed, nor listed on any +-# classpaths. They can, however, be included wholesale in +-# other java modules. +- +-$(call record-module-type,STATIC_JAVA_LIBRARY) +-LOCAL_UNINSTALLABLE_MODULE := true +-LOCAL_IS_STATIC_JAVA_LIBRARY := true +-LOCAL_MODULE_CLASS := JAVA_LIBRARIES +- +-intermediates.COMMON := $(call local-intermediates-dir,COMMON) +- +-my_res_package := +- +-# Process Support Library dependencies. +-include $(BUILD_SYSTEM)/support_libraries.mk +- +-include $(BUILD_SYSTEM)/force_aapt2.mk +- +-ifdef LOCAL_AAPT2_ONLY +-LOCAL_USE_AAPT2 := true +-endif +- +-# Hack to build static Java library with Android resource +-# See bug 5714516 +-all_resources := +-need_compile_res := +-# A static Java library needs to explicily set LOCAL_RESOURCE_DIR. +-ifdef LOCAL_RESOURCE_DIR +-need_compile_res := true +-LOCAL_RESOURCE_DIR := $(foreach d,$(LOCAL_RESOURCE_DIR),$(call clean-path,$(d))) +-endif +-ifeq ($(LOCAL_USE_AAPT2),true) +-ifneq ($(strip $(LOCAL_STATIC_ANDROID_LIBRARIES) $(LOCAL_STATIC_JAVA_AAR_LIBRARIES)),) +-need_compile_res := true +-endif +-endif +- +-ifeq ($(need_compile_res),true) +-all_resources := $(strip \ +- $(foreach dir, $(LOCAL_RESOURCE_DIR), \ +- $(addprefix $(dir)/, \ +- $(patsubst res/%,%, \ +- $(call find-subdir-assets,$(dir)) \ +- ) \ +- ) \ +- )) +- +-# By default we should remove the R/Manifest classes from a static Java library, +-# because they will be regenerated in the app that uses it. +-# But if the static Java library will be used by a library, then we may need to +-# keep the generated classes with "LOCAL_JAR_EXCLUDE_FILES := none". +-ifndef LOCAL_JAR_EXCLUDE_FILES +-LOCAL_JAR_EXCLUDE_FILES := $(ANDROID_RESOURCE_GENERATED_CLASSES) +-endif +-ifeq (none,$(LOCAL_JAR_EXCLUDE_FILES)) +-LOCAL_JAR_EXCLUDE_FILES := +-endif +- +-proguard_options_file := +- +-ifneq ($(filter custom,$(LOCAL_PROGUARD_ENABLED)),custom) +- proguard_options_file := $(intermediates.COMMON)/proguard_options +-endif +- +-LOCAL_PROGUARD_FLAGS := $(addprefix -include ,$(proguard_options_file)) $(LOCAL_PROGUARD_FLAGS) +- +-R_file_stamp := $(intermediates.COMMON)/src/R.stamp +-LOCAL_INTERMEDIATE_TARGETS += $(R_file_stamp) +- +-ifeq ($(LOCAL_USE_AAPT2),true) +- ifneq ($(strip $(LOCAL_STATIC_ANDROID_LIBRARIES) $(LOCAL_STATIC_JAVA_AAR_LIBRARIES)),) +- # If we are using static android libraries, every source file becomes an overlay. +- # This is to emulate old AAPT behavior which simulated library support. +- my_res_resources := +- my_overlay_resources := $(all_resources) +- else +- # Otherwise, for a library we treat all the resource equal with no overlay. +- my_res_resources := $(all_resources) +- my_overlay_resources := +- endif +- # For libraries put everything in the COMMON intermediate directory. +- my_res_package := $(intermediates.COMMON)/package-res.apk +- +- LOCAL_INTERMEDIATE_TARGETS += $(my_res_package) +-endif # LOCAL_USE_AAPT2 +- +-endif # need_compile_res +- +-all_res_assets := $(all_resources) +- +-include $(BUILD_SYSTEM)/java_renderscript.mk +- +-ifeq (true,$(need_compile_res)) +-include $(BUILD_SYSTEM)/android_manifest.mk +- +-LOCAL_SDK_RES_VERSION:=$(strip $(LOCAL_SDK_RES_VERSION)) +-ifeq ($(LOCAL_SDK_RES_VERSION),) +- LOCAL_SDK_RES_VERSION:=$(LOCAL_SDK_VERSION) +-endif +- +-framework_res_package_export := +-# Please refer to package.mk +-ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) +-ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS_USE_PREBUILT_SDK),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),) +-framework_res_package_export := \ +- $(call resolve-prebuilt-sdk-jar-path,$(LOCAL_SDK_RES_VERSION)) +-else +-framework_res_package_export := \ +- $(call intermediates-dir-for,APPS,framework-res,,COMMON)/package-export.apk +-endif +-endif +- +-ifeq ($(LOCAL_USE_AAPT2),true) +-import_proguard_flag_files := $(strip $(foreach l,$(LOCAL_STATIC_ANDROID_LIBRARIES) $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\ +- $(call intermediates-dir-for,JAVA_LIBRARIES,$(l),,COMMON)/export_proguard_flags)) +-$(intermediates.COMMON)/export_proguard_flags: $(import_proguard_flag_files) $(addprefix $(LOCAL_PATH)/,$(LOCAL_EXPORT_PROGUARD_FLAG_FILES)) +- @echo "Export proguard flags: $@" +- rm -f $@ +- touch $@ +- for f in $+; do \ +- echo -e "\n# including $$f" >>$@; \ +- cat $$f >>$@; \ +- done +-import_proguard_flag_files := +-endif +- +-include $(BUILD_SYSTEM)/aapt_flags.mk +- +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_AAPT_CHARACTERISTICS := $(TARGET_AAPT_CHARACTERISTICS) +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_MANIFEST_PACKAGE_NAME := $(LOCAL_MANIFEST_PACKAGE_NAME) +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_MANIFEST_INSTRUMENTATION_FOR := $(LOCAL_MANIFEST_INSTRUMENTATION_FOR) +- +-# add --non-constant-id to prevent inlining constants. +-# AAR needs text symbol file R.txt. +-ifeq ($(LOCAL_USE_AAPT2),true) +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) --static-lib --output-text-symbols $(intermediates.COMMON)/R.txt +-ifndef LOCAL_AAPT_NAMESPACES +- $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_AAPT_FLAGS += --no-static-lib-packages +-endif +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_PRODUCT_AAPT_CONFIG := +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_AAPT_CHARACTERISTICS := +-else +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) --non-constant-id --output-text-symbols $(intermediates.COMMON) +- +-my_srcjar := $(intermediates.COMMON)/aapt.srcjar +-LOCAL_SRCJARS += $(my_srcjar) +-$(R_file_stamp): PRIVATE_SRCJAR := $(my_srcjar) +-$(R_file_stamp): PRIVATE_JAVA_GEN_DIR := $(intermediates.COMMON)/aapt +-$(R_file_stamp): .KATI_IMPLICIT_OUTPUTS := $(my_srcjar) +-endif +- +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ANDROID_MANIFEST := $(full_android_manifest) +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RESOURCE_PUBLICS_OUTPUT := $(intermediates.COMMON)/public_resources.xml +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RESOURCE_DIR := $(LOCAL_RESOURCE_DIR) +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_AAPT_INCLUDES := $(framework_res_package_export) +- +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ASSET_DIR := +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_PROGUARD_OPTIONS_FILE := $(proguard_options_file) +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_MANIFEST_PACKAGE_NAME := +-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_MANIFEST_INSTRUMENTATION_FOR := +- +-ifeq ($(LOCAL_USE_AAPT2),true) +- # One more level with name res so we can zip up the flat resources that can be linked by apps. +- my_compiled_res_base_dir := $(intermediates.COMMON)/flat-res/res +- ifneq (,$(filter-out current,$(renderscript_target_api))) +- ifneq ($(call math_gt_or_eq,$(renderscript_target_api),21),true) +- my_generated_res_zips := $(rs_generated_res_zip) +- endif # renderscript_target_api < 21 +- endif # renderscript_target_api is set +- include $(BUILD_SYSTEM)/aapt2.mk +- $(my_res_package) : $(framework_res_package_export) +- $(my_res_package): .KATI_IMPLICIT_OUTPUTS += $(intermediates.COMMON)/R.txt +-else +- $(R_file_stamp): .KATI_IMPLICIT_OUTPUTS += $(intermediates.COMMON)/R.txt +- $(R_file_stamp): PRIVATE_RESOURCE_LIST := $(all_resources) +- $(R_file_stamp) : $(all_resources) $(full_android_manifest) $(AAPT) $(SOONG_ZIP) \ +- $(framework_res_package_export) $(rs_generated_res_zip) +- @echo "target R.java/Manifest.java: $(PRIVATE_MODULE) ($@)" +- $(create-resource-java-files) +- $(hide) find $(PRIVATE_JAVA_GEN_DIR) -name R.java | xargs cat > $@ +-endif # LOCAL_USE_AAPT2 +- +-endif # need_compile_res +- +-include $(BUILD_SYSTEM)/java_library.mk +- +-ifeq (true,$(need_compile_res)) +- +-$(LOCAL_BUILT_MODULE): $(R_file_stamp) +-$(java_source_list_file): $(R_file_stamp) +-$(full_classes_compiled_jar): $(R_file_stamp) +-$(full_classes_turbine_jar): $(R_file_stamp) +- +- +-# if we have custom proguarding done use the proguarded classes jar instead of the normal classes jar +-ifeq ($(filter custom,$(LOCAL_PROGUARD_ENABLED)),custom) +-aar_classes_jar = $(full_classes_jar) +-else +-aar_classes_jar = $(full_classes_pre_proguard_jar) +-endif +- +-# Rule to build AAR, archive including classes.jar, resource, etc. +-built_aar := $(intermediates.COMMON)/javalib.aar +-$(built_aar): PRIVATE_MODULE := $(LOCAL_MODULE) +-$(built_aar): PRIVATE_ANDROID_MANIFEST := $(full_android_manifest) +-$(built_aar): PRIVATE_CLASSES_JAR := $(aar_classes_jar) +-$(built_aar): PRIVATE_RESOURCE_DIR := $(LOCAL_RESOURCE_DIR) +-$(built_aar): PRIVATE_R_TXT := $(intermediates.COMMON)/R.txt +-$(built_aar): $(JAR_ARGS) +-$(built_aar) : $(aar_classes_jar) $(full_android_manifest) $(intermediates.COMMON)/R.txt +- @echo "target AAR: $(PRIVATE_MODULE) ($@)" +- $(hide) rm -rf $(dir $@)aar && mkdir -p $(dir $@)aar/res +- $(hide) cp $(PRIVATE_ANDROID_MANIFEST) $(dir $@)aar/AndroidManifest.xml +- $(hide) cp $(PRIVATE_CLASSES_JAR) $(dir $@)aar/classes.jar +- # Note: Use "cp -n" to honor the resource overlay rules, if multiple res dirs exist. +- $(hide) $(foreach res,$(PRIVATE_RESOURCE_DIR),cp -Rfn $(res)/* $(dir $@)aar/res;) +- $(hide) cp $(PRIVATE_R_TXT) $(dir $@)aar/R.txt +- $(hide) $(JAR) -cMf $@ \ +- $(call jar-args-sorted-files-in-directory,$(dir $@)aar) +- +-# Register the aar file. +-ALL_MODULES.$(LOCAL_MODULE).AAR := $(built_aar) +-endif # need_compile_res +- +-# Reset internal variables. +-aar_classes_jar := +-all_res_assets := +-LOCAL_IS_STATIC_JAVA_LIBRARY := +diff --git a/target/product/base_system.mk b/target/product/base_system.mk +index 699b9c7a14..990e565b88 100644 +--- a/target/product/base_system.mk ++++ b/target/product/base_system.mk +@@ -307,9 +307,9 @@ PRODUCT_HOST_PACKAGES += \ + tz_version_host \ + tz_version_host_runtime_apex \ + +-ifeq ($(TARGET_CORE_JARS),) +-$(error TARGET_CORE_JARS is empty; cannot initialize PRODUCT_BOOT_JARS variable) +-endif ++#ifeq ($(TARGET_CORE_JARS),) ++#$(error TARGET_CORE_JARS is empty; cannot initialize PRODUCT_BOOT_JARS variable) ++#endif + + # The order matters for runtime class lookup performance. + PRODUCT_BOOT_JARS := \ +diff --git a/target/product/runtime_libart.mk b/target/product/runtime_libart.mk +index a88ba3c8d0..4ab27994be 100644 +--- a/target/product/runtime_libart.mk ++++ b/target/product/runtime_libart.mk +@@ -16,9 +16,9 @@ + + # Provides a functioning ART environment without Android frameworks + +-ifeq ($(TARGET_CORE_JARS),) +-$(error TARGET_CORE_JARS is empty; cannot update PRODUCT_PACKAGES variable) +-endif ++#ifeq ($(TARGET_CORE_JARS),) ++#$(error TARGET_CORE_JARS is empty; cannot update PRODUCT_PACKAGES variable) ++#endif + + # Minimal boot classpath. This should be a subset of PRODUCT_BOOT_JARS, and equivalent to + # TARGET_CORE_JARS. +-- +2.35.1 + diff --git a/build/make/0003-hybris-Disable-APEX-check-we-don-t-care-about-it.patch b/build/make/0003-hybris-Disable-APEX-check-we-don-t-care-about-it.patch new file mode 100644 index 0000000..65f767a --- /dev/null +++ b/build/make/0003-hybris-Disable-APEX-check-we-don-t-care-about-it.patch @@ -0,0 +1,26 @@ +From 612e0e295a46f61826f2006d86cc4065992a0c54 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= +Date: Fri, 18 Oct 2019 11:43:31 +0200 +Subject: [PATCH 2/2] (hybris) Disable APEX check, we don't care about it. + +Change-Id: I1099755d6ec01f10b70c78ca68af822ccafb2b6f +--- + core/main.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/core/main.mk b/core/main.mk +index 57e92f1e41..641c7a664a 100644 +--- a/core/main.mk ++++ b/core/main.mk +@@ -1214,7 +1214,7 @@ APEX_MODULE_LIBS += \ + + # An option to disable the check below, for local use since some build targets + # still may create these libraries in /system (b/129006418). +-DISABLE_APEX_LIBS_ABSENCE_CHECK ?= ++DISABLE_APEX_LIBS_ABSENCE_CHECK ?= 1 + + # Bionic should not be in /system, except for the bootstrap instance. + APEX_LIBS_ABSENCE_CHECK_EXCLUDE := lib/bootstrap lib64/bootstrap +-- +2.35.1 + diff --git a/lineage-sdk/0001-hybris-Disable-aar-build.patch b/lineage-sdk/0001-hybris-Disable-aar-build.patch new file mode 100644 index 0000000..ecd6861 --- /dev/null +++ b/lineage-sdk/0001-hybris-Disable-aar-build.patch @@ -0,0 +1,70 @@ +From c170bed035d8a6e37a4d72c732f751f7b7c84ea6 Mon Sep 17 00:00:00 2001 +From: Matti Lehtimaki +Date: Sat, 2 Jan 2021 00:37:09 +0200 +Subject: [PATCH] (hybris) Disable aar build. + +Change-Id: I0578ae72dfe7aa4931e48066ae019937322a68dc +--- + Android.mk | 46 ---------------------------------------------- + 1 file changed, 46 deletions(-) + +diff --git a/Android.mk b/Android.mk +index b813d480..0659089d 100644 +--- a/Android.mk ++++ b/Android.mk +@@ -39,52 +39,6 @@ $(lineage_framework_module): | $(dir $(lineage_framework_module))org.lineageos.p + + lineage_framework_built := $(call java-lib-deps, org.lineageos.platform) + +-# the sdk as an aar for publish, not built as part of full target +-# DO NOT LINK AGAINST THIS IN BUILD +-# ============================================================ +-include $(CLEAR_VARS) +- +-LOCAL_MODULE := org.lineageos.platform.sdk.aar +- +-LOCAL_JACK_ENABLED := disabled +- +-LOCAL_CONSUMER_PROGUARD_FILE := $(LOCAL_PATH)/sdk/proguard.txt +- +-LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, sdk/res/res) +-LOCAL_MANIFEST_FILE := sdk/AndroidManifest.xml +- +-lineage_sdk_exclude_files := 'lineageos/library' +-LOCAL_JAR_EXCLUDE_PACKAGES := $(lineage_sdk_exclude_files) +-LOCAL_JAR_EXCLUDE_FILES := none +- +-LOCAL_STATIC_JAVA_LIBRARIES := org.lineageos.platform.sdk +- +-include $(BUILD_STATIC_JAVA_LIBRARY) +-$(LOCAL_MODULE) : $(built_aar) +- +-# =========================================================== +-# Common Droiddoc vars +-lineage_platform_docs_src_files := \ +- $(call all-java-files-under, $(lineage_sdk_src)) \ +- $(call all-html-files-under, $(lineage_sdk_src)) +- +-lineage_platform_docs_java_libraries := \ +- org.lineageos.platform.sdk +- +-# SDK version as defined +-lineage_platform_docs_SDK_VERSION := 15.1 +- +-# release version +-lineage_platform_docs_SDK_REL_ID := 9 +- +-lineage_platform_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES +- +-lineage_platform_docs_LOCAL_DROIDDOC_SOURCE_PATH := \ +- $(lineage_platform_docs_src_files) +- +-lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR := \ +- $(call intermediates-dir-for,JAVA_LIBRARIES,org.lineageos.platform.sdk,,COMMON) +- + # ==== the api stubs and current.xml =========================== + include $(CLEAR_VARS) + +-- +2.35.1 + diff --git a/system/sepolicy/0001-sepolicy-disable-tests.patch b/system/sepolicy/0001-sepolicy-disable-tests.patch new file mode 100644 index 0000000..abfb4bd --- /dev/null +++ b/system/sepolicy/0001-sepolicy-disable-tests.patch @@ -0,0 +1,41 @@ +From 84ee442a251ff89989e6ac56dc79bd9b360cad9a Mon Sep 17 00:00:00 2001 +From: Alexander Martinz +Date: Tue, 22 Mar 2022 19:11:55 +0100 +Subject: [PATCH] sepolicy: disable tests + +Change-Id: I207bd8c63d82b8856969bb78955d342b4fb8ae02 +Signed-off-by: Alexander Martinz +--- + Android.mk | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/Android.mk b/Android.mk +index dadd7b0a6..1e7cffcd3 100644 +--- a/Android.mk ++++ b/Android.mk +@@ -238,14 +238,14 @@ LOCAL_REQUIRED_MODULES += \ + + endif # ($(PRODUCT_SEPOLICY_SPLIT),true) + +-ifneq ($(with_asan),true) +-ifneq ($(SELINUX_IGNORE_NEVERALLOWS),true) +-LOCAL_REQUIRED_MODULES += \ +- sepolicy_tests \ +- $(addprefix treble_sepolicy_tests_,$(PLATFORM_SEPOLICY_COMPAT_VERSIONS)) \ +- +-endif +-endif ++#ifneq ($(with_asan),true) ++#ifneq ($(SELINUX_IGNORE_NEVERALLOWS),true) ++#LOCAL_REQUIRED_MODULES += \ ++# sepolicy_tests \ ++# $(addprefix treble_sepolicy_tests_,$(PLATFORM_SEPOLICY_COMPAT_VERSIONS)) \ ++# ++#endif ++#endif + + ifneq ($(PLATFORM_SEPOLICY_VERSION),$(TOT_SEPOLICY_VERSION)) + LOCAL_REQUIRED_MODULES += \ +-- +2.35.1 +