From 4c0ac42c0601fb9cb1524f78565a2fcffdf5dde1 Mon Sep 17 00:00:00 2001 From: Eric Jeong Date: Mon, 14 Feb 2022 23:38:54 -0800 Subject: [PATCH 001/139] Remove iorapd from base product packages - iorapd is being removed. - So, it cannot be installed. Bug: 211461392 Test: build okay Change-Id: I17491f42ca7a0b73de0b3a3c588a90c8e3e3f3e9 --- target/product/base_system.mk | 1 - target/product/runtime_libart.mk | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 44f219126f..2368533a7c 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -122,7 +122,6 @@ PRODUCT_PACKAGES += \ input \ installd \ IntentResolver \ - iorapd \ ip \ iptables \ ip-up-vpn \ diff --git a/target/product/runtime_libart.mk b/target/product/runtime_libart.mk index ee63757c95..b6560fc8f3 100644 --- a/target/product/runtime_libart.mk +++ b/target/product/runtime_libart.mk @@ -148,17 +148,6 @@ PRODUCT_SYSTEM_PROPERTIES += \ dalvik.vm.minidebuginfo=true \ dalvik.vm.dex2oat-minidebuginfo=true -# Two other device configs are added to IORap besides "ro.iorapd.enable". -# IORap by default is off and starts when -# (https://source.corp.google.com/android/system/iorap/iorapd.rc?q=iorapd.rc) -# -# * "ro.iorapd.enable" is true excluding unset -# * One of the device configs is true. -# -# "ro.iorapd.enable" has to be set to true, so that iorap can be started. -PRODUCT_SYSTEM_PROPERTIES += \ - ro.iorapd.enable?=true - # Enable Madvising of the whole art, odex and vdex files to MADV_WILLNEED. # The size specified here is the size limit of how much of the file # (in bytes) is madvised. From eb701cb4c01e2a2fabc61e8bc811be9ccfd4f8d1 Mon Sep 17 00:00:00 2001 From: paulhu Date: Tue, 8 Feb 2022 21:21:41 +0800 Subject: [PATCH 002/139] Rename framework-connectivity-tiramisu to framework-connectivity-t Bug: 215434166 Test: build, flash, device boot to home. Change-Id: I046503a60f39aa1ec6026c139203b1a1d5a7dab5 --- target/product/default_art_config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/product/default_art_config.mk b/target/product/default_art_config.mk index 2e34a3d2dd..531af33a76 100644 --- a/target/product/default_art_config.mk +++ b/target/product/default_art_config.mk @@ -66,7 +66,7 @@ PRODUCT_APEX_BOOT_JARS := \ com.android.sdkext:framework-sdkextensions \ com.android.supplementalprocess:framework-supplementalprocess \ com.android.tethering:framework-connectivity \ - com.android.tethering:framework-connectivity-tiramisu \ + com.android.tethering:framework-connectivity-t \ com.android.tethering:framework-tethering \ com.android.uwb:framework-uwb \ com.android.wifi:framework-wifi \ From 0883e078947f08b988f59f9aa8ce19ba13a7abba Mon Sep 17 00:00:00 2001 From: Bassem Khalife Date: Tue, 15 Feb 2022 22:46:03 +0000 Subject: [PATCH 003/139] Adding members of the RelPgM team to fast track monthly Security SPL update approval Bug: 219813826 Change-Id: I957681a17b517fb451f149c0c77fb90538f77bf4 --- core/OWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/OWNERS b/core/OWNERS index 8794434f7b..4873e8bd85 100644 --- a/core/OWNERS +++ b/core/OWNERS @@ -2,5 +2,5 @@ per-file dex_preopt*.mk = ngeoffray@google.com,calin@google.com,mathewi@google.c per-file verify_uses_libraries.sh = ngeoffray@google.com,calin@google.com,skvadrik@google.com # For version updates -per-file version_defaults.mk = aseaton@google.com,elisapascual@google.com,lubomir@google.com,pscovanner@google.com +per-file version_defaults.mk = aseaton@google.com,lubomir@google.com,pscovanner@google.com,bkhalife@google.com,sberbary@google.com,jainne@google.com From 40d69a1250019ac1504df100834ae5e7d85e8aaa Mon Sep 17 00:00:00 2001 From: Yurii Zubrytskyi Date: Thu, 17 Feb 2022 12:27:08 -0800 Subject: [PATCH 004/139] Store raw values for rro attributes aapt2 changes the values of xml attributes when compiling, and this may break applications that rely on the exact string representation of those. This CL adds an aapt2 command line switch to preserve the original values Bug: 194436243 Test: manual Change-Id: Id352cbf209739fd9a094de9068d12049ea6e3e51 --- core/generate_enforce_rro.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/generate_enforce_rro.mk b/core/generate_enforce_rro.mk index 9079981856..ed258cc96d 100644 --- a/core/generate_enforce_rro.mk +++ b/core/generate_enforce_rro.mk @@ -38,7 +38,7 @@ endif LOCAL_FULL_MANIFEST_FILE := $(rro_android_manifest_file) -LOCAL_AAPT_FLAGS += --auto-add-overlay +LOCAL_AAPT_FLAGS += --auto-add-overlay --keep-raw-values LOCAL_RESOURCE_DIR := $(enforce_rro_source_overlays) ifeq (product,$(enforce_rro_partition)) From 7475d557e4ef3961fc5b02f51933b59b64353b38 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 17 Feb 2022 11:29:27 -0800 Subject: [PATCH 005/139] Use single module for clang runtime libraries The clang prebuilts now provide a single module with per-architecture variants instead of a module per architecture. Bug: 220019988 Test: m checkbuild Change-Id: Ie01cbca9cee73bf39ed54eca306d45f0bd4f3867 --- target/product/base_system.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index e025e388d7..739c20e6e8 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -301,7 +301,7 @@ PRODUCT_PACKAGES += \ # HWASAN runtime for SANITIZE_TARGET=hwaddress builds ifneq (,$(filter hwaddress,$(SANITIZE_TARGET))) PRODUCT_PACKAGES += \ - libclang_rt.hwasan-aarch64-android.bootstrap + libclang_rt.hwasan.bootstrap endif # Jacoco agent JARS to be built and installed, if any. From 2e632820599ba56b10dcd183af3b63aa67082a71 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Tue, 23 Nov 2021 22:11:41 +0000 Subject: [PATCH 006/139] Add android.hardware.audio.core-V1-ndk to GSI This is the AIDL version of the audio HAL. Bug: 205884982 Test: m Change-Id: If5a4958dcdd404789b5a3321121e0bd0d904b90d --- target/product/gsi/current.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt index 599d8f9602..44d4facae9 100644 --- a/target/product/gsi/current.txt +++ b/target/product/gsi/current.txt @@ -60,6 +60,7 @@ VNDK-SP: libutilscallstack.so VNDK-SP: libz.so VNDK-core: android.hardware.audio.common-V1-ndk.so VNDK-core: android.hardware.audio.common@2.0.so +VNDK-core: android.hardware.audio.core-V1-ndk.so VNDK-core: android.hardware.authsecret-V1-ndk.so VNDK-core: android.hardware.automotive.occupant_awareness-V1-ndk.so VNDK-core: android.hardware.bluetooth.audio-V1-ndk.so From 29919e3b66bc570bcd1bf05fd75831a302405383 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 24 Feb 2022 13:40:46 -0800 Subject: [PATCH 007/139] Update PLATFORM_VERSION to UP1A Update PLATFORM_VERSION to UP1A. The codename is now UpsideDownCake. Bug: 219519679 Test: m checkbuild Change-Id: I61db64b279e4e64c9be33095bf98b3bbdb0e19d8 --- core/version_defaults.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 2c00c16b45..16e3fcf9a7 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -40,10 +40,10 @@ ifdef INTERNAL_BUILD_ID_MAKEFILE include $(INTERNAL_BUILD_ID_MAKEFILE) endif -DEFAULT_PLATFORM_VERSION := TP1A +DEFAULT_PLATFORM_VERSION := UP1A .KATI_READONLY := DEFAULT_PLATFORM_VERSION MIN_PLATFORM_VERSION := TP1A -MAX_PLATFORM_VERSION := TP1A +MAX_PLATFORM_VERSION := UP1A # The last stable version name of the platform that was released. During # development, this stays at that previous version, while the codename indicates @@ -54,6 +54,7 @@ PLATFORM_VERSION_LAST_STABLE := 12 # 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.TP1A := Tiramisu +PLATFORM_VERSION_CODENAME.UP1A := UpsideDownCake # This is the user-visible version. In a final release build it should # be empty to use PLATFORM_VERSION as the user-visible version. For @@ -90,7 +91,7 @@ PLATFORM_VERSION_KNOWN_CODENAMES := \ Base Base11 Cupcake Donut Eclair Eclair01 EclairMr1 Froyo Gingerbread GingerbreadMr1 \ Honeycomb HoneycombMr1 HoneycombMr2 IceCreamSandwich IceCreamSandwichMr1 \ JellyBean JellyBeanMr1 JellyBeanMr2 Kitkat KitkatWatch Lollipop LollipopMr1 M N NMr1 O OMr1 P \ -Q R S Sv2 Tiramisu +Q R S Sv2 Tiramisu UpsideDownCake # Convert from space separated list to comma separated PLATFORM_VERSION_KNOWN_CODENAMES := \ From 78c0c1c1be94f9759b68b7837fe7f1b9edee3144 Mon Sep 17 00:00:00 2001 From: Bassem Khalife Date: Wed, 20 Apr 2022 22:26:00 +0000 Subject: [PATCH 008/139] Revert "Adding members of the RelPgM team to fast track monthly Security SPL update approval" This reverts commit 0883e078947f08b988f59f9aa8ce19ba13a7abba. Reason for revert: Making the change in aosp-master first to avoid future merger conflicts. Change-Id: I6fadaa9d06125ab1fc848bbf88757812e81e8690 --- core/OWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/OWNERS b/core/OWNERS index 4873e8bd85..8794434f7b 100644 --- a/core/OWNERS +++ b/core/OWNERS @@ -2,5 +2,5 @@ per-file dex_preopt*.mk = ngeoffray@google.com,calin@google.com,mathewi@google.c per-file verify_uses_libraries.sh = ngeoffray@google.com,calin@google.com,skvadrik@google.com # For version updates -per-file version_defaults.mk = aseaton@google.com,lubomir@google.com,pscovanner@google.com,bkhalife@google.com,sberbary@google.com,jainne@google.com +per-file version_defaults.mk = aseaton@google.com,elisapascual@google.com,lubomir@google.com,pscovanner@google.com From 102b9c1b34a201c0dbe2ce629d1887ee46344804 Mon Sep 17 00:00:00 2001 From: Oriol Prieto Gasco Date: Fri, 20 May 2022 17:42:31 +0000 Subject: [PATCH 009/139] RESTRICT AUTOMERGE Update Build ID for APK-in-APEX fix for July Bug: 232929590 Change-Id: Icbf8cc0f14723155cd70eb1c4c4fde028302879a --- core/build_id.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/build_id.mk b/core/build_id.mk index a4897887a2..63aa8fbf1b 100644 --- a/core/build_id.mk +++ b/core/build_id.mk @@ -18,4 +18,4 @@ # (like "CRB01"). It must be a single word, and is # capitalized by convention. -BUILD_ID=TM +BUILD_ID=M_2022_07 From 288d4b6149f9fe5618fda907c137334191551254 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Tue, 24 May 2022 15:47:40 +0000 Subject: [PATCH 010/139] Change default arch for banchan to arm64 Devices that only support 32-bit are very uncommon. Default to the arch that module authors are most likely to be using. Test: banchan com.android.sdkext | grep TARGET_PRODUCT Test: banchan com.android.sdkext arm | grep TARGET_PRODUCT Test: banchan com.android.sdkext arm64 | grep TARGET_PRODUCT Change-Id: I31734660318eabbe3279214980b5cdecb55ab80b (cherry picked from commit 0328e326210604fd8e684d0fb5d354f5a34eaf3a) Merged-In: I31734660318eabbe3279214980b5cdecb55ab80b --- envsetup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/envsetup.sh b/envsetup.sh index be6061d67d..d08028cefa 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -890,7 +890,7 @@ function banchan() fi if [ -z "$product" ]; then - product=arm + product=arm64 elif [ $(echo $product | wc -w) -gt 1 ]; then echo "banchan: Error: Multiple build archs or products supplied: $products" return From be9d1e21f6cb4a3f273f039a288940431df3783a Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Mon, 30 May 2022 16:19:55 +0900 Subject: [PATCH 011/139] Remove AIDL libs from VNDK libs The remaining AIDL libs are still in use by other VNDK libs. Bug: 234181591 Test: m Change-Id: I234a55f10c01ca1786eb5e6715a75ed72705ca50 --- target/product/gsi/current.txt | 46 ---------------------------------- 1 file changed, 46 deletions(-) diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt index 35582b6c0f..bb8dbf483a 100644 --- a/target/product/gsi/current.txt +++ b/target/product/gsi/current.txt @@ -58,71 +58,25 @@ VNDK-SP: libunwindstack.so VNDK-SP: libutils.so VNDK-SP: libutilscallstack.so VNDK-SP: libz.so -VNDK-core: android.hardware.audio.common-V1-ndk.so VNDK-core: android.hardware.audio.common@2.0.so -VNDK-core: android.hardware.audio.core-V1-ndk.so -VNDK-core: android.hardware.authsecret-V1-ndk.so -VNDK-core: android.hardware.automotive.occupant_awareness-V1-ndk.so -VNDK-core: android.hardware.bluetooth.audio-V2-ndk.so -VNDK-core: android.hardware.camera.common-V1-ndk.so -VNDK-core: android.hardware.camera.device-V1-ndk.so -VNDK-core: android.hardware.camera.metadata-V1-ndk.so -VNDK-core: android.hardware.camera.provider-V1-ndk.so VNDK-core: android.hardware.configstore-utils.so VNDK-core: android.hardware.configstore@1.0.so VNDK-core: android.hardware.configstore@1.1.so VNDK-core: android.hardware.confirmationui-support-lib.so -VNDK-core: android.hardware.drm-V1-ndk.so -VNDK-core: android.hardware.dumpstate-V1-ndk.so -VNDK-core: android.hardware.gnss-V2-ndk.so VNDK-core: android.hardware.graphics.allocator@2.0.so VNDK-core: android.hardware.graphics.allocator@3.0.so VNDK-core: android.hardware.graphics.allocator@4.0.so VNDK-core: android.hardware.graphics.bufferqueue@1.0.so VNDK-core: android.hardware.graphics.bufferqueue@2.0.so -VNDK-core: android.hardware.health-V1-ndk.so -VNDK-core: android.hardware.health.storage-V1-ndk.so -VNDK-core: android.hardware.identity-V4-ndk.so -VNDK-core: android.hardware.ir-V1-ndk.so -VNDK-core: android.hardware.keymaster-V3-ndk.so -VNDK-core: android.hardware.light-V2-ndk.so VNDK-core: android.hardware.media.bufferpool@2.0.so VNDK-core: android.hardware.media.omx@1.0.so VNDK-core: android.hardware.media@1.0.so VNDK-core: android.hardware.memtrack-V1-ndk.so VNDK-core: android.hardware.memtrack@1.0.so -VNDK-core: android.hardware.nfc-V1-ndk.so -VNDK-core: android.hardware.oemlock-V1-ndk.so -VNDK-core: android.hardware.power-V3-ndk.so -VNDK-core: android.hardware.power.stats-V1-ndk.so -VNDK-core: android.hardware.radio-V1-ndk.so -VNDK-core: android.hardware.radio.config-V1-ndk.so -VNDK-core: android.hardware.radio.data-V1-ndk.so -VNDK-core: android.hardware.radio.messaging-V1-ndk.so -VNDK-core: android.hardware.radio.modem-V1-ndk.so -VNDK-core: android.hardware.radio.network-V1-ndk.so -VNDK-core: android.hardware.radio.sim-V1-ndk.so -VNDK-core: android.hardware.radio.voice-V1-ndk.so -VNDK-core: android.hardware.rebootescrow-V1-ndk.so -VNDK-core: android.hardware.security.dice-V1-ndk.so -VNDK-core: android.hardware.security.keymint-V2-ndk.so -VNDK-core: android.hardware.security.secureclock-V1-ndk.so -VNDK-core: android.hardware.security.sharedsecret-V1-ndk.so -VNDK-core: android.hardware.sensors-V1-ndk.so -VNDK-core: android.hardware.soundtrigger3-V1-ndk.so VNDK-core: android.hardware.soundtrigger@2.0-core.so VNDK-core: android.hardware.soundtrigger@2.0.so -VNDK-core: android.hardware.usb-V1-ndk.so -VNDK-core: android.hardware.uwb-V1-ndk.so -VNDK-core: android.hardware.vibrator-V2-ndk.so -VNDK-core: android.hardware.weaver-V1-ndk.so -VNDK-core: android.hardware.wifi.hostapd-V1-ndk.so -VNDK-core: android.hardware.wifi.supplicant-V1-ndk.so VNDK-core: android.hidl.token@1.0-utils.so VNDK-core: android.hidl.token@1.0.so -VNDK-core: android.media.audio.common.types-V1-ndk.so -VNDK-core: android.media.soundtrigger.types-V1-ndk.so -VNDK-core: android.system.keystore2-V2-ndk.so VNDK-core: android.system.suspend-V1-ndk.so VNDK-core: android.system.suspend@1.0.so VNDK-core: libaudioroute.so From 63e95a443f62537891600be8f446ae182c4baea6 Mon Sep 17 00:00:00 2001 From: Almaz Mingaleev Date: Mon, 30 May 2022 17:12:00 +0100 Subject: [PATCH 012/139] Remove tzdatacheck from system image. It is part of TZUvA feature, which was superseded by tzdata mainline module(s). Bug: 148144561 Test: see system/timezone Change-Id: I5f67e34e9beb608d3cf3c4c072b268805865f6dd --- target/product/base_system.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 43a5ea8c66..58261ae4a8 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -275,7 +275,6 @@ PRODUCT_PACKAGES += \ traced \ traced_probes \ tune2fs \ - tzdatacheck \ uiautomator \ uinput \ uncrypt \ @@ -345,7 +344,6 @@ PRODUCT_HOST_PACKAGES += \ sqlite3 \ tinyplay \ tune2fs \ - tzdatacheck \ unwind_info \ unwind_reg_info \ unwind_symbols \ From 3f06af64fda2f84f53b5035dc174c11b742ea927 Mon Sep 17 00:00:00 2001 From: Jiakai Zhang Date: Mon, 13 Jun 2022 11:04:05 +0000 Subject: [PATCH 013/139] Merge "Set `TARGET_USES_64_BIT_BINDER` for mainline_sdk." am: d02946c4c3 am: 21d0333357 am: 04ed50089e am: fcc760aa8e am: 679d9572fb Original change: https://android-review.googlesource.com/c/platform/build/+/2121572 Change-Id: I6ab42b109894531e647a720ac3084d7bf6e75511 Signed-off-by: Automerger Merge Worker (cherry picked from commit e88b6b26e059867fa2396763df6513b02ed01042) Merged-In: I6ab42b109894531e647a720ac3084d7bf6e75511 --- target/board/mainline_sdk/BoardConfig.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/board/mainline_sdk/BoardConfig.mk b/target/board/mainline_sdk/BoardConfig.mk index 84f8b2dac6..f5c2dc6b49 100644 --- a/target/board/mainline_sdk/BoardConfig.mk +++ b/target/board/mainline_sdk/BoardConfig.mk @@ -18,3 +18,6 @@ TARGET_ARCH_SUITE := mainline_sdk HOST_CROSS_OS := linux_bionic HOST_CROSS_ARCH := x86_64 HOST_CROSS_2ND_ARCH := + +# Required flag for non-64 bit devices from P. +TARGET_USES_64_BIT_BINDER := true From 148c05b9af45027ebcb6f5f1a8fe9e0f9c63db9e Mon Sep 17 00:00:00 2001 From: Filip Date: Sun, 12 Jun 2022 07:25:32 +0000 Subject: [PATCH 014/139] Add automotive-tests build target Bug: 235717579 Test: package based on device-tests Change-Id: Id7e3d62dda7bd206677018a43b76524394d85052 --- core/tasks/automotive-tests.mk | 61 ++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 core/tasks/automotive-tests.mk diff --git a/core/tasks/automotive-tests.mk b/core/tasks/automotive-tests.mk new file mode 100644 index 0000000000..da6af6bb3c --- /dev/null +++ b/core/tasks/automotive-tests.mk @@ -0,0 +1,61 @@ +# Copyright (C) 2022 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. + + +.PHONY: automotive-tests + +automotive-tests-zip := $(PRODUCT_OUT)/automotive-tests.zip +# Create an artifact to include a list of test config files in automotive-tests. +automotive-tests-list-zip := $(PRODUCT_OUT)/automotive-tests_list.zip +# Create an artifact to include all test config files in automotive-tests. +automotive-tests-configs-zip := $(PRODUCT_OUT)/automotive-tests_configs.zip +my_host_shared_lib_for_automotive_tests := $(call copy-many-files,$(COMPATIBILITY.automotive-tests.HOST_SHARED_LIBRARY.FILES)) +automotive_tests_host_shared_libs_zip := $(PRODUCT_OUT)/automotive-tests_host-shared-libs.zip + +$(automotive-tests-zip) : .KATI_IMPLICIT_OUTPUTS := $(automotive-tests-list-zip) $(automotive-tests-configs-zip) $(automotive_tests_host_shared_libs_zip) +$(automotive-tests-zip) : PRIVATE_automotive_tests_list := $(PRODUCT_OUT)/automotive-tests_list +$(automotive-tests-zip) : PRIVATE_HOST_SHARED_LIBS := $(my_host_shared_lib_for_automotive_tests) +$(automotive-tests-zip) : PRIVATE_automotive_host_shared_libs_zip := $(automotive_tests_host_shared_libs_zip) +$(automotive-tests-zip) : $(COMPATIBILITY.automotive-tests.FILES) $(my_host_shared_lib_for_automotive_tests) $(SOONG_ZIP) + rm -f $@-shared-libs.list + echo $(sort $(COMPATIBILITY.automotive-tests.FILES)) | tr " " "\n" > $@.list + grep $(HOST_OUT_TESTCASES) $@.list > $@-host.list || true + grep -e .*\\.config$$ $@-host.list > $@-host-test-configs.list || true + $(hide) for shared_lib in $(PRIVATE_HOST_SHARED_LIBS); do \ + echo $$shared_lib >> $@-host.list; \ + echo $$shared_lib >> $@-shared-libs.list; \ + done + grep $(HOST_OUT_TESTCASES) $@-shared-libs.list > $@-host-shared-libs.list || true + grep $(TARGET_OUT_TESTCASES) $@.list > $@-target.list || true + grep -e .*\\.config$$ $@-target.list > $@-target-test-configs.list || true + $(hide) $(SOONG_ZIP) -d -o $@ -P host -C $(HOST_OUT) -l $@-host.list -P target -C $(PRODUCT_OUT) -l $@-target.list + $(hide) $(SOONG_ZIP) -d -o $(automotive-tests-configs-zip) \ + -P host -C $(HOST_OUT) -l $@-host-test-configs.list \ + -P target -C $(PRODUCT_OUT) -l $@-target-test-configs.list + $(SOONG_ZIP) -d -o $(PRIVATE_automotive_host_shared_libs_zip) \ + -P host -C $(HOST_OUT) -l $@-host-shared-libs.list + rm -f $(PRIVATE_automotive_tests_list) + $(hide) grep -e .*\\.config$$ $@-host.list | sed s%$(HOST_OUT)%host%g > $(PRIVATE_automotive_tests_list) + $(hide) grep -e .*\\.config$$ $@-target.list | sed s%$(PRODUCT_OUT)%target%g >> $(PRIVATE_automotive_tests_list) + $(hide) $(SOONG_ZIP) -d -o $(automotive-tests-list-zip) -C $(dir $@) -f $(PRIVATE_automotive_tests_list) + rm -f $@.list $@-host.list $@-target.list $@-host-test-configs.list $@-target-test-configs.list \ + $@-shared-libs.list $@-host-shared-libs.list $(PRIVATE_automotive_tests_list) + +automotive-tests: $(automotive-tests-zip) +$(call dist-for-goals, automotive-tests, $(automotive-tests-zip) $(automotive-tests-list-zip) $(automotive-tests-configs-zip) $(automotive_tests_host_shared_libs_zip)) + +$(call declare-1p-container,$(automotive-tests-zip),) +$(call declare-container-license-deps,$(automotive-tests-zip),$(COMPATIBILITY.automotive-tests.FILES) $(my_host_shared_lib_for_automotive_tests),$(PRODUCT_OUT)/:/) + +tests: automotive-tests From 1f228ca77c34a24ba4c3b269eb911991003873d8 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Wed, 22 Jun 2022 00:58:39 +0000 Subject: [PATCH 015/139] Revert "Revert "Target dist files not dist goals."" This reverts commit 9f1fad04ce544b93d97251e664c87d4397876126. Reason for revert: Fixed latent bug in OTA test This change creates license texts and lists of projects to share for individual files in dist instead of for dist goals. If a distribution needs the license texts for part of a dist file or for a combination of multiple files, whoever is distributing will have to create a suitable text notice using `gen_notice{}` or `testnotice` and include it among the dist files for the goal using `dist-for-goals` or equivalent. Bug: 151177513 Bug: 210912771 Bug: 235333302 Bug: 232138105 Bug: 235302632 Test: m cts dist Test: m droid dist Test: tapas google-tradefed-all && m dist Change-Id: I9fbcb07acfa7b14a140563cb031374160b6b23c2 Merged-in: I9fbcb07acfa7b14a140563cb031374160b6b23c2 --- core/distdir.mk | 114 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 89 insertions(+), 25 deletions(-) diff --git a/core/distdir.mk b/core/distdir.mk index 8f48cf817c..bce8e7fd3c 100644 --- a/core/distdir.mk +++ b/core/distdir.mk @@ -49,21 +49,18 @@ endef define __share-projects-rule $(1) : PRIVATE_TARGETS := $(2) -$(1) : PRIVATE_ARGUMENT_FILE := $(call intermediates-dir-for,METAPACKAGING,codesharing)/$(1)/arguments $(1): $(2) $(COMPLIANCE_LISTSHARE) $(hide) rm -f $$@ mkdir -p $$(dir $$@) - mkdir -p $$(dir $$(PRIVATE_ARGUMENT_FILE)) - $$(if $$(strip $$(PRIVATE_TARGETS)),$$(call dump-words-to-file,$$(PRIVATE_TARGETS),$$(PRIVATE_ARGUMENT_FILE))) - $$(if $$(strip $$(PRIVATE_TARGETS)),OUT_DIR=$(OUT_DIR) $(COMPLIANCE_LISTSHARE) -o $$@ @$$(PRIVATE_ARGUMENT_FILE),touch $$@) + $$(if $$(strip $$(PRIVATE_TARGETS)),OUT_DIR=$(OUT_DIR) $(COMPLIANCE_LISTSHARE) -o $$@ $$(PRIVATE_TARGETS),touch $$@) endef -# build list of projects to share in $(1) for dist targets in $(2) +# build list of projects to share in $(1) for meta_lic in $(2) # # $(1): the intermediate project sharing file -# $(2): the dist files to base the sharing on +# $(2): the license metadata to base the sharing on define _share-projects-rule -$(eval $(call __share-projects-rule,$(1),$(call corresponding-license-metadata,$(2)))) +$(eval $(call __share-projects-rule,$(1),$(2))) endef .PHONY: alllicensetexts @@ -86,32 +83,99 @@ $(2): $(3) $(TEXTNOTICE) $$(if $$(strip $$(PRIVATE_TARGETS)),OUT_DIR=$(OUT_DIR) $(TEXTNOTICE) -o $$@ @$$(PRIVATE_ARGUMENT_FILE),touch $$@) endef -# build list of projects to share in $(2) for dist targets in $(3) for dist goal $(1) +# build list of projects to share in $(2) for meta_lic in $(3) for dist goals $(1) +# Strip `out/dist/` used as proxy for 'DIST_DIR' # -# $(1): the name of the dist goal +# $(1): the name of the dist goals # $(2): the intermediate project sharing file -# $(3): the dist files to base the sharing on +# $(3): the license metadata to base the sharing on define _license-texts-rule -$(eval $(call __license-texts-rule,$(1),$(2),$(call corresponding-license-metadata,$(3)),$(sort $(dir $(3))))) +$(eval $(call __license-texts-rule,$(1),$(2),$(3),out/dist/)) endef +########################################################### +## License metadata build rule for dist target $(1) with meta_lic $(2) copied from $(3) +########################################################### +define _dist-target-license-metadata-rule +$(strip $(eval _meta :=$(2))) +$(strip $(eval _dep:=)) +# 0p is the indicator for a non-copyrightable file where no party owns the copyright. +# i.e. pure data with no copyrightable expression. +# If all of the sources are 0p and only 0p, treat the copied file as 0p. Otherwise, all +# of the sources must either be 0p or originate from a single metadata file to copy. +$(strip $(foreach s,$(strip $(3)),\ + $(eval _dmeta:=$(ALL_TARGETS.$(s).META_LIC))\ + $(if $(strip $(_dmeta)),\ + $(if $(filter-out 0p,$(_dep)),\ + $(if $(filter-out $(_dep) 0p,$(_dmeta)),\ + $(error cannot copy target from multiple modules: $(1) from $(_dep) and $(_dmeta)),\ + $(if $(filter 0p,$(_dep)),$(eval _dep:=$(_dmeta)))),\ + $(eval _dep:=$(_dmeta))\ + ),\ + $(eval TARGETS_MISSING_LICENSE_METADATA += $(s) $(1))))) + + +ifeq (0p,$(strip $(_dep))) +# Not copyrightable. No emcumbrances, no license text, no license kind etc. +$(_meta): PRIVATE_CONDITIONS := unencumbered +$(_meta): PRIVATE_SOURCES := $(3) +$(_meta): PRIVATE_INSTALLED := $(1) +# use `$(1)` which is the unique and relatively short `out/dist/$(target)` +$(_meta): PRIVATE_ARGUMENT_FILE := $(call intermediates-dir-for,METAPACKAGING,notice)/$(1)/arguments +$(_meta): $(BUILD_LICENSE_METADATA) +$(_meta) : + rm -f $$@ + mkdir -p $$(dir $$@) + mkdir -p $$(dir $$(PRIVATE_ARGUMENT_FILE)) + $$(call dump-words-to-file,\ + $$(addprefix -c ,$$(PRIVATE_CONDITIONS))\ + $$(addprefix -s ,$$(PRIVATE_SOURCES))\ + $$(addprefix -t ,$$(PRIVATE_TARGETS))\ + $$(addprefix -i ,$$(PRIVATE_INSTALLED)),\ + $$(PRIVATE_ARGUMENT_FILE)) + OUT_DIR=$(OUT_DIR) $(BUILD_LICENSE_METADATA) \ + @$$(PRIVATE_ARGUMENT_FILE) \ + -o $$@ + +else ifneq (,$(strip $(_dep))) +# Not a missing target, copy metadata and `is_container` etc. from license metadata file `$(_dep)` +$(_meta): PRIVATE_DEST_TARGET := $(1) +$(_meta): PRIVATE_SOURCE_TARGETS := $(3) +$(_meta): PRIVATE_SOURCE_METADATA := $(_dep) +# use `$(1)` which is the unique and relatively short `out/dist/$(target)` +$(_meta): PRIVATE_ARGUMENT_FILE := $(call intermediates-dir-for,METAPACKAGING,copynotice)/$(1)/arguments +$(_meta) : $(_dep) $(COPY_LICENSE_METADATA) + rm -f $$@ + mkdir -p $$(dir $$@) + mkdir -p $$(dir $$(PRIVATE_ARGUMENT_FILE)) + $$(call dump-words-to-file,\ + $$(addprefix -i ,$$(PRIVATE_DEST_TARGET))\ + $$(addprefix -s ,$$(PRIVATE_SOURCE_TARGETS))\ + $$(addprefix -d ,$$(PRIVATE_SOURCE_METADATA)),\ + $$(PRIVATE_ARGUMENT_FILE)) + OUT_DIR=$(OUT_DIR) $(COPY_LICENSE_METADATA) \ + @$$(PRIVATE_ARGUMENT_FILE) \ + -o $$@ + +endif +endef + +# use `out/dist/` as a proxy for 'DIST_DIR' define _add_projects_to_share +$(strip $(eval _mdir := $(call intermediates-dir-for,METAPACKAGING,meta)/out/dist)) \ $(strip $(eval _idir := $(call intermediates-dir-for,METAPACKAGING,shareprojects))) \ $(strip $(eval _tdir := $(call intermediates-dir-for,METAPACKAGING,licensetexts))) \ -$(strip $(eval _goals := $(sort $(_all_dist_goals)))) \ -$(strip $(eval _opairs := $(sort $(_all_dist_goal_output_pairs)))) \ -$(strip $(eval _dpairs := $(sort $(_all_dist_src_dst_pairs)))) \ -$(strip $(eval _allt :=)) \ -$(foreach goal,$(_goals), \ - $(eval _f := $(_idir)/$(goal).shareprojects) \ - $(eval _n := $(_tdir)/$(goal).txt) \ - $(call dist-for-goals,$(goal),$(_f):shareprojects/$(basename $(notdir $(_f)))) \ - $(call dist-for-goals,$(goal),$(_n):licensetexts/$(basename $(notdir $(_n)))) \ - $(eval _targets :=) \ - $(foreach op,$(filter $(goal):%,$(_opairs)),$(foreach p,$(filter %:$(call word-colon,2,$(op)),$(_dpairs)),$(eval _targets += $(call word-colon,1,$(p))))) \ - $(eval _allt += $(_targets)) \ - $(eval $(call _share-projects-rule,$(_f),$(_targets))) \ - $(eval $(call _license-texts-rule,$(goal),$(_n),$(_targets))) \ +$(strip $(eval _allt := $(sort $(foreach goal,$(_all_dist_goal_output_pairs),$(call word-colon,2,$(goal)))))) \ +$(foreach target,$(_allt), \ + $(eval _goals := $(sort $(foreach dg,$(filter %:$(target),$(_all_dist_goal_output_pairs)),$(call word-colon,1,$(dg))))) \ + $(eval _srcs := $(sort $(foreach sdp,$(filter %:$(target),$(_all_dist_src_dst_pairs)),$(call word-colon,1,$(sdp))))) \ + $(eval $(call _dist-target-license-metadata-rule,out/dist/$(target),$(_mdir)/out/dist/$(target).meta_lic,$(_srcs))) \ + $(eval _f := $(_idir)/$(target).shareprojects) \ + $(eval _n := $(_tdir)/$(target).txt) \ + $(eval $(call dist-for-goals,$(_goals),$(_f):shareprojects/$(target).shareprojects)) \ + $(eval $(call dist-for-goals,$(_goals),$(_n):licensetexts/$(target).txt)) \ + $(eval $(call _share-projects-rule,$(_f),$(foreach t, $(filter-out $(TARGETS_MISSING_LICENSE_METADATA),out/dist/$(target)),$(_mdir)/$(t).meta_lic))) \ + $(eval $(call _license-texts-rule,$(_goals),$(_n),$(foreach t,$(filter-out $(TARGETS_MISSING_LICENSE_METADATA),out/dist/$(target)),$(_mdir)/$(t).meta_lic))) \ ) endef From f40f63a4d1857956ba09dfd179fa2fb37004170c Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Wed, 29 Jun 2022 15:01:32 +0000 Subject: [PATCH 016/139] Revert "Revert "Revert "Target dist files not dist goals.""" This reverts commit 1f228ca77c34a24ba4c3b269eb911991003873d8. Bug: 237412270 Reason for revert: b/237412270 Change-Id: I517c087b3452d305e8d82b38d0c36bff4894558c --- core/distdir.mk | 114 +++++++++++------------------------------------- 1 file changed, 25 insertions(+), 89 deletions(-) diff --git a/core/distdir.mk b/core/distdir.mk index bce8e7fd3c..8f48cf817c 100644 --- a/core/distdir.mk +++ b/core/distdir.mk @@ -49,18 +49,21 @@ endef define __share-projects-rule $(1) : PRIVATE_TARGETS := $(2) +$(1) : PRIVATE_ARGUMENT_FILE := $(call intermediates-dir-for,METAPACKAGING,codesharing)/$(1)/arguments $(1): $(2) $(COMPLIANCE_LISTSHARE) $(hide) rm -f $$@ mkdir -p $$(dir $$@) - $$(if $$(strip $$(PRIVATE_TARGETS)),OUT_DIR=$(OUT_DIR) $(COMPLIANCE_LISTSHARE) -o $$@ $$(PRIVATE_TARGETS),touch $$@) + mkdir -p $$(dir $$(PRIVATE_ARGUMENT_FILE)) + $$(if $$(strip $$(PRIVATE_TARGETS)),$$(call dump-words-to-file,$$(PRIVATE_TARGETS),$$(PRIVATE_ARGUMENT_FILE))) + $$(if $$(strip $$(PRIVATE_TARGETS)),OUT_DIR=$(OUT_DIR) $(COMPLIANCE_LISTSHARE) -o $$@ @$$(PRIVATE_ARGUMENT_FILE),touch $$@) endef -# build list of projects to share in $(1) for meta_lic in $(2) +# build list of projects to share in $(1) for dist targets in $(2) # # $(1): the intermediate project sharing file -# $(2): the license metadata to base the sharing on +# $(2): the dist files to base the sharing on define _share-projects-rule -$(eval $(call __share-projects-rule,$(1),$(2))) +$(eval $(call __share-projects-rule,$(1),$(call corresponding-license-metadata,$(2)))) endef .PHONY: alllicensetexts @@ -83,99 +86,32 @@ $(2): $(3) $(TEXTNOTICE) $$(if $$(strip $$(PRIVATE_TARGETS)),OUT_DIR=$(OUT_DIR) $(TEXTNOTICE) -o $$@ @$$(PRIVATE_ARGUMENT_FILE),touch $$@) endef -# build list of projects to share in $(2) for meta_lic in $(3) for dist goals $(1) -# Strip `out/dist/` used as proxy for 'DIST_DIR' +# build list of projects to share in $(2) for dist targets in $(3) for dist goal $(1) # -# $(1): the name of the dist goals +# $(1): the name of the dist goal # $(2): the intermediate project sharing file -# $(3): the license metadata to base the sharing on +# $(3): the dist files to base the sharing on define _license-texts-rule -$(eval $(call __license-texts-rule,$(1),$(2),$(3),out/dist/)) +$(eval $(call __license-texts-rule,$(1),$(2),$(call corresponding-license-metadata,$(3)),$(sort $(dir $(3))))) endef -########################################################### -## License metadata build rule for dist target $(1) with meta_lic $(2) copied from $(3) -########################################################### -define _dist-target-license-metadata-rule -$(strip $(eval _meta :=$(2))) -$(strip $(eval _dep:=)) -# 0p is the indicator for a non-copyrightable file where no party owns the copyright. -# i.e. pure data with no copyrightable expression. -# If all of the sources are 0p and only 0p, treat the copied file as 0p. Otherwise, all -# of the sources must either be 0p or originate from a single metadata file to copy. -$(strip $(foreach s,$(strip $(3)),\ - $(eval _dmeta:=$(ALL_TARGETS.$(s).META_LIC))\ - $(if $(strip $(_dmeta)),\ - $(if $(filter-out 0p,$(_dep)),\ - $(if $(filter-out $(_dep) 0p,$(_dmeta)),\ - $(error cannot copy target from multiple modules: $(1) from $(_dep) and $(_dmeta)),\ - $(if $(filter 0p,$(_dep)),$(eval _dep:=$(_dmeta)))),\ - $(eval _dep:=$(_dmeta))\ - ),\ - $(eval TARGETS_MISSING_LICENSE_METADATA += $(s) $(1))))) - - -ifeq (0p,$(strip $(_dep))) -# Not copyrightable. No emcumbrances, no license text, no license kind etc. -$(_meta): PRIVATE_CONDITIONS := unencumbered -$(_meta): PRIVATE_SOURCES := $(3) -$(_meta): PRIVATE_INSTALLED := $(1) -# use `$(1)` which is the unique and relatively short `out/dist/$(target)` -$(_meta): PRIVATE_ARGUMENT_FILE := $(call intermediates-dir-for,METAPACKAGING,notice)/$(1)/arguments -$(_meta): $(BUILD_LICENSE_METADATA) -$(_meta) : - rm -f $$@ - mkdir -p $$(dir $$@) - mkdir -p $$(dir $$(PRIVATE_ARGUMENT_FILE)) - $$(call dump-words-to-file,\ - $$(addprefix -c ,$$(PRIVATE_CONDITIONS))\ - $$(addprefix -s ,$$(PRIVATE_SOURCES))\ - $$(addprefix -t ,$$(PRIVATE_TARGETS))\ - $$(addprefix -i ,$$(PRIVATE_INSTALLED)),\ - $$(PRIVATE_ARGUMENT_FILE)) - OUT_DIR=$(OUT_DIR) $(BUILD_LICENSE_METADATA) \ - @$$(PRIVATE_ARGUMENT_FILE) \ - -o $$@ - -else ifneq (,$(strip $(_dep))) -# Not a missing target, copy metadata and `is_container` etc. from license metadata file `$(_dep)` -$(_meta): PRIVATE_DEST_TARGET := $(1) -$(_meta): PRIVATE_SOURCE_TARGETS := $(3) -$(_meta): PRIVATE_SOURCE_METADATA := $(_dep) -# use `$(1)` which is the unique and relatively short `out/dist/$(target)` -$(_meta): PRIVATE_ARGUMENT_FILE := $(call intermediates-dir-for,METAPACKAGING,copynotice)/$(1)/arguments -$(_meta) : $(_dep) $(COPY_LICENSE_METADATA) - rm -f $$@ - mkdir -p $$(dir $$@) - mkdir -p $$(dir $$(PRIVATE_ARGUMENT_FILE)) - $$(call dump-words-to-file,\ - $$(addprefix -i ,$$(PRIVATE_DEST_TARGET))\ - $$(addprefix -s ,$$(PRIVATE_SOURCE_TARGETS))\ - $$(addprefix -d ,$$(PRIVATE_SOURCE_METADATA)),\ - $$(PRIVATE_ARGUMENT_FILE)) - OUT_DIR=$(OUT_DIR) $(COPY_LICENSE_METADATA) \ - @$$(PRIVATE_ARGUMENT_FILE) \ - -o $$@ - -endif -endef - -# use `out/dist/` as a proxy for 'DIST_DIR' define _add_projects_to_share -$(strip $(eval _mdir := $(call intermediates-dir-for,METAPACKAGING,meta)/out/dist)) \ $(strip $(eval _idir := $(call intermediates-dir-for,METAPACKAGING,shareprojects))) \ $(strip $(eval _tdir := $(call intermediates-dir-for,METAPACKAGING,licensetexts))) \ -$(strip $(eval _allt := $(sort $(foreach goal,$(_all_dist_goal_output_pairs),$(call word-colon,2,$(goal)))))) \ -$(foreach target,$(_allt), \ - $(eval _goals := $(sort $(foreach dg,$(filter %:$(target),$(_all_dist_goal_output_pairs)),$(call word-colon,1,$(dg))))) \ - $(eval _srcs := $(sort $(foreach sdp,$(filter %:$(target),$(_all_dist_src_dst_pairs)),$(call word-colon,1,$(sdp))))) \ - $(eval $(call _dist-target-license-metadata-rule,out/dist/$(target),$(_mdir)/out/dist/$(target).meta_lic,$(_srcs))) \ - $(eval _f := $(_idir)/$(target).shareprojects) \ - $(eval _n := $(_tdir)/$(target).txt) \ - $(eval $(call dist-for-goals,$(_goals),$(_f):shareprojects/$(target).shareprojects)) \ - $(eval $(call dist-for-goals,$(_goals),$(_n):licensetexts/$(target).txt)) \ - $(eval $(call _share-projects-rule,$(_f),$(foreach t, $(filter-out $(TARGETS_MISSING_LICENSE_METADATA),out/dist/$(target)),$(_mdir)/$(t).meta_lic))) \ - $(eval $(call _license-texts-rule,$(_goals),$(_n),$(foreach t,$(filter-out $(TARGETS_MISSING_LICENSE_METADATA),out/dist/$(target)),$(_mdir)/$(t).meta_lic))) \ +$(strip $(eval _goals := $(sort $(_all_dist_goals)))) \ +$(strip $(eval _opairs := $(sort $(_all_dist_goal_output_pairs)))) \ +$(strip $(eval _dpairs := $(sort $(_all_dist_src_dst_pairs)))) \ +$(strip $(eval _allt :=)) \ +$(foreach goal,$(_goals), \ + $(eval _f := $(_idir)/$(goal).shareprojects) \ + $(eval _n := $(_tdir)/$(goal).txt) \ + $(call dist-for-goals,$(goal),$(_f):shareprojects/$(basename $(notdir $(_f)))) \ + $(call dist-for-goals,$(goal),$(_n):licensetexts/$(basename $(notdir $(_n)))) \ + $(eval _targets :=) \ + $(foreach op,$(filter $(goal):%,$(_opairs)),$(foreach p,$(filter %:$(call word-colon,2,$(op)),$(_dpairs)),$(eval _targets += $(call word-colon,1,$(p))))) \ + $(eval _allt += $(_targets)) \ + $(eval $(call _share-projects-rule,$(_f),$(_targets))) \ + $(eval $(call _license-texts-rule,$(goal),$(_n),$(_targets))) \ ) endef From fb72d542ad0a766683b86fc48b6a9301140eea04 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Tue, 12 Jul 2022 13:35:26 +0000 Subject: [PATCH 017/139] Add permission to the list of individually toggleable modules This is safe even though permission is not an optional mainline module because devices that support mainline must pass GTS and testModulesSignedCorrectly and testModulesPreloadedCorrectly in GTS currently tests this, along with testMainlineApprovedTrain which checks mandatory/optional, signing keys, and if what's preloaded are part of approved trains. Bug: 238175656 Test: # Cherry pick to branch that has Google signed prebuilts for # permission and builds from prebuilts by default. # Update the permission to an sdk snapshot generated with # r.android.com/2151273. # Make sure that the permission is built from prebuilts by # default Change-Id: Id4eb9ba0da8a05c41d3b29b1cb8fa1d2d485c7b9 --- core/android_soong_config_vars.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/core/android_soong_config_vars.mk b/core/android_soong_config_vars.mk index 483beaff3b..7e1e98ea97 100644 --- a/core/android_soong_config_vars.mk +++ b/core/android_soong_config_vars.mk @@ -76,6 +76,7 @@ $(call soong_config_set,art_module,source_build,$(ART_MODULE_BUILD_FROM_SOURCE)) # default. INDIVIDUALLY_TOGGLEABLE_PREBUILT_MODULES := \ bluetooth \ + permission \ uwb \ wifi \ From d4bde8362d6738a97f5af32cde9a05d53cd88721 Mon Sep 17 00:00:00 2001 From: zhidou Date: Mon, 11 Jul 2022 20:12:24 +0000 Subject: [PATCH 018/139] Keep proguard fields for lite runtime of jarjared class Some targets rename protobuf.MessageLite with jarjar rules. This change adds keep rules to keep the fields of renamed classes. Bug: 233746531 Test: m checkbuild. Change-Id: I986f05455b45651749fb5f819661041d7399f683 --- core/proguard_basic_keeps.flags | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/proguard_basic_keeps.flags b/core/proguard_basic_keeps.flags index 30c2341649..54cbdccf3b 100644 --- a/core/proguard_basic_keeps.flags +++ b/core/proguard_basic_keeps.flags @@ -74,5 +74,6 @@ -dontnote # The lite proto runtime uses reflection to access fields based on the names in -# the schema, keep all the fields. --keepclassmembers class * extends com.google.protobuf.MessageLite { ; } +# the schema, keep all the fields. Wildcard is used to apply the rule to classes +# that have been renamed with jarjar. +-keepclassmembers class * extends **.protobuf.MessageLite { ; } From b61b66340b902f890e82ebc764cd9acfe54caef7 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Mon, 25 Jul 2022 14:10:19 +0900 Subject: [PATCH 019/139] Add WIFI_ variables into soong config To migrate libwifi-hal module from make to soong, WIFI_ make variables are added to soong config variables in `wifi` namespace. Bug: 239984067 Test: m libwifi-hal Change-Id: If60f5909619af887be8e0086a8dfef65dc97cce0 --- core/board_config.mk | 2 + core/board_config_wifi.mk | 77 +++++++++++++++++++++++++++++++++++++++ core/soong_config.mk | 2 +- 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 core/board_config_wifi.mk diff --git a/core/board_config.mk b/core/board_config.mk index d2803490f8..a0c16ca7b5 100644 --- a/core/board_config.mk +++ b/core/board_config.mk @@ -283,6 +283,8 @@ $(foreach var,$(_board_true_false_vars), \ $(if $(filter-out true false,$($(var))), \ $(error Valid values of $(var) are "true", "false", and "". Not "$($(var))"))) +include $(BUILD_SYSTEM)/board_config_wifi.mk + # Default *_CPU_VARIANT_RUNTIME to CPU_VARIANT if unspecified. TARGET_CPU_VARIANT_RUNTIME := $(or $(TARGET_CPU_VARIANT_RUNTIME),$(TARGET_CPU_VARIANT)) TARGET_2ND_CPU_VARIANT_RUNTIME := $(or $(TARGET_2ND_CPU_VARIANT_RUNTIME),$(TARGET_2ND_CPU_VARIANT)) diff --git a/core/board_config_wifi.mk b/core/board_config_wifi.mk new file mode 100644 index 0000000000..ddeb0d7d6d --- /dev/null +++ b/core/board_config_wifi.mk @@ -0,0 +1,77 @@ +# +# Copyright (C) 2022 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 file adds WIFI variables into soong config namespace (`wifi`) +# ############################################################### + +ifdef BOARD_WLAN_DEVICE + $(call soong_config_set,wifi,board_wlan_device,$(BOARD_WLAN_DEVICE)) +endif +ifdef WIFI_DRIVER_MODULE_PATH + $(call soong_config_set,wifi,driver_module_path,$(WIFI_DRIVER_MODULE_PATH)) +endif +ifdef WIFI_DRIVER_MODULE_ARG + $(call soong_config_set,wifi,driver_module_arg,$(WIFI_DRIVER_MODULE_ARG)) +endif +ifdef WIFI_DRIVER_MODULE_NAME + $(call soong_config_set,wifi,driver_module_name,$(WIFI_DRIVER_MODULE_NAME)) +endif +ifdef WIFI_DRIVER_FW_PATH_STA + $(call soong_config_set,wifi,driver_fw_path_sta,$(WIFI_DRIVER_FW_PATH_STA)) +endif +ifdef WIFI_DRIVER_FW_PATH_AP + $(call soong_config_set,wifi,driver_fw_path_ap,$(WIFI_DRIVER_FW_PATH_AP)) +endif +ifdef WIFI_DRIVER_FW_PATH_P2P + $(call soong_config_set,wifi,driver_fw_path_p2p,$(WIFI_DRIVER_FW_PATH_P2P)) +endif +ifdef WIFI_DRIVER_FW_PATH_PARAM + $(call soong_config_set,wifi,driver_fw_path_param,$(WIFI_DRIVER_FW_PATH_PARAM)) +endif +ifdef WIFI_DRIVER_STATE_CTRL_PARAM + $(call soong_config_set,wifi,driver_state_ctrl_param,$(WIFI_DRIVER_STATE_CTRL_PARAM)) +endif +ifdef WIFI_DRIVER_STATE_ON + $(call soong_config_set,wifi,driver_state_on,$(WIFI_DRIVER_STATE_ON)) +endif +ifdef WIFI_DRIVER_STATE_OFF + $(call soong_config_set,wifi,driver_state_off,$(WIFI_DRIVER_STATE_OFF)) +endif +ifdef WIFI_MULTIPLE_VENDOR_HALS + $(call soong_config_set,wifi,multiple_vendor_hals,$(WIFI_MULTIPLE_VENDOR_HALS)) +endif +ifneq ($(wildcard vendor/google/libraries/GoogleWifiConfigLib),) + $(call soong_config_set,wifi,google_wifi_config_lib,true) +endif +ifdef WIFI_HAL_INTERFACE_COMBINATIONS + $(call soong_config_set,wifi,hal_interface_combinations,$(WIFI_HAL_INTERFACE_COMBINATIONS)) +endif +ifdef WIFI_HIDL_FEATURE_AWARE + $(call soong_config_set,wifi,hidl_feature_aware,true) +endif +ifdef WIFI_HIDL_FEATURE_DUAL_INTERFACE + $(call soong_config_set,wifi,hidl_feature_dual_interface,true) +endif +ifdef WIFI_HIDL_FEATURE_DISABLE_AP + $(call soong_config_set,wifi,hidl_feature_disable_ap,true) +endif +ifdef WIFI_HIDL_FEATURE_DISABLE_AP_MAC_RANDOMIZATION + $(call soong_config_set,wifi,hidl_feature_disable_ap_mac_randomization,true) +endif +ifdef WIFI_AVOID_IFACE_RESET_MAC_CHANGE + $(call soong_config_set,wifi,avoid_iface_reset_mac_change,true) +endif \ No newline at end of file diff --git a/core/soong_config.mk b/core/soong_config.mk index c4a40af0c7..e975d8adc5 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -250,7 +250,7 @@ $(call add_json_map, VendorVars) $(foreach namespace,$(SOONG_CONFIG_NAMESPACES),\ $(call add_json_map, $(namespace))\ $(foreach key,$(SOONG_CONFIG_$(namespace)),\ - $(call add_json_str,$(key),$(SOONG_CONFIG_$(namespace)_$(key))))\ + $(call add_json_str,$(key),$(subst ",\",$(SOONG_CONFIG_$(namespace)_$(key)))))\ $(call end_json_map)) $(call end_json_map) From 2a8c1b9554083a82698e92b9f427dac5456d61d3 Mon Sep 17 00:00:00 2001 From: Nick Kovacs Date: Thu, 21 Jul 2022 17:59:51 +0000 Subject: [PATCH 020/139] Update minimum supported targetSdk to 29 Trailing by 4 major releases, as per schedule. Test: make Test: atest CtsWindowManagerSdk25TestCases:AspectRatioSdk25Tests Test: atest CtsWindowManagerSdk28TestCases:AspectRatioSdk28Tests Bug: 215522897 Change-Id: Ie4a4ad6d4e7af8c23003a653a2d2ef514adb1169 --- core/version_util.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_util.mk b/core/version_util.mk index cbfef96593..1c8574c0cc 100644 --- a/core/version_util.mk +++ b/core/version_util.mk @@ -251,6 +251,6 @@ ifndef PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION # Used to set minimum supported target sdk version. Apps targeting sdk # version lower than the set value will result in a warning being shown # when any activity from the app is started. - PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 23 + PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 29 endif .KATI_READONLY := PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION From bb6cde606444f21dabc30313541c9b33e94e1158 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Fri, 27 May 2022 19:40:41 -0700 Subject: [PATCH 021/139] Create license metadata for copied targets. Bug: 213388645 Bug: 240342946 Test: m cts dist reportmissinglicenses Change-Id: I43043e5e7b80d9f3210d6498c215846aec761add Merged-in: I43043e5e7b80d9f3210d6498c215846aec761add --- core/Makefile | 2 +- core/definitions.mk | 83 ++++++++++++++++++++++++--- core/main.mk | 2 +- core/notice_files.mk | 3 +- core/tasks/tools/vts_package_utils.mk | 2 +- 5 files changed, 79 insertions(+), 13 deletions(-) diff --git a/core/Makefile b/core/Makefile index 309a179ee0..7384a49350 100644 --- a/core/Makefile +++ b/core/Makefile @@ -3561,7 +3561,7 @@ INSTALLED_VENDORIMAGE_TARGET := $(PRODUCT_OUT)/vendor.img $(eval $(call copy-one-file,$(BOARD_PREBUILT_VENDORIMAGE),$(INSTALLED_VENDORIMAGE_TARGET))) $(if $(strip $(ALL_TARGETS.$(INSTALLED_VENDORIMAGE_TARGET).META_LIC)),,\ $(if $(strip $(ALL_TARGETS.$(BOARD_PREBUILT_VENDORIMAGE).META_LIC)),\ - $(eval ALL_TARGETS.$(INSTALLED_VENDORIMAGE_TARGET).META_LIC:=$(ALL_TARGETS.$(BOARD_PREBUILT_VENDORIMAGE).META_LIC)),\ + $(call declare-copy-target-license-metadata,$(INSTALLED_VENDORIMAGE_TARGET),$(BOARD_PREBUILT_VENDORIMAGE)),\ $(call declare-license-metadata,$(INSTALLED_VENDORIMAGE_TARGET),legacy_proprietary,proprietary,,"Vendor Image",vendor))) endif diff --git a/core/definitions.mk b/core/definitions.mk index 0c46de9fc6..d5fc279510 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -41,6 +41,9 @@ ALL_MODULES:= ALL_NON_MODULES:= NON_MODULES_WITHOUT_LICENSE_METADATA:= +# List of copied targets that need license metadata copied. +ALL_COPIED_TARGETS:= + # Full paths to targets that should be added to the "make droid" # set of installed targets. ALL_DEFAULT_INSTALLED_MODULES:= @@ -582,6 +585,19 @@ $(strip $(foreach target, $(sort $(1)), \ $(call append-path,$(call license-metadata-dir),$(patsubst $(OUT_DIR)%,out%,$(target).meta_lic)))))) endef +########################################################### +## Record a target $(1) copied from another target(s) $(2) that will need +## license metadata. +########################################################### +define declare-copy-target-license-metadata +$(strip $(if $(filter $(OUT_DIR)%,$(2)),$(eval _dir:=$(call license-metadata-dir))\ + $(eval _tgt:=$(strip $(1)))\ + $(eval _meta := $(call append-path,$(_dir),$(patsubst $(OUT_DIR)%,out%,$(_tgt).meta_lic)))\ + $(eval ALL_COPIED_TARGETS.$(_tgt).SOURCES := $(ALL_COPIED_TARGETS.$(_tgt).SOURCES) $(filter $(OUT_DIR)%,$(2)))\ + $(eval ALL_COPIED_TARGETS += $(_tgt)),\ + $(eval ALL_TARGETS.$(1).META_LIC:=$(module_license_metadata)))) +endef + ########################################################### ## License metadata build rule for my_register_name $(1) ########################################################### @@ -661,13 +677,6 @@ $(strip $(eval _deps := $(sort $(filter-out 0p: :,$(foreach d,$(strip $(ALL_NON_ $(strip $(eval _notices := $(sort $(ALL_NON_MODULES.$(_tgt).NOTICES)))) $(strip $(eval _path := $(sort $(ALL_NON_MODULES.$(_tgt).PATH)))) $(strip $(eval _install_map := $(ALL_NON_MODULES.$(_tgt).ROOT_MAPPINGS))) -$(strip $(eval \ - $$(foreach d,$(strip $(ALL_NON_MODULES.$(_tgt).DEPENDENCIES)), \ - $$(if $$(strip $$(ALL_TARGETS.$$(d).META_LIC)), \ - , \ - $$(eval NON_MODULES_WITHOUT_LICENSE_METADATA += $$(d))) \ - )) \ -) $(_meta): PRIVATE_KINDS := $(sort $(ALL_NON_MODULES.$(_tgt).LICENSE_KINDS)) $(_meta): PRIVATE_CONDITIONS := $(sort $(ALL_NON_MODULES.$(_tgt).LICENSE_CONDITIONS)) @@ -704,6 +713,60 @@ $(_meta) : $(foreach d,$(_deps),$(call word-colon,1,$(d))) $(foreach n,$(_notice endef +########################################################### +## Record missing dependencies for non-module target $(1) +########################################################### +define record-missing-non-module-dependencies +$(strip $(eval _tgt := $(strip $(1)))) +$(strip $(foreach d,$(strip $(ALL_NON_MODULES.$(_tgt).DEPENDENCIES)), \ + $(if $(strip $(ALL_TARGETS.$(d).META_LIC)), \ + , \ + $(eval NON_MODULES_WITHOUT_LICENSE_METADATA += $(d))) \ +)) +endef + +########################################################### +## License metadata build rule for copied target $(1) +########################################################### +define copied-target-license-metadata-rule +$(if $(strip $(ALL_TARGETS.$(1).META_LIC)),,$(call _copied-target-license-metadata-rule,$(1))) +endef + +define _copied-target-license-metadata-rule +$(strip $(eval _dir := $(call license-metadata-dir))) +$(strip $(eval _meta := $(call append-path,$(_dir),$(patsubst $(OUT_DIR)%,out%,$(1).meta_lic)))) +$(strip $(eval ALL_TARGETS.$(1).META_LIC:=$(_meta))) +$(strip $(eval _dep:=)) +$(strip $(foreach s,$(ALL_COPIED_TARGETS.$(1).SOURCES),\ + $(eval _dmeta:=$(ALL_TARGETS.$(s).META_LIC))\ + $(if $(filter 0p,$(_dmeta)),\ + $(if $(filter-out 0p,$(_dep)),,$(eval ALL_TARGETS.$(1).META_LIC:=0p)),\ + $(if $(_dep),\ + $(if $(filter-out $(_dep),$(_dmeta)),$(error cannot copy target from multiple modules: $(1) from $(_dep) and $(_dmeta))), + $(eval _dep:=$(_dmeta)))))) +$(strip $(if $(strip $(_dep)),,$(error cannot copy target from unknown module: $(1) from $(ALL_COPIED_TARGETS.$(1).SOURCES)))) + +ifneq (0p,$(ALL_TARGETS.$(1).META_LIC)) +$(_meta): PRIVATE_DEST_TARGET := $(1) +$(_meta): PRIVATE_SOURCE_TARGETS := $(ALL_COPIED_TARGETS.$(1).SOURCES) +$(_meta): PRIVATE_SOURCE_METADATA := $(_dep) +$(_meta): PRIVATE_ARGUMENT_FILE := $(call intermediates-dir-for,PACKAGING,copynotice)/$(_meta)/arguments +$(_meta) : $(_dep) + rm -f $$@ + mkdir -p $$(dir $$@) + mkdir -p $$(dir $$(PRIVATE_ARGUMENT_FILE)) + $$(call dump-words-to-file,\ + $$(addprefix -i ,$$(PRIVATE_DEST_TARGET))\ + $$(addprefix -s ,$$(PRIVATE_SOURCE_TARGETS))\ + $$(addprefix -d ,$$(PRIVATE_SOURCE_METADATA)),\ + $$(PRIVATE_ARGUMENT_FILE)) + OUT_DIR=$(OUT_DIR) $(COPY_LICENSE_METADATA) \ + @$$(PRIVATE_ARGUMENT_FILE) \ + -o $$@ + +endif +endef + ########################################################### ## Declare the license metadata for non-module target $(1). ## @@ -919,6 +982,8 @@ $(strip \ ) \ $(foreach t,$(sort $(ALL_NON_MODULES)),$(eval $(call non-module-license-metadata-rule,$(t)))) \ $(foreach m,$(sort $(ALL_MODULES)),$(eval $(call license-metadata-rule,$(m)))) \ + $(foreach t,$(sort $(ALL_COPIED_TARGETS)),$(eval $(call copied-target-license-metadata-rule,$(t)))) \ + $(foreach t,$(sort $(ALL_NON_MODULES)),$(call record-missing-non-module-dependencies,$(t))) \ $(eval $(call report-missing-licenses-rule)) \ $(eval $(call report-all-notice-library-names-rule)) \ $(eval $(call build-all-license-metadata-rule))) @@ -3405,11 +3470,11 @@ endef define create-suite-dependencies $(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \ $(eval $(if $(strip $(module_license_metadata)),\ - $$(foreach f,$$(my_compat_dist_$(suite)),$$(eval ALL_TARGETS.$$(call word-colon,2,$$(f)).META_LIC := $(module_license_metadata))),\ + $$(foreach f,$$(my_compat_dist_$(suite)),$$(call declare-copy-target-license-metadata,$$(call word-colon,2,$$(f)),$$(call word-colon,1,$$(f)))),\ $$(eval my_test_data += $$(foreach f,$$(my_compat_dist_$(suite)), $$(call word-colon,2,$$(f)))) \ )) \ $(eval $(if $(strip $(module_license_metadata)),\ - $$(foreach f,$$(my_compat_dist_config_$(suite)),$$(eval ALL_TARGETS.$$(call word-colon,2,$$(f)).META_LIC := $(module_license_metadata))),\ + $$(foreach f,$$(my_compat_dist_config_$(suite)),$$(call declare-copy-target-license-metadata,$$(call word-colon,2,$$(f)),$$(call word-colon,1,$$(f)))),\ $$(eval my_test_config += $$(foreach f,$$(my_compat_dist_config_$(suite)), $$(call word-colon,2,$$(f)))) \ )) \ $(if $(filter $(suite),$(ALL_COMPATIBILITY_SUITES)),,\ diff --git a/core/main.mk b/core/main.mk index c63c6dfde9..cb927c4be9 100644 --- a/core/main.mk +++ b/core/main.mk @@ -935,7 +935,7 @@ $(foreach suite,general-tests device-tests vts tvts art-host-tests host-unit-tes $(eval my_testcases := $(HOST_OUT_TESTCASES)),\ $(eval my_testcases := $$(COMPATIBILITY_TESTCASES_OUT_$(suite))))\ $(eval target := $(my_testcases)/$(lastword $(subst /, ,$(dir $(f))))/$(notdir $(f)))\ - $(if $(strip $(ALL_TARGETS.$(target).META_LIC)),,$(eval ALL_TARGETS.$(target).META_LIC:=$(module_license_metadata)))\ + $(if $(strip $(ALL_TARGETS.$(target).META_LIC)),,$(call declare-copy-target-license-metadata,$(target),$(f)))\ $(eval COMPATIBILITY.$(suite).HOST_SHARED_LIBRARY.FILES := \ $$(COMPATIBILITY.$(suite).HOST_SHARED_LIBRARY.FILES) $(f):$(target))\ $(eval COMPATIBILITY.$(suite).HOST_SHARED_LIBRARY.FILES := \ diff --git a/core/notice_files.mk b/core/notice_files.mk index c05d4ea0be..84523af5e2 100644 --- a/core/notice_files.mk +++ b/core/notice_files.mk @@ -127,7 +127,8 @@ module_license_metadata := ifdef my_register_name module_license_metadata := $(call local-intermediates-dir)/$(my_register_name).meta_lic - $(foreach target,$(ALL_MODULES.$(my_register_name).BUILT) $(ALL_MODULES.$(my_register_name).INSTALLED) $(my_test_data) $(my_test_config),\ + $(foreach target,$(ALL_MODULES.$(my_register_name).BUILT) $(ALL_MODULES.$(my_register_name).INSTALLED) $(foreach bi,$(LOCAL_SOONG_BUILT_INSTALLED),$(call word-colon,1,$(bi))) \ + $(my_test_data) $(my_test_config),\ $(eval ALL_TARGETS.$(target).META_LIC := $(module_license_metadata))) ALL_MODULES.$(my_register_name).META_LIC := $(strip $(ALL_MODULES.$(my_register_name).META_LIC) $(module_license_metadata)) diff --git a/core/tasks/tools/vts_package_utils.mk b/core/tasks/tools/vts_package_utils.mk index f1159b3bd9..06161f0b3c 100644 --- a/core/tasks/tools/vts_package_utils.mk +++ b/core/tasks/tools/vts_package_utils.mk @@ -29,6 +29,6 @@ $(foreach m,$(1),\ $(eval my_copy_dest := $(patsubst data/%,DATA/%,\ $(patsubst system/%,DATA/%,\ $(patsubst $(PRODUCT_OUT)/%,%,$(ins)))))\ - $(eval ALL_TARGETS.$(2)/$(my_copy_dest).META_LIC := $(if $(strip $(ALL_MODULES.$(m).META_LIC)),$(ALL_MODULES.$(m).META_LIC),$(ALL_MODULES.$(m).DELAYED_META_LIC)))\ + $(call declare-copy-target-license-metadata,$(2)/$(my_copy_dest),$(bui))\ $(bui):$(2)/$(my_copy_dest)))) endef From 917c60a26733c49e84f43d70e90a5c3cde083b00 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Mon, 6 Jun 2022 16:59:33 -0700 Subject: [PATCH 022/139] Fix pitfall: do not delete intermediates dir. Test: build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_coral_hwasan TARGET_BUILD_VARIANT=userdebug droid dist with-license platform_tests continuous_instrumentation_tests continuous_native_tests Bug: 240342946 Change-Id: Ibf1bff6ee67e4958b1e1ea2fbc0385787d3bf0f0 Merged-in: Ibf1bff6ee67e4958b1e1ea2fbc0385787d3bf0f0 Merged-in: I6f0f2fa7861bca18e34576c920a3c33ffef6b46e --- core/tasks/tools/package-modules.mk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/tasks/tools/package-modules.mk b/core/tasks/tools/package-modules.mk index f89d51eea0..c41aec5fc4 100644 --- a/core/tasks/tools/package-modules.mk +++ b/core/tasks/tools/package-modules.mk @@ -27,7 +27,7 @@ LOCAL_MODULE_CLASS := PACKAGING LOCAL_MODULE_STEM := $(my_package_name).zip LOCAL_UNINSTALLABLE_MODULE := true include $(BUILD_SYSTEM)/base_rules.mk -my_staging_dir := $(intermediates) +my_staging_dir := $(intermediates)/staging my_package_zip := $(LOCAL_BUILT_MODULE) my_built_modules := $(foreach p,$(my_copy_pairs),$(call word-colon,1,$(p))) @@ -94,17 +94,18 @@ ifneq ($(my_missing_error),) endif $(my_package_zip): PRIVATE_COPY_PAIRS := $(my_copy_pairs) +$(my_package_zip): PRIVATE_STAGING_DIR := $(my_staging_dir) $(my_package_zip): PRIVATE_PICKUP_FILES := $(my_pickup_files) $(my_package_zip) : $(my_built_modules) @echo "Package $@" - @rm -rf $(dir $@) && mkdir -p $(dir $@) + @rm -rf $(PRIVATE_STAGING_DIR) && mkdir -p $(PRIVATE_STAGING_DIR) $(foreach p, $(PRIVATE_COPY_PAIRS),\ $(eval pair := $(subst :,$(space),$(p)))\ mkdir -p $(dir $(word 2,$(pair))) && \ cp -Rf $(word 1,$(pair)) $(word 2,$(pair)) && ) true $(hide) $(foreach f, $(PRIVATE_PICKUP_FILES),\ - cp -RfL $(f) $(dir $@) && ) true - $(hide) cd $(dir $@) && zip -rqX $(notdir $@) * + cp -RfL $(f) $(PRIVATE_STAGING_DIR) && ) true + $(hide) cd $(PRIVATE_STAGING_DIR) && zip -rqX ../$(notdir $@) * my_makefile := my_staging_dir := From 633c15e614bddd0fac0d375c5e84989a03b68cec Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Tue, 14 Jun 2022 18:18:45 +0000 Subject: [PATCH 023/139] Create lists of projects to share per dist target Bug: 240342946 Test: build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_coral_hwasan TARGET_BUILD_VARIANT=userdebug droid dist with-license platform_tests continuous_instrumentation_tests continuous_native_tests Test: tapas google-tradefed-all && m dist Change-Id: I1e5f5639ebf1fa61060124a5183f6f0a2ece04b5 Merged-in: I1e5f5639ebf1fa61060124a5183f6f0a2ece04b5 --- core/definitions.mk | 85 +++++++++++++++++++++++++++++++++++++------- core/distdir.mk | 47 ++++++++++++++++++++++++ core/notice_files.mk | 2 +- 3 files changed, 121 insertions(+), 13 deletions(-) diff --git a/core/definitions.mk b/core/definitions.mk index d5fc279510..0b9263ee8d 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -573,16 +573,21 @@ define license-metadata-dir $(call generated-sources-dir-for,META,lic,) endef +TARGETS_MISSING_LICENSE_METADATA:= + ########################################################### # License metadata targets corresponding to targets in $(1) ########################################################### define corresponding-license-metadata -$(strip $(foreach target, $(sort $(1)), \ +$(strip $(filter-out 0p,$(foreach target, $(sort $(1)), \ $(if $(strip $(ALL_MODULES.$(target).META_LIC)), \ $(ALL_MODULES.$(target).META_LIC), \ $(if $(strip $(ALL_TARGETS.$(target).META_LIC)), \ $(ALL_TARGETS.$(target).META_LIC), \ - $(call append-path,$(call license-metadata-dir),$(patsubst $(OUT_DIR)%,out%,$(target).meta_lic)))))) + $(eval TARGETS_MISSING_LICENSE_METADATA += $(target)) \ + ) \ + ) \ +))) endef ########################################################### @@ -751,7 +756,7 @@ $(_meta): PRIVATE_DEST_TARGET := $(1) $(_meta): PRIVATE_SOURCE_TARGETS := $(ALL_COPIED_TARGETS.$(1).SOURCES) $(_meta): PRIVATE_SOURCE_METADATA := $(_dep) $(_meta): PRIVATE_ARGUMENT_FILE := $(call intermediates-dir-for,PACKAGING,copynotice)/$(_meta)/arguments -$(_meta) : $(_dep) +$(_meta) : $(_dep) $(COPY_LICENSE_METADATA) rm -f $$@ mkdir -p $$(dir $$@) mkdir -p $$(dir $$(PRIVATE_ARGUMENT_FILE)) @@ -780,6 +785,7 @@ define declare-license-metadata $(strip \ $(eval _tgt := $(subst //,/,$(strip $(1)))) \ $(eval ALL_NON_MODULES += $(_tgt)) \ + $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir)/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ $(eval ALL_NON_MODULES.$(_tgt).LICENSE_KINDS := $(strip $(2))) \ $(eval ALL_NON_MODULES.$(_tgt).LICENSE_CONDITIONS := $(strip $(3))) \ $(eval ALL_NON_MODULES.$(_tgt).NOTICES := $(strip $(4))) \ @@ -820,6 +826,7 @@ define declare-container-license-metadata $(strip \ $(eval _tgt := $(subst //,/,$(strip $(1)))) \ $(eval ALL_NON_MODULES += $(_tgt)) \ + $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir)/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ $(eval ALL_NON_MODULES.$(_tgt).LICENSE_KINDS := $(strip $(2))) \ $(eval ALL_NON_MODULES.$(_tgt).LICENSE_CONDITIONS := $(strip $(3))) \ $(eval ALL_NON_MODULES.$(_tgt).NOTICES := $(strip $(4))) \ @@ -892,6 +899,7 @@ define declare-license-deps $(strip \ $(eval _tgt := $(strip $(1))) \ $(eval ALL_NON_MODULES += $(_tgt)) \ + $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir)/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ $(eval ALL_NON_MODULES.$(_tgt).DEPENDENCIES := $(strip $(ALL_NON_MODULES.$(_tgt).DEPENDENCIES) $(2))) \ ) endef @@ -908,6 +916,7 @@ define declare-container-license-deps $(strip \ $(eval _tgt := $(strip $(1))) \ $(eval ALL_NON_MODULES += $(_tgt)) \ + $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir)/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ $(eval ALL_NON_MODULES.$(_tgt).DEPENDENCIES := $(strip $(ALL_NON_MODULES.$(_tgt).DEPENDENCIES) $(2))) \ $(eval ALL_NON_MODULES.$(_tgt).IS_CONTAINER := true) \ $(eval ALL_NON_MODULES.$(_tgt).ROOT_MAPPINGS := $(strip $(ALL_NON_MODULES.$(_tgt).ROOT_MAPPINGS) $(3))) \ @@ -919,12 +928,14 @@ endef ########################################################### define report-missing-licenses-rule .PHONY: reportmissinglicenses -reportmissinglicenses: PRIVATE_NON_MODULES:=$(sort $(NON_MODULES_WITHOUT_LICENSE_METADATA)) -reportmissinglicenses: PRIVATE_COPIED_FILES:=$(sort $(filter $(NON_MODULES_WITHOUT_LICENSE_METADATA),$(foreach _pair,$(PRODUCT_COPY_FILES), $(PRODUCT_OUT)/$(call word-colon,2,$(_pair))))) +reportmissinglicenses: PRIVATE_NON_MODULES:=$(sort $(NON_MODULES_WITHOUT_LICENSE_METADATA) $(TARGETS_MISSING_LICENSE_METADATA)) +reportmissinglicenses: PRIVATE_COPIED_FILES:=$(sort $(filter $(NON_MODULES_WITHOUT_LICENSE_METADATA) $(TARGETS_MISSING_LICENSE_METADATA),\ + $(foreach _pair,$(PRODUCT_COPY_FILES), $(PRODUCT_OUT)/$(call word-colon,2,$(_pair))))) reportmissinglicenses: @echo Reporting $$(words $$(PRIVATE_NON_MODULES)) targets without license metadata $$(foreach t,$$(PRIVATE_NON_MODULES),if ! [ -h $$(t) ]; then echo No license metadata for $$(t) >&2; fi;) $$(foreach t,$$(PRIVATE_COPIED_FILES),if ! [ -h $$(t) ]; then echo No license metadata for copied file $$(t) >&2; fi;) + echo $$(words $$(PRIVATE_NON_MODULES)) targets missing license metadata >&2 endef @@ -977,15 +988,9 @@ $(strip \ $(foreach t,$(sort $(ALL_0P_TARGETS)), \ $(eval ALL_TARGETS.$(t).META_LIC := 0p) \ ) \ - $(foreach t,$(sort $(ALL_NON_MODULES)), \ - $(eval ALL_TARGETS.$(t).META_LIC := $(call append-path,$(_dir),$(patsubst $(OUT_DIR)%,out%,$(t).meta_lic))) \ - ) \ $(foreach t,$(sort $(ALL_NON_MODULES)),$(eval $(call non-module-license-metadata-rule,$(t)))) \ $(foreach m,$(sort $(ALL_MODULES)),$(eval $(call license-metadata-rule,$(m)))) \ $(foreach t,$(sort $(ALL_COPIED_TARGETS)),$(eval $(call copied-target-license-metadata-rule,$(t)))) \ - $(foreach t,$(sort $(ALL_NON_MODULES)),$(call record-missing-non-module-dependencies,$(t))) \ - $(eval $(call report-missing-licenses-rule)) \ - $(eval $(call report-all-notice-library-names-rule)) \ $(eval $(call build-all-license-metadata-rule))) endef @@ -1057,6 +1062,22 @@ $(strip \ ) endef +# Uses LOCAL_MODULE_CLASS, LOCAL_MODULE, and LOCAL_IS_HOST_MODULE +# to determine the intermediates directory. +# +# $(1): if non-empty, force the intermediates to be COMMON +# $(2): if non-empty, force the intermediates to be for the 2nd arch +# $(3): if non-empty, force the intermediates to be for the host cross os +define local-meta-intermediates-dir +$(strip \ + $(if $(strip $(LOCAL_MODULE_CLASS)),, \ + $(error $(LOCAL_PATH): LOCAL_MODULE_CLASS not defined before call to local-meta-intermediates-dir)) \ + $(if $(strip $(LOCAL_MODULE)),, \ + $(error $(LOCAL_PATH): LOCAL_MODULE not defined before call to local-meta-intermediates-dir)) \ + $(call intermediates-dir-for,META$(LOCAL_MODULE_CLASS),$(LOCAL_MODULE),$(if $(strip $(LOCAL_IS_HOST_MODULE)),HOST),$(1),$(2),$(3)) \ +) +endef + ########################################################### ## The generated sources directory. Placing generated ## source files directly in the intermediates directory @@ -2476,7 +2497,47 @@ define dump-words-to-file @$(call emit-line,$(wordlist 38001,38500,$(1)),$(2)) @$(call emit-line,$(wordlist 38501,39000,$(1)),$(2)) @$(call emit-line,$(wordlist 39001,39500,$(1)),$(2)) - @$(if $(wordlist 39501,39502,$(1)),$(error Too many words ($(words $(1))))) + @$(call emit-line,$(wordlist 39501,40000,$(1)),$(2)) + @$(call emit-line,$(wordlist 40001,40500,$(1)),$(2)) + @$(call emit-line,$(wordlist 40501,41000,$(1)),$(2)) + @$(call emit-line,$(wordlist 41001,41500,$(1)),$(2)) + @$(call emit-line,$(wordlist 41501,42000,$(1)),$(2)) + @$(call emit-line,$(wordlist 42001,42500,$(1)),$(2)) + @$(call emit-line,$(wordlist 42501,43000,$(1)),$(2)) + @$(call emit-line,$(wordlist 43001,43500,$(1)),$(2)) + @$(call emit-line,$(wordlist 43501,44000,$(1)),$(2)) + @$(call emit-line,$(wordlist 44001,44500,$(1)),$(2)) + @$(call emit-line,$(wordlist 44501,45000,$(1)),$(2)) + @$(call emit-line,$(wordlist 45001,45500,$(1)),$(2)) + @$(call emit-line,$(wordlist 45501,46000,$(1)),$(2)) + @$(call emit-line,$(wordlist 46001,46500,$(1)),$(2)) + @$(call emit-line,$(wordlist 46501,47000,$(1)),$(2)) + @$(call emit-line,$(wordlist 47001,47500,$(1)),$(2)) + @$(call emit-line,$(wordlist 47501,48000,$(1)),$(2)) + @$(call emit-line,$(wordlist 48001,48500,$(1)),$(2)) + @$(call emit-line,$(wordlist 48501,49000,$(1)),$(2)) + @$(call emit-line,$(wordlist 49001,49500,$(1)),$(2)) + @$(call emit-line,$(wordlist 49501,50000,$(1)),$(2)) + @$(call emit-line,$(wordlist 50001,50500,$(1)),$(2)) + @$(call emit-line,$(wordlist 50501,51000,$(1)),$(2)) + @$(call emit-line,$(wordlist 51001,51500,$(1)),$(2)) + @$(call emit-line,$(wordlist 51501,52000,$(1)),$(2)) + @$(call emit-line,$(wordlist 52001,52500,$(1)),$(2)) + @$(call emit-line,$(wordlist 52501,53000,$(1)),$(2)) + @$(call emit-line,$(wordlist 53001,53500,$(1)),$(2)) + @$(call emit-line,$(wordlist 53501,54000,$(1)),$(2)) + @$(call emit-line,$(wordlist 54001,54500,$(1)),$(2)) + @$(call emit-line,$(wordlist 54501,55000,$(1)),$(2)) + @$(call emit-line,$(wordlist 55001,55500,$(1)),$(2)) + @$(call emit-line,$(wordlist 55501,56000,$(1)),$(2)) + @$(call emit-line,$(wordlist 56001,56500,$(1)),$(2)) + @$(call emit-line,$(wordlist 56501,57000,$(1)),$(2)) + @$(call emit-line,$(wordlist 57001,57500,$(1)),$(2)) + @$(call emit-line,$(wordlist 57501,58000,$(1)),$(2)) + @$(call emit-line,$(wordlist 58001,58500,$(1)),$(2)) + @$(call emit-line,$(wordlist 58501,59000,$(1)),$(2)) + @$(call emit-line,$(wordlist 59001,59500,$(1)),$(2)) + @$(if $(wordlist 59501,59502,$(1)),$(error Too many words ($(words $(1))))) endef # Return jar arguments to compress files in a given directory # $(1): directory diff --git a/core/distdir.mk b/core/distdir.mk index aad8ff3d65..bdfb490e18 100644 --- a/core/distdir.mk +++ b/core/distdir.mk @@ -45,6 +45,44 @@ $(foreach file,$(2), \ $(eval _all_dist_goal_output_pairs += $$(goal):$$(dst)))) endef +.PHONY: shareprojects +#shareprojects: + +define __share-projects-rule +$(1) : PRIVATE_TARGETS := $(2) +$(1) : PRIVATE_ARGUMENT_FILE := $(call intermediates-dir-for,PACKAGING,codesharing)/$(1)/arguments +$(1): $(2) $(COMPLIANCE_LISTSHARE) + $(hide) rm -f $$@ + mkdir -p $$(dir $$@) + mkdir -p $$(dir $$(PRIVATE_ARGUMENT_FILE)) + $$(if $$(strip $$(PRIVATE_TARGETS)),$$(call dump-words-to-file,$$(PRIVATE_TARGETS),$$(PRIVATE_ARGUMENT_FILE))) + $$(if $$(strip $$(PRIVATE_TARGETS)),OUT_DIR=$(OUT_DIR) $(COMPLIANCE_LISTSHARE) -o $$@ @$$(PRIVATE_ARGUMENT_FILE),touch $$@) +endef + +# build list of projects to share in $(1) for dist targets in $(2) +# +# $(1): the intermediate project sharing file +# $(2): the dist files to base the sharing on +define _share-projects-rule +$(eval $(call __share-projects-rule,$(1),$(call corresponding-license-metadata,$(2)))) +endef + +define _add_projects_to_share +$(strip $(eval _idir := $(call intermediates-dir-for,PACKAGING,shareprojects))) \ +$(strip $(eval _goals := $(sort $(_all_dist_goals)))) \ +$(strip $(eval _opairs := $(sort $(_all_dist_goal_output_pairs)))) \ +$(strip $(eval _dpairs := $(sort $(_all_dist_src_dst_pairs)))) \ +$(strip $(eval _allt :=)) \ +$(foreach goal,$(_goals), \ + $(eval _f := $(_idir)/$(goal).shareprojects) \ + $(call dist-for-goals,$(goal),$(_f):shareprojects/$(basename $(notdir $(_f)))) \ + $(eval _targets :=) \ + $(foreach op,$(filter $(goal):%,$(_opairs)),$(foreach p,$(filter %:$(call word-colon,2,$(op)),$(_dpairs)),$(eval _targets += $(call word-colon,1,$(p))))) \ + $(eval _allt += $(_targets)) \ + $(eval $(call _share-projects-rule,$(_f),$(_targets))) \ +) +endef + #------------------------------------------------------------------ # To be used at the end of the build to collect all the uses of # dist-for-goals, and write them into a file for the packaging step to use. @@ -52,6 +90,15 @@ endef # $(1): The file to write define dist-write-file $(strip \ + $(call _add_projects_to_share)\ + $(if $(strip $(ANDROID_REQUIRE_LICENSE_METADATA)),\ + $(foreach target,$(sort $(TARGETS_MISSING_LICENSE_METADATA)),$(warning target $(target) missing license metadata))\ + $(if $(strip $(TARGETS_MISSING_LICENSE_METADATA)),\ + $(if $(filter true error,$(ANDROID_REQUIRE_LICENSE_METADATA)),\ + $(error $(words $(sort $(TARGETS_MISSING_LICENSE_METADATA))) targets need license metadata))))\ + $(foreach t,$(sort $(ALL_NON_MODULES)),$(call record-missing-non-module-dependencies,$(t))) \ + $(eval $(call report-missing-licenses-rule)) \ + $(eval $(call report-all-notice-library-names-rule)) \ $(KATI_obsolete_var dist-for-goals,Cannot be used after dist-write-file) \ $(foreach goal,$(sort $(_all_dist_goals)), \ $(eval $$(goal): _dist_$$(goal))) \ diff --git a/core/notice_files.mk b/core/notice_files.mk index 84523af5e2..cbfcaa4f7a 100644 --- a/core/notice_files.mk +++ b/core/notice_files.mk @@ -125,7 +125,7 @@ local_path := $(LOCAL_PATH) module_license_metadata := ifdef my_register_name - module_license_metadata := $(call local-intermediates-dir)/$(my_register_name).meta_lic + module_license_metadata := $(call local-meta-intermediates-dir)/$(my_register_name).meta_lic $(foreach target,$(ALL_MODULES.$(my_register_name).BUILT) $(ALL_MODULES.$(my_register_name).INSTALLED) $(foreach bi,$(LOCAL_SOONG_BUILT_INSTALLED),$(call word-colon,1,$(bi))) \ $(my_test_data) $(my_test_config),\ From 1651ffe292179b5a813a9cb9ef759e3b73f90243 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Tue, 14 Jun 2022 18:19:30 +0000 Subject: [PATCH 024/139] Record license text for every dist target. Bug: 240342946 Test: m droid dist reportmissinglicenses Test: tapas google-tradefed-all && m dist Test: build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_coral_hwasan TARGET_BUILD_VARIANT=userdebug droid dist with-license platform_tests continuous_instrumentation_tests continuous_native_tests Change-Id: I392047ec50ac6e74b9accf260c62e77aef1640d5 Merged-in: I392047ec50ac6e74b9accf260c62e77aef1640d5 --- core/distdir.mk | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/core/distdir.mk b/core/distdir.mk index bdfb490e18..8f48cf817c 100644 --- a/core/distdir.mk +++ b/core/distdir.mk @@ -46,11 +46,10 @@ $(foreach file,$(2), \ endef .PHONY: shareprojects -#shareprojects: define __share-projects-rule $(1) : PRIVATE_TARGETS := $(2) -$(1) : PRIVATE_ARGUMENT_FILE := $(call intermediates-dir-for,PACKAGING,codesharing)/$(1)/arguments +$(1) : PRIVATE_ARGUMENT_FILE := $(call intermediates-dir-for,METAPACKAGING,codesharing)/$(1)/arguments $(1): $(2) $(COMPLIANCE_LISTSHARE) $(hide) rm -f $$@ mkdir -p $$(dir $$@) @@ -67,19 +66,52 @@ define _share-projects-rule $(eval $(call __share-projects-rule,$(1),$(call corresponding-license-metadata,$(2)))) endef +.PHONY: alllicensetexts + +define __license-texts-rule +$(2) : PRIVATE_GOAL := $(1) +$(2) : PRIVATE_TARGETS := $(3) +$(2) : PRIVATE_ROOTS := $(4) +$(2) : PRIVATE_ARGUMENT_FILE := $(call intermediates-dir-for,METAPACKAGING,licensetexts)/$(2)/arguments +$(2): $(3) $(TEXTNOTICE) + $(hide) rm -f $$@ + mkdir -p $$(dir $$@) + mkdir -p $$(dir $$(PRIVATE_ARGUMENT_FILE)) + $$(if $$(strip $$(PRIVATE_TARGETS)),$$(call dump-words-to-file,\ + -product="$$(PRIVATE_GOAL)" -title="$$(PRIVATE_GOAL)" \ + $$(addprefix -strip_prefix ,$$(PRIVATE_ROOTS)) \ + -strip_prefix=$(PRODUCT_OUT)/ -strip_prefix=$(HOST_OUT)/\ + $$(PRIVATE_TARGETS),\ + $$(PRIVATE_ARGUMENT_FILE))) + $$(if $$(strip $$(PRIVATE_TARGETS)),OUT_DIR=$(OUT_DIR) $(TEXTNOTICE) -o $$@ @$$(PRIVATE_ARGUMENT_FILE),touch $$@) +endef + +# build list of projects to share in $(2) for dist targets in $(3) for dist goal $(1) +# +# $(1): the name of the dist goal +# $(2): the intermediate project sharing file +# $(3): the dist files to base the sharing on +define _license-texts-rule +$(eval $(call __license-texts-rule,$(1),$(2),$(call corresponding-license-metadata,$(3)),$(sort $(dir $(3))))) +endef + define _add_projects_to_share -$(strip $(eval _idir := $(call intermediates-dir-for,PACKAGING,shareprojects))) \ +$(strip $(eval _idir := $(call intermediates-dir-for,METAPACKAGING,shareprojects))) \ +$(strip $(eval _tdir := $(call intermediates-dir-for,METAPACKAGING,licensetexts))) \ $(strip $(eval _goals := $(sort $(_all_dist_goals)))) \ $(strip $(eval _opairs := $(sort $(_all_dist_goal_output_pairs)))) \ $(strip $(eval _dpairs := $(sort $(_all_dist_src_dst_pairs)))) \ $(strip $(eval _allt :=)) \ $(foreach goal,$(_goals), \ $(eval _f := $(_idir)/$(goal).shareprojects) \ + $(eval _n := $(_tdir)/$(goal).txt) \ $(call dist-for-goals,$(goal),$(_f):shareprojects/$(basename $(notdir $(_f)))) \ + $(call dist-for-goals,$(goal),$(_n):licensetexts/$(basename $(notdir $(_n)))) \ $(eval _targets :=) \ $(foreach op,$(filter $(goal):%,$(_opairs)),$(foreach p,$(filter %:$(call word-colon,2,$(op)),$(_dpairs)),$(eval _targets += $(call word-colon,1,$(p))))) \ $(eval _allt += $(_targets)) \ $(eval $(call _share-projects-rule,$(_f),$(_targets))) \ + $(eval $(call _license-texts-rule,$(goal),$(_n),$(_targets))) \ ) endef From 17bfa62a87f188a65842003c661fa2041bbaa4ce Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Wed, 22 Jun 2022 00:58:39 +0000 Subject: [PATCH 025/139] Target dist files not dist goals. This change creates license texts and lists of projects to share for individual files in dist instead of for dist goals. If a distribution needs the license texts for part of a dist file or for a combination of multiple files, whoever is distributing will have to create a suitable text notice using `gen_notice{}` or `testnotice` and include it among the dist files for the goal using `dist-for-goals` or equivalent. Bug: 240342946 Test: m cts dist Test: m droid dist Test: tapas google-tradefed-all && m dist Change-Id: I9fbcb07acfa7b14a140563cb031374160b6b23c2 Merged-in: I9fbcb07acfa7b14a140563cb031374160b6b23c2 --- core/distdir.mk | 114 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 89 insertions(+), 25 deletions(-) diff --git a/core/distdir.mk b/core/distdir.mk index 8f48cf817c..bce8e7fd3c 100644 --- a/core/distdir.mk +++ b/core/distdir.mk @@ -49,21 +49,18 @@ endef define __share-projects-rule $(1) : PRIVATE_TARGETS := $(2) -$(1) : PRIVATE_ARGUMENT_FILE := $(call intermediates-dir-for,METAPACKAGING,codesharing)/$(1)/arguments $(1): $(2) $(COMPLIANCE_LISTSHARE) $(hide) rm -f $$@ mkdir -p $$(dir $$@) - mkdir -p $$(dir $$(PRIVATE_ARGUMENT_FILE)) - $$(if $$(strip $$(PRIVATE_TARGETS)),$$(call dump-words-to-file,$$(PRIVATE_TARGETS),$$(PRIVATE_ARGUMENT_FILE))) - $$(if $$(strip $$(PRIVATE_TARGETS)),OUT_DIR=$(OUT_DIR) $(COMPLIANCE_LISTSHARE) -o $$@ @$$(PRIVATE_ARGUMENT_FILE),touch $$@) + $$(if $$(strip $$(PRIVATE_TARGETS)),OUT_DIR=$(OUT_DIR) $(COMPLIANCE_LISTSHARE) -o $$@ $$(PRIVATE_TARGETS),touch $$@) endef -# build list of projects to share in $(1) for dist targets in $(2) +# build list of projects to share in $(1) for meta_lic in $(2) # # $(1): the intermediate project sharing file -# $(2): the dist files to base the sharing on +# $(2): the license metadata to base the sharing on define _share-projects-rule -$(eval $(call __share-projects-rule,$(1),$(call corresponding-license-metadata,$(2)))) +$(eval $(call __share-projects-rule,$(1),$(2))) endef .PHONY: alllicensetexts @@ -86,32 +83,99 @@ $(2): $(3) $(TEXTNOTICE) $$(if $$(strip $$(PRIVATE_TARGETS)),OUT_DIR=$(OUT_DIR) $(TEXTNOTICE) -o $$@ @$$(PRIVATE_ARGUMENT_FILE),touch $$@) endef -# build list of projects to share in $(2) for dist targets in $(3) for dist goal $(1) +# build list of projects to share in $(2) for meta_lic in $(3) for dist goals $(1) +# Strip `out/dist/` used as proxy for 'DIST_DIR' # -# $(1): the name of the dist goal +# $(1): the name of the dist goals # $(2): the intermediate project sharing file -# $(3): the dist files to base the sharing on +# $(3): the license metadata to base the sharing on define _license-texts-rule -$(eval $(call __license-texts-rule,$(1),$(2),$(call corresponding-license-metadata,$(3)),$(sort $(dir $(3))))) +$(eval $(call __license-texts-rule,$(1),$(2),$(3),out/dist/)) endef +########################################################### +## License metadata build rule for dist target $(1) with meta_lic $(2) copied from $(3) +########################################################### +define _dist-target-license-metadata-rule +$(strip $(eval _meta :=$(2))) +$(strip $(eval _dep:=)) +# 0p is the indicator for a non-copyrightable file where no party owns the copyright. +# i.e. pure data with no copyrightable expression. +# If all of the sources are 0p and only 0p, treat the copied file as 0p. Otherwise, all +# of the sources must either be 0p or originate from a single metadata file to copy. +$(strip $(foreach s,$(strip $(3)),\ + $(eval _dmeta:=$(ALL_TARGETS.$(s).META_LIC))\ + $(if $(strip $(_dmeta)),\ + $(if $(filter-out 0p,$(_dep)),\ + $(if $(filter-out $(_dep) 0p,$(_dmeta)),\ + $(error cannot copy target from multiple modules: $(1) from $(_dep) and $(_dmeta)),\ + $(if $(filter 0p,$(_dep)),$(eval _dep:=$(_dmeta)))),\ + $(eval _dep:=$(_dmeta))\ + ),\ + $(eval TARGETS_MISSING_LICENSE_METADATA += $(s) $(1))))) + + +ifeq (0p,$(strip $(_dep))) +# Not copyrightable. No emcumbrances, no license text, no license kind etc. +$(_meta): PRIVATE_CONDITIONS := unencumbered +$(_meta): PRIVATE_SOURCES := $(3) +$(_meta): PRIVATE_INSTALLED := $(1) +# use `$(1)` which is the unique and relatively short `out/dist/$(target)` +$(_meta): PRIVATE_ARGUMENT_FILE := $(call intermediates-dir-for,METAPACKAGING,notice)/$(1)/arguments +$(_meta): $(BUILD_LICENSE_METADATA) +$(_meta) : + rm -f $$@ + mkdir -p $$(dir $$@) + mkdir -p $$(dir $$(PRIVATE_ARGUMENT_FILE)) + $$(call dump-words-to-file,\ + $$(addprefix -c ,$$(PRIVATE_CONDITIONS))\ + $$(addprefix -s ,$$(PRIVATE_SOURCES))\ + $$(addprefix -t ,$$(PRIVATE_TARGETS))\ + $$(addprefix -i ,$$(PRIVATE_INSTALLED)),\ + $$(PRIVATE_ARGUMENT_FILE)) + OUT_DIR=$(OUT_DIR) $(BUILD_LICENSE_METADATA) \ + @$$(PRIVATE_ARGUMENT_FILE) \ + -o $$@ + +else ifneq (,$(strip $(_dep))) +# Not a missing target, copy metadata and `is_container` etc. from license metadata file `$(_dep)` +$(_meta): PRIVATE_DEST_TARGET := $(1) +$(_meta): PRIVATE_SOURCE_TARGETS := $(3) +$(_meta): PRIVATE_SOURCE_METADATA := $(_dep) +# use `$(1)` which is the unique and relatively short `out/dist/$(target)` +$(_meta): PRIVATE_ARGUMENT_FILE := $(call intermediates-dir-for,METAPACKAGING,copynotice)/$(1)/arguments +$(_meta) : $(_dep) $(COPY_LICENSE_METADATA) + rm -f $$@ + mkdir -p $$(dir $$@) + mkdir -p $$(dir $$(PRIVATE_ARGUMENT_FILE)) + $$(call dump-words-to-file,\ + $$(addprefix -i ,$$(PRIVATE_DEST_TARGET))\ + $$(addprefix -s ,$$(PRIVATE_SOURCE_TARGETS))\ + $$(addprefix -d ,$$(PRIVATE_SOURCE_METADATA)),\ + $$(PRIVATE_ARGUMENT_FILE)) + OUT_DIR=$(OUT_DIR) $(COPY_LICENSE_METADATA) \ + @$$(PRIVATE_ARGUMENT_FILE) \ + -o $$@ + +endif +endef + +# use `out/dist/` as a proxy for 'DIST_DIR' define _add_projects_to_share +$(strip $(eval _mdir := $(call intermediates-dir-for,METAPACKAGING,meta)/out/dist)) \ $(strip $(eval _idir := $(call intermediates-dir-for,METAPACKAGING,shareprojects))) \ $(strip $(eval _tdir := $(call intermediates-dir-for,METAPACKAGING,licensetexts))) \ -$(strip $(eval _goals := $(sort $(_all_dist_goals)))) \ -$(strip $(eval _opairs := $(sort $(_all_dist_goal_output_pairs)))) \ -$(strip $(eval _dpairs := $(sort $(_all_dist_src_dst_pairs)))) \ -$(strip $(eval _allt :=)) \ -$(foreach goal,$(_goals), \ - $(eval _f := $(_idir)/$(goal).shareprojects) \ - $(eval _n := $(_tdir)/$(goal).txt) \ - $(call dist-for-goals,$(goal),$(_f):shareprojects/$(basename $(notdir $(_f)))) \ - $(call dist-for-goals,$(goal),$(_n):licensetexts/$(basename $(notdir $(_n)))) \ - $(eval _targets :=) \ - $(foreach op,$(filter $(goal):%,$(_opairs)),$(foreach p,$(filter %:$(call word-colon,2,$(op)),$(_dpairs)),$(eval _targets += $(call word-colon,1,$(p))))) \ - $(eval _allt += $(_targets)) \ - $(eval $(call _share-projects-rule,$(_f),$(_targets))) \ - $(eval $(call _license-texts-rule,$(goal),$(_n),$(_targets))) \ +$(strip $(eval _allt := $(sort $(foreach goal,$(_all_dist_goal_output_pairs),$(call word-colon,2,$(goal)))))) \ +$(foreach target,$(_allt), \ + $(eval _goals := $(sort $(foreach dg,$(filter %:$(target),$(_all_dist_goal_output_pairs)),$(call word-colon,1,$(dg))))) \ + $(eval _srcs := $(sort $(foreach sdp,$(filter %:$(target),$(_all_dist_src_dst_pairs)),$(call word-colon,1,$(sdp))))) \ + $(eval $(call _dist-target-license-metadata-rule,out/dist/$(target),$(_mdir)/out/dist/$(target).meta_lic,$(_srcs))) \ + $(eval _f := $(_idir)/$(target).shareprojects) \ + $(eval _n := $(_tdir)/$(target).txt) \ + $(eval $(call dist-for-goals,$(_goals),$(_f):shareprojects/$(target).shareprojects)) \ + $(eval $(call dist-for-goals,$(_goals),$(_n):licensetexts/$(target).txt)) \ + $(eval $(call _share-projects-rule,$(_f),$(foreach t, $(filter-out $(TARGETS_MISSING_LICENSE_METADATA),out/dist/$(target)),$(_mdir)/$(t).meta_lic))) \ + $(eval $(call _license-texts-rule,$(_goals),$(_n),$(foreach t,$(filter-out $(TARGETS_MISSING_LICENSE_METADATA),out/dist/$(target)),$(_mdir)/$(t).meta_lic))) \ ) endef From 9d2cf6f326043381678b6a6c8bce00227b3e1724 Mon Sep 17 00:00:00 2001 From: Nick Kovacs Date: Wed, 3 Aug 2022 22:37:47 +0000 Subject: [PATCH 026/139] Revert "Update minimum supported targetSdk to 29" Revert "Expect warning message for app targetSdk < 29" Revert submission 19380683-increase-min-target-sdk-version Reason for revert: Test failures Reverted Changes: Ie4a4ad6d4:Update minimum supported targetSdk to 29 Icda326d6e:Expect warning message for app targetSdk < 29 Change-Id: I46c71b21e97d702408ecca8c8c0172e5f92ceb0c --- core/version_util.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_util.mk b/core/version_util.mk index 1c8574c0cc..cbfef96593 100644 --- a/core/version_util.mk +++ b/core/version_util.mk @@ -251,6 +251,6 @@ ifndef PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION # Used to set minimum supported target sdk version. Apps targeting sdk # version lower than the set value will result in a warning being shown # when any activity from the app is started. - PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 29 + PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 23 endif .KATI_READONLY := PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION From 67ebe09f86bf55b54731cfa99bbfbe90db7c850b Mon Sep 17 00:00:00 2001 From: Nick Kovacs Date: Fri, 5 Aug 2022 19:32:08 +0000 Subject: [PATCH 027/139] Update minimum supported targetSdk to 28 This change will cause a dismissable warning message to display indicating the app is targeting a low targetSdkVersion. Previously this message was displayed for apps targeting < 23. The eventual goal is to move this to 29, but still working through some failed CTS tests. Updating first to 28, and then will follow up with an update to 29. Bringing this to 29 would be in line with trailing by 4 major releases. Test: make Test: atest CtsWindowManagerSdk25TestCases:AspectRatioSdk25Tests Test: atest CtsWindowManagerSdk28TestCases:AspectRatioSdk28Tests Change-Id: I669d325770b5abebcb29c2f4dc31f82fb8e638c7 --- core/version_util.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_util.mk b/core/version_util.mk index cbfef96593..e5830304fb 100644 --- a/core/version_util.mk +++ b/core/version_util.mk @@ -251,6 +251,6 @@ ifndef PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION # Used to set minimum supported target sdk version. Apps targeting sdk # version lower than the set value will result in a warning being shown # when any activity from the app is started. - PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 23 + PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 28 endif .KATI_READONLY := PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION From 2092c97c2e954e8ec389de37419448a3f56bb68f Mon Sep 17 00:00:00 2001 From: Nick Kovacs Date: Mon, 8 Aug 2022 18:44:42 +0000 Subject: [PATCH 028/139] Update minimum supported targetSdk to 29 Trailing by 4 major releases, as per schedule. Test: make Bug: 215522897 Change-Id: I33cd75a1092cb54f3f56bab6083d8f9211a32b64 --- core/version_util.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_util.mk b/core/version_util.mk index cbfef96593..00174d9ac0 100644 --- a/core/version_util.mk +++ b/core/version_util.mk @@ -170,7 +170,7 @@ ifndef PLATFORM_SYSTEMSDK_MIN_VERSION # to the public SDK where platform essentially supports all previous SDK versions, # platform supports only a few number of recent system SDK versions as some of # old system APIs are gradually deprecated, removed and then deleted. - PLATFORM_SYSTEMSDK_MIN_VERSION := 28 + PLATFORM_SYSTEMSDK_MIN_VERSION := 29 endif .KATI_READONLY := PLATFORM_SYSTEMSDK_MIN_VERSION From 00ea5ee7f55c005ee296f9a8bdc9986cfbc8eb07 Mon Sep 17 00:00:00 2001 From: zhidou Date: Wed, 10 Aug 2022 14:48:23 +0000 Subject: [PATCH 029/139] Ensure runtime-visible annotations are kept With R8 full mode, these annotations must be explicitly kept as attributes. Also keep annotation defaults as they may be used at runtime. Test: m + presubmit Bug: 233746531 Merged-In: Ibab630cd8498c5789ebcad6785fda24967df4d61 Change-Id: Icf2cddf89d06d29bdbd000a8216d1b975b5f49d8 --- core/proguard_basic_keeps.flags | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/proguard_basic_keeps.flags b/core/proguard_basic_keeps.flags index 54cbdccf3b..b5d14fa6b2 100644 --- a/core/proguard_basic_keeps.flags +++ b/core/proguard_basic_keeps.flags @@ -2,6 +2,11 @@ # that isn't explicitly part of the API -dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers +# Annotations are implemented as attributes, so we have to explicitly keep them. +# Keep all runtime-visible annotations like RuntimeVisibleParameterAnnotations +# and RuntimeVisibleTypeAnnotations, as well as associated defaults. +-keepattributes RuntimeVisible*Annotation*,AnnotationDefault + # For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations -keepclassmembers enum * { public static **[] values(); From 54cd052e049a2c6170d1a05ceb63d845beb6e27a Mon Sep 17 00:00:00 2001 From: Anna Zhuravleva Date: Mon, 15 Aug 2022 16:00:30 +0000 Subject: [PATCH 030/139] Add HealthConnect module to base_system.mk Bug: 242298335 Test: build Change-Id: I30dce77d48895621c9a557c1bb154066f5d31aba --- target/product/base_system.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 0470aad3ce..cca2a64e8f 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -56,6 +56,7 @@ PRODUCT_PACKAGES += \ com.android.conscrypt \ com.android.cronet \ com.android.extservices \ + com.android.healthconnect \ com.android.i18n \ com.android.ipsec \ com.android.location.provider \ From 01d7c4745acd050d63cd70b5d89f66ef5aa7cc9f Mon Sep 17 00:00:00 2001 From: Sam Delmerico Date: Thu, 1 Sep 2022 13:38:00 -0400 Subject: [PATCH 031/139] add module_arm64only product 64bit only systems won't load modules with mixed 32/64 binaries. We need a 64bit only product to build with. Bug: 205990590 Test: lunch module_arm64only && m Change-Id: I050a673bfa95978e624e64004089fe7a2b8e0a95 --- target/board/module_arm64only/BoardConfig.mk | 21 +++++++++++++++++++ target/board/module_arm64only/README.md | 2 ++ target/product/module_arm64only.mk | 22 ++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 target/board/module_arm64only/BoardConfig.mk create mode 100644 target/board/module_arm64only/README.md create mode 100644 target/product/module_arm64only.mk diff --git a/target/board/module_arm64only/BoardConfig.mk b/target/board/module_arm64only/BoardConfig.mk new file mode 100644 index 0000000000..3cabf05d94 --- /dev/null +++ b/target/board/module_arm64only/BoardConfig.mk @@ -0,0 +1,21 @@ +# Copyright (C) 2022 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. +# + +include build/make/target/board/BoardConfigModuleCommon.mk + +TARGET_ARCH := arm64 +TARGET_ARCH_VARIANT := armv8-a +TARGET_CPU_VARIANT := generic +TARGET_CPU_ABI := arm64-v8a diff --git a/target/board/module_arm64only/README.md b/target/board/module_arm64only/README.md new file mode 100644 index 0000000000..0dd16992f7 --- /dev/null +++ b/target/board/module_arm64only/README.md @@ -0,0 +1,2 @@ +This device is suitable for an unbundled module targeted specifically to an +arm64 device. 32 bit binaries will not be built. diff --git a/target/product/module_arm64only.mk b/target/product/module_arm64only.mk new file mode 100644 index 0000000000..4e8d53eb75 --- /dev/null +++ b/target/product/module_arm64only.mk @@ -0,0 +1,22 @@ +# +# Copyright (C) 2022 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 inherit-product, $(SRC_TARGET_DIR)/product/module_common.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk) + +PRODUCT_NAME := module_arm64only +PRODUCT_BRAND := Android +PRODUCT_DEVICE := module_arm64only From f7ee62d73da2991ebbdd4795eb7753e3107306f8 Mon Sep 17 00:00:00 2001 From: Sam Delmerico Date: Thu, 1 Sep 2022 14:50:01 -0400 Subject: [PATCH 032/139] add module_x86_64only product 64bit only systems won't load modules with mixed 32/64 binaries. We need a 64bit only product to build with. Bug: 205990590 Test: lunch module_x86_64only && m Test: vendor/google/build/build_mainline_modules.sh Change-Id: I906f6cd10882986c8182ed16916e07c0f0d8b32e --- target/board/module_x86_64only/BoardConfig.mk | 20 +++++++++++++++++ target/board/module_x86_64only/README.md | 2 ++ target/product/module_x86_64only.mk | 22 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 target/board/module_x86_64only/BoardConfig.mk create mode 100644 target/board/module_x86_64only/README.md create mode 100644 target/product/module_x86_64only.mk diff --git a/target/board/module_x86_64only/BoardConfig.mk b/target/board/module_x86_64only/BoardConfig.mk new file mode 100644 index 0000000000..b0676cbe22 --- /dev/null +++ b/target/board/module_x86_64only/BoardConfig.mk @@ -0,0 +1,20 @@ +# Copyright (C) 2020 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. +# + +include build/make/target/board/BoardConfigModuleCommon.mk + +TARGET_CPU_ABI := x86_64 +TARGET_ARCH := x86_64 +TARGET_ARCH_VARIANT := x86_64 diff --git a/target/board/module_x86_64only/README.md b/target/board/module_x86_64only/README.md new file mode 100644 index 0000000000..8fd7dc4757 --- /dev/null +++ b/target/board/module_x86_64only/README.md @@ -0,0 +1,2 @@ +This device is suitable for an unbundled module targeted specifically to an +x86_64 device. 32 bit binaries will not be built. diff --git a/target/product/module_x86_64only.mk b/target/product/module_x86_64only.mk new file mode 100644 index 0000000000..bca4541efe --- /dev/null +++ b/target/product/module_x86_64only.mk @@ -0,0 +1,22 @@ +# +# Copyright (C) 2021 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +$(call inherit-product, $(SRC_TARGET_DIR)/product/module_common.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk) + +PRODUCT_NAME := module_x86_64only +PRODUCT_BRAND := Android +PRODUCT_DEVICE := module_x86_64only From d40c04b41178bcbd718bca5534ff4ea17936d8f4 Mon Sep 17 00:00:00 2001 From: Zhi Dou Date: Fri, 2 Sep 2022 02:29:39 +0000 Subject: [PATCH 033/139] Suppress R8 warnings for support library annotations Most of these annotations are stripped at dex compile-time, and are not necessarily present in the generated dex library's classpath. As the classpath is used to inform R8 about `libraryjars`, this can cause reference failures during R8 execution when warnings are enabled. For now, suppress the reference warnings. Unrecognized runtime-visible annotations will still be kept, and this should unblock efforts to re-enable R8 warnings for many platform targets. A proper solution will be to ensure the appropriate annotation libs are fed as `-libraryjars` to R8. Bug: 242088131 Test: m + `optimize { ignore_warnings: false } Merged-In: Ie92db2a9725ff520b311c6b66a50feae79463925 Change-Id: Ie9caf9657667bf504bf541c75ccbfd07ef5be2fe --- core/proguard_basic_keeps.flags | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/proguard_basic_keeps.flags b/core/proguard_basic_keeps.flags index b5d14fa6b2..38feec37b8 100644 --- a/core/proguard_basic_keeps.flags +++ b/core/proguard_basic_keeps.flags @@ -75,6 +75,19 @@ # has a fallback, but again, don't use Futures.getChecked on Android regardless. -dontwarn java.lang.ClassValue +# Ignore missing annotation references for various support libraries. +# While this is not ideal, it should be relatively safe given that +# 1) runtime-visible annotations will still be kept, and 2) compile-time +# annotations are stripped by R8 anyway. +# Note: The ** prefix is used to accommodate jarjar repackaging. +# TODO(b/242088131): Remove these exemptions after resolving transitive libs +# dependencies that are provided to R8. +-dontwarn **android**.annotation*.** +-dontwarn **com.google.errorprone.annotations.** +-dontwarn javax.annotation.** +-dontwarn org.checkerframework.** +-dontwarn org.jetbrains.annotations.** + # Less spammy. -dontnote From 30dd9b143d5785f0e6199a743d5f209c92e6b394 Mon Sep 17 00:00:00 2001 From: Anna Zhuravleva Date: Tue, 6 Sep 2022 11:20:32 +0000 Subject: [PATCH 034/139] Add healthconnect library to bootlcasspath. Test: build, checked bootclasspath Bug: 244547761 Change-Id: I85fd85826e951494b96c4948e657d817e32429b4 --- target/product/default_art_config.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/default_art_config.mk b/target/product/default_art_config.mk index 901302e091..1c1e09b3a3 100644 --- a/target/product/default_art_config.mk +++ b/target/product/default_art_config.mk @@ -56,6 +56,7 @@ PRODUCT_APEX_BOOT_JARS := \ com.android.appsearch:framework-appsearch \ com.android.btservices:framework-bluetooth \ com.android.conscrypt:conscrypt \ + com.android.healthconnect:framework-healthconnect \ com.android.i18n:core-icu4j \ com.android.ipsec:android.net.ipsec.ike \ com.android.media:updatable-media \ From 169954221652cafcc3ed4c98e1c6a592ecb7f608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Kongstad?= Date: Wed, 7 Sep 2022 15:04:56 +0200 Subject: [PATCH 035/139] Bump SDK Extension version to 4 Modules with new APIs in this version are - AD_SERVICES - SDK_EXTENSIONS - TETHERING Bug: 245513010 Test: manual install of modules Change-Id: I8f4becf87001220a385df3b220e6929b2b212920 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 3dc896501b..8319b9b1d0 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -78,7 +78,7 @@ endif .KATI_READONLY := PLATFORM_SDK_VERSION # This is the sdk extension version of this tree. -PLATFORM_SDK_EXTENSION_VERSION := 3 +PLATFORM_SDK_EXTENSION_VERSION := 4 .KATI_READONLY := PLATFORM_SDK_EXTENSION_VERSION # This is the sdk extension version that PLATFORM_SDK_VERSION ships with. From dede1b9f7761967f973c4761093d03ed03c8b95a Mon Sep 17 00:00:00 2001 From: Anna Zhuravleva Date: Thu, 8 Sep 2022 13:25:48 +0000 Subject: [PATCH 036/139] Add Health Connect library to system server jars. Bug: 245722029 Test: build Change-Id: Ice145e15d876b5f37ffb6a071afbb36b106be26a --- target/product/default_art_config.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/default_art_config.mk b/target/product/default_art_config.mk index 1c1e09b3a3..b8e3fac640 100644 --- a/target/product/default_art_config.mk +++ b/target/product/default_art_config.mk @@ -81,6 +81,7 @@ PRODUCT_APEX_SYSTEM_SERVER_JARS := \ com.android.adservices:service-sdksandbox \ com.android.appsearch:service-appsearch \ com.android.art:service-art \ + com.android.healthconnect:service-healthconnect \ com.android.media:service-media-s \ com.android.permission:service-permission \ From 56d5a4006330a4dec5fb6b8940d58d47ee4a64da Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Tue, 6 Sep 2022 14:36:00 +0000 Subject: [PATCH 037/139] Make banchan support arm64only and x86_64only Test: banchan arm64only Test: banchan x86_64only Change-Id: I1a787a4c5d80db18d7712d257e196dc19f3496b7 (cherry picked from commit 90ac61c8b6c49005a75bce675fcaf26b85886f3e) Merged-In: I1a787a4c5d80db18d7712d257e196dc19f3496b7 --- envsetup.sh | 7 +++++-- target/product/AndroidProducts.mk | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/envsetup.sh b/envsetup.sh index d08028cefa..a4cf114bf0 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -10,7 +10,8 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y invocations of 'm' etc. - tapas: tapas [ ...] [arm|x86|arm64|x86_64] [eng|userdebug|user] Sets up the build environment for building unbundled apps (APKs). -- banchan: banchan [ ...] [arm|x86|arm64|x86_64] [eng|userdebug|user] +- banchan: banchan [ ...] [arm|x86|arm64|x86_64|arm64_only|x86_64only] \ + [eng|userdebug|user] Sets up the build environment for building unbundled modules (APEXes). - croot: Changes directory to the top of the tree, or a subdirectory thereof. - m: Makes from the top of the tree. @@ -880,7 +881,7 @@ function tapas() function banchan() { local showHelp="$(echo $* | xargs -n 1 echo | \grep -E '^(help)$' | xargs)" - local product="$(echo $* | xargs -n 1 echo | \grep -E '^(.*_)?(arm|x86|arm64|x86_64)$' | xargs)" + local product="$(echo $* | xargs -n 1 echo | \grep -E '^(.*_)?(arm|x86|arm64|x86_64|arm64only|x86_64only)$' | xargs)" local variant="$(echo $* | xargs -n 1 echo | \grep -E '^(user|userdebug|eng)$' | xargs)" local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|(.*_)?(arm|x86|arm64|x86_64))$' | xargs)" @@ -909,6 +910,8 @@ function banchan() x86) product=module_x86;; arm64) product=module_arm64;; x86_64) product=module_x86_64;; + arm64only) product=module_arm64only;; + x86_64only) product=module_x86_64only;; esac if [ -z "$variant" ]; then variant=eng diff --git a/target/product/AndroidProducts.mk b/target/product/AndroidProducts.mk index ee702e5d16..ad6eb55e48 100644 --- a/target/product/AndroidProducts.mk +++ b/target/product/AndroidProducts.mk @@ -77,8 +77,10 @@ PRODUCT_MAKEFILES += \ $(LOCAL_DIR)/mainline_sdk.mk \ $(LOCAL_DIR)/module_arm.mk \ $(LOCAL_DIR)/module_arm64.mk \ + $(LOCAL_DIR)/module_arm64only.mk \ $(LOCAL_DIR)/module_x86.mk \ $(LOCAL_DIR)/module_x86_64.mk \ + $(LOCAL_DIR)/module_x86_64only.mk \ COMMON_LUNCH_CHOICES := \ aosp_arm64-eng \ From 899cc7be32a450daef284422fac02545c5da1585 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Mon, 12 Sep 2022 19:09:52 -0700 Subject: [PATCH 038/139] Put host license metadata in OUT_DIR. Test: m droid dist Test: build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=sdk TARGET_BUILD_VARIANT=userdebug sdk dist sdk_repo Change-Id: I9f5d9c1b70eb8469031d49818c32770dcf34fad2 Merged-in: I9f5d9c1b70eb8469031d49818c32770dcf34fad2 --- core/definitions.mk | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/core/definitions.mk b/core/definitions.mk index 0b9263ee8d..821cc38ce5 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -570,7 +570,7 @@ endef ## Target directory for license metadata files. ########################################################### define license-metadata-dir -$(call generated-sources-dir-for,META,lic,) +$(call generated-sources-dir-for,META,lic,$(filter-out $(PRODUCT_OUT)%,$(1))) endef TARGETS_MISSING_LICENSE_METADATA:= @@ -595,7 +595,7 @@ endef ## license metadata. ########################################################### define declare-copy-target-license-metadata -$(strip $(if $(filter $(OUT_DIR)%,$(2)),$(eval _dir:=$(call license-metadata-dir))\ +$(strip $(if $(filter $(OUT_DIR)%,$(2)),$(eval _dir:=$(call license-metadata-dir,$(1)))\ $(eval _tgt:=$(strip $(1)))\ $(eval _meta := $(call append-path,$(_dir),$(patsubst $(OUT_DIR)%,out%,$(_tgt).meta_lic)))\ $(eval ALL_COPIED_TARGETS.$(_tgt).SOURCES := $(ALL_COPIED_TARGETS.$(_tgt).SOURCES) $(filter $(OUT_DIR)%,$(2)))\ @@ -675,7 +675,7 @@ endef ## License metadata build rule for non-module target $(1) ########################################################### define non-module-license-metadata-rule -$(strip $(eval _dir := $(call license-metadata-dir))) +$(strip $(eval _dir := $(call license-metadata-dir,$(1)))) $(strip $(eval _tgt := $(strip $(1)))) $(strip $(eval _meta := $(call append-path,$(_dir),$(patsubst $(OUT_DIR)%,out%,$(_tgt).meta_lic)))) $(strip $(eval _deps := $(sort $(filter-out 0p: :,$(foreach d,$(strip $(ALL_NON_MODULES.$(_tgt).DEPENDENCIES)),$(ALL_TARGETS.$(call word-colon,1,$(d)).META_LIC):$(call wordlist-colon,2,9999,$(d))))))) @@ -738,7 +738,7 @@ $(if $(strip $(ALL_TARGETS.$(1).META_LIC)),,$(call _copied-target-license-metada endef define _copied-target-license-metadata-rule -$(strip $(eval _dir := $(call license-metadata-dir))) +$(strip $(eval _dir := $(call license-metadata-dir,$(1)))) $(strip $(eval _meta := $(call append-path,$(_dir),$(patsubst $(OUT_DIR)%,out%,$(1).meta_lic)))) $(strip $(eval ALL_TARGETS.$(1).META_LIC:=$(_meta))) $(strip $(eval _dep:=)) @@ -785,7 +785,7 @@ define declare-license-metadata $(strip \ $(eval _tgt := $(subst //,/,$(strip $(1)))) \ $(eval ALL_NON_MODULES += $(_tgt)) \ - $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir)/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ + $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir,$(1))/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ $(eval ALL_NON_MODULES.$(_tgt).LICENSE_KINDS := $(strip $(2))) \ $(eval ALL_NON_MODULES.$(_tgt).LICENSE_CONDITIONS := $(strip $(3))) \ $(eval ALL_NON_MODULES.$(_tgt).NOTICES := $(strip $(4))) \ @@ -826,7 +826,7 @@ define declare-container-license-metadata $(strip \ $(eval _tgt := $(subst //,/,$(strip $(1)))) \ $(eval ALL_NON_MODULES += $(_tgt)) \ - $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir)/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ + $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir,$(1))/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ $(eval ALL_NON_MODULES.$(_tgt).LICENSE_KINDS := $(strip $(2))) \ $(eval ALL_NON_MODULES.$(_tgt).LICENSE_CONDITIONS := $(strip $(3))) \ $(eval ALL_NON_MODULES.$(_tgt).NOTICES := $(strip $(4))) \ @@ -899,7 +899,7 @@ define declare-license-deps $(strip \ $(eval _tgt := $(strip $(1))) \ $(eval ALL_NON_MODULES += $(_tgt)) \ - $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir)/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ + $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir,$(1))/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ $(eval ALL_NON_MODULES.$(_tgt).DEPENDENCIES := $(strip $(ALL_NON_MODULES.$(_tgt).DEPENDENCIES) $(2))) \ ) endef @@ -916,7 +916,7 @@ define declare-container-license-deps $(strip \ $(eval _tgt := $(strip $(1))) \ $(eval ALL_NON_MODULES += $(_tgt)) \ - $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir)/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ + $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir,$(1))/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ $(eval ALL_NON_MODULES.$(_tgt).DEPENDENCIES := $(strip $(ALL_NON_MODULES.$(_tgt).DEPENDENCIES) $(2))) \ $(eval ALL_NON_MODULES.$(_tgt).IS_CONTAINER := true) \ $(eval ALL_NON_MODULES.$(_tgt).ROOT_MAPPINGS := $(strip $(ALL_NON_MODULES.$(_tgt).ROOT_MAPPINGS) $(3))) \ @@ -957,7 +957,7 @@ define report-all-notice-library-names-rule $(strip $(eval _all := $(call all-license-metadata))) .PHONY: reportallnoticelibrarynames -reportallnoticelibrarynames: PRIVATE_LIST_FILE := $(call license-metadata-dir)/filelist +reportallnoticelibrarynames: PRIVATE_LIST_FILE := $(call license-metadata-dir,COMMON)/filelist reportallnoticelibrarynames: | $(COMPLIANCENOTICE_SHIPPEDLIBS) reportallnoticelibrarynames: $(_all) @echo Reporting notice library names for at least $$(words $(_all)) license metadata files @@ -984,7 +984,6 @@ endef ########################################################### define build-license-metadata $(strip \ - $(strip $(eval _dir := $(call license-metadata-dir))) \ $(foreach t,$(sort $(ALL_0P_TARGETS)), \ $(eval ALL_TARGETS.$(t).META_LIC := 0p) \ ) \ From be129965effd2cad0059dff2aa3d8b2b15387340 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Mon, 12 Sep 2022 19:53:23 -0700 Subject: [PATCH 039/139] Normalize target path for license dependencies. If not normalized the same as declare-license-metadata, two rules get generated instead of one rule with both license text and deps. Test: m droid dist Test: build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=sdk TARGET_BUILD_VARIANT=userdebug sdk dist sdk_repo Change-Id: I3a8f2d3825c8c0183049fa12b14ace9b54066a01 Merged-in: I3a8f2d3825c8c0183049fa12b14ace9b54066a01 --- core/definitions.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/definitions.mk b/core/definitions.mk index 821cc38ce5..8c2cbc967d 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -897,7 +897,7 @@ endef ########################################################### define declare-license-deps $(strip \ - $(eval _tgt := $(strip $(1))) \ + $(eval _tgt := $(subst //,/,$(strip $(1)))) \ $(eval ALL_NON_MODULES += $(_tgt)) \ $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir,$(1))/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ $(eval ALL_NON_MODULES.$(_tgt).DEPENDENCIES := $(strip $(ALL_NON_MODULES.$(_tgt).DEPENDENCIES) $(2))) \ @@ -914,7 +914,7 @@ endef ########################################################### define declare-container-license-deps $(strip \ - $(eval _tgt := $(strip $(1))) \ + $(eval _tgt := $(subst //,/,$(strip $(1)))) \ $(eval ALL_NON_MODULES += $(_tgt)) \ $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir,$(1))/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ $(eval ALL_NON_MODULES.$(_tgt).DEPENDENCIES := $(strip $(ALL_NON_MODULES.$(_tgt).DEPENDENCIES) $(2))) \ From d0a861cdb67da4973b1e7d16d9999bb30a8edaec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Kongstad?= Date: Fri, 16 Sep 2022 15:36:01 +0200 Subject: [PATCH 040/139] Bump PLATFORM_BASE_SDK_EXTENSION_VERSION to 4 Modules with new APIs in this version are - AD_SERVICES - SDK_EXTENSIONS Bug: 245513010 Test: manual install of modules Change-Id: I1f7c213c1dc2b76901b3641f7bc8a533e03c63d7 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 764a34c9f4..55334cc786 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -82,7 +82,7 @@ PLATFORM_SDK_EXTENSION_VERSION := 4 .KATI_READONLY := PLATFORM_SDK_EXTENSION_VERSION # This is the sdk extension version that PLATFORM_SDK_VERSION ships with. -PLATFORM_BASE_SDK_EXTENSION_VERSION := 3 +PLATFORM_BASE_SDK_EXTENSION_VERSION := 4 .KATI_READONLY := PLATFORM_BASE_SDK_EXTENSION_VERSION # This are all known codenames. From 6b2198847fab38c37c24b4153131abfea893619c Mon Sep 17 00:00:00 2001 From: Filip Date: Wed, 14 Sep 2022 02:21:15 +0000 Subject: [PATCH 041/139] automotive-general-tests package definition Test: manual Bug: 246471877 Change-Id: I68ad15970c6df7c521e252abaf00a639c39188e8 --- core/tasks/automotive-general-tests.mk | 89 ++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 core/tasks/automotive-general-tests.mk diff --git a/core/tasks/automotive-general-tests.mk b/core/tasks/automotive-general-tests.mk new file mode 100644 index 0000000000..44b62bef78 --- /dev/null +++ b/core/tasks/automotive-general-tests.mk @@ -0,0 +1,89 @@ +# Copyright (C) 2022 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. + +.PHONY: automotive-general-tests + +automotive_general_tests_tools := \ + $(HOST_OUT_JAVA_LIBRARIES)/cts-tradefed.jar \ + $(HOST_OUT_JAVA_LIBRARIES)/compatibility-host-util.jar \ + $(HOST_OUT_JAVA_LIBRARIES)/vts-tradefed.jar \ + +intermediates_dir := $(call intermediates-dir-for,PACKAGING,automotive-general-tests) +automotive_general_tests_zip := $(PRODUCT_OUT)/automotive-general-tests.zip +# Create an artifact to include a list of test config files in automotive-general-tests. +automotive_general_tests_list_zip := $(PRODUCT_OUT)/automotive-general-tests_list.zip + +# Filter shared entries between automotive-general-tests and automotive-tests's HOST_SHARED_LIBRARY.FILES, +# to avoid warning about overriding commands. +my_host_shared_lib_for_automotive_general_tests := \ + $(foreach m,$(filter $(COMPATIBILITY.automotive-tests.HOST_SHARED_LIBRARY.FILES),\ + $(COMPATIBILITY.automotive-general-tests.HOST_SHARED_LIBRARY.FILES)),$(call word-colon,2,$(m))) +my_automotive_general_tests_shared_lib_files := \ + $(filter-out $(COMPATIBILITY.automotive-tests.HOST_SHARED_LIBRARY.FILES),\ + $(COMPATIBILITY.automotive-general-tests.HOST_SHARED_LIBRARY.FILES)) + +my_host_shared_lib_for_automotive_general_tests += $(call copy-many-files,$(my_automotive_general_tests_shared_lib_files)) + +# Create an artifact to include all test config files in automotive-general-tests. +automotive_general_tests_configs_zip := $(PRODUCT_OUT)/automotive-general-tests_configs.zip +# Create an artifact to include all shared librariy files in automotive-general-tests. +automotive_general_tests_host_shared_libs_zip := $(PRODUCT_OUT)/automotive-general-tests_host-shared-libs.zip + +$(automotive_general_tests_zip) : PRIVATE_automotive_general_tests_list_zip := $(automotive_general_tests_list_zip) +$(automotive_general_tests_zip) : .KATI_IMPLICIT_OUTPUTS := $(automotive_general_tests_list_zip) $(automotive_general_tests_configs_zip) $(automotive_general_tests_host_shared_libs_zip) +$(automotive_general_tests_zip) : PRIVATE_TOOLS := $(automotive_general_tests_tools) +$(automotive_general_tests_zip) : PRIVATE_INTERMEDIATES_DIR := $(intermediates_dir) +$(automotive_general_tests_zip) : PRIVATE_HOST_SHARED_LIBS := $(my_host_shared_lib_for_automotive_general_tests) +$(automotive_general_tests_zip) : PRIVATE_automotive_general_tests_configs_zip := $(automotive_general_tests_configs_zip) +$(automotive_general_tests_zip) : PRIVATE_general_host_shared_libs_zip := $(automotive_general_tests_host_shared_libs_zip) +$(automotive_general_tests_zip) : $(COMPATIBILITY.automotive-general-tests.FILES) $(automotive_general_tests_tools) $(my_host_shared_lib_for_automotive_general_tests) $(SOONG_ZIP) + rm -rf $(PRIVATE_INTERMEDIATES_DIR) + rm -f $@ $(PRIVATE_automotive_general_tests_list_zip) + mkdir -p $(PRIVATE_INTERMEDIATES_DIR) $(PRIVATE_INTERMEDIATES_DIR)/tools + echo $(sort $(COMPATIBILITY.automotive-general-tests.FILES)) | tr " " "\n" > $(PRIVATE_INTERMEDIATES_DIR)/list + grep $(HOST_OUT_TESTCASES) $(PRIVATE_INTERMEDIATES_DIR)/list > $(PRIVATE_INTERMEDIATES_DIR)/host.list || true + grep $(TARGET_OUT_TESTCASES) $(PRIVATE_INTERMEDIATES_DIR)/list > $(PRIVATE_INTERMEDIATES_DIR)/target.list || true + grep -e .*\\.config$$ $(PRIVATE_INTERMEDIATES_DIR)/host.list > $(PRIVATE_INTERMEDIATES_DIR)/host-test-configs.list || true + grep -e .*\\.config$$ $(PRIVATE_INTERMEDIATES_DIR)/target.list > $(PRIVATE_INTERMEDIATES_DIR)/target-test-configs.list || true + $(hide) for shared_lib in $(PRIVATE_HOST_SHARED_LIBS); do \ + echo $$shared_lib >> $(PRIVATE_INTERMEDIATES_DIR)/host.list; \ + echo $$shared_lib >> $(PRIVATE_INTERMEDIATES_DIR)/shared-libs.list; \ + done + grep $(HOST_OUT_TESTCASES) $(PRIVATE_INTERMEDIATES_DIR)/shared-libs.list > $(PRIVATE_INTERMEDIATES_DIR)/host-shared-libs.list || true + cp -fp $(PRIVATE_TOOLS) $(PRIVATE_INTERMEDIATES_DIR)/tools/ + $(SOONG_ZIP) -d -o $@ \ + -P host -C $(PRIVATE_INTERMEDIATES_DIR) -D $(PRIVATE_INTERMEDIATES_DIR)/tools \ + -P host -C $(HOST_OUT) -l $(PRIVATE_INTERMEDIATES_DIR)/host.list \ + -P target -C $(PRODUCT_OUT) -l $(PRIVATE_INTERMEDIATES_DIR)/target.list + $(SOONG_ZIP) -d -o $(PRIVATE_automotive_general_tests_configs_zip) \ + -P host -C $(HOST_OUT) -l $(PRIVATE_INTERMEDIATES_DIR)/host-test-configs.list \ + -P target -C $(PRODUCT_OUT) -l $(PRIVATE_INTERMEDIATES_DIR)/target-test-configs.list + $(SOONG_ZIP) -d -o $(PRIVATE_general_host_shared_libs_zip) \ + -P host -C $(HOST_OUT) -l $(PRIVATE_INTERMEDIATES_DIR)/host-shared-libs.list + grep -e .*\\.config$$ $(PRIVATE_INTERMEDIATES_DIR)/host.list | sed s%$(HOST_OUT)%host%g > $(PRIVATE_INTERMEDIATES_DIR)/automotive-general-tests_list + grep -e .*\\.config$$ $(PRIVATE_INTERMEDIATES_DIR)/target.list | sed s%$(PRODUCT_OUT)%target%g >> $(PRIVATE_INTERMEDIATES_DIR)/automotive-general-tests_list + $(SOONG_ZIP) -d -o $(PRIVATE_automotive_general_tests_list_zip) -C $(PRIVATE_INTERMEDIATES_DIR) -f $(PRIVATE_INTERMEDIATES_DIR)/automotive-general-tests_list + +automotive-general-tests: $(automotive_general_tests_zip) +$(call dist-for-goals, automotive-general-tests, $(automotive_general_tests_zip) $(automotive_general_tests_list_zip) $(automotive_general_tests_configs_zip) $(automotive_general_tests_host_shared_libs_zip)) + +$(call declare-1p-container,$(automotive_general_tests_zip),) +$(call declare-container-license-deps,$(automotive_general_tests_zip),$(COMPATIBILITY.automotive-general-tests.FILES) $(automotive_general_tests_tools) $(my_host_shared_lib_for_automotive_general_tests),$(PRODUCT_OUT)/:/) + +intermediates_dir := +automotive_general_tests_tools := +automotive_general_tests_zip := +automotive_general_tests_list_zip := +automotive_general_tests_configs_zip := +automotive_general_tests_host_shared_libs_zip := From 4410420cca171674c5015624f0cd46bfceff5ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Kongstad?= Date: Mon, 19 Sep 2022 12:36:32 +0200 Subject: [PATCH 042/139] Simplify PLATFORM_BASE_SDK_EXTENSION_VERSION Make PLATFORM_BASE_SDK_EXTENSION_VERSION default to PLATFORM_SDK_EXTENSION_VERSION: they only need to be different on the SDK extension branches. Bug: 247413701 Test: manual install of modules Change-Id: Iedcd9d6bce4e7346d24146b871d489255a17466c --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 55334cc786..904fa3e1cd 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -82,7 +82,7 @@ PLATFORM_SDK_EXTENSION_VERSION := 4 .KATI_READONLY := PLATFORM_SDK_EXTENSION_VERSION # This is the sdk extension version that PLATFORM_SDK_VERSION ships with. -PLATFORM_BASE_SDK_EXTENSION_VERSION := 4 +PLATFORM_BASE_SDK_EXTENSION_VERSION := $(PLATFORM_SDK_EXTENSION_VERSION) .KATI_READONLY := PLATFORM_BASE_SDK_EXTENSION_VERSION # This are all known codenames. From 2cde8c726fdd5544dac4f887c3f745b9ca13e708 Mon Sep 17 00:00:00 2001 From: Kean Mariotti Date: Fri, 12 Aug 2022 15:36:11 +0000 Subject: [PATCH 043/139] Add layertracegenerator executable Add layertracegenerator into userdebug + eng builds to convert SurfaceFlinger's transaction traces into layer traces Bug: 226139740 Test: adb root && adb shell layertracegenerator /data/misc/wmtrace/transactions_trace.winscope /data/misc/wmtrace/generated_layers_trace.winscope Change-Id: Ic4aeffd904a318334a41bf0d21ca025936da86e3 --- target/product/base_system.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index ba094ac1cb..b567eeb5d4 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -385,6 +385,7 @@ PRODUCT_PACKAGES_DEBUG := \ iotop \ iperf3 \ iw \ + layertracegenerator \ logpersist.start \ logtagd.rc \ procrank \ From 60cc7b642378c95149a62bcd0f5e29a6cdbc3595 Mon Sep 17 00:00:00 2001 From: qiaoli Date: Fri, 23 Sep 2022 23:53:58 +0000 Subject: [PATCH 044/139] Add federatedcompute in build branch Test: TH Bug: 244640209 Change-Id: I23b0809c11e3c6189a467c8e2cd7a1375425e3ac --- target/product/base_system.mk | 1 + target/product/default_art_config.mk | 1 + 2 files changed, 2 insertions(+) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index ba094ac1cb..1b7a4ea213 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -56,6 +56,7 @@ PRODUCT_PACKAGES += \ com.android.conscrypt \ com.android.cronet \ com.android.extservices \ + com.android.federatedcompute \ com.android.healthconnect \ com.android.i18n \ com.android.ipsec \ diff --git a/target/product/default_art_config.mk b/target/product/default_art_config.mk index b8e3fac640..6050103f0f 100644 --- a/target/product/default_art_config.mk +++ b/target/product/default_art_config.mk @@ -56,6 +56,7 @@ PRODUCT_APEX_BOOT_JARS := \ com.android.appsearch:framework-appsearch \ com.android.btservices:framework-bluetooth \ com.android.conscrypt:conscrypt \ + com.android.federatedcompute:framework-federatedcompute \ com.android.healthconnect:framework-healthconnect \ com.android.i18n:core-icu4j \ com.android.ipsec:android.net.ipsec.ike \ From fe635dab29e77765026562a8c7c5fab02d49314d Mon Sep 17 00:00:00 2001 From: ryanlwlin Date: Tue, 30 Aug 2022 20:13:15 +0800 Subject: [PATCH 045/139] Fix unavailable window magnification feature for upgraded device The feature xml is copyed to vendor partition. However, OEM might not update the vendor parition when migrating system. To fix it, we need to copy it to system partition. Bug: 244382630 Test: manual test Change-Id: Ie81d2c36f5cd0ad5aaa93e778a5162525c6fcfc5 --- target/product/handheld_system.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/product/handheld_system.mk b/target/product/handheld_system.mk index 41233b2c0a..577e108e63 100644 --- a/target/product/handheld_system.mk +++ b/target/product/handheld_system.mk @@ -79,7 +79,8 @@ PRODUCT_SYSTEM_SERVER_APPS += \ Telecom \ PRODUCT_COPY_FILES += \ - frameworks/av/media/libeffects/data/audio_effects.conf:system/etc/audio_effects.conf + frameworks/av/media/libeffects/data/audio_effects.conf:system/etc/audio_effects.conf \ + frameworks/native/data/etc/android.software.window_magnification.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/android.software.window_magnification.xml \ PRODUCT_VENDOR_PROPERTIES += \ ro.carrier?=unknown \ From 0b51b8c29d9920193571ddfceb09cb98d3b09291 Mon Sep 17 00:00:00 2001 From: Hassan Ali Date: Wed, 5 Oct 2022 13:14:15 +0000 Subject: [PATCH 046/139] Add configinfrastructure to bootclasspath Test: m configinfrastructure-sdk Bug: 248552678 Change-Id: Id241ab2a547685d0ac47ca60e5e659ff43cff70f --- target/product/base_system.mk | 1 + target/product/default_art_config.mk | 1 + 2 files changed, 2 insertions(+) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 30c60e142d..80010c5776 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -53,6 +53,7 @@ PRODUCT_PACKAGES += \ com.android.adservices \ com.android.appsearch \ com.android.btservices \ + com.android.configinfrastructure \ com.android.conscrypt \ com.android.cronet \ com.android.extservices \ diff --git a/target/product/default_art_config.mk b/target/product/default_art_config.mk index 6050103f0f..bd3fdf23f6 100644 --- a/target/product/default_art_config.mk +++ b/target/product/default_art_config.mk @@ -55,6 +55,7 @@ PRODUCT_APEX_BOOT_JARS := \ com.android.adservices:framework-sdksandbox \ com.android.appsearch:framework-appsearch \ com.android.btservices:framework-bluetooth \ + com.android.configinfrastructure:framework-configinfrastructure \ com.android.conscrypt:conscrypt \ com.android.federatedcompute:framework-federatedcompute \ com.android.healthconnect:framework-healthconnect \ From b876fb0d3b3455df8893fbc9c1dc6b003d36736a Mon Sep 17 00:00:00 2001 From: Dennis Shen Date: Mon, 10 Oct 2022 21:19:46 +0000 Subject: [PATCH 047/139] add EROFS apex support. Signing code uses deapexer to expand payload image, deapexer currently only supports ext4 payload image expansion using debugfs or debugfs_static. To support EROFS, need to supply deapexer with fsck.erofs native binary for EROFS payload expansion. BUG: b/195515562, b/240288941 Change-Id: Ibf707989f2502bfcf112202a3a6fdb74b6a8dbbc --- tools/releasetools/apex_utils.py | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/tools/releasetools/apex_utils.py b/tools/releasetools/apex_utils.py index 941edc600d..fbe90abace 100644 --- a/tools/releasetools/apex_utils.py +++ b/tools/releasetools/apex_utils.py @@ -63,6 +63,8 @@ class ApexApkSigner(object): self.codename_to_api_level_map = codename_to_api_level_map self.debugfs_path = os.path.join( OPTIONS.search_path, "bin", "debugfs_static") + self.fsckerofs_path = os.path.join( + OPTIONS.search_path, "bin", "fsck.erofs") self.avbtool = avbtool if avbtool else "avbtool" self.sign_tool = sign_tool @@ -80,8 +82,13 @@ class ApexApkSigner(object): "Couldn't find location of debugfs_static: " + "Path {} does not exist. ".format(self.debugfs_path) + "Make sure bin/debugfs_static can be found in -p ") - list_cmd = ['deapexer', '--debugfs_path', - self.debugfs_path, 'list', self.apex_path] + if not os.path.exists(self.fsckerofs_path): + raise ApexSigningError( + "Couldn't find location of fsck.erofs: " + + "Path {} does not exist. ".format(self.fsckerofs_path) + + "Make sure bin/fsck.erofs can be found in -p ") + list_cmd = ['deapexer', '--debugfs_path', self.debugfs_path, + '--fsckerofs_path', self.fsckerofs_path, 'list', self.apex_path] entries_names = common.RunAndCheckOutput(list_cmd).split() apk_entries = [name for name in entries_names if name.endswith('.apk')] @@ -116,9 +123,15 @@ class ApexApkSigner(object): "Couldn't find location of debugfs_static: " + "Path {} does not exist. ".format(self.debugfs_path) + "Make sure bin/debugfs_static can be found in -p ") + if not os.path.exists(self.fsckerofs_path): + raise ApexSigningError( + "Couldn't find location of fsck.erofs: " + + "Path {} does not exist. ".format(self.fsckerofs_path) + + "Make sure bin/fsck.erofs can be found in -p ") payload_dir = common.MakeTempDir() - extract_cmd = ['deapexer', '--debugfs_path', - self.debugfs_path, 'extract', self.apex_path, payload_dir] + extract_cmd = ['deapexer', '--debugfs_path', self.debugfs_path, + '--fsckerofs_path', self.fsckerofs_path, 'extract', + self.apex_path, payload_dir] common.RunAndCheckOutput(extract_cmd) has_signed_content = False @@ -417,6 +430,7 @@ def SignCompressedApex(avbtool, apex_file, payload_key, container_key, The path to the signed APEX file. """ debugfs_path = os.path.join(OPTIONS.search_path, 'bin', 'debugfs_static') + fsckerofs_path = os.path.join(OPTIONS.search_path, 'bin', 'fsck.erofs') # 1. Decompress original_apex inside compressed apex. original_apex_file = common.MakeTempFile(prefix='original-apex-', @@ -424,6 +438,7 @@ def SignCompressedApex(avbtool, apex_file, payload_key, container_key, # Decompression target path should not exist os.remove(original_apex_file) common.RunAndCheckOutput(['deapexer', '--debugfs_path', debugfs_path, + '--fsckerofs_path', fsckerofs_path, 'decompress', '--input', apex_file, '--output', original_apex_file]) @@ -487,7 +502,9 @@ def SignApex(avbtool, apex_data, payload_key, container_key, container_pw, output_fp.write(apex_data) debugfs_path = os.path.join(OPTIONS.search_path, 'bin', 'debugfs_static') + fsckerofs_path = os.path.join(OPTIONS.search_path, 'bin', 'fsck.erofs') cmd = ['deapexer', '--debugfs_path', debugfs_path, + '--fsckerofs_path', fsckerofs_path, 'info', '--print-type', apex_file] try: @@ -559,11 +576,17 @@ def GetApexInfoFromTargetFiles(input_file, partition, compressed_only=True): debugfs_path = "debugfs" if OPTIONS.search_path: debugfs_path = os.path.join(OPTIONS.search_path, "bin", "debugfs_static") + + fsckerofs_path = "fsck.erofs" + if OPTIONS.search_path: + fsckerofs_path = os.path.join(OPTIONS.search_path, "bin", "fsck.erofs") + deapexer = 'deapexer' if OPTIONS.search_path: deapexer_path = os.path.join(OPTIONS.search_path, "bin", "deapexer") if os.path.isfile(deapexer_path): deapexer = deapexer_path + for apex_filename in os.listdir(target_dir): apex_filepath = os.path.join(target_dir, apex_filename) if not os.path.isfile(apex_filepath) or \ @@ -578,6 +601,7 @@ def GetApexInfoFromTargetFiles(input_file, partition, compressed_only=True): # Check if the file is compressed or not apex_type = RunAndCheckOutput([ deapexer, "--debugfs_path", debugfs_path, + "--fsckerofs_path", fsckerofs_path, 'info', '--print-type', apex_filepath]).rstrip() if apex_type == 'COMPRESSED': apex_info.is_compressed = True From 4ea16966bb950d5d3c27282da0467c574e5c1651 Mon Sep 17 00:00:00 2001 From: Helen Qin Date: Mon, 26 Sep 2022 20:59:01 +0000 Subject: [PATCH 048/139] Include CredentialManager UX app into system image. The CredentialManager UX is a set of confirmation / selection dialogs that let a user configure the provider / credential retrieval or saving options. Test: build Bug: 253157036,247862353 Change-Id: I915cb622119a6ad1d542c4c1d5ced84a4ebef78e --- target/product/handheld_system.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/handheld_system.mk b/target/product/handheld_system.mk index 577e108e63..7fbb617e02 100644 --- a/target/product/handheld_system.mk +++ b/target/product/handheld_system.mk @@ -42,6 +42,7 @@ PRODUCT_PACKAGES += \ CameraExtensionsProxy \ CaptivePortalLogin \ CertInstaller \ + CredentialManager \ DocumentsUI \ DownloadProviderUi \ EasterEgg \ From 3a78a17f3b8350b39bb2c689af763e1d60747f11 Mon Sep 17 00:00:00 2001 From: Amos Bianchi Date: Tue, 2 Aug 2022 15:37:53 -0700 Subject: [PATCH 049/139] Add Device Lock module. Bug: b/241442337 Test: service successfully starts Test: atest DeviceLockUnitTests Test: cts-tradefed run cts -m CtsDeviceLockTestCases Change-Id: Ie0a7ed87dd3f986859f3dc6e550337a2d44ae351 --- target/product/base_system.mk | 1 + target/product/default_art_config.mk | 2 ++ 2 files changed, 3 insertions(+) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index d077cd4d99..7314fb6270 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -56,6 +56,7 @@ PRODUCT_PACKAGES += \ com.android.configinfrastructure \ com.android.conscrypt \ com.android.cronet \ + com.android.devicelock \ com.android.extservices \ com.android.federatedcompute \ com.android.healthconnect \ diff --git a/target/product/default_art_config.mk b/target/product/default_art_config.mk index bd3fdf23f6..d37281c0e2 100644 --- a/target/product/default_art_config.mk +++ b/target/product/default_art_config.mk @@ -57,6 +57,7 @@ PRODUCT_APEX_BOOT_JARS := \ com.android.btservices:framework-bluetooth \ com.android.configinfrastructure:framework-configinfrastructure \ com.android.conscrypt:conscrypt \ + com.android.devicelock:framework-devicelock \ com.android.federatedcompute:framework-federatedcompute \ com.android.healthconnect:framework-healthconnect \ com.android.i18n:core-icu4j \ @@ -102,6 +103,7 @@ PRODUCT_STANDALONE_SYSTEM_SERVER_JARS := \ # Note: For modules available in Q, DO NOT add new entries here. PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS := \ com.android.btservices:service-bluetooth \ + com.android.devicelock:service-devicelock \ com.android.os.statsd:service-statsd \ com.android.scheduling:service-scheduling \ com.android.tethering:service-connectivity \ From 4a68052ffaf5d35d045cefa20a4a0ef7c7ede609 Mon Sep 17 00:00:00 2001 From: Motomu Utsumi Date: Wed, 26 Oct 2022 23:18:24 +0900 Subject: [PATCH 050/139] Remove cronet from PRODUCT_PACKAGES cronet apex is removed and cronet libraries are moved to the tethering apex Bug: 251054736 Test: atest CronetApiTest Change-Id: Ib7a3cd33aaf4f63ccb1fbee926df5f23c29d3b48 --- target/product/base_system.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 7314fb6270..839effa57f 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -55,7 +55,6 @@ PRODUCT_PACKAGES += \ com.android.btservices \ com.android.configinfrastructure \ com.android.conscrypt \ - com.android.cronet \ com.android.devicelock \ com.android.extservices \ com.android.federatedcompute \ From a0e091108cfe952b8cf6c12956b36f3988bffd5e Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Sat, 29 Oct 2022 00:54:49 +0000 Subject: [PATCH 051/139] graphics.common V3 -> V4 Bug: 251177105 Test: builds Change-Id: I5ed6fbaf18aa1568f3bebf5f46ab31484d386598 --- target/product/gsi/current.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt index 94892dccf0..728c5fd44c 100644 --- a/target/product/gsi/current.txt +++ b/target/product/gsi/current.txt @@ -21,7 +21,7 @@ LLNDK: libvulkan.so VNDK-SP: android.hardware.common-V2-ndk.so VNDK-SP: android.hardware.common.fmq-V1-ndk.so VNDK-SP: android.hardware.graphics.allocator-V1-ndk.so -VNDK-SP: android.hardware.graphics.common-V3-ndk.so +VNDK-SP: android.hardware.graphics.common-V4-ndk.so VNDK-SP: android.hardware.graphics.common@1.0.so VNDK-SP: android.hardware.graphics.common@1.1.so VNDK-SP: android.hardware.graphics.common@1.2.so From 03fbfe7d30f28db61c0eb2582d1531e8214e9753 Mon Sep 17 00:00:00 2001 From: Gurpreet Singh Date: Tue, 1 Nov 2022 17:00:22 +0000 Subject: [PATCH 052/139] Bump SDK Extension version to 5 This bump includes Adservices and MediaProvider. Bug: 256848771 Test: The build passes Change-Id: I309e0eb80a3cb3c7abc48f0ff4e19ee5a5ac6bf9 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index feb643e701..c7aa309ffb 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -78,7 +78,7 @@ endif .KATI_READONLY := PLATFORM_SDK_VERSION # This is the sdk extension version of this tree. -PLATFORM_SDK_EXTENSION_VERSION := 4 +PLATFORM_SDK_EXTENSION_VERSION := 5 .KATI_READONLY := PLATFORM_SDK_EXTENSION_VERSION # This is the sdk extension version that PLATFORM_SDK_VERSION ships with. From bf4c0251e37fb7c05de83e59758e7e8730f473f2 Mon Sep 17 00:00:00 2001 From: Dennis Shen Date: Mon, 7 Nov 2022 18:53:10 +0000 Subject: [PATCH 053/139] Add missing fsck.erofs and blkid to OTATOOLS cherry pick of aosp/2290117 BUG: b/257882042 Merged-In: I9821106d45fa6c66f7482be2d0cdd605fe61706f Change-Id: I36403f5078890f7b580f5e4e9eb9fc2dabe1b782 --- core/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/Makefile b/core/Makefile index 664573cb25..b018106853 100644 --- a/core/Makefile +++ b/core/Makefile @@ -5065,8 +5065,10 @@ INTERNAL_OTATOOLS_MODULES := \ INTERNAL_OTATOOLS_MODULES += \ apexer \ apex_compression_tool \ + blkid \ deapexer \ debugfs_static \ + fsck.erofs \ merge_zips \ resize2fs \ soong_zip \ From bee7473f301aac98bad893dd7ea0bea9e3e5510b Mon Sep 17 00:00:00 2001 From: Dennis Shen Date: Mon, 7 Nov 2022 21:37:06 +0000 Subject: [PATCH 054/139] Update deapexer call to explictly use blkid To support erofs apex extract via deapexer, we need blkid to tell the filesystem type of underlying payload image. If it is ext4, debugfs_static will be used, if it is erofs, then we should use fsck.erofs. Thus we now need explicit blkid input. Also, remove dependency on fsck.erofs for other deapexer calls. Only extract deapexer call needs blkid and fsck.erofs. BUG: b/255963179, b/240288941 Change-Id: I8cea0f2def664f9cabf8b14c9a7ecc47bbddfbdd (cherry picked from commit a8d1143beb13a9f3cbe802d626d7eb9b12fbdc5e) --- tools/releasetools/apex_utils.py | 26 +++++++++--------------- tools/releasetools/merge/merge_dexopt.py | 4 ++++ 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/tools/releasetools/apex_utils.py b/tools/releasetools/apex_utils.py index fbe90abace..ea099149dc 100644 --- a/tools/releasetools/apex_utils.py +++ b/tools/releasetools/apex_utils.py @@ -65,6 +65,8 @@ class ApexApkSigner(object): OPTIONS.search_path, "bin", "debugfs_static") self.fsckerofs_path = os.path.join( OPTIONS.search_path, "bin", "fsck.erofs") + self.blkid_path = os.path.join( + OPTIONS.search_path, "bin", "blkid") self.avbtool = avbtool if avbtool else "avbtool" self.sign_tool = sign_tool @@ -82,13 +84,8 @@ class ApexApkSigner(object): "Couldn't find location of debugfs_static: " + "Path {} does not exist. ".format(self.debugfs_path) + "Make sure bin/debugfs_static can be found in -p ") - if not os.path.exists(self.fsckerofs_path): - raise ApexSigningError( - "Couldn't find location of fsck.erofs: " + - "Path {} does not exist. ".format(self.fsckerofs_path) + - "Make sure bin/fsck.erofs can be found in -p ") list_cmd = ['deapexer', '--debugfs_path', self.debugfs_path, - '--fsckerofs_path', self.fsckerofs_path, 'list', self.apex_path] + 'list', self.apex_path] entries_names = common.RunAndCheckOutput(list_cmd).split() apk_entries = [name for name in entries_names if name.endswith('.apk')] @@ -128,9 +125,15 @@ class ApexApkSigner(object): "Couldn't find location of fsck.erofs: " + "Path {} does not exist. ".format(self.fsckerofs_path) + "Make sure bin/fsck.erofs can be found in -p ") + if not os.path.exists(self.blkid_path): + raise ApexSigningError( + "Couldn't find location of blkid: " + + "Path {} does not exist. ".format(self.blkid_path) + + "Make sure bin/blkid can be found in -p ") payload_dir = common.MakeTempDir() extract_cmd = ['deapexer', '--debugfs_path', self.debugfs_path, - '--fsckerofs_path', self.fsckerofs_path, 'extract', + '--fsckerofs_path', self.fsckerofs_path, + '--blkid_path', self.blkid_path, 'extract', self.apex_path, payload_dir] common.RunAndCheckOutput(extract_cmd) @@ -430,7 +433,6 @@ def SignCompressedApex(avbtool, apex_file, payload_key, container_key, The path to the signed APEX file. """ debugfs_path = os.path.join(OPTIONS.search_path, 'bin', 'debugfs_static') - fsckerofs_path = os.path.join(OPTIONS.search_path, 'bin', 'fsck.erofs') # 1. Decompress original_apex inside compressed apex. original_apex_file = common.MakeTempFile(prefix='original-apex-', @@ -438,7 +440,6 @@ def SignCompressedApex(avbtool, apex_file, payload_key, container_key, # Decompression target path should not exist os.remove(original_apex_file) common.RunAndCheckOutput(['deapexer', '--debugfs_path', debugfs_path, - '--fsckerofs_path', fsckerofs_path, 'decompress', '--input', apex_file, '--output', original_apex_file]) @@ -502,9 +503,7 @@ def SignApex(avbtool, apex_data, payload_key, container_key, container_pw, output_fp.write(apex_data) debugfs_path = os.path.join(OPTIONS.search_path, 'bin', 'debugfs_static') - fsckerofs_path = os.path.join(OPTIONS.search_path, 'bin', 'fsck.erofs') cmd = ['deapexer', '--debugfs_path', debugfs_path, - '--fsckerofs_path', fsckerofs_path, 'info', '--print-type', apex_file] try: @@ -577,10 +576,6 @@ def GetApexInfoFromTargetFiles(input_file, partition, compressed_only=True): if OPTIONS.search_path: debugfs_path = os.path.join(OPTIONS.search_path, "bin", "debugfs_static") - fsckerofs_path = "fsck.erofs" - if OPTIONS.search_path: - fsckerofs_path = os.path.join(OPTIONS.search_path, "bin", "fsck.erofs") - deapexer = 'deapexer' if OPTIONS.search_path: deapexer_path = os.path.join(OPTIONS.search_path, "bin", "deapexer") @@ -601,7 +596,6 @@ def GetApexInfoFromTargetFiles(input_file, partition, compressed_only=True): # Check if the file is compressed or not apex_type = RunAndCheckOutput([ deapexer, "--debugfs_path", debugfs_path, - "--fsckerofs_path", fsckerofs_path, 'info', '--print-type', apex_filepath]).rstrip() if apex_type == 'COMPRESSED': apex_info.is_compressed = True diff --git a/tools/releasetools/merge/merge_dexopt.py b/tools/releasetools/merge/merge_dexopt.py index 7bf9bd4b17..16182b5cbb 100644 --- a/tools/releasetools/merge/merge_dexopt.py +++ b/tools/releasetools/merge/merge_dexopt.py @@ -164,6 +164,10 @@ def MergeDexopt(temp_dir, output_target_files_dir): 'deapexer', '--debugfs_path', 'debugfs_static', + '--blkid_path', + 'blkid', + '--fsckerofs_path', + 'fsck.erofs', 'extract', apex, apex_extract_dir, From be7b50f0caf9fedcc8c31d6e2411690156b3c9f5 Mon Sep 17 00:00:00 2001 From: qiaoli Date: Tue, 15 Nov 2022 07:16:52 +0000 Subject: [PATCH 055/139] Delete federatedcompute boot jar in build branch Test: TH Bug: 253316936 Change-Id: Ia3add966bb3e5e9d750cf28441c3f5fc34312233 --- target/product/base_system.mk | 1 - target/product/default_art_config.mk | 1 - 2 files changed, 2 deletions(-) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 7314fb6270..6ca2ef4e04 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -58,7 +58,6 @@ PRODUCT_PACKAGES += \ com.android.cronet \ com.android.devicelock \ com.android.extservices \ - com.android.federatedcompute \ com.android.healthconnect \ com.android.i18n \ com.android.ipsec \ diff --git a/target/product/default_art_config.mk b/target/product/default_art_config.mk index d37281c0e2..1f35dd03c9 100644 --- a/target/product/default_art_config.mk +++ b/target/product/default_art_config.mk @@ -58,7 +58,6 @@ PRODUCT_APEX_BOOT_JARS := \ com.android.configinfrastructure:framework-configinfrastructure \ com.android.conscrypt:conscrypt \ com.android.devicelock:framework-devicelock \ - com.android.federatedcompute:framework-federatedcompute \ com.android.healthconnect:framework-healthconnect \ com.android.i18n:core-icu4j \ com.android.ipsec:android.net.ipsec.ike \ From ba2dfa88ded0db625382a4125f41f2846b820bed Mon Sep 17 00:00:00 2001 From: John Reck Date: Wed, 16 Nov 2022 20:06:24 -0500 Subject: [PATCH 056/139] Move allocator-V1 entry Just a shuffle to avoid a merge conflict Test: make Change-Id: Id68e4ef3b38965c08c9b783d32ccc2aca342ed24 --- target/product/gsi/current.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt index e711c62942..9908fb9646 100644 --- a/target/product/gsi/current.txt +++ b/target/product/gsi/current.txt @@ -21,7 +21,6 @@ LLNDK: libvndksupport.so LLNDK: libvulkan.so VNDK-SP: android.hardware.common-V2-ndk.so VNDK-SP: android.hardware.common.fmq-V1-ndk.so -VNDK-SP: android.hardware.graphics.allocator-V1-ndk.so VNDK-SP: android.hardware.graphics.common-V4-ndk.so VNDK-SP: android.hardware.graphics.common@1.0.so VNDK-SP: android.hardware.graphics.common@1.1.so @@ -31,6 +30,7 @@ VNDK-SP: android.hardware.graphics.mapper@2.0.so VNDK-SP: android.hardware.graphics.mapper@2.1.so VNDK-SP: android.hardware.graphics.mapper@3.0.so VNDK-SP: android.hardware.graphics.mapper@4.0.so +VNDK-SP: android.hardware.graphics.allocator-V1-ndk.so VNDK-SP: android.hardware.renderscript@1.0.so VNDK-SP: android.hidl.memory.token@1.0.so VNDK-SP: android.hidl.memory@1.0-impl.so From 5c7f190fbcb9b149f74e8d88aed7ede6aa6802cb Mon Sep 17 00:00:00 2001 From: John Reck Date: Mon, 31 Oct 2022 15:53:40 -0400 Subject: [PATCH 057/139] IAllocator-V2 Test: make Change-Id: Ifa1ef1a91e7de94d5ad27c846d287d9bbacabd2a --- target/product/gsi/current.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt index 9908fb9646..474cb20239 100644 --- a/target/product/gsi/current.txt +++ b/target/product/gsi/current.txt @@ -30,7 +30,7 @@ VNDK-SP: android.hardware.graphics.mapper@2.0.so VNDK-SP: android.hardware.graphics.mapper@2.1.so VNDK-SP: android.hardware.graphics.mapper@3.0.so VNDK-SP: android.hardware.graphics.mapper@4.0.so -VNDK-SP: android.hardware.graphics.allocator-V1-ndk.so +VNDK-SP: android.hardware.graphics.allocator-V2-ndk.so VNDK-SP: android.hardware.renderscript@1.0.so VNDK-SP: android.hidl.memory.token@1.0.so VNDK-SP: android.hidl.memory@1.0-impl.so From 49b88e41711aaf5857f71ad0d831da358f2d4b96 Mon Sep 17 00:00:00 2001 From: Seth Moore Date: Fri, 18 Nov 2022 14:11:42 -0800 Subject: [PATCH 058/139] Add rkpd mainline module Bug: 254112668 Test: It builds Change-Id: Iacd7164d9fae68a622ad45467c2e4af2f0111468 --- target/product/base_system.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 2225c1fcd7..5f13527a41 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -69,6 +69,7 @@ PRODUCT_PACKAGES += \ com.android.os.statsd \ com.android.permission \ com.android.resolv \ + com.android.rkpd \ com.android.neuralnetworks \ com.android.scheduling \ com.android.sdkext \ From 3001ead929163350a7dfff841d5ef13c5143720e Mon Sep 17 00:00:00 2001 From: Cynthia Wasonga Date: Thu, 10 Nov 2022 23:39:47 +0000 Subject: [PATCH 059/139] Prevent pre-installation of aosp system apps on clone profile Apps and their corresponding config files linked here: go/clone-configs-and-mks Bug: 238970256 Test: Confirmed that the apps don't get pre-installed on the clone profile Change-Id: I72beb9fd2ea5bcd5f1bf382a44a14812ef92c07d --- target/product/generic_system.mk | 1 + target/product/handheld_system.mk | 1 + target/product/sysconfig/Android.bp | 20 +++++++++++ ...stalled-packages-platform-aosp-product.xml | 8 +++++ ...alled-packages-platform-generic-system.xml | 29 ++++++++++++++++ ...led-packages-platform-handheld-product.xml | 34 +++++++++++++++++++ ...lled-packages-platform-handheld-system.xml | 26 ++++++++++++++ ...ed-packages-platform-telephony-product.xml | 29 ++++++++++++++++ target/product/telephony_product.mk | 1 + 9 files changed, 149 insertions(+) create mode 100644 target/product/sysconfig/preinstalled-packages-platform-generic-system.xml create mode 100644 target/product/sysconfig/preinstalled-packages-platform-handheld-system.xml create mode 100644 target/product/sysconfig/preinstalled-packages-platform-telephony-product.xml diff --git a/target/product/generic_system.mk b/target/product/generic_system.mk index 1a639ef717..ce4e5f3fe2 100644 --- a/target/product/generic_system.mk +++ b/target/product/generic_system.mk @@ -32,6 +32,7 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ LiveWallpapersPicker \ PartnerBookmarksProvider \ + preinstalled-packages-platform-generic-system.xml \ Stk \ Tag \ diff --git a/target/product/handheld_system.mk b/target/product/handheld_system.mk index 7fbb617e02..2da1395c99 100644 --- a/target/product/handheld_system.mk +++ b/target/product/handheld_system.mk @@ -57,6 +57,7 @@ PRODUCT_PACKAGES += \ MusicFX \ NfcNci \ PacProcessor \ + preinstalled-packages-platform-handheld-system.xml \ PrintRecommendationService \ PrintSpooler \ ProxyHandler \ diff --git a/target/product/sysconfig/Android.bp b/target/product/sysconfig/Android.bp index 29122e4af2..27ac8cf2b4 100644 --- a/target/product/sysconfig/Android.bp +++ b/target/product/sysconfig/Android.bp @@ -29,9 +29,29 @@ prebuilt_etc { src: "preinstalled-packages-platform-full-base.xml", } +prebuilt_etc { + name: "preinstalled-packages-platform-generic-system.xml", + sub_dir: "sysconfig", + src: "preinstalled-packages-platform-generic-system.xml", +} + prebuilt_etc { name: "preinstalled-packages-platform-handheld-product.xml", product_specific: true, sub_dir: "sysconfig", src: "preinstalled-packages-platform-handheld-product.xml", } + +prebuilt_etc { + name: "preinstalled-packages-platform-handheld-system.xml", + sub_dir: "sysconfig", + src: "preinstalled-packages-platform-handheld-system.xml", +} + +prebuilt_etc { + name: "preinstalled-packages-platform-telephony-product.xml", + product_specific: true, + sub_dir: "sysconfig", + src: "preinstalled-packages-platform-telephony-product.xml", +} + diff --git a/target/product/sysconfig/preinstalled-packages-platform-aosp-product.xml b/target/product/sysconfig/preinstalled-packages-platform-aosp-product.xml index eec1326833..1295e1c726 100644 --- a/target/product/sysconfig/preinstalled-packages-platform-aosp-product.xml +++ b/target/product/sysconfig/preinstalled-packages-platform-aosp-product.xml @@ -20,4 +20,12 @@ + + + + + + + + diff --git a/target/product/sysconfig/preinstalled-packages-platform-generic-system.xml b/target/product/sysconfig/preinstalled-packages-platform-generic-system.xml new file mode 100644 index 0000000000..e2482e1ad3 --- /dev/null +++ b/target/product/sysconfig/preinstalled-packages-platform-generic-system.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + diff --git a/target/product/sysconfig/preinstalled-packages-platform-handheld-product.xml b/target/product/sysconfig/preinstalled-packages-platform-handheld-product.xml index a5d9ba21dd..79c1565ee2 100644 --- a/target/product/sysconfig/preinstalled-packages-platform-handheld-product.xml +++ b/target/product/sysconfig/preinstalled-packages-platform-handheld-product.xml @@ -20,4 +20,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/target/product/sysconfig/preinstalled-packages-platform-handheld-system.xml b/target/product/sysconfig/preinstalled-packages-platform-handheld-system.xml new file mode 100644 index 0000000000..d25c17ada6 --- /dev/null +++ b/target/product/sysconfig/preinstalled-packages-platform-handheld-system.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + diff --git a/target/product/sysconfig/preinstalled-packages-platform-telephony-product.xml b/target/product/sysconfig/preinstalled-packages-platform-telephony-product.xml new file mode 100644 index 0000000000..cc1c135fd7 --- /dev/null +++ b/target/product/sysconfig/preinstalled-packages-platform-telephony-product.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + diff --git a/target/product/telephony_product.mk b/target/product/telephony_product.mk index 18374d4b23..aa70f46797 100644 --- a/target/product/telephony_product.mk +++ b/target/product/telephony_product.mk @@ -21,3 +21,4 @@ PRODUCT_PACKAGES += \ Dialer \ ImsServiceEntitlement \ + preinstalled-packages-platform-telephony-product.xml From 7bf4c34e29558934bbf962f27fc1f9119195517c Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Sat, 12 Nov 2022 23:20:11 +0000 Subject: [PATCH 060/139] Remove dalvik.vm.usejitprofiles system property. Disabling profiles is no longer supported. Most of the profile support has been active even when this property was false, and it won't be supported in the ART Service. Test: Boot Bug: 254434433 Change-Id: I1a77f006f204cd2f1fb302bcf4b1126f54e2e78b --- target/product/runtime_libart.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/target/product/runtime_libart.mk b/target/product/runtime_libart.mk index a62cda7898..bd4fd1cd05 100644 --- a/target/product/runtime_libart.mk +++ b/target/product/runtime_libart.mk @@ -95,7 +95,6 @@ endif # The thermal cutoff value is currently set to THERMAL_STATUS_MODERATE. PRODUCT_SYSTEM_PROPERTIES += \ dalvik.vm.usejit=true \ - dalvik.vm.usejitprofiles=true \ dalvik.vm.dexopt.secondary=true \ dalvik.vm.dexopt.thermal-cutoff=2 \ dalvik.vm.appimageformat=lz4 From 738203785966c9a5810a3d2a84dd70766cd3e448 Mon Sep 17 00:00:00 2001 From: Yihan Dong Date: Wed, 30 Nov 2022 18:06:20 +0800 Subject: [PATCH 061/139] Tool for generating GTS open-sourced report The report contains: 1. whether gts-verifier need to be open-sourced 2. gts test modules that need to be open-sourced Test: m gts Change-Id: I1ce48f7e612556162d5ce1c76b3168ee7f35f826 --- tools/Android.bp | 5 ++ tools/generate_gts_shared_report.py | 128 ++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 tools/generate_gts_shared_report.py diff --git a/tools/Android.bp b/tools/Android.bp index 1f0d406566..f446973bbc 100644 --- a/tools/Android.bp +++ b/tools/Android.bp @@ -64,3 +64,8 @@ python_binary_host { name: "check_elf_file", srcs: ["check_elf_file.py"], } + +python_binary_host { + name: "generate_gts_shared_report", + srcs: ["generate_gts_shared_report.py"], +} diff --git a/tools/generate_gts_shared_report.py b/tools/generate_gts_shared_report.py new file mode 100644 index 0000000000..11c9364189 --- /dev/null +++ b/tools/generate_gts_shared_report.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2022 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. +""" +Checks and generates a report for gts modules that should be open-sourced. + +Usage: + generate_gts_open_source_report.py + --gtsv-metalic [gts-verifier meta_lic] + --gts-test-metalic [android-gts meta_lic] + --checkshare [COMPLIANCE_CHECKSHARE] + --gts-test-dir [directory of android-gts] + --output [output file] + +Output example: + GTS-Verifier: PASS/FAIL + GTS-Modules: PASS/FAIL + GtsIncrementalInstallTestCases_BackgroundProcess + GtsUnsignedNetworkStackTestCases +""" +import sys +import argparse +import subprocess +import re + +def _get_args(): + """Parses input arguments.""" + parser = argparse.ArgumentParser() + parser.add_argument( + '--gtsv-metalic', required=True, + help='license meta_lic file path of gts-verifier.zip') + parser.add_argument( + '--gts-test-metalic', required=True, + help='license meta_lic file path of android-gts.zip') + parser.add_argument( + '--checkshare', required=True, + help='path of the COMPLIANCE_CHECKSHARE tool') + parser.add_argument( + '--gts-test-dir', required=True, + help='directory of android-gts') + parser.add_argument( + '-o', '--output', required=True, + help='file path of the output report') + return parser.parse_args() + +def _check_gtsv(checkshare: str, gtsv_metalic: str) -> str: + """Checks gts-verifier license. + + Args: + checkshare: path of the COMPLIANCE_CHECKSHARE tool + gtsv_metalic: license meta_lic file path of gts-verifier.zip + + Returns: + PASS when gts-verifier.zip doesn't need to be shared, and FAIL + when gts-verifier.zip need to be shared. + """ + cmd = f'{checkshare} {gtsv_metalic}' + proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + proc.communicate() + return 'PASS' if proc.returncode == 0 else 'FAIL' + +def _check_gts_test(checkshare: str, gts_test_metalic: str, + gts_test_dir: str) -> tuple[str, set[str]]: + """Checks android-gts license. + + Args: + checkshare: path of the COMPLIANCE_CHECKSHARE tool + gts_test_metalic: license meta_lic file path of android-gts.zip + gts_test_dir: directory of android-gts + + Returns: + Check result (PASS when android-gts doesn't need to be shared, + FAIL when some gts modules need to be shared) and gts modules + that need to be shared. + """ + cmd = f'{checkshare} {gts_test_metalic}' + proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + _, str_stderr = map(lambda b: b.decode(), proc.communicate()) + if proc.returncode == 0: + return 'PASS', [] + open_source_modules = set() + for error_line in str_stderr.split('\n'): + # Skip the empty liness + if not error_line: + continue + module_meta_lic = error_line.strip().split()[0] + groups = re.fullmatch( + re.compile(f'.*/{gts_test_dir}/(.*)'), module_meta_lic) + if groups: + open_source_modules.add( + groups[1].removesuffix('.meta_lic')) + return 'FAIL', open_source_modules + + +def main(argv): + args = _get_args() + + gtsv_metalic = args.gtsv_metalic + gts_test_metalic = args.gts_test_metalic + output_file = args.output + checkshare = args.checkshare + gts_test_dir = args.gts_test_dir + + with open(output_file, 'w') as file: + result = _check_gtsv(checkshare, gtsv_metalic) + file.write(f'GTS-Verifier: {result}\n') + result, open_source_modules = _check_gts_test( + checkshare, gts_test_metalic, gts_test_dir) + file.write(f'GTS-Modules: {result}\n') + for open_source_module in open_source_modules: + file.write(f'\t{open_source_module}\n') + +if __name__ == "__main__": + main(sys.argv) \ No newline at end of file From a527b1a0ee82cc5a6c78e44ed6eaf7d71f710a1b Mon Sep 17 00:00:00 2001 From: Sanket Chinchalkar Date: Thu, 1 Dec 2022 06:30:16 -0800 Subject: [PATCH 062/139] Add Traefed Contrib to CATBox Test: make catbox Bug: 226980239 Change-Id: I3012cc4690eda97407846970312f7b9026aaab8f --- core/tasks/catbox.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/core/tasks/catbox.mk b/core/tasks/catbox.mk index 443f4bbe95..a771a935ba 100644 --- a/core/tasks/catbox.mk +++ b/core/tasks/catbox.mk @@ -16,6 +16,7 @@ test_suite_name := catbox test_suite_tradefed := catbox-tradefed test_suite_readme := test/catbox/tools/catbox-tradefed/README test_suite_tools := $(HOST_OUT_JAVA_LIBRARIES)/catbox-report-lib.jar +test_suite_tools += $(HOST_OUT_JAVA_LIBRARIES)/tradefed-contrib.jar include $(BUILD_SYSTEM)/tasks/tools/compatibility.mk From 19cdf97934a2ccab179dec249d251cf27a8b8c80 Mon Sep 17 00:00:00 2001 From: Hassan Ali Date: Wed, 7 Dec 2022 19:25:39 +0000 Subject: [PATCH 063/139] Add service configinfrastructure Test: m Bug: 261723346 Change-Id: If3eb3ea3bf2d3a0ef0b47192f8da43fb5b2afee0 --- target/product/default_art_config.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/default_art_config.mk b/target/product/default_art_config.mk index 79f113ba80..67d3b60b15 100644 --- a/target/product/default_art_config.mk +++ b/target/product/default_art_config.mk @@ -84,6 +84,7 @@ PRODUCT_APEX_SYSTEM_SERVER_JARS := \ com.android.adservices:service-sdksandbox \ com.android.appsearch:service-appsearch \ com.android.art:service-art \ + com.android.configinfrastructure:service-configinfrastructure \ com.android.healthconnect:service-healthconnect \ com.android.media:service-media-s \ com.android.permission:service-permission \ From fec25312ca84d6ed4ac37954f11ed7caa60f1803 Mon Sep 17 00:00:00 2001 From: Zhi Dou Date: Fri, 9 Dec 2022 22:17:29 +0000 Subject: [PATCH 064/139] Add condition check of KEEP_APEX_INHERIT Add environment variable KEEP_APEX_INHERIT condition check to set the proper value of Soong conditional variable library_linking_strategy. If the KEEP_APEX_INHERIT exists, the "min_sdk_version" in condition will be set to "apex_inherit". For more detail: https://docs.google.com/document/d/1R2vZw0cQa-haAMgFyQ682uSq9aGBNQrzMHKIsU17-XY/edit?usp=sharing&resourcekey=0-gUbs463r9LCKs7vdP_Xkmg Test: build module locally, and check the corresponding change. Presbumit Bug: 254634795 Change-Id: Ic5da1c83b3b9c090bc2a24d36b1a4ac936ce1a59 --- core/android_soong_config_vars.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/android_soong_config_vars.mk b/core/android_soong_config_vars.mk index 575aa9acee..ce7b31d05a 100644 --- a/core/android_soong_config_vars.mk +++ b/core/android_soong_config_vars.mk @@ -91,6 +91,10 @@ $(foreach m, $(INDIVIDUALLY_TOGGLEABLE_PREBUILT_MODULES),\ # Apex build mode variables ifdef APEX_BUILD_FOR_PRE_S_DEVICES $(call add_soong_config_var_value,ANDROID,library_linking_strategy,prefer_static) +else +ifdef KEEP_APEX_INHERIT +$(call add_soong_config_var_value,ANDROID,library_linking_strategy,prefer_static) +endif endif ifeq (true,$(MODULE_BUILD_FROM_SOURCE)) From e04a3f5a35e0ca6475d2a43aaa8b6204c5dd9358 Mon Sep 17 00:00:00 2001 From: Dennis Shen Date: Tue, 13 Dec 2022 13:42:47 +0000 Subject: [PATCH 065/139] switch to use blkid_static BUG: b/259003057, b/257933023 Change-Id: I967fc07a25d596aa40489df3f9636bfc94f0848d --- tools/releasetools/apex_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releasetools/apex_utils.py b/tools/releasetools/apex_utils.py index ea099149dc..c3f7203b60 100644 --- a/tools/releasetools/apex_utils.py +++ b/tools/releasetools/apex_utils.py @@ -66,7 +66,7 @@ class ApexApkSigner(object): self.fsckerofs_path = os.path.join( OPTIONS.search_path, "bin", "fsck.erofs") self.blkid_path = os.path.join( - OPTIONS.search_path, "bin", "blkid") + OPTIONS.search_path, "bin", "blkid_static") self.avbtool = avbtool if avbtool else "avbtool" self.sign_tool = sign_tool From d43618d96559696459a8d1690bea9b996f6936bd Mon Sep 17 00:00:00 2001 From: Avichal Rakesh Date: Fri, 28 Oct 2022 15:13:48 -0700 Subject: [PATCH 066/139] Add vndk cameraservice to GSI Bug: 243593375 Test: n/a Change-Id: I7e96e4f069331c3809ca8be6e61016c018fb7fe3 --- target/product/gsi/current.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt index 474cb20239..ceb2060c19 100644 --- a/target/product/gsi/current.txt +++ b/target/product/gsi/current.txt @@ -58,6 +58,9 @@ VNDK-SP: libunwindstack.so VNDK-SP: libutils.so VNDK-SP: libutilscallstack.so VNDK-SP: libz.so +VNDK-core: android.frameworks.cameraservice.common-V1-ndk.so +VNDK-core: android.frameworks.cameraservice.device-V1-ndk.so +VNDK-core: android.frameworks.cameraservice.service-V1-ndk.so VNDK-core: android.hardware.audio.common@2.0.so VNDK-core: android.hardware.configstore-utils.so VNDK-core: android.hardware.configstore@1.0.so From 8450989b34fac0ab0dc0f9869d0dee0745246f02 Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Mon, 16 Jan 2023 17:14:14 +0000 Subject: [PATCH 067/139] Add system property for the new boot-after-mainline-update compilation reason. Test: Boot Bug: 265685704 Ignore-AOSP-First: Topic with internal changes - will cherry-pick to AOSP later. Change-Id: I11d8d6eac1ea0e9537a839ee39adf3edb51852ec --- target/product/runtime_libart.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/runtime_libart.mk b/target/product/runtime_libart.mk index bd4fd1cd05..39666ead68 100644 --- a/target/product/runtime_libart.mk +++ b/target/product/runtime_libart.mk @@ -122,6 +122,7 @@ endif # without exceptions). PRODUCT_SYSTEM_PROPERTIES += \ pm.dexopt.post-boot?=extract \ + pm.dexopt.boot-after-mainline-update?=verify \ pm.dexopt.install?=speed-profile \ pm.dexopt.install-fast?=skip \ pm.dexopt.install-bulk?=speed-profile \ From 0e592f05df130781136d0385ba396ef41e6b5f39 Mon Sep 17 00:00:00 2001 From: Sumedh Sen Date: Mon, 23 Jan 2023 13:09:49 -0800 Subject: [PATCH 068/139] Add new xml reference to Android.mk Add "initial-package-stopped-states.xml" in Android.mk for it to be available for SystemConfig to use. Test: None Bug: 249514169 Change-Id: I7ea99a285c930d3de93c35deaacc206e37c6aad0 --- target/product/base_system.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 8f64b05509..f2ae0203c6 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -123,6 +123,7 @@ PRODUCT_PACKAGES += \ incident-helper-cmd \ init.environ.rc \ init_system \ + initial-package-stopped-states.xml \ input \ installd \ IntentResolver \ From e98268fc4fe812023b85b27c2bad0a374b80fd7e Mon Sep 17 00:00:00 2001 From: Karthik Mahesh Date: Mon, 23 Jan 2023 13:32:46 -0800 Subject: [PATCH 069/139] Add ODP system service jar to system server jars list. Bug: 236174677 Test: TH Change-Id: Ia999f9a514c32bedef0e6cdd2bba8087290cfe7e --- target/product/default_art_config.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/default_art_config.mk b/target/product/default_art_config.mk index 67d3b60b15..7d5b8e8862 100644 --- a/target/product/default_art_config.mk +++ b/target/product/default_art_config.mk @@ -87,6 +87,7 @@ PRODUCT_APEX_SYSTEM_SERVER_JARS := \ com.android.configinfrastructure:service-configinfrastructure \ com.android.healthconnect:service-healthconnect \ com.android.media:service-media-s \ + com.android.ondevicepersonalization:service-ondevicepersonalization \ com.android.permission:service-permission \ com.android.rkpd:service-rkp \ From ff6bc088a517b9bb4d57be27268c5d34db43ae86 Mon Sep 17 00:00:00 2001 From: Kun Niu Date: Fri, 16 Dec 2022 10:17:37 -0800 Subject: [PATCH 070/139] Set UNBUNDLED_BUILD_SDKS_FROM_SOURCE to true by default in module_common.mk if the branch is not using slim manifests. This makes sure that mainline modules build locally are using the build from source sdk. Bug: 262783668 Test: time m atest && time atest-dev CtsNetTestCasesLatestSdk[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex] --verbose Change-Id: I37b94448a45b0b811ae1815ad8c46589c62e8542 (cherry picked from commit 40e6f9bdcabc6336657a1735cb036e9bfdefd45d) Merged-In: I37b94448a45b0b811ae1815ad8c46589c62e8542 --- target/product/module_common.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/product/module_common.mk b/target/product/module_common.mk index 54f3949965..ec670ee4c9 100644 --- a/target/product/module_common.mk +++ b/target/product/module_common.mk @@ -25,3 +25,8 @@ PRODUCT_SHIPPING_API_LEVEL := 29 # Builds using a module product should build modules from source, even if # BRANCH_DEFAULT_MODULE_BUILD_FROM_SOURCE says otherwise. PRODUCT_MODULE_BUILD_FROM_SOURCE := true + +# Build sdk from source if the branch is not using slim manifests. +ifneq (,$(strip $(wildcard frameworks/base/Android.bp))) + UNBUNDLED_BUILD_SDKS_FROM_SOURCE := true +endif From 730d0c437a879bd23c80f82566bab8f8db2418ee Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Wed, 1 Feb 2023 12:12:51 +0000 Subject: [PATCH 071/139] Support SHA minSdkVersion in APK in APEX Bug: 266903788 Test: rm -fr out/dist UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true TARGET_BUILD_APPS="com.google.android.rkpd" vendor/google/build/mainline_modules_bundles.sh # Without this change it fails, with this change it passes at # which point run the following. mkdir contents cd contents unzip ../out/dist/dev_keys_signed/com.google.android.rkpd/com.google.android.rkpd.apks deapexer extract standalones/standalone-x86.apex apex-contents aapt2 dump badging apex-contents/priv-app/rkpdapp.google@*/rkpdapp.google.apk | grep Version # The sdkVersion and targetSdkVersion should both be set to SHA # versions. Change-Id: I9ca54affd30f0a6cf561f1274b991d39e7cf1bce --- tools/releasetools/common.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 9919029854..f609e6a9ae 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -2320,12 +2320,22 @@ def GetMinSdkVersionInt(apk_name, codename_to_api_level_map): try: return int(version) except ValueError: - # Not a decimal number. Codename? - if version in codename_to_api_level_map: - return codename_to_api_level_map[version] + # Not a decimal number. + # + # It could be either a straight codename, e.g. + # UpsideDownCake + # + # Or a codename with API fingerprint SHA, e.g. + # UpsideDownCake.e7d3947f14eb9dc4fec25ff6c5f8563e + # + # Extract the codename and try and map it to a version number. + split = version.split(".") + codename = split[0] + if codename in codename_to_api_level_map: + return codename_to_api_level_map[codename] raise ExternalError( - "Unknown minSdkVersion: '{}'. Known codenames: {}".format( - version, codename_to_api_level_map)) + "Unknown codename: '{}' from minSdkVersion: '{}'. Known codenames: {}".format( + codename, version, codename_to_api_level_map)) def SignFile(input_name, output_name, key, password, min_api_level=None, From 28b6a02300745d97bb658250eb21f68dccf36f88 Mon Sep 17 00:00:00 2001 From: Avichal Rakesh Date: Wed, 25 Jan 2023 14:55:31 -0800 Subject: [PATCH 072/139] Add DeviceAsWebcam to general handheld_system DeviceAsWebcam is a new service that lets an Android Device be used as a UVC webcam. The logic in DeviceAsWebcam is protected behind the vendor property `ro.usb.uvc.enabled`. Vendors who support UVC will need to set the property to `true` using something like ``` PRODUCT_VENDOR_PROPERTIES += \ ro.usb.uvc.enabled?=true ``` Bug: 242344221 Test: Manually tested that the makefile is correctly inherited from. Change-Id: I9b8444406f1c02fc8b76caee3e961016d9430a0a --- target/product/handheld_system.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/handheld_system.mk b/target/product/handheld_system.mk index 2da1395c99..3009d6a4dd 100644 --- a/target/product/handheld_system.mk +++ b/target/product/handheld_system.mk @@ -43,6 +43,7 @@ PRODUCT_PACKAGES += \ CaptivePortalLogin \ CertInstaller \ CredentialManager \ + DeviceAsWebcam \ DocumentsUI \ DownloadProviderUi \ EasterEgg \ From 72edb1b11d90d352c03d7b1e8e2ecdf64942813f Mon Sep 17 00:00:00 2001 From: Daniel Norman Date: Fri, 20 Jan 2023 12:25:55 -0800 Subject: [PATCH 073/139] Includes AccessibilityMenu on handheld devices. In FR b/261252772 we are migrating the AccessibilityMenu accessibility service from the Android Accessibility Suite into the framework. This APK is very small (210KB), does not run unless enabled by the user in accessibility Settings, and uses <150MB PSS while running per `dumpsys meminfo`. Bug: 266591148 Test: check that A11yMenu is present in system_ext and can be enabled in Settings > Accessibility Change-Id: I4da09e4f98eb56bcfb441ca1afdeff28f6d3aa31 --- target/product/handheld_system_ext.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/handheld_system_ext.mk b/target/product/handheld_system_ext.mk index d935fbfddf..187b6275bb 100644 --- a/target/product/handheld_system_ext.mk +++ b/target/product/handheld_system_ext.mk @@ -22,6 +22,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/media_system_ext.mk) # /system_ext packages PRODUCT_PACKAGES += \ + AccessibilityMenu \ Launcher3QuickStep \ Provision \ Settings \ From bc566a4e0e603a09ab37ca7e7e297cba200cf463 Mon Sep 17 00:00:00 2001 From: ronish Date: Tue, 7 Feb 2023 18:48:22 +0000 Subject: [PATCH 074/139] Rename healthconnect to healthfitness Bug: 264516143 Change-Id: I11a359ae23c1990fafb68667988e3249390e47e0 --- target/product/base_system.mk | 2 +- target/product/default_art_config.mk | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 1bbad14f8e..60172f75d9 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -57,7 +57,7 @@ PRODUCT_PACKAGES += \ com.android.conscrypt \ com.android.devicelock \ com.android.extservices \ - com.android.healthconnect \ + com.android.healthfitness \ com.android.i18n \ com.android.ipsec \ com.android.location.provider \ diff --git a/target/product/default_art_config.mk b/target/product/default_art_config.mk index 7d5b8e8862..d970203470 100644 --- a/target/product/default_art_config.mk +++ b/target/product/default_art_config.mk @@ -58,7 +58,7 @@ PRODUCT_APEX_BOOT_JARS := \ com.android.configinfrastructure:framework-configinfrastructure \ com.android.conscrypt:conscrypt \ com.android.devicelock:framework-devicelock \ - com.android.healthconnect:framework-healthconnect \ + com.android.healthfitness:framework-healthfitness \ com.android.i18n:core-icu4j \ com.android.ipsec:android.net.ipsec.ike \ com.android.media:updatable-media \ @@ -85,7 +85,7 @@ PRODUCT_APEX_SYSTEM_SERVER_JARS := \ com.android.appsearch:service-appsearch \ com.android.art:service-art \ com.android.configinfrastructure:service-configinfrastructure \ - com.android.healthconnect:service-healthconnect \ + com.android.healthfitness:service-healthfitness \ com.android.media:service-media-s \ com.android.ondevicepersonalization:service-ondevicepersonalization \ com.android.permission:service-permission \ From 05edbf828ad05a990ac4e9d5da9c36b01aff5a8e Mon Sep 17 00:00:00 2001 From: Zhong Dong Date: Thu, 9 Feb 2023 20:37:07 +0000 Subject: [PATCH 075/139] Add a new flag to control WallpaperBackup Test: Locally build android and flashed a debug device. Bug: 266917524 Change-Id: I418699c5ded8580f105afaf9ec7c3c528dde8939 --- target/product/base_system.mk | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 1bbad14f8e..3b5c08331c 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -289,7 +289,6 @@ PRODUCT_PACKAGES += \ viewcompiler \ voip-common \ vold \ - WallpaperBackup \ watchdogd \ wificond \ wifi.rc \ @@ -323,6 +322,11 @@ ifeq ($(EMMA_INSTRUMENT),true) endif # EMMA_INSTRUMENT_STATIC endif # EMMA_INSTRUMENT +ifeq (,$(DISABLE_WALLPAPER_BACKUP)) + PRODUCT_PACKAGES += \ + WallpaperBackup +endif + # For testing purposes ifeq ($(FORCE_AUDIO_SILENT), true) PRODUCT_SYSTEM_PROPERTIES += ro.audio.silent=1 @@ -412,7 +416,11 @@ PRODUCT_PACKAGES_DEBUG := \ # The set of packages whose code can be loaded by the system server. PRODUCT_SYSTEM_SERVER_APPS += \ SettingsProvider \ + +ifeq (,$(DISABLE_WALLPAPER_BACKUP)) + PRODUCT_SYSTEM_SERVER_APPS += \ WallpaperBackup +endif PRODUCT_PACKAGES_DEBUG_JAVA_COVERAGE := \ libdumpcoverage From 12727fceab2990eb23a8014d2fc27b873ff3afb1 Mon Sep 17 00:00:00 2001 From: Cory Barker Date: Fri, 3 Feb 2023 00:19:34 +0000 Subject: [PATCH 076/139] Build java fuzz targets with one build target instead of needed a host target and device Test: built locally and verified fuzzers with Jazzer Change-Id: Icb1ecef1920fa1ba6d4492acdd3b37093964eb84 --- core/Makefile | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/core/Makefile b/core/Makefile index f9f0b4a2b9..df57a2c611 100644 --- a/core/Makefile +++ b/core/Makefile @@ -7093,17 +7093,9 @@ FUZZ_SHARED_DEPS := $(call copy-many-files,$(strip $(FUZZ_TARGET_SHARED_DEPS_INS haiku: $(SOONG_FUZZ_PACKAGING_ARCH_MODULES) $(ALL_FUZZ_TARGETS) $(call dist-for-goals,haiku,$(SOONG_FUZZ_PACKAGING_ARCH_MODULES)) $(call dist-for-goals,haiku,$(PRODUCT_OUT)/module-info.json) - -.PHONY: haiku-java-device -haiku-java-device: $(SOONG_JAVA_FUZZ_DEVICE_PACKAGING_ARCH_MODULES) $(ALL_JAVA_FUZZ_DEVICE_TARGETS) -$(call dist-for-goals,haiku-java-device,$(SOONG_JAVA_FUZZ_DEVICE_PACKAGING_ARCH_MODULES)) -$(call dist-for-goals,haiku-java-device,$(PRODUCT_OUT)/module-info.json) - -.PHONY: haiku-java-host -haiku-java-host: $(SOONG_JAVA_FUZZ_HOST_PACKAGING_ARCH_MODULES) $(ALL_JAVA_FUZZ_HOST_TARGETS) -$(call dist-for-goals,haiku-java-host,$(SOONG_JAVA_FUZZ_HOST_PACKAGING_ARCH_MODULES)) -$(call dist-for-goals,haiku-java-host,$(PRODUCT_OUT)/module-info.json) - +.PHONY: haiku-java +haiku-java: $(SOONG_JAVA_FUZZ_PACKAGING_ARCH_MODULES) $(ALL_JAVA_FUZZ_TARGETS) +$(call dist-for-goals,haiku-java,$(SOONG_JAVA_FUZZ_PACKAGING_ARCH_MODULES)) .PHONY: haiku-rust haiku-rust: $(SOONG_RUST_FUZZ_PACKAGING_ARCH_MODULES) $(ALL_RUST_FUZZ_TARGETS) $(call dist-for-goals,haiku-rust,$(SOONG_RUST_FUZZ_PACKAGING_ARCH_MODULES)) From 94a52f20179a217372c9652170fd588163e3c415 Mon Sep 17 00:00:00 2001 From: Cynthia Wasonga Date: Tue, 24 Jan 2023 17:16:28 +0000 Subject: [PATCH 077/139] Add preinstallation configs for AOSP Files, Search and Keyboard Bug: 238970256 Bug: 267617358 Test: Verify app installation on device Change-Id: I08d238dfc61571fc9f575e7b72fbee6db418c90c Merged-In: I08d238dfc61571fc9f575e7b72fbee6db418c90c --- ...led-packages-platform-handheld-product.xml | 26 +++++++++++++++---- ...lled-packages-platform-handheld-system.xml | 10 ++++++- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/target/product/sysconfig/preinstalled-packages-platform-handheld-product.xml b/target/product/sysconfig/preinstalled-packages-platform-handheld-product.xml index 79c1565ee2..54add22f75 100644 --- a/target/product/sysconfig/preinstalled-packages-platform-handheld-product.xml +++ b/target/product/sysconfig/preinstalled-packages-platform-handheld-product.xml @@ -17,8 +17,11 @@ Documentation at frameworks/base/data/etc/preinstalled-packages-platform.xml --> - + + + + @@ -28,30 +31,43 @@ - + - + - + - + + + + + + + + + + + + + + diff --git a/target/product/sysconfig/preinstalled-packages-platform-handheld-system.xml b/target/product/sysconfig/preinstalled-packages-platform-handheld-system.xml index d25c17ada6..02b03f1aaa 100644 --- a/target/product/sysconfig/preinstalled-packages-platform-handheld-system.xml +++ b/target/product/sysconfig/preinstalled-packages-platform-handheld-system.xml @@ -17,7 +17,15 @@ Documentation at frameworks/base/data/etc/preinstalled-packages-platform.xml --> - + + + + + + + + + From d21c5ae2d2a81e828f8461ce536b87c2e432b196 Mon Sep 17 00:00:00 2001 From: Avichal Rakesh Date: Fri, 17 Feb 2023 01:19:21 +0000 Subject: [PATCH 078/139] Revert "Add DeviceAsWebcam to general handheld_system" This reverts commit 28b6a02300745d97bb658250eb21f68dccf36f88. Reason for revert: DeviceAsWebcam is not ready to ship. The target will be re-added once the service is more polished. Change-Id: I287d352782760427db2a66594e4f69f757ff1fb2 Merged-In: I287d352782760427db2a66594e4f69f757ff1fb2 --- target/product/handheld_system.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/target/product/handheld_system.mk b/target/product/handheld_system.mk index 3009d6a4dd..2da1395c99 100644 --- a/target/product/handheld_system.mk +++ b/target/product/handheld_system.mk @@ -43,7 +43,6 @@ PRODUCT_PACKAGES += \ CaptivePortalLogin \ CertInstaller \ CredentialManager \ - DeviceAsWebcam \ DocumentsUI \ DownloadProviderUi \ EasterEgg \ From 60a7775d5674bf2fb402b2930f1a849f06497a06 Mon Sep 17 00:00:00 2001 From: Alex Buynytskyy Date: Wed, 22 Feb 2023 02:13:00 +0000 Subject: [PATCH 079/139] Fix finalization script for UDC. Bug: 260755259 Test: run locally Change-Id: I55b4fb5e51e25232c08f4bd7f602818ab86857b5 --- tools/finalization/environment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/finalization/environment.sh b/tools/finalization/environment.sh index 983e19dc4a..6b20791fa7 100755 --- a/tools/finalization/environment.sh +++ b/tools/finalization/environment.sh @@ -5,7 +5,7 @@ set -ex export FINAL_BUG_ID='0' export FINAL_PLATFORM_CODENAME='UpsideDownCake' -export CURRENT_PLATFORM_CODENAME='VanillaIceCream' +export CURRENT_PLATFORM_CODENAME='UpsideDownCake' export FINAL_PLATFORM_CODENAME_JAVA='UPSIDE_DOWN_CAKE' export FINAL_PLATFORM_SDK_VERSION='34' export FINAL_PLATFORM_VERSION='14' From fc6f2a43af1b8954d2780a14a88891fa0dd890c8 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Fri, 24 Feb 2023 11:14:36 -0800 Subject: [PATCH 080/139] Add libclang_rt.ubsan_standalone to all debug builds This is needed to run tests that use `sanitize: { undefined: true }`. Test: run test that needs ubsan on cf_x86_64_phone without this change: fails to link with this change: works Bug: 255414852 Change-Id: Id5d3be9bafcc4dbaaf59ca55728ffc40b5cc4af5 --- target/product/base_system.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 9b76de8e0d..360102cf33 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -392,6 +392,7 @@ PRODUCT_PACKAGES_DEBUG := \ iperf3 \ iw \ layertracegenerator \ + libclang_rt.ubsan_standalone \ logpersist.start \ logtagd.rc \ procrank \ From b3b72e8910f123a0708752ed9d1dfb08dc57b966 Mon Sep 17 00:00:00 2001 From: Roberto Gil Date: Wed, 1 Mar 2023 11:08:13 +0000 Subject: [PATCH 081/139] Bump SDK Extension version to 6 This bump includes Adservices Bug: 271242945 Test: The build passes Ignore-AOSP-first: Finalization is not perform in AOSP Change-Id: I0a9b2f9329a176732f9567a5602e902958555304 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 649032b60f..3df3fb3663 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -78,7 +78,7 @@ endif .KATI_READONLY := PLATFORM_SDK_VERSION # This is the sdk extension version of this tree. -PLATFORM_SDK_EXTENSION_VERSION := 5 +PLATFORM_SDK_EXTENSION_VERSION := 6 .KATI_READONLY := PLATFORM_SDK_EXTENSION_VERSION # This is the sdk extension version that PLATFORM_SDK_VERSION ships with. From 44f6963cb06706d854a155435eb52ffddb04ae4d Mon Sep 17 00:00:00 2001 From: Roberto Gil Del Sol Date: Mon, 13 Mar 2023 08:33:02 +0000 Subject: [PATCH 082/139] Revert "Bump SDK Extension version to 6" This reverts commit b3b72e8910f123a0708752ed9d1dfb08dc57b966. Reason for revert: Due to lack of testing extServices needs to deboard M-05 train and sdk finalization needs to be reverted Change-Id: I278a499b5c30f13617c134ce27a43a8ffa32e099 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 3df3fb3663..649032b60f 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -78,7 +78,7 @@ endif .KATI_READONLY := PLATFORM_SDK_VERSION # This is the sdk extension version of this tree. -PLATFORM_SDK_EXTENSION_VERSION := 6 +PLATFORM_SDK_EXTENSION_VERSION := 5 .KATI_READONLY := PLATFORM_SDK_EXTENSION_VERSION # This is the sdk extension version that PLATFORM_SDK_VERSION ships with. From f109ea74c7cbb11dfe7bfdfc4d0c42e760535505 Mon Sep 17 00:00:00 2001 From: Jiakai Zhang Date: Thu, 19 Jan 2023 12:05:20 +0800 Subject: [PATCH 083/139] Turn on ART Service. Bug: 272053358 Test: Presubmit Change-Id: Ief92fd8bc759e674c7fb2fcec71233c0f3c88946 Ignore-AOSP-First: ART Service is a new feature only in internal. --- target/product/runtime_libart.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/product/runtime_libart.mk b/target/product/runtime_libart.mk index 39666ead68..68ed2494dc 100644 --- a/target/product/runtime_libart.mk +++ b/target/product/runtime_libart.mk @@ -175,3 +175,6 @@ ifeq (false,$(ART_MODULE_BUILD_FROM_SOURCE)) system/framework/%.odex \ system/framework/%.vdex endif + +PRODUCT_SYSTEM_PROPERTIES += \ + dalvik.vm.useartservice=true From 681222dc119d57c392cb65e81ef1b2c2013a7cc7 Mon Sep 17 00:00:00 2001 From: Jiakai Zhang Date: Thu, 16 Mar 2023 13:38:32 +0000 Subject: [PATCH 084/139] Revert "Turn on ART Service." This reverts commit f109ea74c7cbb11dfe7bfdfc4d0c42e760535505. Reason for revert: Broke a lot of things. Change-Id: If9db83e6b2ac533560e9ab996695619901f29dbf --- target/product/runtime_libart.mk | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/product/runtime_libart.mk b/target/product/runtime_libart.mk index 68ed2494dc..39666ead68 100644 --- a/target/product/runtime_libart.mk +++ b/target/product/runtime_libart.mk @@ -175,6 +175,3 @@ ifeq (false,$(ART_MODULE_BUILD_FROM_SOURCE)) system/framework/%.odex \ system/framework/%.vdex endif - -PRODUCT_SYSTEM_PROPERTIES += \ - dalvik.vm.useartservice=true From 95b546475f29747f11cb8448131bdeeb4a2c39fe Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Fri, 17 Mar 2023 22:19:08 +0000 Subject: [PATCH 085/139] Add rkpd to the list of individually toggleable modules This is needed because the rkpd module is optional at runtime and so needs to be optional at build time. Ignore-AOSP-First: rkpd only exists internally Bug: 259958590 Test: # Add prebuilts for the rkpd module. m MODULE_BUILD_FROM_SOURCE=true droid m MODULE_BUILD_FROM_SOURCE=false droid # Make sure that they build from sources and prebuilts respectively. Change-Id: Id0c0e482e2928d57a1bb6ee4f3bcd143ca15122c --- core/android_soong_config_vars.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/core/android_soong_config_vars.mk b/core/android_soong_config_vars.mk index b4fc2556d5..c19b995150 100644 --- a/core/android_soong_config_vars.mk +++ b/core/android_soong_config_vars.mk @@ -81,6 +81,7 @@ endif INDIVIDUALLY_TOGGLEABLE_PREBUILT_MODULES := \ btservices \ permission \ + rkpd \ uwb \ wifi \ From b32ce6f50edd1ca31295d053190d2dd170531708 Mon Sep 17 00:00:00 2001 From: Jiakai Zhang Date: Thu, 16 Mar 2023 21:10:31 +0000 Subject: [PATCH 086/139] Turn on ART Service. Bug: 272053358 Test: CTS, GTS, Platinum, and full test mapping (See http://b/272053358#comment9) Ignore-AOSP-First: ART Service is a new feature only in internal. Change-Id: Ide4f81efb021ff05178dd5395fad6091a89cf6da --- target/product/runtime_libart.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/product/runtime_libart.mk b/target/product/runtime_libart.mk index 39666ead68..68ed2494dc 100644 --- a/target/product/runtime_libart.mk +++ b/target/product/runtime_libart.mk @@ -175,3 +175,6 @@ ifeq (false,$(ART_MODULE_BUILD_FROM_SOURCE)) system/framework/%.odex \ system/framework/%.vdex endif + +PRODUCT_SYSTEM_PROPERTIES += \ + dalvik.vm.useartservice=true From eb9dc3e1a08b1fa7257bcd8a641e4c08772ab693 Mon Sep 17 00:00:00 2001 From: Pascal Muetschard Date: Thu, 23 Mar 2023 10:18:02 +0100 Subject: [PATCH 087/139] Adds the gpu_counter_producer command. This is a small binary that will load a GPU vendor provided shared library called libgpudataproducer.so, look for the "start" symbol in that library, and call it. This can be used to start the GPU hardware counter Perfetto producer that will allow tracing of GPU profiling data via Perfetto. Test: manual Bug: b/273907878 Ignore-AOSP-First: change in topic with internal-first project Change-Id: I450e159c4d4c323ade90ffa46759239a7bcd4aac --- target/product/base_vendor.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/base_vendor.mk b/target/product/base_vendor.mk index 3c4d62ea91..97809c295d 100644 --- a/target/product/base_vendor.mk +++ b/target/product/base_vendor.mk @@ -51,6 +51,7 @@ PRODUCT_PACKAGES += \ dumpsys_vendor \ fs_config_files_nonsystem \ fs_config_dirs_nonsystem \ + gpu_counter_producer \ gralloc.default \ group_odm \ group_vendor \ From 1669b364b5e52deadfa6bbfc7fb6a83e2351ff41 Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Mon, 27 Mar 2023 19:38:47 +0000 Subject: [PATCH 088/139] Update generic system makefile to use the AIDL Wifi Vendor HAL. Bug: 274964641 Test: Pre-submit tests Ignore-AOSP-First: AIDL HAL is not in AOSP yet. Change-Id: Id4af079389d5adf8380431da01a1d7f36bb1510d --- target/product/generic_system.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/product/generic_system.mk b/target/product/generic_system.mk index ce4e5f3fe2..98d6046854 100644 --- a/target/product/generic_system.mk +++ b/target/product/generic_system.mk @@ -68,7 +68,7 @@ PRODUCT_PACKAGES += \ android.hardware.radio.config@1.0 \ android.hardware.radio.deprecated@1.0 \ android.hardware.secure_element@1.0 \ - android.hardware.wifi@1.0 \ + android.hardware.wifi \ libaudio-resampler \ libaudiohal \ libdrm \ From b3300a79f60d3d9d1b228286a9554ad194632691 Mon Sep 17 00:00:00 2001 From: Roberto Gil Date: Tue, 4 Apr 2023 11:53:45 +0000 Subject: [PATCH 089/139] Bump SDK Extension version to 6 This bump includes Adservices, Extservices Bug: 276851559 Test: The build passes Ignore-AOSP-first: Finalization is not perform in AOSP Change-Id: I3b087f0d98212a62728d78b10e4c520ca6745cca --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index afdc61f40b..de01c3ac7e 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -78,7 +78,7 @@ endif .KATI_READONLY := PLATFORM_SDK_VERSION # This is the sdk extension version of this tree. -PLATFORM_SDK_EXTENSION_VERSION := 5 +PLATFORM_SDK_EXTENSION_VERSION := 6 .KATI_READONLY := PLATFORM_SDK_EXTENSION_VERSION # This is the sdk extension version that PLATFORM_SDK_VERSION ships with. From c3c48ca2400bc918706fd9e7cae6c17008e33b8d Mon Sep 17 00:00:00 2001 From: Alex Buynytskyy Date: Wed, 5 Apr 2023 17:22:30 +0000 Subject: [PATCH 090/139] Set master finalization bug to 275409981. Ignore-AOSP-First: UpsideDownCake Finalization Bug: 275409981 Test: builds Change-Id: Iab70de07b5a46de0e2fd6b56c648c168ac0ebe6a --- tools/finalization/environment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/finalization/environment.sh b/tools/finalization/environment.sh index 14951b8628..37ae5c3588 100755 --- a/tools/finalization/environment.sh +++ b/tools/finalization/environment.sh @@ -2,7 +2,7 @@ set -ex -export FINAL_BUG_ID='0' +export FINAL_BUG_ID='275409981' export FINAL_PLATFORM_CODENAME='UpsideDownCake' export CURRENT_PLATFORM_CODENAME='UpsideDownCake' From e7dc4736dc8c890f443a4dd1ad654d2e0b6feb84 Mon Sep 17 00:00:00 2001 From: Alex Buynytskyy Date: Tue, 4 Apr 2023 19:52:21 +0000 Subject: [PATCH 091/139] UpsideDownCake is now 34 Ignore-AOSP-First: UpsideDownCake Finalization Bug: 275409981 Test: build Change-Id: I956555f9e767cca52a410536a9cd832e9f7a0f05 --- core/config.mk | 2 +- core/version_defaults.mk | 6 +- target/product/gsi/34.txt | 210 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+), 4 deletions(-) create mode 100644 target/product/gsi/34.txt diff --git a/core/config.mk b/core/config.mk index 26e90efe9e..e86c4fd578 100644 --- a/core/config.mk +++ b/core/config.mk @@ -828,7 +828,7 @@ BUILD_DATETIME_FROM_FILE := $$(cat $(BUILD_DATETIME_FILE)) # is made which breaks compatibility with the previous platform sepolicy version, # not just on every increase in PLATFORM_SDK_VERSION. The minor version should # be reset to 0 on every bump of the PLATFORM_SDK_VERSION. -sepolicy_major_vers := 33 +sepolicy_major_vers := 34 sepolicy_minor_vers := 0 ifneq ($(sepolicy_major_vers), $(PLATFORM_SDK_VERSION)) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 06c0675a61..cb4f845450 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -48,7 +48,7 @@ MAX_PLATFORM_VERSION := VP1A # The last stable version name of the platform that was released. During # development, this stays at that previous version, while the codename indicates # further work based on the previous version. -PLATFORM_VERSION_LAST_STABLE := 13 +PLATFORM_VERSION_LAST_STABLE := 14 .KATI_READONLY := PLATFORM_VERSION_LAST_STABLE # These are the current development codenames, if the build is not a final @@ -74,12 +74,12 @@ ifndef PLATFORM_SDK_VERSION # When you increment the PLATFORM_SDK_VERSION please ensure you also # clear out the following text file of all older PLATFORM_VERSION's: # cts/tests/tests/os/assets/platform_versions.txt - PLATFORM_SDK_VERSION := 33 + PLATFORM_SDK_VERSION := 34 endif .KATI_READONLY := PLATFORM_SDK_VERSION # This is the sdk extension version of this tree. -PLATFORM_SDK_EXTENSION_VERSION := 6 +PLATFORM_SDK_EXTENSION_VERSION := 7 .KATI_READONLY := PLATFORM_SDK_EXTENSION_VERSION # This is the sdk extension version that PLATFORM_SDK_VERSION ships with. diff --git a/target/product/gsi/34.txt b/target/product/gsi/34.txt new file mode 100644 index 0000000000..ceb2060c19 --- /dev/null +++ b/target/product/gsi/34.txt @@ -0,0 +1,210 @@ +LLNDK: libEGL.so +LLNDK: libGLESv1_CM.so +LLNDK: libGLESv2.so +LLNDK: libGLESv3.so +LLNDK: libRS.so +LLNDK: libandroid_net.so +LLNDK: libbinder_ndk.so +LLNDK: libc.so +LLNDK: libcgrouprc.so +LLNDK: libcom.android.tethering.connectivity_native.so +LLNDK: libdl.so +LLNDK: libft2.so +LLNDK: liblog.so +LLNDK: libm.so +LLNDK: libmediandk.so +LLNDK: libnativewindow.so +LLNDK: libneuralnetworks.so +LLNDK: libselinux.so +LLNDK: libsync.so +LLNDK: libvndksupport.so +LLNDK: libvulkan.so +VNDK-SP: android.hardware.common-V2-ndk.so +VNDK-SP: android.hardware.common.fmq-V1-ndk.so +VNDK-SP: android.hardware.graphics.common-V4-ndk.so +VNDK-SP: android.hardware.graphics.common@1.0.so +VNDK-SP: android.hardware.graphics.common@1.1.so +VNDK-SP: android.hardware.graphics.common@1.2.so +VNDK-SP: android.hardware.graphics.composer3-V1-ndk.so +VNDK-SP: android.hardware.graphics.mapper@2.0.so +VNDK-SP: android.hardware.graphics.mapper@2.1.so +VNDK-SP: android.hardware.graphics.mapper@3.0.so +VNDK-SP: android.hardware.graphics.mapper@4.0.so +VNDK-SP: android.hardware.graphics.allocator-V2-ndk.so +VNDK-SP: android.hardware.renderscript@1.0.so +VNDK-SP: android.hidl.memory.token@1.0.so +VNDK-SP: android.hidl.memory@1.0-impl.so +VNDK-SP: android.hidl.memory@1.0.so +VNDK-SP: android.hidl.safe_union@1.0.so +VNDK-SP: libRSCpuRef.so +VNDK-SP: libRSDriver.so +VNDK-SP: libRS_internal.so +VNDK-SP: libbase.so +VNDK-SP: libbcinfo.so +VNDK-SP: libblas.so +VNDK-SP: libc++.so +VNDK-SP: libcompiler_rt.so +VNDK-SP: libcutils.so +VNDK-SP: libdmabufheap.so +VNDK-SP: libgralloctypes.so +VNDK-SP: libhardware.so +VNDK-SP: libhidlbase.so +VNDK-SP: libhidlmemory.so +VNDK-SP: libion.so +VNDK-SP: libjsoncpp.so +VNDK-SP: liblzma.so +VNDK-SP: libprocessgroup.so +VNDK-SP: libunwindstack.so +VNDK-SP: libutils.so +VNDK-SP: libutilscallstack.so +VNDK-SP: libz.so +VNDK-core: android.frameworks.cameraservice.common-V1-ndk.so +VNDK-core: android.frameworks.cameraservice.device-V1-ndk.so +VNDK-core: android.frameworks.cameraservice.service-V1-ndk.so +VNDK-core: android.hardware.audio.common@2.0.so +VNDK-core: android.hardware.configstore-utils.so +VNDK-core: android.hardware.configstore@1.0.so +VNDK-core: android.hardware.configstore@1.1.so +VNDK-core: android.hardware.confirmationui-support-lib.so +VNDK-core: android.hardware.graphics.allocator@2.0.so +VNDK-core: android.hardware.graphics.allocator@3.0.so +VNDK-core: android.hardware.graphics.allocator@4.0.so +VNDK-core: android.hardware.graphics.bufferqueue@1.0.so +VNDK-core: android.hardware.graphics.bufferqueue@2.0.so +VNDK-core: android.hardware.media.bufferpool@2.0.so +VNDK-core: android.hardware.media.omx@1.0.so +VNDK-core: android.hardware.media@1.0.so +VNDK-core: android.hardware.memtrack-V1-ndk.so +VNDK-core: android.hardware.memtrack@1.0.so +VNDK-core: android.hardware.soundtrigger@2.0-core.so +VNDK-core: android.hardware.soundtrigger@2.0.so +VNDK-core: android.hidl.token@1.0-utils.so +VNDK-core: android.hidl.token@1.0.so +VNDK-core: android.system.suspend-V1-ndk.so +VNDK-core: android.system.suspend@1.0.so +VNDK-core: libaudioroute.so +VNDK-core: libaudioutils.so +VNDK-core: libbinder.so +VNDK-core: libbufferqueueconverter.so +VNDK-core: libcamera_metadata.so +VNDK-core: libcap.so +VNDK-core: libcn-cbor.so +VNDK-core: libcodec2.so +VNDK-core: libcrypto.so +VNDK-core: libcrypto_utils.so +VNDK-core: libcurl.so +VNDK-core: libdiskconfig.so +VNDK-core: libdumpstateutil.so +VNDK-core: libevent.so +VNDK-core: libexif.so +VNDK-core: libexpat.so +VNDK-core: libfmq.so +VNDK-core: libgatekeeper.so +VNDK-core: libgui.so +VNDK-core: libhardware_legacy.so +VNDK-core: libhidlallocatorutils.so +VNDK-core: libjpeg.so +VNDK-core: libldacBT_abr.so +VNDK-core: libldacBT_enc.so +VNDK-core: liblz4.so +VNDK-core: libmedia_helper.so +VNDK-core: libmedia_omx.so +VNDK-core: libmemtrack.so +VNDK-core: libminijail.so +VNDK-core: libmkbootimg_abi_check.so +VNDK-core: libnetutils.so +VNDK-core: libnl.so +VNDK-core: libpcre2.so +VNDK-core: libpiex.so +VNDK-core: libpng.so +VNDK-core: libpower.so +VNDK-core: libprocinfo.so +VNDK-core: libradio_metadata.so +VNDK-core: libspeexresampler.so +VNDK-core: libsqlite.so +VNDK-core: libssl.so +VNDK-core: libstagefright_bufferpool@2.0.so +VNDK-core: libstagefright_bufferqueue_helper.so +VNDK-core: libstagefright_foundation.so +VNDK-core: libstagefright_omx.so +VNDK-core: libstagefright_omx_utils.so +VNDK-core: libstagefright_xmlparser.so +VNDK-core: libsysutils.so +VNDK-core: libtinyalsa.so +VNDK-core: libtinyxml2.so +VNDK-core: libui.so +VNDK-core: libusbhost.so +VNDK-core: libwifi-system-iface.so +VNDK-core: libxml2.so +VNDK-core: libyuv.so +VNDK-core: libziparchive.so +VNDK-private: libblas.so +VNDK-private: libcompiler_rt.so +VNDK-private: libft2.so +VNDK-private: libgui.so +VNDK-product: android.hardware.audio.common@2.0.so +VNDK-product: android.hardware.configstore@1.0.so +VNDK-product: android.hardware.configstore@1.1.so +VNDK-product: android.hardware.graphics.allocator@2.0.so +VNDK-product: android.hardware.graphics.allocator@3.0.so +VNDK-product: android.hardware.graphics.allocator@4.0.so +VNDK-product: android.hardware.graphics.bufferqueue@1.0.so +VNDK-product: android.hardware.graphics.bufferqueue@2.0.so +VNDK-product: android.hardware.graphics.common@1.0.so +VNDK-product: android.hardware.graphics.common@1.1.so +VNDK-product: android.hardware.graphics.common@1.2.so +VNDK-product: android.hardware.graphics.mapper@2.0.so +VNDK-product: android.hardware.graphics.mapper@2.1.so +VNDK-product: android.hardware.graphics.mapper@3.0.so +VNDK-product: android.hardware.graphics.mapper@4.0.so +VNDK-product: android.hardware.media.bufferpool@2.0.so +VNDK-product: android.hardware.media.omx@1.0.so +VNDK-product: android.hardware.media@1.0.so +VNDK-product: android.hardware.memtrack@1.0.so +VNDK-product: android.hardware.renderscript@1.0.so +VNDK-product: android.hardware.soundtrigger@2.0.so +VNDK-product: android.hidl.memory.token@1.0.so +VNDK-product: android.hidl.memory@1.0.so +VNDK-product: android.hidl.safe_union@1.0.so +VNDK-product: android.hidl.token@1.0.so +VNDK-product: android.system.suspend@1.0.so +VNDK-product: libaudioutils.so +VNDK-product: libbase.so +VNDK-product: libc++.so +VNDK-product: libcamera_metadata.so +VNDK-product: libcap.so +VNDK-product: libcompiler_rt.so +VNDK-product: libcrypto.so +VNDK-product: libcurl.so +VNDK-product: libcutils.so +VNDK-product: libevent.so +VNDK-product: libexpat.so +VNDK-product: libfmq.so +VNDK-product: libhidlbase.so +VNDK-product: libhidlmemory.so +VNDK-product: libion.so +VNDK-product: libjpeg.so +VNDK-product: libjsoncpp.so +VNDK-product: libldacBT_abr.so +VNDK-product: libldacBT_enc.so +VNDK-product: liblz4.so +VNDK-product: liblzma.so +VNDK-product: libminijail.so +VNDK-product: libnl.so +VNDK-product: libpcre2.so +VNDK-product: libpiex.so +VNDK-product: libpng.so +VNDK-product: libprocessgroup.so +VNDK-product: libprocinfo.so +VNDK-product: libspeexresampler.so +VNDK-product: libssl.so +VNDK-product: libtinyalsa.so +VNDK-product: libtinyxml2.so +VNDK-product: libunwindstack.so +VNDK-product: libutils.so +VNDK-product: libutilscallstack.so +VNDK-product: libwifi-system-iface.so +VNDK-product: libxml2.so +VNDK-product: libyuv.so +VNDK-product: libz.so +VNDK-product: libziparchive.so From a89bae363d0e9a8546cecac180652793a02b1cef Mon Sep 17 00:00:00 2001 From: Alex Buynytskyy Date: Wed, 12 Apr 2023 10:10:20 -0700 Subject: [PATCH 092/139] Switch udc-dev to 'sdk finalized' mode. Bug: 243966946 Test: run locally Change-Id: I46026e5fe0c8442caee277a97d7777ec9631c578 --- tools/finalization/environment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/finalization/environment.sh b/tools/finalization/environment.sh index aa3dc6a122..796ccc6c39 100755 --- a/tools/finalization/environment.sh +++ b/tools/finalization/environment.sh @@ -18,4 +18,4 @@ export FINAL_MAINLINE_EXTENSION='7' # 'unfinalized' - branch is in development state, # 'sdk' - SDK/API is finalized # 'rel' - branch is finalized, switched to REL -export FINAL_STATE='unfinalized' +export FINAL_STATE='sdk' From ebce49601af0dfe77dcfa69ddb10bbb862c8c747 Mon Sep 17 00:00:00 2001 From: Vinh Tran Date: Wed, 12 Apr 2023 17:48:34 -0400 Subject: [PATCH 093/139] Split PRODUCT_AFDO_PROFILES into two variables Currently, PRODUCT_AFDO_PROFILES is generally applied to all products and is not semantically treated as a product config varilable. Splitting this allows us: 1. Explicitly tell that PRODUCT_AFDO_PROFILES takes precedence over product-agnostic profiles in AFDO_PROFILES 2. Add PRODUCT_AFDO_PROFILES to _product_vars_list Ignore-AOSP-First: ag/22604900 in the same topic is in internal repo Test: Define PRODUCT_AFDO_PROFILES in a product config and make sure it appears first in the soong var AfdoProfiles Bug: 277215393 Change-Id: I284f6308d456994bb72129cb0d7be7cd091993ae --- core/product.mk | 2 ++ core/soong_config.mk | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/product.mk b/core/product.mk index ed10604490..1789561caf 100644 --- a/core/product.mk +++ b/core/product.mk @@ -395,6 +395,8 @@ _product_list_vars += PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS # supports it _product_single_value_vars += PRODUCT_ENABLE_UFFD_GC +_product_list_vars += PRODUCT_AFDO_PROFILES + .KATI_READONLY := _product_single_value_vars _product_list_vars _product_var_list :=$= $(_product_single_value_vars) $(_product_list_vars) diff --git a/core/soong_config.mk b/core/soong_config.mk index a3961f9ed6..346edcf9ae 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -12,7 +12,15 @@ endif include $(BUILD_SYSTEM)/art_config.mk include $(BUILD_SYSTEM)/dex_preopt_config.mk +ifndef AFDO_PROFILES +# Set AFDO_PROFILES -include vendor/google_data/pgo_profile/sampling/afdo_profiles.mk +else +$(error AFDO_PROFILES can only be set from soong_config.mk. For product-specific fdo_profiles, please use PRODUCT_AFDO_PROFILES) +endif + +# PRODUCT_AFDO_PROFILES takes precedence over product-agnostic profiles in AFDO_PROFILES +ALL_AFDO_PROFILES := $(PRODUCT_AFDO_PROFILES) $(AFDO_PROFILES) ifeq ($(WRITE_SOONG_VARIABLES),true) @@ -311,7 +319,7 @@ $(call add_json_bool, IgnorePrefer32OnDevice, $(filter true,$(IGNORE_PREFER32_ON $(call add_json_list, IncludeTags, $(PRODUCT_INCLUDE_TAGS)) $(call add_json_list, SourceRootDirs, $(PRODUCT_SOURCE_ROOT_DIRS)) -$(call add_json_list, AfdoProfiles, $(PRODUCT_AFDO_PROFILES)) +$(call add_json_list, AfdoProfiles, $(ALL_AFDO_PROFILES)) $(call json_end) From 20466aa978bdc4e7224039b28e177f1c3841d156 Mon Sep 17 00:00:00 2001 From: Alex Buynytskyy Date: Fri, 21 Apr 2023 18:31:47 +0000 Subject: [PATCH 094/139] [RESTRICT AUTOMERGE] UpsideDownCake/34 is now REL Ignore-AOSP-First: UpsideDownCake Finalization Bug: 275409981 Test: build Change-Id: I4b5e9939b60cde7482021fc1d0aede38a99493c1 Merged-In: I4b5e9939b60cde7482021fc1d0aede38a99493c1 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index bcbdeeb012..cb79fe25cc 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -53,7 +53,7 @@ PLATFORM_VERSION_LAST_STABLE := 14 # 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.UP1A := UpsideDownCake +PLATFORM_VERSION_CODENAME.UP1A := REL PLATFORM_VERSION_CODENAME.VP1A := VanillaIceCream # This is the user-visible version. In a final release build it should From 4d3070c6eed7ebbbb3c5b4bc7dc78b304a68a45c Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 18 Jan 2023 13:47:11 -0800 Subject: [PATCH 095/139] Update PLATFORM_VERSION to VP1A Update PLATFORM_VERSION to VP1A. The codename is now VanillaIceCream. Bug: 264658905 Test: m checkbuild Change-Id: Ibc24c10cf040407d79662c1819beaf97da791efb Merged-In: Ibc24c10cf040407d79662c1819beaf97da791efb --- core/version_defaults.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index bcbdeeb012..7824c1764f 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -40,7 +40,7 @@ ifdef INTERNAL_BUILD_ID_MAKEFILE include $(INTERNAL_BUILD_ID_MAKEFILE) endif -DEFAULT_PLATFORM_VERSION := UP1A +DEFAULT_PLATFORM_VERSION := VP1A .KATI_READONLY := DEFAULT_PLATFORM_VERSION MIN_PLATFORM_VERSION := UP1A MAX_PLATFORM_VERSION := VP1A @@ -91,7 +91,7 @@ PLATFORM_VERSION_KNOWN_CODENAMES := \ Base Base11 Cupcake Donut Eclair Eclair01 EclairMr1 Froyo Gingerbread GingerbreadMr1 \ Honeycomb HoneycombMr1 HoneycombMr2 IceCreamSandwich IceCreamSandwichMr1 \ JellyBean JellyBeanMr1 JellyBeanMr2 Kitkat KitkatWatch Lollipop LollipopMr1 M N NMr1 O OMr1 P \ -Q R S Sv2 Tiramisu UpsideDownCake +Q R S Sv2 Tiramisu UpsideDownCake VanillaIceCream # Convert from space separated list to comma separated PLATFORM_VERSION_KNOWN_CODENAMES := \ From 657af614c660cc6291249fe4195772713aec3f2f Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Fri, 21 Apr 2023 09:46:47 -0700 Subject: [PATCH 096/139] Fix incremental OTA generation failures source_file might be a directory, use the _ReadApexInfo() helper function to read it instead of go straight to zipfiles. Test: build incremental OTA for pixel Bug: 279142680 Bug: 227848550 Bug: 277028723 (cherry picked from https://android-review.googlesource.com/q/commit:ca45d7a85d5eaf09ba8684f09440e8706ab190ca) Merged-In: Ia0041e2c72c1a57123519c970f6e734194a81cd2 Change-Id: Ia0041e2c72c1a57123519c970f6e734194a81cd2 --- tools/releasetools/ota_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/releasetools/ota_utils.py b/tools/releasetools/ota_utils.py index 80a6c7a39b..3291d56328 100644 --- a/tools/releasetools/ota_utils.py +++ b/tools/releasetools/ota_utils.py @@ -642,8 +642,7 @@ def ConstructOtaApexInfo(target_zip, source_file=None): if not source_file: return target_apex_string - with zipfile.ZipFile(source_file, "r", allowZip64=True) as source_zip: - source_apex_string = _ReadApexInfo(source_zip) + source_apex_string = _ReadApexInfo(source_file) if not source_apex_string: return target_apex_string From 91fe424ecf563a5136891e2e0c83b4c9d13557b0 Mon Sep 17 00:00:00 2001 From: Alex Buynytskyy Date: Fri, 21 Apr 2023 18:31:47 +0000 Subject: [PATCH 097/139] [RESTRICT AUTOMERGE] UpsideDownCake/34 is now REL Ignore-AOSP-First: UpsideDownCake Finalization Bug: 275409981 Test: build Change-Id: I4b5e9939b60cde7482021fc1d0aede38a99493c1 Merged-In: I4b5e9939b60cde7482021fc1d0aede38a99493c1 From 33376577bf9261868a97106373b8b40a654c43e2 Mon Sep 17 00:00:00 2001 From: Pranav Gupta Date: Tue, 18 Apr 2023 22:29:26 -0700 Subject: [PATCH 098/139] Remove MODULE_BUILD_FROM_SOURCE for gsi_release.mk The gsi_release.mk should be agnostic of AOSP or Android. In case of Android builds, modules should be prebuilt, however in the case of AOSP they can be built from source. This option should now be configured at the product makefile level Also update the shipping API to 34 Bug: 278607630 Test: TARGET_PRODUCT=gsi_arm64 TARGET_BUILD_VARIANT=userdebug build/soong/soong_ui.bash --dumpvar-mode MODULE_BUILD_FROM_SOURCE returns true TARGET_PRODUCT=gsi_arm64 TARGET_BUILD_VARIANT=userdebug MODULE_BUILD_FROM_SOURCE=false build/soong/soong_ui.bash --dumpvar-mode MODULE_BUILD_FROM_SOURCE returns false (cherry picked from https://android-review.googlesource.com/q/commit:105610bdf04b12404026e3b52f272688099eda93) Merged-In: I5937764d8df307ed7547363e6ba2742828779282 Change-Id: I5937764d8df307ed7547363e6ba2742828779282 --- target/product/aosp_64bitonly_x86_64.mk | 3 +++ target/product/aosp_arm.mk | 3 +++ target/product/aosp_arm64.mk | 3 +++ target/product/aosp_riscv64.mk | 3 +++ target/product/aosp_x86.mk | 3 +++ target/product/aosp_x86_64.mk | 3 +++ target/product/gsi_release.mk | 5 +---- 7 files changed, 19 insertions(+), 4 deletions(-) diff --git a/target/product/aosp_64bitonly_x86_64.mk b/target/product/aosp_64bitonly_x86_64.mk index b8ca3aa634..75fd3c8f17 100644 --- a/target/product/aosp_64bitonly_x86_64.mk +++ b/target/product/aosp_64bitonly_x86_64.mk @@ -58,6 +58,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_x86_64/device.mk) # Special settings for GSI releasing # ifeq (aosp_64bitonly_x86_64,$(TARGET_PRODUCT)) +# Build modules from source if this has not been pre-configured +MODULE_BUILD_FROM_SOURCE ?= true + $(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk) endif diff --git a/target/product/aosp_arm.mk b/target/product/aosp_arm.mk index 5f200aafb6..61c13169b9 100644 --- a/target/product/aosp_arm.mk +++ b/target/product/aosp_arm.mk @@ -57,6 +57,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_x86/device.mk) # Special settings for GSI releasing # ifeq (aosp_arm,$(TARGET_PRODUCT)) +# Build modules from source if this has not been pre-configured +MODULE_BUILD_FROM_SOURCE ?= true + $(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk) endif diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk index ffc37a9bd2..6c907db0ed 100644 --- a/target/product/aosp_arm64.mk +++ b/target/product/aosp_arm64.mk @@ -62,6 +62,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/non_ab_device.mk) # Special settings for GSI releasing # ifeq (aosp_arm64,$(TARGET_PRODUCT)) +# Build modules from source if this has not been pre-configured +MODULE_BUILD_FROM_SOURCE ?= true + $(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk) endif diff --git a/target/product/aosp_riscv64.mk b/target/product/aosp_riscv64.mk index 0e5d9fec07..270a989620 100644 --- a/target/product/aosp_riscv64.mk +++ b/target/product/aosp_riscv64.mk @@ -53,6 +53,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_riscv64/device.mk) # Special settings for GSI releasing # ifeq (aosp_riscv64,$(TARGET_PRODUCT)) +# Build modules from source if this has not been pre-configured +MODULE_BUILD_FROM_SOURCE ?= true + $(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk) endif diff --git a/target/product/aosp_x86.mk b/target/product/aosp_x86.mk index 669874e3ad..a2f0390c22 100644 --- a/target/product/aosp_x86.mk +++ b/target/product/aosp_x86.mk @@ -55,6 +55,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_x86/device.mk) # Special settings for GSI releasing # ifeq (aosp_x86,$(TARGET_PRODUCT)) +# Build modules from source if this has not been pre-configured +MODULE_BUILD_FROM_SOURCE ?= true + $(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk) endif diff --git a/target/product/aosp_x86_64.mk b/target/product/aosp_x86_64.mk index deaa3b1df3..535ee3f0a7 100644 --- a/target/product/aosp_x86_64.mk +++ b/target/product/aosp_x86_64.mk @@ -64,6 +64,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/non_ab_device.mk) # Special settings for GSI releasing # ifeq (aosp_x86_64,$(TARGET_PRODUCT)) +# Build modules from source if this has not been pre-configured +MODULE_BUILD_FROM_SOURCE ?= true + $(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk) endif diff --git a/target/product/gsi_release.mk b/target/product/gsi_release.mk index 09d4bc9a6b..3b977927d1 100644 --- a/target/product/gsi_release.mk +++ b/target/product/gsi_release.mk @@ -36,7 +36,7 @@ PRODUCT_ARTIFACT_PATH_REQUIREMENT_ALLOWED_LIST += \ # GSI should always support up-to-date platform features. # Keep this value at the latest API level to ensure latest build system # default configs are applied. -PRODUCT_SHIPPING_API_LEVEL := 31 +PRODUCT_SHIPPING_API_LEVEL := 34 # Enable dynamic partitions to facilitate mixing onto Cuttlefish PRODUCT_USE_DYNAMIC_PARTITIONS := true @@ -88,9 +88,6 @@ PRODUCT_BUILD_SUPER_EMPTY_IMAGE := false PRODUCT_BUILD_SYSTEM_DLKM_IMAGE := false PRODUCT_EXPORT_BOOT_IMAGE_TO_DIST := true -# Always build modules from source -MODULE_BUILD_FROM_SOURCE := true - # Additional settings used in all GSI builds PRODUCT_PRODUCT_PROPERTIES += \ ro.crypto.metadata_init_delete_all_keys.enabled=false \ From 44395a813898e89e3f83d3cf0657d4d6e00f1ccc Mon Sep 17 00:00:00 2001 From: Alex Buynytskyy Date: Wed, 26 Apr 2023 05:17:13 +0000 Subject: [PATCH 099/139] Mark udc-dev as finalized branch. Ignore-AOSP-First: This CL is only meant internal udc-dev at this time. Test: ./build-step-1-and-m.sh Bug: 279615150 Change-Id: I9920da7605cf6861742607a62222287f0c79b003 --- tools/finalization/environment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/finalization/environment.sh b/tools/finalization/environment.sh index 796ccc6c39..d95bea05db 100755 --- a/tools/finalization/environment.sh +++ b/tools/finalization/environment.sh @@ -18,4 +18,4 @@ export FINAL_MAINLINE_EXTENSION='7' # 'unfinalized' - branch is in development state, # 'sdk' - SDK/API is finalized # 'rel' - branch is finalized, switched to REL -export FINAL_STATE='sdk' +export FINAL_STATE='rel' From a3e0f4eed380438df94d206a4bad3929d85b9a97 Mon Sep 17 00:00:00 2001 From: William Loh Date: Wed, 26 Apr 2023 10:50:49 -0700 Subject: [PATCH 100/139] Add preinstalled-packages-asl-files.xml to base_system.mk Bug: 276979041 Test: None Change-Id: I8165f2c33245ef5e652a9fb3dc93711f518dd079 --- target/product/base_system.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 8918a80e3e..10f2995fab 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -242,6 +242,7 @@ PRODUCT_PACKAGES += \ platform.xml \ pm \ pppd \ + preinstalled-packages-asl-files.xml \ preinstalled-packages-platform.xml \ privapp-permissions-platform.xml \ prng_seeder \ From 3ef95f51738d3f4264406f12ce39e8ddd8506c13 Mon Sep 17 00:00:00 2001 From: Alex Buynytskyy Date: Wed, 26 Apr 2023 05:17:13 +0000 Subject: [PATCH 101/139] Mark master as VIC development branch. Test: ./build-step-1-and-m.sh Bug: 279615150 Change-Id: Idb485846345ea146c04c5ecf6eb4ab6eea122f9b (cherry picked from commit 576ca9f1621ea4e0196da062654b6f515fa2b111) --- tools/finalization/environment.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tools/finalization/environment.sh b/tools/finalization/environment.sh index 796ccc6c39..892361dd9c 100755 --- a/tools/finalization/environment.sh +++ b/tools/finalization/environment.sh @@ -2,20 +2,21 @@ set -ex -export FINAL_BUG_ID='275409981' +export FINAL_BUG_ID='0' # CI only -export FINAL_PLATFORM_CODENAME='UpsideDownCake' -export CURRENT_PLATFORM_CODENAME='UpsideDownCake' -export FINAL_PLATFORM_CODENAME_JAVA='UPSIDE_DOWN_CAKE' -export FINAL_PLATFORM_SDK_VERSION='34' -export FINAL_PLATFORM_VERSION='14' +export FINAL_PLATFORM_CODENAME='VanillaIceCream' +export CURRENT_PLATFORM_CODENAME='VanillaIceCream' +export FINAL_PLATFORM_CODENAME_JAVA='VANILLA_ICE_CREAM' +export FINAL_BUILD_PREFIX='VP1A' +export FINAL_PLATFORM_VERSION='15' -export FINAL_BUILD_PREFIX='UP1A' - -export FINAL_MAINLINE_EXTENSION='7' +# Set arbitrary large values for CI. +# Feel free to randomize them once in a while to detect buggy version detection code. +export FINAL_PLATFORM_SDK_VERSION='97' +export FINAL_MAINLINE_EXTENSION='98' # Options: # 'unfinalized' - branch is in development state, # 'sdk' - SDK/API is finalized # 'rel' - branch is finalized, switched to REL -export FINAL_STATE='sdk' +export FINAL_STATE='unfinalized' From 8a1cdb8e9564b191f5cb89340ab637ab218315a5 Mon Sep 17 00:00:00 2001 From: Martijn Coenen Date: Mon, 3 Apr 2023 10:58:18 +0000 Subject: [PATCH 102/139] Add initial stopped state packages for AOSP products. AOSP starts with all apps exempt from the stopped state; apps without a launcher entry aren't stopped by default, and all AOSP apps that do have a launcher entry are contained in this sysconfig. Bug: 269129704 Test: Manually inspect Ignore-AOSP-First: Merge conflict from AOSP to internal master (and this needs to go to UDC, als) Change-Id: I752f986a210621510f694b3f62bb5c6151db55d6 --- target/product/aosp_product.mk | 1 + target/product/sysconfig/Android.bp | 6 +++ .../initial-package-stopped-states-aosp.xml | 51 +++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 target/product/sysconfig/initial-package-stopped-states-aosp.xml diff --git a/target/product/aosp_product.mk b/target/product/aosp_product.mk index e396ad11ff..a4c3a91145 100644 --- a/target/product/aosp_product.mk +++ b/target/product/aosp_product.mk @@ -29,6 +29,7 @@ PRODUCT_PRODUCT_PROPERTIES += \ # More AOSP packages PRODUCT_PACKAGES += \ + initial-package-stopped-states-aosp.xml \ messaging \ PhotoTable \ preinstalled-packages-platform-aosp-product.xml \ diff --git a/target/product/sysconfig/Android.bp b/target/product/sysconfig/Android.bp index 27ac8cf2b4..95042a707e 100644 --- a/target/product/sysconfig/Android.bp +++ b/target/product/sysconfig/Android.bp @@ -55,3 +55,9 @@ prebuilt_etc { src: "preinstalled-packages-platform-telephony-product.xml", } +prebuilt_etc { + name: "initial-package-stopped-states-aosp.xml", + product_specific: true, + sub_dir: "sysconfig", + src: "initial-package-stopped-states-aosp.xml", +} diff --git a/target/product/sysconfig/initial-package-stopped-states-aosp.xml b/target/product/sysconfig/initial-package-stopped-states-aosp.xml new file mode 100644 index 0000000000..f98493f093 --- /dev/null +++ b/target/product/sysconfig/initial-package-stopped-states-aosp.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + From 9dfc376c19bda53b12269b6023f3ac595e18aca0 Mon Sep 17 00:00:00 2001 From: Yuxin Hu Date: Tue, 25 Apr 2023 01:58:05 +0000 Subject: [PATCH 103/139] Use ro.gfx.angle.supported to indicate if ANGLE is built in vendor This is a change cherry-picked from aosp: https://r.android.com/2560175 Merged-In: I0fb881962ab77abd18f05d33393c4ee11694109c Bug: b/270994705 Test: m -j45; flash and check Pixel 7 boots fine atest CtsAngleIntegrationHostTestCases Change-Id: I4632ff64bc26623c796b992a71761a754149955a --- core/main.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/main.mk b/core/main.mk index e84dfaa3a1..f3523879ef 100644 --- a/core/main.mk +++ b/core/main.mk @@ -320,6 +320,10 @@ ADDITIONAL_VENDOR_PROPERTIES += \ ro.board.platform=$(TARGET_BOARD_PLATFORM) \ ro.hwui.use_vulkan=$(TARGET_USES_VULKAN) +# Set ro.gfx.angle.supported based on if ANGLE is installed in vendor partition +ADDITIONAL_VENDOR_PROPERTIES += \ + ro.gfx.angle.supported=$(USE_ANGLE) + ifdef TARGET_SCREEN_DENSITY ADDITIONAL_VENDOR_PROPERTIES += \ ro.sf.lcd_density=$(TARGET_SCREEN_DENSITY) From 6871bbf91ea92e86d82fcc2d56f2c8b89a06d670 Mon Sep 17 00:00:00 2001 From: Peiyong Lin Date: Wed, 26 Apr 2023 01:07:35 +0000 Subject: [PATCH 104/139] Properly define angle.mk Previously we used USE_ANGLE to determine whether the build should include ANGLE drivers, this patch consolidates that into a separate Makefile. Bug: b/270994705 Test: atest CtsAngleIntegrationHostTestCases Change-Id: I4d7ffb869ced219009446d907230178e4b940157 Merged-In: I4d7ffb869ced219009446d907230178e4b940157 --- core/main.mk | 4 ---- target/product/angle.mk | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 target/product/angle.mk diff --git a/core/main.mk b/core/main.mk index 6f0b927c85..09616d08dc 100644 --- a/core/main.mk +++ b/core/main.mk @@ -320,10 +320,6 @@ ADDITIONAL_VENDOR_PROPERTIES += \ ro.board.platform=$(TARGET_BOARD_PLATFORM) \ ro.hwui.use_vulkan=$(TARGET_USES_VULKAN) -# Set ro.gfx.angle.supported based on if ANGLE is installed in vendor partition -ADDITIONAL_VENDOR_PROPERTIES += \ - ro.gfx.angle.supported=$(USE_ANGLE) - ifdef TARGET_SCREEN_DENSITY ADDITIONAL_VENDOR_PROPERTIES += \ ro.sf.lcd_density=$(TARGET_SCREEN_DENSITY) diff --git a/target/product/angle.mk b/target/product/angle.mk new file mode 100644 index 0000000000..93b0e64777 --- /dev/null +++ b/target/product/angle.mk @@ -0,0 +1,26 @@ +# +# Copyright 2023 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. +# + +# To include ANGLE drivers into the build, add +# $(call inherit-product, $(SRC_TARGET_DIR)/product/angle.mk) to the Makefile. + +PRODUCT_PACKAGES += \ + libEGL_angle \ + libGLESv1_CM_angle \ + libGLESv2_angle + +# Set ro.gfx.angle.supported based on if ANGLE is installed in vendor partition +PRODUCT_VENDOR_PROPERTIES := ro.gfx.angle.supported=true From 4c9153bae082c6ee859d36390bfd99b347916683 Mon Sep 17 00:00:00 2001 From: Omar Eissa Date: Fri, 28 Apr 2023 14:43:34 +0000 Subject: [PATCH 105/139] Exclude apps from initial stopped state allow list Exclude apps that we have high confidence that force stopping them wouldn't be an issue given that they don't need to start until the user interacts with them. Bug: 269129704 Test: Manual Ignore-AOSP-First: Merge conflict from AOSP to internal master (and this needs to go to UDC, als) Change-Id: I363fbd4d899aed6772199b05fa763be3fa5f31b6 --- .../product/sysconfig/initial-package-stopped-states-aosp.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/target/product/sysconfig/initial-package-stopped-states-aosp.xml b/target/product/sysconfig/initial-package-stopped-states-aosp.xml index f98493f093..1704ff2c44 100644 --- a/target/product/sysconfig/initial-package-stopped-states-aosp.xml +++ b/target/product/sysconfig/initial-package-stopped-states-aosp.xml @@ -39,13 +39,9 @@ Example usage - - - - From 39e34a9defe50bbe883f243bd6c74414529f4895 Mon Sep 17 00:00:00 2001 From: Juan Yescas Date: Fri, 7 Apr 2023 23:46:43 -0700 Subject: [PATCH 106/139] 16k: Define PRODUCT_MAX_PAGE_SIZE_SUPPORTED flag The PRODUCT_MAX_PAGE_SIZE_SUPPORTED will be used to define the ELF segment alignment of the binaries (executables and shared libraries). The alignment is set based on these conditions: - If PRODUCT_MAX_PAGE_SIZE_SUPPORTED is defined, that value will be used to align the binaries. If not defined, see condition below: - If it is a low memory device, 4096 will be the alignment. If it is not low memory device, see conditon below: - If VSR vendor API level < 34, 4096 will be the alignment, otherwise it will be 65536. Test: Built for in Pixel 4a, 6 and verified the alignment with readelf. Bug: 276963698 Bug: 276801883 (cherry picked from https://android-review.googlesource.com/q/commit:e5c0c174d50e4fab5db797dc815a875d673eadac) Merged-In: I53a8902ab62e6d378aec84c28bc627f0e8a98500 Change-Id: I53a8902ab62e6d378aec84c28bc627f0e8a98500 --- core/config.mk | 45 ++++++++++++++++++++++++++++++++++++++++++++ core/product.mk | 8 +++++++- core/soong_config.mk | 1 + 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/core/config.mk b/core/config.mk index e86c4fd578..fb162f00ca 100644 --- a/core/config.mk +++ b/core/config.mk @@ -358,6 +358,51 @@ endif # are specific to the user's build configuration. include $(BUILD_SYSTEM)/envsetup.mk +# Returns true if it is a low memory device, otherwise it returns false. +define is-low-mem-device +$(if $(findstring ro.config.low_ram=true,$(PRODUCT_PROPERTY_OVERRIDES)),true,\ +$(if $(findstring ro.config.low_ram=true,$(PRODUCT_DEFAULT_PROPERTY_OVERRIDES)),true,\ +$(if $(findstring ro.config.low_ram=true,$(PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE)),true,\ +$(if $(findstring ro.config.low_ram=true,$(PRODUCT_COMPATIBLE_PROPERTY)),true,\ +$(if $(findstring ro.config.low_ram=true,$(PRODUCT_SYSTEM_DEFAULT_PROPERTIES)),true,\ +$(if $(findstring ro.config.low_ram=true,$(PRODUCT_SYSTEM_EXT_PROPERTIES)),true,\ +$(if $(findstring ro.config.low_ram=true,$(PRODUCT_PRODUCT_PROPERTIES)),true,\ +$(if $(findstring ro.config.low_ram=true,$(PRODUCT_VENDOR_PROPERTIES)),true,\ +$(if $(findstring ro.config.low_ram=true,$(PRODUCT_ODM_PROPERTIES)),true,false))))))))) +endef + +# Get the board API level. +board_api_level := $(PLATFORM_SDK_VERSION) +ifdef BOARD_API_LEVEL + board_api_level := $(BOARD_API_LEVEL) +else ifdef BOARD_SHIPPING_API_LEVEL + # Vendors with GRF must define BOARD_SHIPPING_API_LEVEL for the vendor API level. + board_api_level := $(BOARD_SHIPPING_API_LEVEL) +endif + +# Calculate the VSR vendor API level. +vsr_vendor_api_level := $(board_api_level) + +ifdef PRODUCT_SHIPPING_API_LEVEL + vsr_vendor_api_level := $(call math_min,$(PRODUCT_SHIPPING_API_LEVEL),$(board_api_level)) +endif + +# Set TARGET_MAX_PAGE_SIZE_SUPPORTED. +ifdef PRODUCT_MAX_PAGE_SIZE_SUPPORTED + TARGET_MAX_PAGE_SIZE_SUPPORTED := $(PRODUCT_MAX_PAGE_SIZE_SUPPORTED) +else ifeq ($(strip $(call is-low-mem-device)),true) + # Low memory device will have 4096 binary alignment. + TARGET_MAX_PAGE_SIZE_SUPPORTED := 4096 +else + # The default binary alignment for userspace is 4096. + TARGET_MAX_PAGE_SIZE_SUPPORTED := 4096 + # When VSR vendor API level >= 34, binary alignment will be 65536. + ifeq ($(call math_gt_or_eq,$(vsr_vendor_api_level),34),true) + TARGET_MAX_PAGE_SIZE_SUPPORTED := 65536 + endif +endif +.KATI_READONLY := TARGET_MAX_PAGE_SIZE_SUPPORTED + # Pruned directory options used when using findleaves.py # See envsetup.mk for a description of SCAN_EXCLUDE_DIRS FIND_LEAVES_EXCLUDES := $(addprefix --prune=, $(SCAN_EXCLUDE_DIRS) .repo .git) diff --git a/core/product.mk b/core/product.mk index 1789561caf..32eeca66b0 100644 --- a/core/product.mk +++ b/core/product.mk @@ -27,7 +27,13 @@ _product_single_value_vars += PRODUCT_MODEL _product_single_value_vars += PRODUCT_NAME_FOR_ATTESTATION _product_single_value_vars += PRODUCT_MODEL_FOR_ATTESTATION -# The resoure configuration options to use for this product. +# Defines the ELF segment alignment for binaries (executables and shared libraries). +# The ELF segment alignment has to be a PAGE_SIZE multiple. For example, if +# PRODUCT_MAX_PAGE_SIZE_SUPPORTED=65536, the possible values for PAGE_SIZE could be +# 4096, 16384 and 65536. +_product_single_value_vars += PRODUCT_MAX_PAGE_SIZE_SUPPORTED + +# The resource configuration options to use for this product. _product_list_vars += PRODUCT_LOCALES _product_list_vars += PRODUCT_AAPT_CONFIG _product_single_value_vars += PRODUCT_AAPT_PREF_CONFIG diff --git a/core/soong_config.mk b/core/soong_config.mk index 346edcf9ae..a52ebd9b25 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -156,6 +156,7 @@ $(call add_json_bool, Malloc_not_svelte, $(call invert_bool,$(fi $(call add_json_bool, Malloc_zero_contents, $(call invert_bool,$(filter false,$(MALLOC_ZERO_CONTENTS)))) $(call add_json_bool, Malloc_pattern_fill_contents, $(MALLOC_PATTERN_FILL_CONTENTS)) $(call add_json_str, Override_rs_driver, $(OVERRIDE_RS_DRIVER)) +$(call add_json_str, DeviceMaxPageSizeSupported, $(TARGET_MAX_PAGE_SIZE_SUPPORTED)) $(call add_json_bool, UncompressPrivAppDex, $(call invert_bool,$(filter true,$(DONT_UNCOMPRESS_PRIV_APPS_DEXS)))) $(call add_json_list, ModulesLoadedByPrivilegedModules, $(PRODUCT_LOADED_BY_PRIVILEGED_MODULES)) From c480b5d4c43133a7808494d23786be52481ebdad Mon Sep 17 00:00:00 2001 From: Kalesh Singh Date: Fri, 28 Apr 2023 20:37:47 +0000 Subject: [PATCH 107/139] 16k: Add ro.product.cpu.pagesize.max property The device's max supported page size is determined by the build variable TARGET_MAX_PAGE_SIZE_SUPPORTED. Export this variable as system property for use in tests. Bug: 277360995 Test: atest -c vendor_elf_alignment_test -s Signed-off-by: Kalesh Singh (cherry picked from https://android-review.googlesource.com/q/commit:72222fbec9b2efd6709e263dc16bcca98f216c15) Merged-In: I4f33a42de359c8119e55056f9fd9c7147c7058ec Change-Id: I4f33a42de359c8119e55056f9fd9c7147c7058ec --- core/main.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/main.mk b/core/main.mk index 09616d08dc..6a24bd3050 100644 --- a/core/main.mk +++ b/core/main.mk @@ -347,6 +347,10 @@ ifeq ($(AB_OTA_UPDATER),true) ADDITIONAL_PRODUCT_PROPERTIES += ro.product.ab_ota_partitions=$(subst $(space),$(comma),$(sort $(AB_OTA_PARTITIONS))) endif +# Set this property for VTS to skip large page size tests on unsupported devices. +ADDITIONAL_PRODUCT_PROPERTIES += \ + ro.product.cpu.pagesize.max=$(TARGET_MAX_PAGE_SIZE_SUPPORTED) + # ----------------------------------------------------------------- ### ### In this section we set up the things that are different From 9f5b5c2268757aeb340d495772f133f95704aaea Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Mon, 24 Apr 2023 01:09:37 -0700 Subject: [PATCH 108/139] Save approx 18GB of RAM by not having a bazillion copies of the same modules names Bug: 280108166 Bug: 278864904 Test: treehugger, m, manual inspection Merged-In: 2556850 Change-Id: Ib564b3edf4a0523fc8231b8e57a5ba9c42a73294 --- core/definitions.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/definitions.mk b/core/definitions.mk index fcc101d9fd..e4cee7ab5a 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -597,7 +597,7 @@ endef define declare-copy-target-license-metadata $(strip $(if $(filter $(OUT_DIR)%,$(2)),\ $(eval _tgt:=$(strip $(1)))\ - $(eval ALL_COPIED_TARGETS.$(_tgt).SOURCES := $(ALL_COPIED_TARGETS.$(_tgt).SOURCES) $(filter $(OUT_DIR)%,$(2)))\ + $(eval ALL_COPIED_TARGETS.$(_tgt).SOURCES := $(sort $(ALL_COPIED_TARGETS.$(_tgt).SOURCES) $(filter $(OUT_DIR)%,$(2))))\ $(eval ALL_COPIED_TARGETS += $(_tgt)))) endef From 56d335bdb5247eca27dacbc29c1978186162edad Mon Sep 17 00:00:00 2001 From: Julien Desprez Date: Tue, 2 May 2023 18:14:09 +0000 Subject: [PATCH 109/139] Revert "Add Traefed Contrib to CATBox" This reverts commit a527b1a0ee82cc5a6c78e44ed6eaf7d71f710a1b. Reason for revert: tradefed-contrib isn't an allowed dependency outside tradefed. Suites shouldn't use it. This breaks prebuilts in udc-* Bug: 280372052 Change-Id: Id840568f36a801e19e7bb8e9c34cef2aeb625f1d Ignore-AOSP-First: revert of CL submitted in internal anyway --- core/tasks/catbox.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/core/tasks/catbox.mk b/core/tasks/catbox.mk index a771a935ba..443f4bbe95 100644 --- a/core/tasks/catbox.mk +++ b/core/tasks/catbox.mk @@ -16,7 +16,6 @@ test_suite_name := catbox test_suite_tradefed := catbox-tradefed test_suite_readme := test/catbox/tools/catbox-tradefed/README test_suite_tools := $(HOST_OUT_JAVA_LIBRARIES)/catbox-report-lib.jar -test_suite_tools += $(HOST_OUT_JAVA_LIBRARIES)/tradefed-contrib.jar include $(BUILD_SYSTEM)/tasks/tools/compatibility.mk From b2d34e4d4a68f77f0504019a1237e6f2ac7049cf Mon Sep 17 00:00:00 2001 From: Hang Lu Date: Mon, 29 Aug 2022 14:42:34 +0800 Subject: [PATCH 110/139] Enable HWASan for multiple modules in one place(Make) Environment variables HWASAN_INCLUDE_PATHS and PRODUCT_HWASAN_INCLUDE_PATHS can be used to enable HWASan for multiple modules, by just adding the module directory to the env variable. Bug: b/271948407 Test: Set specific module directory to above env variable and check the assembly codes of output elf files after building, finding hwasan related symbols inside. Merged-In: I4493cb627fb564ee317eb95bd24ec020d42ae28c Change-Id: I4493cb627fb564ee317eb95bd24ec020d42ae28c (cherry picked from commit e235ded73360f87077fc246afa07a64af93480fd) --- core/config_sanitizers.mk | 11 +++++++++++ core/product.mk | 3 +++ core/soong_config.mk | 1 + 3 files changed, 15 insertions(+) diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index 35c632c039..0e84f51647 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -155,6 +155,17 @@ ifeq ($(filter memtag_heap, $(my_sanitize)),) endif endif +# Enable HWASan in included paths. +ifeq ($(filter hwaddress, $(my_sanitize)),) + combined_include_paths := $(HWASAN_INCLUDE_PATHS) \ + $(PRODUCT_HWASAN_INCLUDE_PATHS) + + ifneq ($(strip $(foreach dir,$(subst $(comma),$(space),$(combined_include_paths)),\ + $(filter $(dir)%,$(LOCAL_PATH)))),) + my_sanitize := hwaddress $(my_sanitize) + endif +endif + # If CFI is disabled globally, remove it from my_sanitize. ifeq ($(strip $(ENABLE_CFI)),false) my_sanitize := $(filter-out cfi,$(my_sanitize)) diff --git a/core/product.mk b/core/product.mk index 32eeca66b0..e90e27b003 100644 --- a/core/product.mk +++ b/core/product.mk @@ -244,6 +244,9 @@ _product_list_vars += PRODUCT_CFI_INCLUDE_PATHS # Whether any paths are excluded from sanitization when SANITIZE_TARGET=cfi _product_list_vars += PRODUCT_CFI_EXCLUDE_PATHS +# Whether any paths should have HWASan enabled for components +_product_list_vars += PRODUCT_HWASAN_INCLUDE_PATHS + # Whether the Scudo hardened allocator is disabled platform-wide _product_single_value_vars += PRODUCT_DISABLE_SCUDO diff --git a/core/soong_config.mk b/core/soong_config.mk index a52ebd9b25..b3e2303134 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -120,6 +120,7 @@ $(call add_json_bool, EnableCFI, $(call invert_bool,$(fi $(call add_json_list, CFIExcludePaths, $(CFI_EXCLUDE_PATHS) $(PRODUCT_CFI_EXCLUDE_PATHS)) $(call add_json_list, CFIIncludePaths, $(CFI_INCLUDE_PATHS) $(PRODUCT_CFI_INCLUDE_PATHS)) $(call add_json_list, IntegerOverflowExcludePaths, $(INTEGER_OVERFLOW_EXCLUDE_PATHS) $(PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS)) +$(call add_json_list, HWASanIncludePaths, $(HWASAN_INCLUDE_PATHS) $(PRODUCT_HWASAN_INCLUDE_PATHS)) $(call add_json_list, MemtagHeapExcludePaths, $(MEMTAG_HEAP_EXCLUDE_PATHS) $(PRODUCT_MEMTAG_HEAP_EXCLUDE_PATHS)) $(call add_json_list, MemtagHeapAsyncIncludePaths, $(MEMTAG_HEAP_ASYNC_INCLUDE_PATHS) $(PRODUCT_MEMTAG_HEAP_ASYNC_INCLUDE_PATHS)) From 3161693a62ddd8d8efceaf3cf547dbf1f789789a Mon Sep 17 00:00:00 2001 From: Peiyong Lin Date: Wed, 3 May 2023 16:44:07 +0000 Subject: [PATCH 111/139] Split ANGLE supported and enabled into different Makefiles. ANGLE binaries should be added to the PRODUCT_PACKAGES instead. This patch also splits the angle.mk to angle_supported.mk and angle_default.mk so that when a device just wants to ship ANGLE binaries to coexist with native GLES drivers, it only needs to inherit the angle_supported.mk and when a device wants to ship ANGLE as the default system GLES drivers, it only needs to inherit the angle_default.mk. When ANGLE is the default system GLES driver, make sure persist.graphics.egl is defined so that ANGLE is loaded properly. Bug: 270994705 Test: atest CtsAngleIntegrationHostTestCases Change-Id: I3de4a40b62b39c91c8f6df56d68755830b303f10 Merged-In: I3de4a40b62b39c91c8f6df56d68755830b303f10 --- target/product/angle_default.mk | 23 +++++++++++++++++++ .../product/{angle.mk => angle_supported.mk} | 7 +++--- 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 target/product/angle_default.mk rename target/product/{angle.mk => angle_supported.mk} (73%) diff --git a/target/product/angle_default.mk b/target/product/angle_default.mk new file mode 100644 index 0000000000..bea0be6d53 --- /dev/null +++ b/target/product/angle_default.mk @@ -0,0 +1,23 @@ +# +# Copyright 2023 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. +# + +# To enable ANGLE as the default system GLES drivers, add +# $(call inherit-product, $(SRC_TARGET_DIR)/product/angle_enabled.mk) to the Makefile. + +$(call inherit-product, $(SRC_TARGET_DIR)/product/angle_supported.mk) + +PRODUCT_VENDOR_PROPERTIES += \ + persist.graphics.egl=angle diff --git a/target/product/angle.mk b/target/product/angle_supported.mk similarity index 73% rename from target/product/angle.mk rename to target/product/angle_supported.mk index 93b0e64777..c83ff5fcb2 100644 --- a/target/product/angle.mk +++ b/target/product/angle_supported.mk @@ -14,8 +14,9 @@ # limitations under the License. # -# To include ANGLE drivers into the build, add -# $(call inherit-product, $(SRC_TARGET_DIR)/product/angle.mk) to the Makefile. +# To include ANGLE into the image build, add +# $(call inherit-product, $(SRC_TARGET_DIR)/product/angle_supported.mk) to the Makefile. +# By default, this will allow ANGLE binaries to coexist with native GLES drivers. PRODUCT_PACKAGES += \ libEGL_angle \ @@ -23,4 +24,4 @@ PRODUCT_PACKAGES += \ libGLESv2_angle # Set ro.gfx.angle.supported based on if ANGLE is installed in vendor partition -PRODUCT_VENDOR_PROPERTIES := ro.gfx.angle.supported=true +PRODUCT_VENDOR_PROPERTIES += ro.gfx.angle.supported=true From 995cfaeace01f0f709d3120e9b58eafc622bdff5 Mon Sep 17 00:00:00 2001 From: Shunkai Yao Date: Thu, 4 May 2023 18:39:59 +0000 Subject: [PATCH 112/139] Removed obsolete audio_effects.conf dependency Bug: 279987639 Test: presubmit Ignore-AOSP-First: To avoid merge conflict Change-Id: Ida71c17e8675878ee406900d805ab0eff2e70acd --- target/product/handheld_system.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/product/handheld_system.mk b/target/product/handheld_system.mk index 2da1395c99..52f9ee1153 100644 --- a/target/product/handheld_system.mk +++ b/target/product/handheld_system.mk @@ -81,7 +81,7 @@ PRODUCT_SYSTEM_SERVER_APPS += \ Telecom \ PRODUCT_COPY_FILES += \ - frameworks/av/media/libeffects/data/audio_effects.conf:system/etc/audio_effects.conf \ + frameworks/av/media/libeffects/data/audio_effects.xml:system/etc/audio_effects.xml \ frameworks/native/data/etc/android.software.window_magnification.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/android.software.window_magnification.xml \ PRODUCT_VENDOR_PROPERTIES += \ From fc3387bb0efeac1801bbc6166060199df7a77aa3 Mon Sep 17 00:00:00 2001 From: Po Hu Date: Wed, 29 Mar 2023 17:49:49 +0800 Subject: [PATCH 113/139] Support to merge PREBUILT_IMAGES For example, pvmfw.img comes from framework target files package and dtbo.img comes from vendor target files package. Bug: 270241811 Test: merge_target_files Merged-In: If2e6fac5ce3671e3387e801808a195fb7b2c55b5 Change-Id: If2e6fac5ce3671e3387e801808a195fb7b2c55b5 (cherry picked from commit 81c3f4a884a8491a2d0d480e219cb68c9986562d) --- tools/releasetools/merge/merge_utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/releasetools/merge/merge_utils.py b/tools/releasetools/merge/merge_utils.py index c284338a6e..b5683a854a 100644 --- a/tools/releasetools/merge/merge_utils.py +++ b/tools/releasetools/merge/merge_utils.py @@ -181,6 +181,7 @@ def ValidateConfigLists(): _PARTITION_ITEM_PATTERN = re.compile(r'^([A-Z_]+)/.*$') _IMAGE_PARTITION_PATTERN = re.compile(r'^IMAGES/(.*)\.img$') +_PREBUILT_IMAGE_PARTITION_PATTERN = re.compile(r'^PREBUILT_IMAGES/(.*)\.img$') def ItemListToPartitionSet(item_list): @@ -203,12 +204,12 @@ def ItemListToPartitionSet(item_list): partition_set = set() for item in item_list: - for pattern in (_PARTITION_ITEM_PATTERN, _IMAGE_PARTITION_PATTERN): + for pattern in (_PARTITION_ITEM_PATTERN, _IMAGE_PARTITION_PATTERN, _PREBUILT_IMAGE_PARTITION_PATTERN): partition_match = pattern.search(item.strip()) if partition_match: partition = partition_match.group(1).lower() # These directories in target-files are not actual partitions. - if partition not in ('meta', 'images'): + if partition not in ('meta', 'images', 'prebuilt_images'): partition_set.add(partition) return partition_set @@ -217,7 +218,7 @@ def ItemListToPartitionSet(item_list): # Partitions that are grabbed from the framework partial build by default. _FRAMEWORK_PARTITIONS = { 'system', 'product', 'system_ext', 'system_other', 'root', 'system_dlkm', - 'vbmeta_system' + 'vbmeta_system', 'pvmfw' } @@ -253,7 +254,7 @@ def InferItemList(input_namelist, framework): if partition == 'meta': continue - if partition == 'images': + if partition in ('images', 'prebuilt_images'): image_partition, extension = os.path.splitext(os.path.basename(namelist)) if image_partition == 'vbmeta': # Always regenerate vbmeta.img since it depends on hash information From f3f48883bcfe8a8f46fdec7affd545c81ba1a8ee Mon Sep 17 00:00:00 2001 From: Motomu Utsumi Date: Tue, 9 May 2023 12:54:24 +0900 Subject: [PATCH 114/139] Use non-next NetworkStack NetworkStack now builds against stable U APIs, so U can use the stable binaries instead of the "next" versions. Since it has just been bumped, NetworkStack is equivalent to NetworkStackNext at this point, so this is a no-op. Bug: 280250560 Test: m Ignore-AOSP-First: This CL will be cherry-picked to aosp Change-Id: I00a9840a69d06c6f4246a2db284c3060392b302b --- target/product/base_system.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 10f2995fab..a3f5ab3470 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -230,7 +230,7 @@ PRODUCT_PACKAGES += \ mtpd \ ndc \ netd \ - NetworkStackNext \ + NetworkStack \ odsign \ org.apache.http.legacy \ otacerts \ From 81cd7533c943e9938e929a256280906b8876f73d Mon Sep 17 00:00:00 2001 From: Jiakai Zhang Date: Wed, 10 May 2023 13:49:05 +0100 Subject: [PATCH 115/139] Also disable dexpreopt for boot images for unbundled builds. This fixes the tradefed build error caused by aosp/2582191. Bug: 280440941 Test: `BUILD_BROKEN_DISABLE_BAZEL=true m dist` on tradefed branch. (cherry picked from https://android-review.googlesource.com/q/commit:c74a4011e2815f2ffc3815176c958a0fdabbd621) Merged-In: I34c9fea0a5f7110c9b2bda1986df82afa3eafc79 Change-Id: I34c9fea0a5f7110c9b2bda1986df82afa3eafc79 --- core/config.mk | 3 +++ core/dex_preopt_config.mk | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/core/config.mk b/core/config.mk index fb162f00ca..0c086ee090 100644 --- a/core/config.mk +++ b/core/config.mk @@ -545,8 +545,10 @@ endif TARGET_BUILD_USE_PREBUILT_SDKS := DISABLE_PREOPT := +DISABLE_PREOPT_BOOT_IMAGES := ifneq (,$(TARGET_BUILD_APPS)$(TARGET_BUILD_UNBUNDLED_IMAGE)) DISABLE_PREOPT := true + DISABLE_PREOPT_BOOT_IMAGES := true endif ifeq (true,$(TARGET_BUILD_UNBUNDLED)) ifneq (true,$(UNBUNDLED_BUILD_SDKS_FROM_SOURCE)) @@ -557,6 +559,7 @@ endif .KATI_READONLY := \ TARGET_BUILD_USE_PREBUILT_SDKS \ DISABLE_PREOPT \ + DISABLE_PREOPT_BOOT_IMAGES \ prebuilt_sdk_tools := prebuilts/sdk/tools prebuilt_sdk_tools_bin := $(prebuilt_sdk_tools)/$(HOST_OS)/bin diff --git a/core/dex_preopt_config.mk b/core/dex_preopt_config.mk index e36e2ebb6f..7b9c4dbac0 100644 --- a/core/dex_preopt_config.mk +++ b/core/dex_preopt_config.mk @@ -12,9 +12,15 @@ else ifneq (true,$(filter true,$(PRODUCT_USES_DEFAULT_ART_CONFIG))) # would result in passing bad arguments to dex2oat and failing the build. ENABLE_PREOPT := ENABLE_PREOPT_BOOT_IMAGES := -else ifeq (true,$(DISABLE_PREOPT)) - # Disable dexpreopt for libraries/apps, but do compile boot images. - ENABLE_PREOPT := +else + ifeq (true,$(DISABLE_PREOPT)) + # Disable dexpreopt for libraries/apps, but may compile boot images. + ENABLE_PREOPT := + endif + ifeq (true,$(DISABLE_PREOPT_BOOT_IMAGES)) + # Disable dexpreopt for boot images, but may compile libraries/apps. + ENABLE_PREOPT_BOOT_IMAGES := + endif endif # The default value for LOCAL_DEX_PREOPT From d6c119bfaa2b768070bda5e0d9c71806d83b7e39 Mon Sep 17 00:00:00 2001 From: Steve Berbary Date: Sat, 13 May 2023 22:22:21 +0000 Subject: [PATCH 116/139] Update Security String to 2023-07-05 Bug: 282371465 Change-Id: I2bb1848e16aff436787a5bf43dbea18012d485a7 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 60bd4cdcb2..23dce80440 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -103,7 +103,7 @@ ifndef PLATFORM_SECURITY_PATCH # It must be of the form "YYYY-MM-DD" on production devices. # It must match one of the Android Security Patch Level strings of the Public Security Bulletins. # If there is no $PLATFORM_SECURITY_PATCH set, keep it empty. - PLATFORM_SECURITY_PATCH := 2023-06-05 + PLATFORM_SECURITY_PATCH := 2023-07-05 endif include $(BUILD_SYSTEM)/version_util.mk From 26a7d4bd9ef2a7cc8e7d729bce0ece0ad9ac1bf8 Mon Sep 17 00:00:00 2001 From: Steve Berbary Date: Sat, 13 May 2023 22:24:26 +0000 Subject: [PATCH 117/139] Update Security String to 2023-07-01 Bug: 282371465 Change-Id: I2bb1848e16aff436787a5bf43dbea18012d485a7 Merged-In: I2bb1848e16aff436787a5bf43dbea18012d485a7 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index b10856da66..f7bb875463 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -240,7 +240,7 @@ ifndef PLATFORM_SECURITY_PATCH # It must be of the form "YYYY-MM-DD" on production devices. # It must match one of the Android Security Patch Level strings of the Public Security Bulletins. # If there is no $PLATFORM_SECURITY_PATCH set, keep it empty. - PLATFORM_SECURITY_PATCH := 2023-06-01 + PLATFORM_SECURITY_PATCH := 2023-07-01 endif .KATI_READONLY := PLATFORM_SECURITY_PATCH From 053ad8aa1bfc73de30199023cea705c7cc0249ee Mon Sep 17 00:00:00 2001 From: Steve Berbary Date: Sat, 13 May 2023 22:26:09 +0000 Subject: [PATCH 118/139] Update Security String to 2023-07-01 Bug: 282371465 Change-Id: I2bb1848e16aff436787a5bf43dbea18012d485a7 Merged-In: I2bb1848e16aff436787a5bf43dbea18012d485a7 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index cfedb3f0b7..315f7b2593 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -240,7 +240,7 @@ ifndef PLATFORM_SECURITY_PATCH # It must be of the form "YYYY-MM-DD" on production devices. # It must match one of the Android Security Patch Level strings of the Public Security Bulletins. # If there is no $PLATFORM_SECURITY_PATCH set, keep it empty. - PLATFORM_SECURITY_PATCH := 2023-06-01 + PLATFORM_SECURITY_PATCH := 2023-07-01 endif .KATI_READONLY := PLATFORM_SECURITY_PATCH From 0dce348046a3eefe9fea0a8308373db3058520d8 Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Mon, 15 May 2023 15:38:58 +0800 Subject: [PATCH 119/139] Support dynamic 64-bit drmserver 64-bit GSI requires support both 64_32-bit and 64-bit devices at the same time. Add a new variable TARGET_DYNAMIC_64_32_DRMSERVER to put drmserver_dynamic.rc into GSI. Which starts 64-bit drmserver if ro.zygote is zygote64. Otherwise, it keeps the original behavior to start 32-bit drmserver. Bug: 282603373 Test: make gsi_arm64-user; Check system/etc/init Test: make gsi_arm-user; Check systen/etc/init Change-Id: I874cee00a066086f565e044549ad40c6ab5d62b0 Merged-In: I874cee00a066086f565e044549ad40c6ab5d62b0 --- core/android_soong_config_vars.mk | 1 + target/board/generic_arm64/BoardConfig.mk | 2 ++ target/board/generic_x86_64/BoardConfig.mk | 2 ++ target/board/gsi_arm64/BoardConfig.mk | 2 ++ 4 files changed, 7 insertions(+) diff --git a/core/android_soong_config_vars.mk b/core/android_soong_config_vars.mk index cfeb238b41..b5f7b22c7f 100644 --- a/core/android_soong_config_vars.mk +++ b/core/android_soong_config_vars.mk @@ -27,6 +27,7 @@ $(call add_soong_config_namespace,ANDROID) # Add variables to the namespace below: $(call add_soong_config_var,ANDROID,TARGET_DYNAMIC_64_32_MEDIASERVER) +$(call add_soong_config_var,ANDROID,TARGET_DYNAMIC_64_32_DRMSERVER) $(call add_soong_config_var,ANDROID,TARGET_ENABLE_MEDIADRM_64) $(call add_soong_config_var,ANDROID,IS_TARGET_MIXED_SEPOLICY) ifeq ($(IS_TARGET_MIXED_SEPOLICY),true) diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index 40be80e413..e2d5fb4df8 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -54,6 +54,8 @@ endif # Include 64-bit mediaserver to support 64-bit only devices TARGET_DYNAMIC_64_32_MEDIASERVER := true +# Include 64-bit drmserver to support 64-bit only devices +TARGET_DYNAMIC_64_32_DRMSERVER := true include build/make/target/board/BoardConfigGsiCommon.mk diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk index e7f2ae0072..36136f4b35 100755 --- a/target/board/generic_x86_64/BoardConfig.mk +++ b/target/board/generic_x86_64/BoardConfig.mk @@ -24,6 +24,8 @@ TARGET_2ND_ARCH_VARIANT := x86_64 # Include 64-bit mediaserver to support 64-bit only devices TARGET_DYNAMIC_64_32_MEDIASERVER := true +# Include 64-bit drmserver to support 64-bit only devices +TARGET_DYNAMIC_64_32_DRMSERVER := true include build/make/target/board/BoardConfigGsiCommon.mk diff --git a/target/board/gsi_arm64/BoardConfig.mk b/target/board/gsi_arm64/BoardConfig.mk index db95082e5f..7910b1da15 100644 --- a/target/board/gsi_arm64/BoardConfig.mk +++ b/target/board/gsi_arm64/BoardConfig.mk @@ -29,6 +29,8 @@ TARGET_2ND_CPU_VARIANT := generic # Include 64-bit mediaserver to support 64-bit only devices TARGET_DYNAMIC_64_32_MEDIASERVER := true +# Include 64-bit drmserver to support 64-bit only devices +TARGET_DYNAMIC_64_32_DRMSERVER := true # TODO(b/111434759, b/111287060) SoC specific hacks BOARD_ROOT_EXTRA_SYMLINKS += /vendor/lib/dsp:/dsp From f24be9dba9b53b0c1682929253a3eba9af7a4c31 Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Wed, 19 Oct 2022 01:38:49 -0400 Subject: [PATCH 120/139] Add BUILD_BROKEN_PLUGIN_VALIDATION flag Use is to specify the list of plugins are are not allowed. Ignore-AOSP-First: Requires an internal only change to not break when submitted Test: CI Change-Id: Ia2fe83d82ead618e480e99a82b1b825ed08d3eab --- Changes.md | 14 +++++++++++++- core/board_config.mk | 1 + core/soong_config.mk | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index daebd5231a..6d20173c19 100644 --- a/Changes.md +++ b/Changes.md @@ -1,5 +1,18 @@ # Build System Changes for Android.mk Writers +## Perform validation of Soong plugins + +Each Soong plugin will require manual work to migrate to Bazel. In order to +minimize the manual work outside of build/soong, we are restricting plugins to +those that exist today and those in vendor or hardware directories. + +If you need to extend the build system via a plugin, please reach out to the +build team via email android-building@googlegroups.com (external) for any +questions, or see [go/soong](http://go/soong) (internal). + +To omit the validation, `BUILD_BROKEN_PLUGIN_VALIDATION` expects a list of +plugins to omit from the validation. + ## Python 2 to 3 migration The path set when running builds now makes the `python` executable point to python 3, @@ -15,7 +28,6 @@ overridden by setting the `BUILD_BROKEN_USES_SOONG_PYTHON2_MODULES` product conf variable to `true`. Python 2 is slated for complete removal in V. - ## Stop referencing sysprop_library directly from cc modules For the migration to Bazel, we are no longer mapping sysprop_library targets diff --git a/core/board_config.mk b/core/board_config.mk index fae7aaa2c0..2c083076d8 100644 --- a/core/board_config.mk +++ b/core/board_config.mk @@ -174,6 +174,7 @@ _board_strip_list += ODM_MANIFEST_SKUS _build_broken_var_list := \ + BUILD_BROKEN_PLUGIN_VALIDATION \ BUILD_BROKEN_CLANG_PROPERTY \ BUILD_BROKEN_CLANG_ASFLAGS \ BUILD_BROKEN_CLANG_CFLAGS \ diff --git a/core/soong_config.mk b/core/soong_config.mk index 346edcf9ae..a17009f002 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -291,6 +291,7 @@ $(call add_json_str, PrebuiltHiddenApiDir, $(BOARD_PREBUILT_HIDDENAPI_DIR)) $(call add_json_str, ShippingApiLevel, $(PRODUCT_SHIPPING_API_LEVEL)) +$(call add_json_list, BuildBrokenPluginValidation, $(BUILD_BROKEN_PLUGIN_VALIDATION)) $(call add_json_bool, BuildBrokenClangProperty, $(filter true,$(BUILD_BROKEN_CLANG_PROPERTY))) $(call add_json_bool, BuildBrokenClangAsFlags, $(filter true,$(BUILD_BROKEN_CLANG_ASFLAGS))) $(call add_json_bool, BuildBrokenClangCFlags, $(filter true,$(BUILD_BROKEN_CLANG_CFLAGS))) From 0d3c15c2aed9ec5856395b447ca914e2a642eb2f Mon Sep 17 00:00:00 2001 From: Daniel Zheng Date: Tue, 25 Apr 2023 12:41:44 -0700 Subject: [PATCH 121/139] Add --max_threads to OTA generation Adding an option to configure max number of threads used during ota_from_target_files Bug: 277794445 Test: tested ota_from_target_files (cherry picked from https://android-review.googlesource.com/q/commit:a30989bafa820faf24eca7e11e48f8f122d7991f) Merged-In: I9bae92ee43c21926434ab04563a2b4f0678b73eb Change-Id: I9bae92ee43c21926434ab04563a2b4f0678b73eb this patch is necessary for partner to improve OTA generation b/277794445 --- tools/releasetools/ota_from_target_files.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index 2d4928883e..e40256c67c 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -248,6 +248,9 @@ A/B OTA specific options --security_patch_level Override the security patch level in target files + + --max_threads + Specify max number of threads allowed when generating A/B OTA """ from __future__ import print_function @@ -321,6 +324,8 @@ OPTIONS.enable_zucchini = True OPTIONS.enable_lz4diff = False OPTIONS.vabc_compression_param = None OPTIONS.security_patch_level = None +OPTIONS.max_threads = None + POSTINSTALL_CONFIG = 'META/postinstall_config.txt' DYNAMIC_PARTITION_INFO = 'META/dynamic_partitions_info.txt' @@ -985,6 +990,9 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None): additional_args += ["--security_patch_level", security_patch_level] + if OPTIONS.max_threads: + additional_args += ["--max_threads", OPTIONS.max_threads] + additional_args += ["--enable_zucchini=" + str(OPTIONS.enable_zucchini).lower()] @@ -1191,6 +1199,12 @@ def main(argv): OPTIONS.vabc_compression_param = a.lower() elif o == "--security_patch_level": OPTIONS.security_patch_level = a + elif o in ("--max_threads"): + if a.isdigit(): + OPTIONS.max_threads = a + else: + raise ValueError("Cannot parse value %r for option %r - only " + "integers are allowed." % (a, o)) else: return False return True @@ -1242,6 +1256,7 @@ def main(argv): "enable_lz4diff=", "vabc_compression_param=", "security_patch_level=", + "max_threads=", ], extra_option_handler=option_handler) common.InitLogging() From 6c8f896589a724284b4eb520ffa346e82e7ebe43 Mon Sep 17 00:00:00 2001 From: Satoshi Futenma Date: Tue, 18 Apr 2023 16:41:35 +0900 Subject: [PATCH 122/139] Support custom payload signer in merge_ota Add options to handle custom payload signer as it is required in merge_ota.py as well if the original OTA packages are signed by the signer. If input is only one OTA, clone apex_info.pb to the target. Use common.ZipWriteStr instead of zipfile.writestr, this ensures that the same permission for the entries as done by ota_from_target_files. Bug: 282189563 Test: manual. pass single OTA to merge_ota, with same signing parameters as originally used. Confirm that output zip is binary identical to input. (cherry picked from https://android-review.googlesource.com/q/commit:1f93ce20c5a5f3e7c2f6b5e1f9fdc4d2572220cc) Merged-In: I3b926b8cd69bc74dff6ccf8b5ccc72bedffcac6f Change-Id: I3b926b8cd69bc74dff6ccf8b5ccc72bedffcac6f --- tools/releasetools/merge_ota.py | 50 ++++++++++++++++++++++++++-- tools/releasetools/payload_signer.py | 13 +++++--- 2 files changed, 57 insertions(+), 6 deletions(-) diff --git a/tools/releasetools/merge_ota.py b/tools/releasetools/merge_ota.py index 7d3d3a3fc3..441312cf25 100644 --- a/tools/releasetools/merge_ota.py +++ b/tools/releasetools/merge_ota.py @@ -14,6 +14,7 @@ import argparse import logging +import shlex import struct import sys import update_payload @@ -34,6 +35,7 @@ from ota_utils import PayloadGenerator, METADATA_PROTO_NAME, FinalizeMetadata logger = logging.getLogger(__name__) CARE_MAP_ENTRY = "care_map.pb" +APEX_INFO_ENTRY = "apex_info.pb" def WriteDataBlob(payload: Payload, outfp: BinaryIO, read_size=1024*64): @@ -188,6 +190,22 @@ def CheckDuplicatePartitions(payloads: List[Payload]): f"OTA {partition_to_ota[part].name} and {payload.name} have duplicating partition {part}") partition_to_ota[part] = payload +def ApexInfo(file_paths): + if len(file_paths) > 1: + logger.info("More than one target file specified, will ignore " + "apex_info.pb (if any)") + return None + with zipfile.ZipFile(file_paths[0], "r", allowZip64=True) as zfp: + if APEX_INFO_ENTRY in zfp.namelist(): + apex_info_bytes = zfp.read(APEX_INFO_ENTRY) + return apex_info_bytes + return None + +def ParseSignerArgs(args): + if args is None: + return None + return shlex.split(args) + def main(argv): parser = argparse.ArgumentParser(description='Merge multiple partial OTAs') parser.add_argument('packages', type=str, nargs='+', @@ -196,6 +214,13 @@ def main(argv): help='Paths to private key for signing payload') parser.add_argument('--search_path', type=str, help='Search path for framework/signapk.jar') + parser.add_argument('--payload_signer', type=str, + help='Path to custom payload signer') + parser.add_argument('--payload_signer_args', type=ParseSignerArgs, + help='Arguments for payload signer if necessary') + parser.add_argument('--payload_signer_maximum_signature_size', type=str, + help='Maximum signature size (in bytes) that would be ' + 'generated by the given payload signer') parser.add_argument('--output', type=str, help='Paths to output merged ota', required=True) parser.add_argument('--metadata_ota', type=str, @@ -203,6 +228,9 @@ def main(argv): parser.add_argument('--private_key_suffix', type=str, help='Suffix to be appended to package_key path', default=".pk8") parser.add_argument('-v', action="store_true", help="Enable verbose logging", dest="verbose") + parser.epilog = ('This tool can also be used to resign a regular OTA. For a single regular OTA, ' + 'apex_info.pb will be written to output. When merging multiple OTAs, ' + 'apex_info.pb will not be written.') args = parser.parse_args(argv[1:]) file_paths = args.packages @@ -225,6 +253,13 @@ def main(argv): merged_manifest = MergeManifests(payloads) + # Get signing keys + key_passwords = common.GetKeyPasswords([args.package_key]) + + generator = PayloadGenerator() + + apex_info_bytes = ApexInfo(file_paths) + with tempfile.NamedTemporaryFile() as unsigned_payload: WriteHeaderAndManifest(merged_manifest, unsigned_payload) ConcatBlobs(payloads, unsigned_payload) @@ -236,20 +271,31 @@ def main(argv): if args.package_key: logger.info("Signing payload...") - signer = PayloadSigner(args.package_key, args.private_key_suffix) + # TODO: remove OPTIONS when no longer used as fallback in payload_signer + common.OPTIONS.payload_signer_args = None + common.OPTIONS.payload_signer_maximum_signature_size = None + signer = PayloadSigner(args.package_key, args.private_key_suffix, + key_passwords[args.package_key], + payload_signer=args.payload_signer, + payload_signer_args=args.payload_signer_args, + payload_signer_maximum_signature_size=args.payload_signer_maximum_signature_size) generator.payload_file = unsigned_payload.name generator.Sign(signer) logger.info("Payload size: %d", os.path.getsize(generator.payload_file)) logger.info("Writing to %s", args.output) + key_passwords = common.GetKeyPasswords([args.package_key]) with tempfile.NamedTemporaryFile(prefix="signed_ota", suffix=".zip") as signed_ota: with zipfile.ZipFile(signed_ota, "w") as zfp: generator.WriteToZip(zfp) care_map_bytes = MergeCareMap(args.packages) if care_map_bytes: - zfp.writestr(CARE_MAP_ENTRY, care_map_bytes) + common.ZipWriteStr(zfp, CARE_MAP_ENTRY, care_map_bytes) + if apex_info_bytes: + logger.info("Writing %s", APEX_INFO_ENTRY) + common.ZipWriteStr(zfp, APEX_INFO_ENTRY, apex_info_bytes) AddOtaMetadata(signed_ota.name, metadata_ota, args.output, args.package_key, key_passwords[args.package_key]) return 0 diff --git a/tools/releasetools/payload_signer.py b/tools/releasetools/payload_signer.py index 4f342ac9fe..9933aefeb8 100644 --- a/tools/releasetools/payload_signer.py +++ b/tools/releasetools/payload_signer.py @@ -36,11 +36,16 @@ class PayloadSigner(object): (OPTIONS.package_key) and calls openssl for the signing works. """ - def __init__(self, package_key=None, private_key_suffix=None, pw=None, payload_signer=None): + def __init__(self, package_key=None, private_key_suffix=None, pw=None, payload_signer=None, + payload_signer_args=None, payload_signer_maximum_signature_size=None): if package_key is None: package_key = OPTIONS.package_key if private_key_suffix is None: private_key_suffix = OPTIONS.private_key_suffix + if payload_signer_args is None: + payload_signer_args = OPTIONS.payload_signer_args + if payload_signer_maximum_signature_size is None: + payload_signer_maximum_signature_size = OPTIONS.payload_signer_maximum_signature_size if payload_signer is None: # Prepare the payload signing key. @@ -59,10 +64,10 @@ class PayloadSigner(object): signing_key) else: self.signer = payload_signer - self.signer_args = OPTIONS.payload_signer_args - if OPTIONS.payload_signer_maximum_signature_size: + self.signer_args = payload_signer_args + if payload_signer_maximum_signature_size: self.maximum_signature_size = int( - OPTIONS.payload_signer_maximum_signature_size) + payload_signer_maximum_signature_size) else: # The legacy config uses RSA2048 keys. logger.warning("The maximum signature size for payload signer is not" From 2e55115ab362dbff12002d694b51c164b476df46 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 17 May 2023 10:56:44 -0700 Subject: [PATCH 123/139] Don't build automatic RROs for tests Automatic RROs don't make sense for tests, the tests can't rely on overlays being installed on product or vendor. Creating the RROs causes a race during builds that build both droid and device-tests goals, as the RROs may be installed to the vendor directory as a dependency of the device-tests goal before or after the vendor image is packaged as a dependency of the droid goal. If the RROs are installed first and the vendor image is low on space it may result in an out-of-space error. Bug: 282885159 Test: Rule to build $OUT/vendor/overlay/SystemUITests__*__auto_generated_rro_vendor.apk no longer exists Ignore-AOSP-First: high priority build fix Change-Id: I760355ffb1818e91c02a98473312f9f21c149361 --- core/package_internal.mk | 32 +++++++++++++++-------------- core/soong_app_prebuilt.mk | 42 ++++++++++++++++++++------------------ 2 files changed, 39 insertions(+), 35 deletions(-) diff --git a/core/package_internal.mk b/core/package_internal.mk index c7a173b71f..3e9106bd8e 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -111,24 +111,26 @@ include $(BUILD_SYSTEM)/support_libraries.mk # Determine whether auto-RRO is enabled for this package. enforce_rro_enabled := -ifneq (,$(filter *, $(PRODUCT_ENFORCE_RRO_TARGETS))) - # * means all system and system_ext APKs, so enable conditionally based on module path. +ifeq (,$(filter tests,$(LOCAL_MODULE_TAGS))) + ifneq (,$(filter *, $(PRODUCT_ENFORCE_RRO_TARGETS))) + # * means all system and system_ext APKs, so enable conditionally based on module path. - # Note that base_rules.mk has not yet been included, so it's likely that only - # one of LOCAL_MODULE_PATH and the LOCAL_X_MODULE flags has been set. - ifeq (,$(LOCAL_MODULE_PATH)) - non_rro_target_module := $(filter true,\ - $(LOCAL_ODM_MODULE) \ - $(LOCAL_OEM_MODULE) \ - $(LOCAL_PRODUCT_MODULE) \ - $(LOCAL_PROPRIETARY_MODULE) \ - $(LOCAL_VENDOR_MODULE)) - enforce_rro_enabled := $(if $(non_rro_target_module),,true) - else ifneq ($(filter $(TARGET_OUT)/%,$(LOCAL_MODULE_PATH)),) + # Note that base_rules.mk has not yet been included, so it's likely that only + # one of LOCAL_MODULE_PATH and the LOCAL_X_MODULE flags has been set. + ifeq (,$(LOCAL_MODULE_PATH)) + non_rro_target_module := $(filter true,\ + $(LOCAL_ODM_MODULE) \ + $(LOCAL_OEM_MODULE) \ + $(LOCAL_PRODUCT_MODULE) \ + $(LOCAL_PROPRIETARY_MODULE) \ + $(LOCAL_VENDOR_MODULE)) + enforce_rro_enabled := $(if $(non_rro_target_module),,true) + else ifneq ($(filter $(TARGET_OUT)/%,$(LOCAL_MODULE_PATH)),) + enforce_rro_enabled := true + endif + else ifneq (,$(filter $(LOCAL_PACKAGE_NAME), $(PRODUCT_ENFORCE_RRO_TARGETS))) enforce_rro_enabled := true endif -else ifneq (,$(filter $(LOCAL_PACKAGE_NAME), $(PRODUCT_ENFORCE_RRO_TARGETS))) - enforce_rro_enabled := true endif product_package_overlays := $(strip \ diff --git a/core/soong_app_prebuilt.mk b/core/soong_app_prebuilt.mk index dd550b5808..ccc54494f7 100644 --- a/core/soong_app_prebuilt.mk +++ b/core/soong_app_prebuilt.mk @@ -239,26 +239,28 @@ my_common := COMMON include $(BUILD_SYSTEM)/link_type.mk endif # !LOCAL_IS_HOST_MODULE -ifdef LOCAL_SOONG_DEVICE_RRO_DIRS - $(call append_enforce_rro_sources, \ - $(my_register_name), \ - false, \ - $(LOCAL_FULL_MANIFEST_FILE), \ - $(if $(LOCAL_EXPORT_PACKAGE_RESOURCES),true,false), \ - $(LOCAL_SOONG_DEVICE_RRO_DIRS), \ - vendor \ - ) -endif +ifeq (,$(filter tests,$(LOCAL_MODULE_TAGS))) + ifdef LOCAL_SOONG_DEVICE_RRO_DIRS + $(call append_enforce_rro_sources, \ + $(my_register_name), \ + false, \ + $(LOCAL_FULL_MANIFEST_FILE), \ + $(if $(LOCAL_EXPORT_PACKAGE_RESOURCES),true,false), \ + $(LOCAL_SOONG_DEVICE_RRO_DIRS), \ + vendor \ + ) + endif -ifdef LOCAL_SOONG_PRODUCT_RRO_DIRS - $(call append_enforce_rro_sources, \ - $(my_register_name), \ - false, \ - $(LOCAL_FULL_MANIFEST_FILE), \ - $(if $(LOCAL_EXPORT_PACKAGE_RESOURCES),true,false), \ - $(LOCAL_SOONG_PRODUCT_RRO_DIRS), \ - product \ - ) + ifdef LOCAL_SOONG_PRODUCT_RRO_DIRS + $(call append_enforce_rro_sources, \ + $(my_register_name), \ + false, \ + $(LOCAL_FULL_MANIFEST_FILE), \ + $(if $(LOCAL_EXPORT_PACKAGE_RESOURCES),true,false), \ + $(LOCAL_SOONG_PRODUCT_RRO_DIRS), \ + product \ + ) + endif endif ifdef LOCAL_PREBUILT_COVERAGE_ARCHIVE @@ -273,4 +275,4 @@ SOONG_ALREADY_CONV += $(LOCAL_MODULE) ########################################################### ## SBOM generation ########################################################### -include $(BUILD_SBOM_GEN) \ No newline at end of file +include $(BUILD_SBOM_GEN) From d637b06d8f445f5aa433df413c5bfcb3943a0c6e Mon Sep 17 00:00:00 2001 From: Wei Li Date: Thu, 4 May 2023 08:45:16 -0700 Subject: [PATCH 124/139] Export some make variables to soong.variables. Bug: 275472038 Test: CIs (cherry picked from https://android-review.googlesource.com/q/commit:996830047f79a5b9e9c9ed590886217068d9576e) Merged-In: I2e7a07007224364418659453d979e2bee58fe5f9 Change-Id: I2e7a07007224364418659453d979e2bee58fe5f9 --- core/soong_config.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/soong_config.mk b/core/soong_config.mk index b3e2303134..a149e2a77a 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -323,6 +323,10 @@ $(call add_json_list, SourceRootDirs, $(PRODUCT_SOURCE_ROOT_DIRS)) $(call add_json_list, AfdoProfiles, $(ALL_AFDO_PROFILES)) +$(call add_json_str, ProductManufacturer, $(PRODUCT_MANUFACTURER)) +$(call add_json_str, ProductBrand, $(PRODUCT_BRAND)) +$(call add_json_list, BuildVersionTags, $(BUILD_VERSION_TAGS)) + $(call json_end) $(file >$(SOONG_VARIABLES).tmp,$(json_contents)) From 233d5b97f84e3639d3c8c78bd93e2e5c2cbbd50c Mon Sep 17 00:00:00 2001 From: Wei Li Date: Fri, 5 May 2023 10:49:28 -0700 Subject: [PATCH 125/139] Some changes to support SBOM generation for b build unbundled APEXs. 1) Use output file path of installed files in build system since there is no PRODUCT_OUT in Bazel 2) Use CONTAINS to describe the relationship between a APEX and files it contains 3) Generate SBOM of APEXs, which is similar to SBOM of products Bug: 275472038 Test: CIs (cherry picked from https://android-review.googlesource.com/q/commit:fd7e6517d345d3b8d4af12dae345434d968b83b9) Merged-In: I41622366e5e6ed9dc78cca7bc7bb69a1f8f9bd9f Change-Id: I41622366e5e6ed9dc78cca7bc7bb69a1f8f9bd9f --- core/main.mk | 11 +++--- tools/sbom/generate-sbom.py | 68 +++++++++++++++++++++++-------------- tools/sbom/sbom_data.py | 1 + tools/sbom/sbom_writers.py | 22 +++++++----- 4 files changed, 63 insertions(+), 39 deletions(-) diff --git a/core/main.mk b/core/main.mk index 6a24bd3050..cb4dca6b41 100644 --- a/core/main.mk +++ b/core/main.mk @@ -2163,10 +2163,11 @@ endif # TARGET_BUILD_APPS $(shell rm $(PRODUCT_OUT)/sbom-metadata.csv >/dev/null 2>&1) $(PRODUCT_OUT)/sbom-metadata.csv: $(installed_files) rm -f $@ - @echo installed_file$(comma)module_path$(comma)soong_module_type$(comma)is_prebuilt_make_module$(comma)product_copy_files$(comma)kernel_module_copy_files$(comma)is_platform_generated >> $@ + @echo installed_file$(comma)module_path$(comma)soong_module_type$(comma)is_prebuilt_make_module$(comma)product_copy_files$(comma)kernel_module_copy_files$(comma)is_platform_generated,build_output_path >> $@ $(foreach f,$(installed_files),\ $(eval _module_name := $(ALL_INSTALLED_FILES.$f)) \ $(eval _path_on_device := $(patsubst $(PRODUCT_OUT)/%,%,$f)) \ + $(eval _build_output_path := $(PRODUCT_OUT)/$(_path_on_device)) \ $(eval _module_path := $(strip $(sort $(ALL_MODULES.$(_module_name).PATH)))) \ $(eval _soong_module_type := $(strip $(sort $(ALL_MODULES.$(_module_name).SOONG_MODULE_TYPE)))) \ $(eval _is_prebuilt_make_module := $(ALL_MODULES.$(_module_name).IS_PREBUILT_MAKE_MODULE)) \ @@ -2184,9 +2185,9 @@ $(PRODUCT_OUT)/sbom-metadata.csv: $(installed_files) $(eval _is_linker_config := $(if $(findstring $f,$(SYSTEM_LINKER_CONFIG) $(vendor_linker_config_file)),Y)) \ $(eval _is_partition_compat_symlink := $(if $(findstring $f,$(PARTITION_COMPAT_SYMLINKS)),Y)) \ $(eval _is_platform_generated := $(_is_build_prop)$(_is_notice_file)$(_is_dexpreopt_image_profile)$(_is_product_system_other_avbkey)$(_is_event_log_tags_file)$(_is_system_other_odex_marker)$(_is_kernel_modules_blocklist)$(_is_fsverity_build_manifest_apk)$(_is_linker_config)$(_is_partition_compat_symlink)) \ - @echo /$(_path_on_device)$(comma)$(_module_path)$(comma)$(_soong_module_type)$(comma)$(_is_prebuilt_make_module)$(comma)$(_product_copy_files)$(comma)$(_kernel_module_copy_files)$(comma)$(_is_platform_generated) >> $@ $(newline) \ + @echo /$(_path_on_device)$(comma)$(_module_path)$(comma)$(_soong_module_type)$(comma)$(_is_prebuilt_make_module)$(comma)$(_product_copy_files)$(comma)$(_kernel_module_copy_files)$(comma)$(_is_platform_generated)$(comma)$(_build_output_path) >> $@ $(newline) \ $(if $(_post_installed_dexpreopt_zip), \ - for i in $$(zipinfo -1 $(_post_installed_dexpreopt_zip)); do echo /$$i$(comma)$(_module_path)$(comma)$(_soong_module_type)$(comma)$(_is_prebuilt_make_module)$(comma)$(_product_copy_files)$(comma)$(_kernel_module_copy_files)$(comma)$(_is_platform_generated) >> $@ ; done $(newline) \ + for i in $$(zipinfo -1 $(_post_installed_dexpreopt_zip)); do echo /$$i$(comma)$(_module_path)$(comma)$(_soong_module_type)$(comma)$(_is_prebuilt_make_module)$(comma)$(_product_copy_files)$(comma)$(_kernel_module_copy_files)$(comma)$(_is_platform_generated)$(comma)$(PRODUCT_OUT)/$$i >> $@ ; done $(newline) \ ) \ ) @@ -2196,14 +2197,14 @@ sbom: $(PRODUCT_OUT)/sbom.spdx.json $(PRODUCT_OUT)/sbom.spdx.json: $(PRODUCT_OUT)/sbom.spdx $(PRODUCT_OUT)/sbom.spdx: $(PRODUCT_OUT)/sbom-metadata.csv $(GEN_SBOM) rm -rf $@ - $(GEN_SBOM) --output_file $@ --metadata $(PRODUCT_OUT)/sbom-metadata.csv --product_out_dir=$(PRODUCT_OUT) --build_version $(BUILD_FINGERPRINT_FROM_FILE) --product_mfr="$(PRODUCT_MANUFACTURER)" --json + $(GEN_SBOM) --output_file $@ --metadata $(PRODUCT_OUT)/sbom-metadata.csv --build_version $(BUILD_FINGERPRINT_FROM_FILE) --product_mfr "$(PRODUCT_MANUFACTURER)" --json $(call dist-for-goals,droid,$(PRODUCT_OUT)/sbom.spdx.json:sbom/sbom.spdx.json) else apps_only_sbom_files := $(sort $(patsubst %,%.spdx.json,$(filter %.apk,$(apps_only_installed_files)))) $(apps_only_sbom_files): $(PRODUCT_OUT)/sbom-metadata.csv $(GEN_SBOM) rm -rf $@ - $(GEN_SBOM) --output_file $@ --metadata $(PRODUCT_OUT)/sbom-metadata.csv --product_out_dir=$(PRODUCT_OUT) --build_version $(BUILD_FINGERPRINT_FROM_FILE) --product_mfr="$(PRODUCT_MANUFACTURER)" --unbundled + $(GEN_SBOM) --output_file $@ --metadata $(PRODUCT_OUT)/sbom-metadata.csv --build_version $(BUILD_FINGERPRINT_FROM_FILE) --product_mfr "$(PRODUCT_MANUFACTURER)" --unbundled_apk sbom: $(apps_only_sbom_files) diff --git a/tools/sbom/generate-sbom.py b/tools/sbom/generate-sbom.py index 56509c9a11..1e98699a47 100755 --- a/tools/sbom/generate-sbom.py +++ b/tools/sbom/generate-sbom.py @@ -19,7 +19,6 @@ Generate the SBOM of the current target product in SPDX format. Usage example: generate-sbom.py --output_file out/target/product/vsoc_x86_64/sbom.spdx \ --metadata out/target/product/vsoc_x86_64/sbom-metadata.csv \ - --product_out_dir=out/target/product/vsoc_x86_64 \ --build_version $(cat out/target/product/vsoc_x86_64/build_fingerprint.txt) \ --product_mfr=Google """ @@ -89,11 +88,11 @@ def get_args(): parser.add_argument('-v', '--verbose', action='store_true', default=False, help='Print more information.') parser.add_argument('--output_file', required=True, help='The generated SBOM file in SPDX format.') parser.add_argument('--metadata', required=True, help='The SBOM metadata file path.') - parser.add_argument('--product_out_dir', required=True, help='The parent directory of all the installed files.') parser.add_argument('--build_version', required=True, help='The build version.') parser.add_argument('--product_mfr', required=True, help='The product manufacturer.') parser.add_argument('--json', action='store_true', default=False, help='Generated SBOM file in SPDX JSON format') - parser.add_argument('--unbundled', action='store_true', default=False, help='Generate SBOM file for unbundled module') + parser.add_argument('--unbundled_apk', action='store_true', default=False, help='Generate SBOM for unbundled APKs') + parser.add_argument('--unbundled_apex', action='store_true', default=False, help='Generate SBOM for unbundled APEXs') return parser.parse_args() @@ -127,7 +126,6 @@ def new_file_id(file_path): def checksum(file_path): - file_path = args.product_out_dir + '/' + file_path h = hashlib.sha1() if os.path.islink(file_path): h.update(os.readlink(file_path).encode('utf-8')) @@ -334,9 +332,8 @@ def generate_package_verification_code(files): return h.hexdigest() -def save_report(report): - prefix, _ = os.path.splitext(args.output_file) - with open(prefix + '-gen-report.txt', 'w', encoding='utf-8') as report_file: +def save_report(report_file_path, report): + with open(report_file_path, 'w', encoding='utf-8') as report_file: for type, issues in report.items(): report_file.write(type + '\n') for issue in issues: @@ -394,7 +391,7 @@ def report_metadata_file(metadata_file_path, installed_file_metadata, report): installed_file_metadata['installed_file'], installed_file_metadata['module_path'])) -def generate_sbom_for_unbundled(): +def generate_sbom_for_unbundled_apk(): with open(args.metadata, newline='') as sbom_metadata_file: reader = csv.DictReader(sbom_metadata_file) doc = sbom_data.Document(name=args.build_version, @@ -402,7 +399,7 @@ def generate_sbom_for_unbundled(): creators=['Organization: ' + args.product_mfr]) for installed_file_metadata in reader: installed_file = installed_file_metadata['installed_file'] - if args.output_file != args.product_out_dir + installed_file + '.spdx.json': + if args.output_file != installed_file_metadata['build_output_path'] + '.spdx.json': continue module_path = installed_file_metadata['module_path'] @@ -412,7 +409,9 @@ def generate_sbom_for_unbundled(): version=args.build_version, supplier='Organization: ' + args.product_mfr) file_id = new_file_id(installed_file) - file = sbom_data.File(id=file_id, name=installed_file, checksum=checksum(installed_file)) + file = sbom_data.File(id=file_id, + name=installed_file, + checksum=checksum(installed_file_metadata['build_output_path'])) relationship = sbom_data.Relationship(id1=file_id, relationship=sbom_data.RelationshipType.GENERATED_FROM, id2=package_id) @@ -435,24 +434,25 @@ def main(): args = get_args() log('Args:', vars(args)) - if args.unbundled: - generate_sbom_for_unbundled() + if args.unbundled_apk: + generate_sbom_for_unbundled_apk() return global metadata_file_protos metadata_file_protos = {} - doc = sbom_data.Document(name=args.build_version, - namespace=f'https://www.google.com/sbom/spdx/android/{args.build_version}', - creators=['Organization: ' + args.product_mfr]) - product_package = sbom_data.Package(id=sbom_data.SPDXID_PRODUCT, name=sbom_data.PACKAGE_NAME_PRODUCT, download_location=sbom_data.VALUE_NONE, version=args.build_version, supplier='Organization: ' + args.product_mfr, files_analyzed=True) - doc.packages.append(product_package) + + doc = sbom_data.Document(name=args.build_version, + namespace=f'https://www.google.com/sbom/spdx/android/{args.build_version}', + creators=['Organization: ' + args.product_mfr]) + if not args.unbundled_apex: + doc.packages.append(product_package) doc.packages.append(sbom_data.Package(id=sbom_data.SPDXID_PLATFORM, name=sbom_data.PACKAGE_NAME_PLATFORM, @@ -478,18 +478,21 @@ def main(): module_path = installed_file_metadata['module_path'] product_copy_files = installed_file_metadata['product_copy_files'] kernel_module_copy_files = installed_file_metadata['kernel_module_copy_files'] + build_output_path = installed_file_metadata['build_output_path'] if not installed_file_has_metadata(installed_file_metadata, report): continue - file_path = args.product_out_dir + '/' + installed_file - if not (os.path.islink(file_path) or os.path.isfile(file_path)): + if not (os.path.islink(build_output_path) or os.path.isfile(build_output_path)): report[ISSUE_INSTALLED_FILE_NOT_EXIST].append(installed_file) continue file_id = new_file_id(installed_file) doc.files.append( - sbom_data.File(id=file_id, name=installed_file, checksum=checksum(installed_file))) - product_package.file_ids.append(file_id) + sbom_data.File(id=file_id, name=installed_file, checksum=checksum(build_output_path))) + if not args.unbundled_apex: + product_package.file_ids.append(file_id) + elif len(doc.files) > 1: + doc.add_relationship(sbom_data.Relationship(doc.files[0].id, sbom_data.RelationshipType.CONTAINS, file_id)) if is_source_package(installed_file_metadata) or is_prebuilt_package(installed_file_metadata): metadata_file_path = get_metadata_file_path(installed_file_metadata) @@ -533,16 +536,31 @@ def main(): relationship=sbom_data.RelationshipType.GENERATED_FROM, id2=sbom_data.SPDXID_PLATFORM)) - product_package.verification_code = generate_package_verification_code(doc.files) + if not args.unbundled_apex: + product_package.verification_code = generate_package_verification_code(doc.files) + + if args.unbundled_apex: + doc.describes = doc.files[0].id # Save SBOM records to output file doc.created = datetime.datetime.now(tz=datetime.timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ') - with open(args.output_file, 'w', encoding="utf-8") as file: - sbom_writers.TagValueWriter.write(doc, file) + prefix = args.output_file + if prefix.endswith('.spdx'): + prefix = prefix.removesuffix('.spdx') + elif prefix.endswith('.spdx.json'): + prefix = prefix.removesuffix('.spdx.json') + + output_file = prefix + '.spdx' + if args.unbundled_apex: + output_file = prefix + '-fragment.spdx' + with open(output_file, 'w', encoding="utf-8") as file: + sbom_writers.TagValueWriter.write(doc, file, fragment=args.unbundled_apex) if args.json: - with open(args.output_file+'.json', 'w', encoding="utf-8") as file: + with open(prefix + '.spdx.json', 'w', encoding="utf-8") as file: sbom_writers.JSONWriter.write(doc, file) + save_report(prefix + '-gen-report.txt', report) + if __name__ == '__main__': main() diff --git a/tools/sbom/sbom_data.py b/tools/sbom/sbom_data.py index d2ef48d52c..14c4eb231d 100644 --- a/tools/sbom/sbom_data.py +++ b/tools/sbom/sbom_data.py @@ -80,6 +80,7 @@ class RelationshipType: DESCRIBES = 'DESCRIBES' VARIANT_OF = 'VARIANT_OF' GENERATED_FROM = 'GENERATED_FROM' + CONTAINS = 'CONTAINS' @dataclass diff --git a/tools/sbom/sbom_writers.py b/tools/sbom/sbom_writers.py index b1c66c5f80..85dee9d1a5 100644 --- a/tools/sbom/sbom_writers.py +++ b/tools/sbom/sbom_writers.py @@ -110,24 +110,26 @@ class TagValueWriter: return tagvalues @staticmethod - def marshal_described_element(sbom_doc): + def marshal_described_element(sbom_doc, fragment): if not sbom_doc.describes: return None product_package = [p for p in sbom_doc.packages if p.id == sbom_doc.describes] if product_package: tagvalues = TagValueWriter.marshal_package(product_package[0]) - tagvalues.append( - f'{Tags.RELATIONSHIP}: {sbom_doc.id} {sbom_data.RelationshipType.DESCRIBES} {sbom_doc.describes}') + if not fragment: + tagvalues.append( + f'{Tags.RELATIONSHIP}: {sbom_doc.id} {sbom_data.RelationshipType.DESCRIBES} {sbom_doc.describes}') tagvalues.append('') return tagvalues file = [f for f in sbom_doc.files if f.id == sbom_doc.describes] if file: - tagvalues = [ - f'{Tags.RELATIONSHIP}: {sbom_doc.id} {sbom_data.RelationshipType.DESCRIBES} {sbom_doc.describes}' - ] + tagvalues = TagValueWriter.marshal_file(file[0]) + if not fragment: + tagvalues.append( + f'{Tags.RELATIONSHIP}: {sbom_doc.id} {sbom_data.RelationshipType.DESCRIBES} {sbom_doc.describes}') return tagvalues @@ -180,6 +182,8 @@ class TagValueWriter: def marshal_files(sbom_doc): tagvalues = [] for file in sbom_doc.files: + if file.id == sbom_doc.describes: + continue tagvalues += TagValueWriter.marshal_file(file) return tagvalues @@ -204,9 +208,9 @@ class TagValueWriter: content = [] if not fragment: content += TagValueWriter.marshal_doc_headers(sbom_doc) - described_element = TagValueWriter.marshal_described_element(sbom_doc) - if described_element: - content += described_element + described_element = TagValueWriter.marshal_described_element(sbom_doc, fragment) + if described_element: + content += described_element content += TagValueWriter.marshal_files(sbom_doc) tagvalues, marshaled_relationships = TagValueWriter.marshal_packages(sbom_doc) content += tagvalues From 58c428e336b550444293d20ec8f9f5f7fdeefd96 Mon Sep 17 00:00:00 2001 From: Yihan Dong Date: Fri, 19 May 2023 18:25:23 +0800 Subject: [PATCH 126/139] Remove GTS-Verifier license check The whole GTS-Verifier will be removed. Before that, remove GTS-V license check first. Ignore-AOSP-First: This CL must be submit with other CLs in the topic to avoid breaking the test. This CL will be cherry pick to AOSP after submitting. Bug: 283384166 Test: m gts Change-Id: I5bc8c1f4609f55cedd5bfbed014b65de164e2b16 --- tools/generate_gts_shared_report.py | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/tools/generate_gts_shared_report.py b/tools/generate_gts_shared_report.py index 11c9364189..3067ae172c 100644 --- a/tools/generate_gts_shared_report.py +++ b/tools/generate_gts_shared_report.py @@ -18,14 +18,12 @@ Checks and generates a report for gts modules that should be open-sourced. Usage: generate_gts_open_source_report.py - --gtsv-metalic [gts-verifier meta_lic] --gts-test-metalic [android-gts meta_lic] --checkshare [COMPLIANCE_CHECKSHARE] --gts-test-dir [directory of android-gts] --output [output file] Output example: - GTS-Verifier: PASS/FAIL GTS-Modules: PASS/FAIL GtsIncrementalInstallTestCases_BackgroundProcess GtsUnsignedNetworkStackTestCases @@ -38,9 +36,6 @@ import re def _get_args(): """Parses input arguments.""" parser = argparse.ArgumentParser() - parser.add_argument( - '--gtsv-metalic', required=True, - help='license meta_lic file path of gts-verifier.zip') parser.add_argument( '--gts-test-metalic', required=True, help='license meta_lic file path of android-gts.zip') @@ -55,23 +50,6 @@ def _get_args(): help='file path of the output report') return parser.parse_args() -def _check_gtsv(checkshare: str, gtsv_metalic: str) -> str: - """Checks gts-verifier license. - - Args: - checkshare: path of the COMPLIANCE_CHECKSHARE tool - gtsv_metalic: license meta_lic file path of gts-verifier.zip - - Returns: - PASS when gts-verifier.zip doesn't need to be shared, and FAIL - when gts-verifier.zip need to be shared. - """ - cmd = f'{checkshare} {gtsv_metalic}' - proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - proc.communicate() - return 'PASS' if proc.returncode == 0 else 'FAIL' - def _check_gts_test(checkshare: str, gts_test_metalic: str, gts_test_dir: str) -> tuple[str, set[str]]: """Checks android-gts license. @@ -109,15 +87,12 @@ def _check_gts_test(checkshare: str, gts_test_metalic: str, def main(argv): args = _get_args() - gtsv_metalic = args.gtsv_metalic gts_test_metalic = args.gts_test_metalic output_file = args.output checkshare = args.checkshare gts_test_dir = args.gts_test_dir with open(output_file, 'w') as file: - result = _check_gtsv(checkshare, gtsv_metalic) - file.write(f'GTS-Verifier: {result}\n') result, open_source_modules = _check_gts_test( checkshare, gts_test_metalic, gts_test_dir) file.write(f'GTS-Modules: {result}\n') @@ -125,4 +100,4 @@ def main(argv): file.write(f'\t{open_source_module}\n') if __name__ == "__main__": - main(sys.argv) \ No newline at end of file + main(sys.argv) From 792dfa537a8a96a344f6de5620dff3f057f1bceb Mon Sep 17 00:00:00 2001 From: Satoshi Futenma Date: Tue, 18 Apr 2023 19:15:26 +0900 Subject: [PATCH 127/139] Add merge_ota to otatools Bug: 282189563 Test: manual, m otatools-package, confirm that merga_ota is present in otatools.zip (cherry picked from https://android-review.googlesource.com/q/commit:6d56d45f96cc1f4e45141bfd04cd92551451d3f5) Merged-In: I40c3866bfb016aa1dec1c6dc2d95c66deb1e61ea Change-Id: I40c3866bfb016aa1dec1c6dc2d95c66deb1e61ea --- core/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/core/Makefile b/core/Makefile index 6561420b5a..4208672300 100644 --- a/core/Makefile +++ b/core/Makefile @@ -5144,6 +5144,7 @@ INTERNAL_OTATOOLS_MODULES := \ lz4 \ make_f2fs \ make_f2fs_casefold \ + merge_ota \ merge_target_files \ minigzip \ mk_combined_img \ From 03bd5812e86c116826b7ab9d0adbcb41c496af37 Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Wed, 19 Oct 2022 01:38:49 -0400 Subject: [PATCH 128/139] Add BUILD_BROKEN_PLUGIN_VALIDATION flag Use is to specify the list of plugins are are not allowed. Ignore-AOSP-First: Requires an internal only change to not break when submitted Test: CI (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f24be9dba9b53b0c1682929253a3eba9af7a4c31) Merged-In: Ia2fe83d82ead618e480e99a82b1b825ed08d3eab Change-Id: Ia2fe83d82ead618e480e99a82b1b825ed08d3eab --- Changes.md | 14 +++++++++++++- core/board_config.mk | 1 + core/soong_config.mk | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index daebd5231a..6d20173c19 100644 --- a/Changes.md +++ b/Changes.md @@ -1,5 +1,18 @@ # Build System Changes for Android.mk Writers +## Perform validation of Soong plugins + +Each Soong plugin will require manual work to migrate to Bazel. In order to +minimize the manual work outside of build/soong, we are restricting plugins to +those that exist today and those in vendor or hardware directories. + +If you need to extend the build system via a plugin, please reach out to the +build team via email android-building@googlegroups.com (external) for any +questions, or see [go/soong](http://go/soong) (internal). + +To omit the validation, `BUILD_BROKEN_PLUGIN_VALIDATION` expects a list of +plugins to omit from the validation. + ## Python 2 to 3 migration The path set when running builds now makes the `python` executable point to python 3, @@ -15,7 +28,6 @@ overridden by setting the `BUILD_BROKEN_USES_SOONG_PYTHON2_MODULES` product conf variable to `true`. Python 2 is slated for complete removal in V. - ## Stop referencing sysprop_library directly from cc modules For the migration to Bazel, we are no longer mapping sysprop_library targets diff --git a/core/board_config.mk b/core/board_config.mk index bdfb279058..c8ec5a9322 100644 --- a/core/board_config.mk +++ b/core/board_config.mk @@ -174,6 +174,7 @@ _board_strip_list += ODM_MANIFEST_SKUS _build_broken_var_list := \ + BUILD_BROKEN_PLUGIN_VALIDATION \ BUILD_BROKEN_CLANG_PROPERTY \ BUILD_BROKEN_CLANG_ASFLAGS \ BUILD_BROKEN_CLANG_CFLAGS \ diff --git a/core/soong_config.mk b/core/soong_config.mk index 8b9ba4f944..7dad167a40 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -285,6 +285,7 @@ $(call add_json_str, PrebuiltHiddenApiDir, $(BOARD_PREBUILT_HIDDENAPI_DIR)) $(call add_json_str, ShippingApiLevel, $(PRODUCT_SHIPPING_API_LEVEL)) +$(call add_json_list, BuildBrokenPluginValidation, $(BUILD_BROKEN_PLUGIN_VALIDATION)) $(call add_json_bool, BuildBrokenClangProperty, $(filter true,$(BUILD_BROKEN_CLANG_PROPERTY))) $(call add_json_bool, BuildBrokenClangAsFlags, $(filter true,$(BUILD_BROKEN_CLANG_ASFLAGS))) $(call add_json_bool, BuildBrokenClangCFlags, $(filter true,$(BUILD_BROKEN_CLANG_CFLAGS))) From d0b037235d5fb4a9e4ff8dc6f4795d8076e912ae Mon Sep 17 00:00:00 2001 From: Jeongik Cha Date: Thu, 27 Apr 2023 11:05:22 +0900 Subject: [PATCH 129/139] BUILD_NUMBER and BUILD_HOSTNAME doesn't affect kati regeneration * Extract BUILD_NUMBER, BUILD_HOSTNAME to file to avoid kati change * Handle FILE_NAME_TAG_PLACEHOLDER string in dist in build/make/packaging/distdir.mk Ignore-AOSP-First: there are internal use cases of FILE_NAME_TAG Test: check if kati isn't invoked even though BUILD_NUMBER, BUILD_HOSTNAME is changed Test: m && m, and check if the second m is no-op Bug: 278060169 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7b40aa8338ba85a58ee481fe6bafac2959f7112b) Merged-In: I1b37760242853c1a145bad255d0bb15524234b25 Change-Id: I1b37760242853c1a145bad255d0bb15524234b25 --- Changes.md | 18 +++++++++ core/Makefile | 32 ++++++++-------- core/config.mk | 1 + core/host_java_library.mk | 2 - core/java.mk | 2 - core/main.mk | 51 +++++++++++--------------- core/sysprop.mk | 13 +++++-- core/tasks/sdk-addon.mk | 15 ++++---- core/tasks/tools/build_custom_image.mk | 3 ++ core/tasks/tools/compatibility.mk | 3 ++ core/tasks/with-license.mk | 6 ++- core/version_util.mk | 15 +------- packaging/distdir.mk | 6 ++- 13 files changed, 91 insertions(+), 76 deletions(-) diff --git a/Changes.md b/Changes.md index 6d20173c19..fc6701d7e5 100644 --- a/Changes.md +++ b/Changes.md @@ -505,6 +505,24 @@ $(call dist-for-goals,foo,bar/baz) will copy `bar/baz` into `$DIST_DIR/baz` when `m foo dist` is run. +#### FILE_NAME_TAG {#FILE_NAME_TAG} + +To embed the `BUILD_NUMBER` (or for local builds, `eng.${USER}`), include +`FILE_NAME_TAG_PLACEHOLDER` in the destination: + +``` make +# you can use dist-for-goals-with-filenametag function +$(call dist-for-goals-with-filenametag,foo,bar.zip) +# or use FILE_NAME_TAG_PLACEHOLDER manually +$(call dist-for-goals,foo,bar.zip:baz-FILE_NAME_TAG_PLACEHOLDER.zip) +``` + +Which will produce `$DIST_DIR/baz-1234567.zip` on build servers which set +`BUILD_NUMBER=1234567`, or `$DIST_DIR/baz-eng.builder.zip` for local builds. + +If you just want to append `BUILD_NUMBER` at the end of basename, use +`dist-for-goals-with-filenametag` instead of `dist-for-goals`. + #### Renames during copy Instead of specifying just a file, a destination name can be specified, diff --git a/core/Makefile b/core/Makefile index f7363a151e..ce7e33dc5a 100644 --- a/core/Makefile +++ b/core/Makefile @@ -711,7 +711,7 @@ name := $(TARGET_PRODUCT) ifeq ($(TARGET_BUILD_TYPE),debug) name := $(name)_debug endif -name := $(name)-apkcerts-$(FILE_NAME_TAG) +name := $(name)-apkcerts intermediates := \ $(call intermediates-dir-for,PACKAGING,apkcerts) APKCERTS_FILE := $(intermediates)/$(name).txt @@ -5710,7 +5710,7 @@ name := $(TARGET_PRODUCT) ifeq ($(TARGET_BUILD_TYPE),debug) name := $(name)_debug endif -name := $(name)-target_files-$(FILE_NAME_TAG) +name := $(name)-target_files intermediates := $(call intermediates-dir-for,PACKAGING,target_files) BUILT_TARGET_FILES_DIR := $(intermediates)/$(name).zip.list @@ -6480,7 +6480,7 @@ $(call declare-container-license-deps,$(BUILT_TARGET_FILES_PACKAGE), $(INSTALLED $(BUILT_KERNEL_CONFIGS_FILE) \ $(BUILT_KERNEL_VERSION_FILE),$(BUILT_TARGET_FILES_PACKAGE):) -$(call dist-for-goals, target-files-package, $(BUILT_TARGET_FILES_PACKAGE)) +$(call dist-for-goals-with-filenametag, target-files-package, $(BUILT_TARGET_FILES_PACKAGE)) # ----------------------------------------------------------------- # NDK Sysroot Package @@ -6515,7 +6515,7 @@ product_name := $(TARGET_PRODUCT) ifeq ($(TARGET_BUILD_TYPE),debug) product_name := $(product_name)_debug endif -name := $(product_name)-ota-$(FILE_NAME_TAG) +name := $(product_name)-ota INTERNAL_OTA_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip INTERNAL_OTA_METADATA := $(PRODUCT_OUT)/ota_metadata @@ -6535,7 +6535,7 @@ $(call declare-container-license-deps,$(INTERNAL_OTA_PACKAGE_TARGET),$(BUILT_TAR otapackage: $(INTERNAL_OTA_PACKAGE_TARGET) ifeq ($(BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE),true) -name := $(product_name)-ota-retrofit-$(FILE_NAME_TAG) +name := $(product_name)-ota-retrofit INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip $(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET): KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR) @@ -6556,7 +6556,7 @@ otapackage otardppackage: $(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TAR endif # BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE ifneq ($(BOARD_PARTIAL_OTA_UPDATE_PARTITIONS_LIST),) -name := $(product_name)-partial-ota-$(FILE_NAME_TAG) +name := $(product_name)-partial-ota INTERNAL_OTA_PARTIAL_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip $(INTERNAL_OTA_PARTIAL_PACKAGE_TARGET): KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR) @@ -6656,9 +6656,9 @@ ifeq ($(TARGET_BUILD_TYPE),debug) endif # The path to the zip file containing binaries with symbols. -SYMBOLS_ZIP := $(PRODUCT_OUT)/$(name)-symbols-$(FILE_NAME_TAG).zip +SYMBOLS_ZIP := $(PRODUCT_OUT)/$(name)-symbols.zip # The path to a file containing mappings from elf IDs to filenames. -SYMBOLS_MAPPING := $(PRODUCT_OUT)/$(name)-symbols-mapping-$(FILE_NAME_TAG).textproto +SYMBOLS_MAPPING := $(PRODUCT_OUT)/$(name)-symbols-mapping.textproto .KATI_READONLY := SYMBOLS_ZIP SYMBOLS_MAPPING # For apps_only build we'll establish the dependency later in build/make/core/main.mk. ifeq (,$(TARGET_BUILD_UNBUNDLED)) @@ -6733,7 +6733,7 @@ name := $(TARGET_PRODUCT) ifeq ($(TARGET_BUILD_TYPE),debug) name := $(name)_debug endif -name := $(name)-apps-$(FILE_NAME_TAG) +name := $(name)-apps APPS_ZIP := $(PRODUCT_OUT)/$(name).zip $(APPS_ZIP): $(FULL_SYSTEMIMAGE_DEPS) @@ -6784,9 +6784,9 @@ endif # EMMA_INSTRUMENT=true # # The path to the zip file containing proguard dictionaries. -PROGUARD_DICT_ZIP := $(PRODUCT_OUT)/$(TARGET_PRODUCT)-proguard-dict-$(FILE_NAME_TAG).zip +PROGUARD_DICT_ZIP := $(PRODUCT_OUT)/$(TARGET_PRODUCT)-proguard-dict.zip # The path to the zip file containing mappings from dictionary hashes to filenames. -PROGUARD_DICT_MAPPING := $(PRODUCT_OUT)/$(TARGET_PRODUCT)-proguard-dict-mapping-$(FILE_NAME_TAG).textproto +PROGUARD_DICT_MAPPING := $(PRODUCT_OUT)/$(TARGET_PRODUCT)-proguard-dict-mapping.textproto .KATI_READONLY := PROGUARD_DICT_ZIP PROGUARD_DICT_MAPPING # For apps_only build we'll establish the dependency later in build/make/core/main.mk. ifeq (,$(TARGET_BUILD_UNBUNDLED)) @@ -6815,7 +6815,7 @@ endif #------------------------------------------------------------------ # A zip of Proguard usage files. # -PROGUARD_USAGE_ZIP := $(PRODUCT_OUT)/$(TARGET_PRODUCT)-proguard-usage-$(FILE_NAME_TAG).zip +PROGUARD_USAGE_ZIP := $(PRODUCT_OUT)/$(TARGET_PRODUCT)-proguard-usage.zip # For apps_only build we'll establish the dependency later in build/make/core/main.mk. ifeq (,$(TARGET_BUILD_UNBUNDLED)) $(PROGUARD_USAGE_ZIP): \ @@ -6992,7 +6992,7 @@ name := $(TARGET_PRODUCT) ifeq ($(TARGET_BUILD_TYPE),debug) name := $(name)_debug endif -name := $(name)-img-$(FILE_NAME_TAG) +name := $(name)-img INTERNAL_UPDATE_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip @@ -7008,7 +7008,7 @@ $(call declare-container-license-deps,$(INTERNAL_UPDATE_PACKAGE_TARGET),$(BUILT_ .PHONY: updatepackage updatepackage: $(INTERNAL_UPDATE_PACKAGE_TARGET) -$(call dist-for-goals,updatepackage,$(INTERNAL_UPDATE_PACKAGE_TARGET)) +$(call dist-for-goals-with-filenametag,updatepackage,$(INTERNAL_UPDATE_PACKAGE_TARGET)) # ----------------------------------------------------------------- @@ -7137,7 +7137,7 @@ INTERNAL_EMULATOR_PACKAGE_FILES += \ $(INSTALLED_SYSTEMIMAGE_TARGET) \ $(INSTALLED_USERDATAIMAGE_TARGET) -name := $(TARGET_PRODUCT)-emulator-$(FILE_NAME_TAG) +name := $(TARGET_PRODUCT)-emulator INTERNAL_EMULATOR_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip @@ -7165,7 +7165,7 @@ sdk_dir := $(HOST_OUT)/sdk/$(TARGET_PRODUCT) ifneq ($(HOST_OS),linux) $(error Building the monolithic SDK is only supported on Linux) endif -sdk_name := android-sdk_$(FILE_NAME_TAG) +sdk_name := android-sdk INTERNAL_SDK_HOST_OS_NAME := linux-$(SDK_HOST_ARCH) sdk_name := $(sdk_name)_$(INTERNAL_SDK_HOST_OS_NAME) diff --git a/core/config.mk b/core/config.mk index f5037649b7..0e2d2719f5 100644 --- a/core/config.mk +++ b/core/config.mk @@ -856,6 +856,7 @@ endif .KATI_READONLY := MAINLINE_SEPOLICY_DEV_CERTIFICATES BUILD_NUMBER_FROM_FILE := $$(cat $(SOONG_OUT_DIR)/build_number.txt) +BUILD_HOSTNAME_FROM_FILE := $$(cat $(SOONG_OUT_DIR)/build_hostname.txt) BUILD_DATETIME_FROM_FILE := $$(cat $(BUILD_DATETIME_FILE)) # SEPolicy versions diff --git a/core/host_java_library.mk b/core/host_java_library.mk index 89aa53ce0c..8e063d0ae3 100644 --- a/core/host_java_library.mk +++ b/core/host_java_library.mk @@ -98,8 +98,6 @@ $(full_classes_combined_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_D $(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 $<) \ $@ $< $(PRIVATE_STATIC_JAVA_LIBRARIES) diff --git a/core/java.mk b/core/java.mk index b13ef4d403..6d8f23709e 100644 --- a/core/java.mk +++ b/core/java.mk @@ -296,8 +296,6 @@ $(full_classes_combined_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_D $(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 $<) \ $@ $< $(PRIVATE_STATIC_JAVA_LIBRARIES) diff --git a/core/main.mk b/core/main.mk index 0f1368f15c..b78766133a 100644 --- a/core/main.mk +++ b/core/main.mk @@ -40,31 +40,23 @@ include $(BUILD_SYSTEM)/clang/config.mk # Write the build number to a file so it can be read back in # without changing the command line every time. Avoids rebuilds # when using ninja. -$(shell mkdir -p $(SOONG_OUT_DIR) && \ - echo -n $(BUILD_NUMBER) > $(SOONG_OUT_DIR)/build_number.tmp; \ - if ! cmp -s $(SOONG_OUT_DIR)/build_number.tmp $(SOONG_OUT_DIR)/build_number.txt; then \ - mv $(SOONG_OUT_DIR)/build_number.tmp $(SOONG_OUT_DIR)/build_number.txt; \ - else \ - rm $(SOONG_OUT_DIR)/build_number.tmp; \ - fi) BUILD_NUMBER_FILE := $(SOONG_OUT_DIR)/build_number.txt -.KATI_READONLY := BUILD_NUMBER_FILE $(KATI_obsolete_var BUILD_NUMBER,See https://android.googlesource.com/platform/build/+/master/Changes.md#BUILD_NUMBER) +BUILD_HOSTNAME_FILE := $(SOONG_OUT_DIR)/build_hostname.txt +$(KATI_obsolete_var BUILD_HOSTNAME,Use BUILD_HOSTNAME_FROM_FILE instead) +$(KATI_obsolete_var FILE_NAME_TAG,https://android.googlesource.com/platform/build/+/master/Changes.md#FILE_NAME_TAG) + $(BUILD_NUMBER_FILE): - touch $@ + touch -a $@ +$(BUILD_HOSTNAME_FILE): + touch -a $@ + +.KATI_RESTAT: $(BUILD_NUMBER_FILE) +.KATI_RESTAT: $(BUILD_HOSTNAME_FILE) DATE_FROM_FILE := date -d @$(BUILD_DATETIME_FROM_FILE) .KATI_READONLY := DATE_FROM_FILE -# Pick a reasonable string to use to identify files. -ifeq ($(strip $(HAS_BUILD_NUMBER)),false) - # BUILD_NUMBER has a timestamp in it, which means that - # it will change every time. Pick a stable value. - FILE_NAME_TAG := eng.$(BUILD_USERNAME) -else - FILE_NAME_TAG := $(file <$(BUILD_NUMBER_FILE)) -endif -.KATI_READONLY := FILE_NAME_TAG # Make an empty directory, which can be used to make empty jars EMPTY_DIRECTORY := $(OUT_DIR)/empty @@ -1751,15 +1743,15 @@ else ifneq ($(TARGET_BUILD_APPS),) endif $(PROGUARD_DICT_ZIP) : $(apps_only_installed_files) - $(call dist-for-goals,apps_only, $(PROGUARD_DICT_ZIP) $(PROGUARD_DICT_MAPPING)) + $(call dist-for-goals-with-filenametag,apps_only, $(PROGUARD_DICT_ZIP) $(PROGUARD_DICT_ZIP) $(PROGUARD_DICT_MAPPING)) $(call declare-container-license-deps,$(PROGUARD_DICT_ZIP),$(apps_only_installed_files),$(PRODUCT_OUT)/:/) $(PROGUARD_USAGE_ZIP) : $(apps_only_installed_files) - $(call dist-for-goals,apps_only, $(PROGUARD_USAGE_ZIP)) + $(call dist-for-goals-with-filenametag,apps_only, $(PROGUARD_USAGE_ZIP)) $(call declare-container-license-deps,$(PROGUARD_USAGE_ZIP),$(apps_only_installed_files),$(PRODUCT_OUT)/:/) $(SYMBOLS_ZIP) : $(apps_only_installed_files) - $(call dist-for-goals,apps_only, $(SYMBOLS_ZIP) $(SYMBOLS_MAPPING)) + $(call dist-for-goals-with-filenametag,apps_only, $(SYMBOLS_ZIP) $(SYMBOLS_MAPPING)) $(call declare-container-license-deps,$(SYMBOLS_ZIP),$(apps_only_installed_files),$(PRODUCT_OUT)/:/) $(COVERAGE_ZIP) : $(apps_only_installed_files) @@ -1805,10 +1797,9 @@ else ifeq ($(TARGET_BUILD_UNBUNDLED),$(TARGET_BUILD_UNBUNDLED_IMAGE)) # avoid disting targets that would cause building framework java sources, # which we want to avoid in an unbundled build. - $(call dist-for-goals, droidcore-unbundled, \ + $(call dist-for-goals-with-filenametag, droidcore-unbundled, \ $(INTERNAL_UPDATE_PACKAGE_TARGET) \ $(INTERNAL_OTA_PACKAGE_TARGET) \ - $(INTERNAL_OTA_METADATA) \ $(INTERNAL_OTA_PARTIAL_PACKAGE_TARGET) \ $(BUILT_RAMDISK_16K_TARGET) \ $(BUILT_KERNEL_16K_TARGET) \ @@ -1818,6 +1809,11 @@ else ifeq ($(TARGET_BUILD_UNBUNDLED),$(TARGET_BUILD_UNBUNDLED_IMAGE)) $(PROGUARD_DICT_ZIP) \ $(PROGUARD_DICT_MAPPING) \ $(PROGUARD_USAGE_ZIP) \ + $(BUILT_TARGET_FILES_PACKAGE) \ + ) + + $(call dist-for-goals, droidcore-unbundled, \ + $(INTERNAL_OTA_METADATA) \ $(COVERAGE_ZIP) \ $(INSTALLED_FILES_FILE) \ $(INSTALLED_FILES_JSON) \ @@ -1845,7 +1841,6 @@ else ifeq ($(TARGET_BUILD_UNBUNDLED),$(TARGET_BUILD_UNBUNDLED_IMAGE)) $(INSTALLED_ODM_BUILD_PROP_TARGET):build.prop-odm \ $(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET):build.prop-system_ext \ $(INSTALLED_RAMDISK_BUILD_PROP_TARGET):build.prop-ramdisk \ - $(BUILT_TARGET_FILES_PACKAGE) \ $(INSTALLED_ANDROID_INFO_TXT_TARGET) \ $(INSTALLED_MISC_INFO_TARGET) \ $(INSTALLED_RAMDISK_TARGET) \ @@ -1857,7 +1852,7 @@ else ifeq ($(TARGET_BUILD_UNBUNDLED),$(TARGET_BUILD_UNBUNDLED_IMAGE)) $(call dist-for-goals, droidcore-unbundled, $(f))) ifneq ($(ANDROID_BUILD_EMBEDDED),true) - $(call dist-for-goals, droidcore, \ + $(call dist-for-goals-with-filenametag, droidcore, \ $(APPS_ZIP) \ $(INTERNAL_EMULATOR_PACKAGE_TARGET) \ ) @@ -1957,10 +1952,8 @@ docs: $(ALL_DOCS) ifeq ($(HOST_OS),linux) ALL_SDK_TARGETS := $(INTERNAL_SDK_TARGET) sdk: $(ALL_SDK_TARGETS) -$(call dist-for-goals,sdk, \ - $(ALL_SDK_TARGETS) \ - $(INSTALLED_BUILD_PROP_TARGET) \ -) +$(call dist-for-goals-with-filenametag,sdk,$(ALL_SDK_TARGETS)) +$(call dist-for-goals,sdk,$(INSTALLED_BUILD_PROP_TARGET)) endif # umbrella targets to assit engineers in verifying builds diff --git a/core/sysprop.mk b/core/sysprop.mk index bd6f3d9fdf..cf4b1f64b4 100644 --- a/core/sysprop.mk +++ b/core/sysprop.mk @@ -174,7 +174,7 @@ ifeq (,$(strip $(BUILD_FINGERPRINT))) ifeq ($(strip $(HAS_BUILD_NUMBER)),false) BF_BUILD_NUMBER := $(BUILD_USERNAME)$$($(DATE_FROM_FILE) +%m%d%H%M) else - BF_BUILD_NUMBER := $(file <$(BUILD_NUMBER_FILE)) + BF_BUILD_NUMBER := $$(cat $(SOONG_OUT_DIR)/build_hostname.txt) endif BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS) endif @@ -196,6 +196,9 @@ ifeq (,$(strip $(BUILD_THUMBPRINT))) endif BUILD_THUMBPRINT_FILE := $(PRODUCT_OUT)/build_thumbprint.txt +ifeq ($(strip $(HAS_BUILD_NUMBER)),true) +$(BUILD_THUMBPRINT_FILE): $(BUILD_NUMBER_FILE) +endif ifneq (,$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_THUMBPRINT) >$(BUILD_THUMBPRINT_FILE) && grep " " $(BUILD_THUMBPRINT_FILE))) $(error BUILD_THUMBPRINT cannot contain spaces: "$(file <$(BUILD_THUMBPRINT_FILE))") endif @@ -260,7 +263,11 @@ $(strip $(subst _,-, $(firstword $(1)))) endef gen_from_buildinfo_sh := $(call intermediates-dir-for,PACKAGING,system_build_prop)/buildinfo.prop -$(gen_from_buildinfo_sh): $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) | $(BUILD_DATETIME_FILE) $(BUILD_NUMBER_FILE) + +ifeq ($(strip $(HAS_BUILD_NUMBER)),true) +$(gen_from_buildinfo_sh): $(BUILD_NUMBER_FILE) +endif +$(gen_from_buildinfo_sh): $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) $(BUILD_HOSTNAME_FILE) | $(BUILD_DATETIME_FILE) $(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \ TARGET_BUILD_FLAVOR="$(TARGET_BUILD_FLAVOR)" \ TARGET_DEVICE="$(TARGET_DEVICE)" \ @@ -271,7 +278,7 @@ $(gen_from_buildinfo_sh): $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) | $(B BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \ DATE="$(DATE_FROM_FILE)" \ BUILD_USERNAME="$(BUILD_USERNAME)" \ - BUILD_HOSTNAME="$(BUILD_HOSTNAME)" \ + BUILD_HOSTNAME="$(BUILD_HOSTNAME_FROM_FILE)" \ BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \ BOARD_USE_VBMETA_DIGTEST_IN_FINGERPRINT="$(BOARD_USE_VBMETA_DIGTEST_IN_FINGERPRINT)" \ PLATFORM_VERSION="$(PLATFORM_VERSION)" \ diff --git a/core/tasks/sdk-addon.mk b/core/tasks/sdk-addon.mk index 5097f1266f..7acac72f1d 100644 --- a/core/tasks/sdk-addon.mk +++ b/core/tasks/sdk-addon.mk @@ -19,12 +19,13 @@ addon_name := $(PRODUCT_SDK_ADDON_NAME) ifneq ($(addon_name),) -addon_dir_leaf := $(addon_name)-$(FILE_NAME_TAG)-$(INTERNAL_SDK_HOST_OS_NAME) -addon_dir_img := $(addon_dir_leaf)-img -intermediates := $(HOST_OUT_INTERMEDIATES)/SDK_ADDON/$(addon_name)_intermediates -full_target := $(HOST_OUT_SDK_ADDON)/$(addon_dir_leaf).zip -full_target_img := $(HOST_OUT_SDK_ADDON)/$(addon_dir_img).zip -staging := $(intermediates) +addon_dir_leaf := $(addon_name)-$(INTERNAL_SDK_HOST_OS_NAME) +addon_dir_img := $(addon_dir_leaf)-img +intermediates := $(HOST_OUT_INTERMEDIATES)/SDK_ADDON/$(addon_name)_intermediates +full_target := $(HOST_OUT_SDK_ADDON)/$(addon_dir_leaf).zip +full_target_dist_name := $(addon_name)-FILE_NAME_TAG_PLACEHOLDER-$(INTERNAL_SDK_HOST_OS_NAME) +full_target_img := $(HOST_OUT_SDK_ADDON)/$(addon_dir_img).zip +staging := $(intermediates) sdk_addon_deps := files_to_copy := @@ -140,7 +141,7 @@ ADDON_SDK_IMG_ZIP := $(full_target_img) else # When not building an sdk_repo, just dist the addon zip file # as-is. -$(call dist-for-goals, sdk_addon, $(full_target)) +$(call dist-for-goals, sdk_addon, $(full_target):$(full_target_dist_name)) endif else # addon_name diff --git a/core/tasks/tools/build_custom_image.mk b/core/tasks/tools/build_custom_image.mk index 2626120eb0..ba97e8a626 100644 --- a/core/tasks/tools/build_custom_image.mk +++ b/core/tasks/tools/build_custom_image.mk @@ -105,6 +105,9 @@ ifeq (true,$(filter true, $(CUSTOM_IMAGE_AVB_HASH_ENABLE) $(CUSTOM_IMAGE_AVB_HAS else ifneq (,$(filter true, $(CUSTOM_IMAGE_AVB_HASH_ENABLE) $(CUSTOM_IMAGE_AVB_HASHTREE_ENABLE))) $(error Cannot set both CUSTOM_IMAGE_AVB_HASH_ENABLE and CUSTOM_IMAGE_AVB_HASHTREE_ENABLE to true) endif +ifeq ($(strip $(HAS_BUILD_NUMBER)),true) +$(my_built_custom_image): $(BUILD_NUMBER_FILE) +endif $(my_built_custom_image): $(INTERNAL_USERIMAGES_DEPS) $(my_built_modules) $(my_image_copy_files) $(my_custom_image_modules_dep) \ $(CUSTOM_IMAGE_DICT_FILE) @echo "Build image $@" diff --git a/core/tasks/tools/compatibility.mk b/core/tasks/tools/compatibility.mk index 8ae2a9ae5a..dd2305e7b9 100644 --- a/core/tasks/tools/compatibility.mk +++ b/core/tasks/tools/compatibility.mk @@ -118,6 +118,9 @@ $(compatibility_zip): PRIVATE_RESOURCES := $(compatibility_zip_resources) $(compatibility_zip): PRIVATE_JDK := $(test_suite_jdk) $(compatibility_zip): PRIVATE_tests_list := $(out_dir)-tests_list $(compatibility_zip): PRIVATE_tests_list_zip := $(compatibility_tests_list_zip) +ifeq ($(strip $(HAS_BUILD_NUMBER)),true) +$(compatibility_zip): $(BUILD_NUMBER_FILE) +endif $(compatibility_zip): $(compatibility_zip_deps) | $(ADB) $(ACP) # Make dir structure mkdir -p $(PRIVATE_OUT_DIR)/tools $(PRIVATE_OUT_DIR)/testcases diff --git a/core/tasks/with-license.mk b/core/tasks/with-license.mk index d41e77a1ce..5ca974a1a0 100644 --- a/core/tasks/with-license.mk +++ b/core/tasks/with-license.mk @@ -20,7 +20,8 @@ ifeq ($(TARGET_BUILD_TYPE),debug) name := $(name)_debug endif -name := $(name)-flashable-$(FILE_NAME_TAG)-with-license +dist_name := $(name)-flashable-FILE_NAME_TAG_PLACEHOLDER-with-license +name := $(name)-flashable-with-license with_license_intermediates := \ $(call intermediates-dir-for,PACKAGING,with_license) @@ -42,6 +43,7 @@ $(call declare-1p-container,$(license_image_input_zip),build) $(call declare-container-deps,$(license_image_input_zip),$(BUILT_TARGET_FILES_PACKAGE)) with_license_zip := $(PRODUCT_OUT)/$(name).sh +dist_name := $(dist_name).sh $(with_license_zip): PRIVATE_NAME := $(name) $(with_license_zip): PRIVATE_INPUT_ZIP := $(license_image_input_zip) $(with_license_zip): PRIVATE_VENDOR_BLOBS_LICENSE := $(VENDOR_BLOBS_LICENSE) @@ -51,7 +53,7 @@ $(with_license_zip): $(HOST_OUT_EXECUTABLES)/generate-self-extracting-archive $(HOST_OUT_EXECUTABLES)/generate-self-extracting-archive $@ \ $(PRIVATE_INPUT_ZIP) $(PRIVATE_NAME) $(PRIVATE_VENDOR_BLOBS_LICENSE) with-license : $(with_license_zip) -$(call dist-for-goals, with-license, $(with_license_zip)) +$(call dist-for-goals, with-license, $(with_license_zip):$(dist_name)) $(call declare-1p-container,$(with_license_zip),) $(call declare-container-license-deps,$(with_license_zip),$(license_image_input_zip),$(with_license_zip):) diff --git a/core/version_util.mk b/core/version_util.mk index 47883d8a89..d4ce113ec5 100644 --- a/core/version_util.mk +++ b/core/version_util.mk @@ -246,21 +246,10 @@ DATE := date -d @$(BUILD_DATETIME) # to soong_ui. $(KATI_obsolete_var BUILD_DATETIME,Use BUILD_DATETIME_FROM_FILE) -HAS_BUILD_NUMBER := true -ifndef BUILD_NUMBER - # BUILD_NUMBER should be set to the source control value that - # represents the current state of the source code. E.g., a - # perforce changelist number or a git hash. Can be an arbitrary string - # (to allow for source control that uses something other than numbers), - # but must be a single word and a valid file name. - # - # If no BUILD_NUMBER is set, create a useful "I am an engineering build - # from this date/time" value. Make it start with a non-digit so that - # anyone trying to parse it as an integer will probably get "0". - BUILD_NUMBER := eng.$(shell echo $${BUILD_USERNAME:0:6}).$(shell $(DATE) +%Y%m%d.%H%M%S) +ifndef HAS_BUILD_NUMBER HAS_BUILD_NUMBER := false endif -.KATI_READONLY := BUILD_NUMBER HAS_BUILD_NUMBER +.KATI_READONLY := HAS_BUILD_NUMBER ifndef PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION # Used to set minimum supported target sdk version. Apps targeting sdk diff --git a/packaging/distdir.mk b/packaging/distdir.mk index 264a8b098c..c9508af323 100644 --- a/packaging/distdir.mk +++ b/packaging/distdir.mk @@ -18,10 +18,12 @@ DIST_GOAL_OUTPUT_PAIRS := DIST_SRC_DST_PAIRS := include $(KATI_PACKAGE_MK_DIR)/dist.mk +FILE_NAME_TAG := $(file <$(OUT_DIR)/file_name_tag.txt) +.KATI_READONLY := FILE_NAME_TAG $(foreach pair,$(DIST_GOAL_OUTPUT_PAIRS), \ $(eval goal := $(call word-colon,1,$(pair))) \ - $(eval output := $(call word-colon,2,$(pair))) \ + $(eval output := $(subst FILE_NAME_TAG_PLACEHOLDER,$(FILE_NAME_TAG),$(call word-colon,2,$(pair)))) \ $(eval .PHONY: _dist_$$(goal)) \ $(if $(call streq,$(DIST),true),\ $(eval _dist_$$(goal): $$(DIST_DIR)/$$(output)), \ @@ -37,7 +39,7 @@ endef ifeq ($(DIST),true) $(foreach pair,$(DIST_SRC_DST_PAIRS), \ $(eval src := $(call word-colon,1,$(pair))) \ - $(eval dst := $(DIST_DIR)/$(call word-colon,2,$(pair))) \ + $(eval dst := $(subst FILE_NAME_TAG_PLACEHOLDER,$(FILE_NAME_TAG),$(DIST_DIR)/$(call word-colon,2,$(pair)))) \ $(eval $(call copy-one-dist-file,$(src),$(dst)))) endif From 6284936f20f564ced4989d7b35974d492859b3c9 Mon Sep 17 00:00:00 2001 From: Wei Li Date: Mon, 15 May 2023 15:11:43 -0700 Subject: [PATCH 130/139] Add upstream package of a prebuilt fork package, which will have the package information from the METADATA file. Bug: 266726655 Test: CIs Test: lunch barbet-user && m sbom (cherry picked from https://android-review.googlesource.com/q/commit:16e7aa3c2ea779ff91a0d88b431a2437964ae1a6) Merged-In: Ic8eb42c369de8c94c7977b9631ff4b9084dfef01 Change-Id: Ic8eb42c369de8c94c7977b9631ff4b9084dfef01 --- tools/sbom/generate-sbom.py | 46 ++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/tools/sbom/generate-sbom.py b/tools/sbom/generate-sbom.py index 1e98699a47..2415f7e270 100755 --- a/tools/sbom/generate-sbom.py +++ b/tools/sbom/generate-sbom.py @@ -263,8 +263,8 @@ def get_package_download_location(metadata_file_path): def get_sbom_fragments(installed_file_metadata, metadata_file_path): """Return SPDX fragment of source/prebuilt packages, which usually contains a SOURCE/PREBUILT - package, a UPSTREAM package if it's a source package and a external SBOM document reference if - it's a prebuilt package with sbom_ref defined in its METADATA file. + package, a UPSTREAM package and an external SBOM document reference if sbom_ref defined in its + METADATA file. See go/android-spdx and go/android-sbom-gen for more details. """ @@ -301,25 +301,33 @@ def get_sbom_fragments(installed_file_metadata, metadata_file_path): prebuilt_package = sbom_data.Package(id=prebuilt_package_id, name=name, download_location=sbom_data.VALUE_NONE, - version=args.build_version, + version=version if version else args.build_version, supplier='Organization: ' + args.product_mfr) - packages.append(prebuilt_package) - if metadata_file_path: - metadata_proto = metadata_file_protos[metadata_file_path] - if metadata_proto.third_party.WhichOneof('sbom') == 'sbom_ref': - sbom_url = metadata_proto.third_party.sbom_ref.url - sbom_checksum = metadata_proto.third_party.sbom_ref.checksum - upstream_element_id = metadata_proto.third_party.sbom_ref.element_id - if sbom_url and sbom_checksum and upstream_element_id: - doc_ref_id = f'DocumentRef-{PKG_UPSTREAM}-{encode_for_spdxid(name)}' - external_doc_ref = sbom_data.DocumentExternalReference(id=doc_ref_id, - uri=sbom_url, - checksum=sbom_checksum) - relationships.append( - sbom_data.Relationship(id1=prebuilt_package_id, - relationship=sbom_data.RelationshipType.VARIANT_OF, - id2=doc_ref_id + ':' + upstream_element_id)) + upstream_package_id = new_package_id(name, PKG_UPSTREAM) + upstream_package = sbom_data.Package(id=upstream_package_id, name=name, version = version, + supplier=('Organization: ' + homepage) if homepage else sbom_data.VALUE_NOASSERTION, + download_location=download_location) + packages += [prebuilt_package, upstream_package] + relationships.append(sbom_data.Relationship(id1=prebuilt_package_id, + relationship=sbom_data.RelationshipType.VARIANT_OF, + id2=upstream_package_id)) + + if metadata_file_path: + metadata_proto = metadata_file_protos[metadata_file_path] + if metadata_proto.third_party.WhichOneof('sbom') == 'sbom_ref': + sbom_url = metadata_proto.third_party.sbom_ref.url + sbom_checksum = metadata_proto.third_party.sbom_ref.checksum + upstream_element_id = metadata_proto.third_party.sbom_ref.element_id + if sbom_url and sbom_checksum and upstream_element_id: + doc_ref_id = f'DocumentRef-{PKG_UPSTREAM}-{encode_for_spdxid(name)}' + external_doc_ref = sbom_data.DocumentExternalReference(id=doc_ref_id, + uri=sbom_url, + checksum=sbom_checksum) + relationships.append( + sbom_data.Relationship(id1=upstream_package_id, + relationship=sbom_data.RelationshipType.VARIANT_OF, + id2=doc_ref_id + ':' + upstream_element_id)) return external_doc_ref, packages, relationships From 593b2e5ce40f5814ebb71ddd9003a1b43799d274 Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Tue, 23 May 2023 17:45:37 +0000 Subject: [PATCH 131/139] Create default PRODUCT_INCLUDE_TAGS in product_config In the current setup in partner branch, we 1. Add blueprint_package_includes to prebuilts/module_sdk/* 2. Add the correct PRODUCT_INCLUDE_TAGS to partner_modules This means in those setups,none of the prebuilts are visible to aosp products since they they do not inherit partner_module makefiles. ``` e.g. prebuilts/module_sdk/art/current/Android.bp prebuilts/module_sdk/art//current/Android.bp // aosp_arm cannot find either ``` To solve this, this CL creates a default inclusion tag for all products that do not set any PRODUCT_INCLUDE_TAGS explicitly. In the previous example, Soong analysis of aosp_* will use prebuilts/module_sdk/art/current/Android.bp. This should be a no-op for aosp and internal branches since none of the Android.bp files today contains blueprint_package_includes Test: m nothing for aosp_arm in the test branch of b/278604467#comment20 Test: m nothing for partner product that uses big android sdk Test: m nothing for partner product that uses go sdk Bug: 278604467 (cherry picked from https://android-review.googlesource.com/q/commit:2e69ea622877e7f88b82db4adbc284b9342f8c2c) Merged-In: I322b52c34ed339989207609dd0fd23c27ed1f697 Change-Id: I322b52c34ed339989207609dd0fd23c27ed1f697 cp required as per b/278604467#comment25 --- core/product_config.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/product_config.mk b/core/product_config.mk index 1ef8890d46..5d76eebd1d 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -279,6 +279,15 @@ BLUEPRINT_INCLUDE_TAGS_ALLOWLIST := com.android.mainline_go com.android.mainline $(foreach include_tag,$(PRODUCT_INCLUDE_TAGS), \ $(if $(filter $(include_tag),$(BLUEPRINT_INCLUDE_TAGS_ALLOWLIST)),,\ $(call pretty-error, $(include_tag) is not in BLUEPRINT_INCLUDE_TAGS_ALLOWLIST: $(BLUEPRINT_INCLUDE_TAGS_ALLOWLIST)))) +# Create default PRODUCT_INCLUDE_TAGS +ifeq (, $(PRODUCT_INCLUDE_TAGS)) +# Soong analysis is global: even though a module might not be relevant to a specific product (e.g. build_tools for aosp_arm), +# we still analyse it. +# This means that in setups where we two have two prebuilts of module_sdk, we need a "default" to use in analysis +# This should be a no-op in aosp and internal since no Android.bp file contains blueprint_package_includes +PRODUCT_INCLUDE_TAGS += com.android.mainline # Use the big android one by default +endif + ############################################################################# # Quick check and assign default values From ba70ed836ea9c8acb1679b5e7bf2f9c0ab02701d Mon Sep 17 00:00:00 2001 From: Lokesh Kumar Goel Date: Sun, 4 Jun 2023 02:50:08 +0000 Subject: [PATCH 132/139] Update Security String to 2023-08-01 Bug: 285692955 Change-Id: Iec37a521c10365635950d6646f57153e7d3e3794 Merged-In: I137506c673d9f44789c26f88a416c0fd06df02ce --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index f7bb875463..d14bd65167 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -240,7 +240,7 @@ ifndef PLATFORM_SECURITY_PATCH # It must be of the form "YYYY-MM-DD" on production devices. # It must match one of the Android Security Patch Level strings of the Public Security Bulletins. # If there is no $PLATFORM_SECURITY_PATCH set, keep it empty. - PLATFORM_SECURITY_PATCH := 2023-07-01 + PLATFORM_SECURITY_PATCH := 2023-08-01 endif .KATI_READONLY := PLATFORM_SECURITY_PATCH From be93b44331a344195d2d9a37c7b6bd1dcb1b3c60 Mon Sep 17 00:00:00 2001 From: Lokesh Kumar Goel Date: Sun, 4 Jun 2023 02:50:54 +0000 Subject: [PATCH 133/139] Update Security String to 2023-08-05 Bug: 285692955 Change-Id: I137506c673d9f44789c26f88a416c0fd06df02ce Ignore-AOSP-First: Future release prep (Internal first) --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 23dce80440..4fa5425a4b 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -103,7 +103,7 @@ ifndef PLATFORM_SECURITY_PATCH # It must be of the form "YYYY-MM-DD" on production devices. # It must match one of the Android Security Patch Level strings of the Public Security Bulletins. # If there is no $PLATFORM_SECURITY_PATCH set, keep it empty. - PLATFORM_SECURITY_PATCH := 2023-07-05 + PLATFORM_SECURITY_PATCH := 2023-08-05 endif include $(BUILD_SYSTEM)/version_util.mk From fa04b8d7ed9cb322088b4461f459deea34d9a8b7 Mon Sep 17 00:00:00 2001 From: Dennis Shen Date: Thu, 30 Mar 2023 12:27:31 +0000 Subject: [PATCH 134/139] Create otatools build target with dist Ignore-AOSP-First: cherry pick of aosp/2515235 BUG: b/275545565 TEST: m otatools-dist dist Change-Id: I8484a7927955bf694221937ba778db7065b83eb2 --- core/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/Makefile b/core/Makefile index b018106853..348bf8c4af 100644 --- a/core/Makefile +++ b/core/Makefile @@ -5137,6 +5137,10 @@ $(call declare-container-license-deps,$(INTERNAL_OTATOOLS_PACKAGE_FILES) $(INTER .PHONY: otatools-package otatools-package: $(BUILT_OTATOOLS_PACKAGE) +$(call dist-for-goals, otatools-package, \ + $(BUILT_OTATOOLS_PACKAGE) \ +) + endif # build_otatools_package # ----------------------------------------------------------------- From dac9d66a75c83c5aafb43a9bbd4df8db59c3132a Mon Sep 17 00:00:00 2001 From: Jiakai Zhang Date: Fri, 9 Jun 2023 17:44:50 +0100 Subject: [PATCH 135/139] Add mainline extension and METADATA.txt to boot.zip. Contents of METADATA.txt: booclasspath = dex_bootjars_input/core-oj.jar:dex_bootjars_input/core-libart.jar:dex_bootjars_input/okhttp.jar:dex_bootjars_input/bouncycastle.jar:dex_bootjars_input/apache-xml.jar:dex_bootjars_input/framework.jar:dex_bootjars_input/framework-graphics.jar:dex_bootjars_input/ext.jar:dex_bootjars_input/telephony-common.jar:dex_bootjars_input/voip-common.jar:dex_bootjars_input/ims-common.jar:dex_bootjars_input/core-icu4j.jar:apex_bootjars/framework-adservices.jar:apex_bootjars/framework-sdksandbox.jar:apex_bootjars/framework-appsearch.jar:apex_bootjars/framework-bluetooth.jar:apex_bootjars/conscrypt.jar:apex_bootjars/android.net.ipsec.ike.jar:apex_bootjars/updatable-media.jar:apex_bootjars/framework-mediaprovider.jar:apex_bootjars/framework-ondevicepersonalization.jar:apex_bootjars/framework-statsd.jar:apex_bootjars/framework-permission.jar:apex_bootjars/framework-permission-s.jar:apex_bootjars/framework-scheduling.jar:apex_bootjars/framework-sdkextensions.jar:apex_bootjars/framework-connectivity.jar:apex_bootjars/framework-connectivity-t.jar:apex_bootjars/framework-tethering.jar:apex_bootjars/framework-uwb.jar:apex_bootjars/framework-virtualization.jar:apex_bootjars/framework-wifi.jar booclasspath-locations = /apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/apex/com.android.adservices/javalib/framework-adservices.jar:/apex/com.android.adservices/javalib/framework-sdksandbox.jar:/apex/com.android.appsearch/javalib/framework-appsearch.jar:/apex/com.android.btservices/javalib/framework-bluetooth.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.ondevicepersonalization/javalib/framework-ondevicepersonalization.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.permission/javalib/framework-permission-s.jar:/apex/com.android.scheduling/javalib/framework-scheduling.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.tethering/javalib/framework-connectivity.jar:/apex/com.android.tethering/javalib/framework-connectivity-t.jar:/apex/com.android.tethering/javalib/framework-tethering.jar:/apex/com.android.uwb/javalib/framework-uwb.jar:/apex/com.android.virt/javalib/framework-virtualization.jar:/apex/com.android.wifi/javalib/framework-wifi.jar boot-image = system/framework/boot.art:system/framework/boot-framework-adservices.art Bug: 286381070 Test: m dist out/dist/boot.zip (cherry picked from https://android-review.googlesource.com/q/commit:a5551c5d91ce236e775bfc61fb3d6b7cdeb07b50) Merged-In: I258479ffbdf199091290b074329ff1b43db2e669 Change-Id: I258479ffbdf199091290b074329ff1b43db2e669 --- core/dex_preopt.mk | 31 ++++++++++++++++++++++++++++--- core/dex_preopt_odex_install.mk | 8 +------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk index 62c3ba3795..af5ff9d686 100644 --- a/core/dex_preopt.mk +++ b/core/dex_preopt.mk @@ -80,15 +80,40 @@ system_server_jars += \ $(foreach m,$(other_system_server_jars),\ $(PRODUCT_OUT)/$(call word-colon,1,$(m))/framework/$(call word-colon,2,$(m)).jar) +# Infix can be 'art' (ART image for testing), 'boot' (primary), or 'mainline' (mainline extension). +# Soong creates a set of variables for Make, one or each boot image. The only reason why the ART +# image is exposed to Make is testing (art gtests) and benchmarking (art golem benchmarks). Install +# rules that use those variables are in dex_preopt_libart.mk. Here for dexpreopt purposes the infix +# is always 'boot' or 'mainline'. +DEXPREOPT_INFIX := $(if $(filter true,$(DEX_PREOPT_WITH_UPDATABLE_BCP)),mainline,boot) + +# The input variables are written by build/soong/java/dexpreopt_bootjars.go. Examples can be found +# at the bottom of build/soong/java/dexpreopt_config_testing.go. +dexpreopt_root_dir := $(dir $(patsubst %/,%,$(dir $(firstword $(bootclasspath_jars))))) +booclasspath_arg := $(subst $(space),:,$(patsubst $(dexpreopt_root_dir)%,%,$(DEXPREOPT_BOOTCLASSPATH_DEX_FILES))) +booclasspath_locations_arg := $(subst $(space),:,$(DEXPREOPT_BOOTCLASSPATH_DEX_LOCATIONS)) +boot_images := $(subst :,$(space),$(DEXPREOPT_IMAGE_LOCATIONS_ON_DEVICE$(DEXPREOPT_INFIX))) +boot_image_arg := $(subst $(space),:,$(patsubst /%,%,$(boot_images))) + +boot_zip_metadata_txt := $(boot_zip).METADATA.txt +$(boot_zip_metadata_txt): + rm -f $@ + echo "booclasspath = $(booclasspath_arg)" >> $@ + echo "booclasspath-locations = $(booclasspath_locations_arg)" >> $@ + echo "boot-image = $(boot_image_arg)" >> $@ + +$(call dist-for-goals, droidcore, $(boot_zip_metadata_txt)) + $(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) $(DEXPREOPT_IMAGE_ZIP_art) +$(boot_zip): $(bootclasspath_jars) $(system_server_jars) $(SOONG_ZIP) $(MERGE_ZIPS) $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art) $(DEXPREOPT_IMAGE_ZIP_mainline) $(boot_zip_metadata_txt) @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) $(DEXPREOPT_IMAGE_ZIP_art) + -C $(PRODUCT_OUT) $(addprefix -f ,$(PRIVATE_SYSTEM_SERVER_JARS)) \ + -e METADATA.txt -f $(boot_zip_metadata_txt) + $(MERGE_ZIPS) $@ $@.tmp $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art) $(DEXPREOPT_IMAGE_ZIP_mainline) rm -f $@.tmp $(call dist-for-goals, droidcore, $(boot_zip)) diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index d4988750dc..8ebf34e016 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -272,13 +272,7 @@ my_dexpreopt_images := my_dexpreopt_images_deps := my_dexpreopt_image_locations_on_host := my_dexpreopt_image_locations_on_device := -# Infix can be 'art', 'boot', or 'mainline'. Soong creates a set of variables -# for Make, one or each boot image (primary, the framework extension, and the -# mainline extension). The only reason why the primary image is exposed to Make -# is testing (art gtests) and benchmarking (art golem benchmarks). Install rules -# that use those variables are in dex_preopt_libart.mk. Here for dexpreopt -# purposes the infix is always 'boot' or 'mainline'. -my_dexpreopt_infix := $(if $(filter true,$(DEX_PREOPT_WITH_UPDATABLE_BCP)),mainline,boot) +my_dexpreopt_infix := $(DEXPREOPT_INFIX) my_create_dexpreopt_config := ifdef LOCAL_DEX_PREOPT From c63a2b36d74dadb51a9cdcc71ad470111ebe3f02 Mon Sep 17 00:00:00 2001 From: Jiakai Zhang Date: Mon, 12 Jun 2023 11:18:12 +0100 Subject: [PATCH 136/139] Avoid using soong_zip's "-e" flag for boot.zip. aosp/23658853 changes boot.zip, which need to be cherry-picked to UDC. It uses soong_zip's "-e" flag to specify the filename to use in boot.zip for METADATA.txt. However, the "-e" flag doesn't exist on UDC. This change uses an alternative approach to avoid using the "-e" flag. Before this change, the contents were written to out/dist/boot.zip.METADATA.txt and then passed to soong_zip with "-e" to rename to file to "METADATA.txt". After this change, the contents are written to out/dist/boot_zip/METADATA.txt and then passed to soong_zip with "-j" to remove the directory name. Bug: 286381070 Test: m dist out/dist/boot.zip (on udc-dev) (cherry picked from https://android-review.googlesource.com/q/commit:34914f620bcc0339104ef0360f6a30492f407409) Merged-In: I769de5194b5716f05e5352f4efd635a70ba0b891 Change-Id: I769de5194b5716f05e5352f4efd635a70ba0b891 --- core/dex_preopt.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk index af5ff9d686..86ca7299b6 100644 --- a/core/dex_preopt.mk +++ b/core/dex_preopt.mk @@ -95,7 +95,7 @@ booclasspath_locations_arg := $(subst $(space),:,$(DEXPREOPT_BOOTCLASSPATH_DEX_L boot_images := $(subst :,$(space),$(DEXPREOPT_IMAGE_LOCATIONS_ON_DEVICE$(DEXPREOPT_INFIX))) boot_image_arg := $(subst $(space),:,$(patsubst /%,%,$(boot_images))) -boot_zip_metadata_txt := $(boot_zip).METADATA.txt +boot_zip_metadata_txt := $(dir $(boot_zip))boot_zip/METADATA.txt $(boot_zip_metadata_txt): rm -f $@ echo "booclasspath = $(booclasspath_arg)" >> $@ @@ -112,7 +112,7 @@ $(boot_zip): $(bootclasspath_jars) $(system_server_jars) $(SOONG_ZIP) $(MERGE_ZI $(SOONG_ZIP) -o $@.tmp \ -C $(dir $(firstword $(PRIVATE_BOOTCLASSPATH_JARS)))/.. $(addprefix -f ,$(PRIVATE_BOOTCLASSPATH_JARS)) \ -C $(PRODUCT_OUT) $(addprefix -f ,$(PRIVATE_SYSTEM_SERVER_JARS)) \ - -e METADATA.txt -f $(boot_zip_metadata_txt) + -j -f $(boot_zip_metadata_txt) $(MERGE_ZIPS) $@ $@.tmp $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art) $(DEXPREOPT_IMAGE_ZIP_mainline) rm -f $@.tmp From 0f79319bb8318077a86cc7e090364b1a70cbeba5 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Wed, 7 Jun 2023 15:02:22 -0700 Subject: [PATCH 137/139] Fix bug when memtag_heap in diag but not sanitizers Without this we get: unsupported argument 'memtag_heap' to option '-fno-sanitize-trap=' (cherry picked from https://android-review.googlesource.com/q/commit:2a6762605574d6fbcea63e9d5e18d184e241417d) Bug: 286415307 Merged-In: Iaeb23d0f4962bb3d788036fadc14b9420221a38e Change-Id: Iaeb23d0f4962bb3d788036fadc14b9420221a38e --- core/config_sanitizers.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index 0e84f51647..ebce4c2a4e 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -249,6 +249,13 @@ ifneq ($(filter memtag_heap memtag_stack,$(my_sanitize)),) endif endif +# Ignore SANITIZE_TARGET_DIAG=memtag_heap without SANITIZE_TARGET=memtag_heap +# This can happen if a condition above filters out memtag_heap from +# my_sanitize. It is easier to handle all of these cases here centrally. +ifneq ($(filter memtag_heap,$(my_sanitize_diag)),) + my_sanitize_diag := $(filter-out memtag_heap,$(my_sanitize_diag)) +endif + ifneq ($(filter memtag_heap,$(my_sanitize)),) my_cflags += -fsanitize=memtag-heap my_sanitize := $(filter-out memtag_heap,$(my_sanitize)) From 8bb740db1ae9bf65d1eadaeb057a54ebcd8d2c3b Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Wed, 7 Jun 2023 13:48:47 -0700 Subject: [PATCH 138/139] Add aosp_arm64_fullmte target Test: lunch aosp_arm64_fullmte && m Test: llvm-readelf -a out/target/product/generic_arm64/system/bin/toybox Memtag Android Note: Tagging Mode: SYNC Heap: Enabled Stack: Enabled Bug: 271768933 Bug: 286415307 (cherry picked from https://android-review.googlesource.com/q/commit:0352c44ab37cd06d3cd7b52dbac2bb73971f366e) Merged-In: I2a1ac78be551d50be9bf6c4ffc8667de4ef7ce8e Change-Id: I2a1ac78be551d50be9bf6c4ffc8667de4ef7ce8e --- target/product/AndroidProducts.mk | 2 ++ target/product/aosp_arm64_fullmte.mk | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 target/product/aosp_arm64_fullmte.mk diff --git a/target/product/AndroidProducts.mk b/target/product/AndroidProducts.mk index 1e0ce19926..133dc7354e 100644 --- a/target/product/AndroidProducts.mk +++ b/target/product/AndroidProducts.mk @@ -35,6 +35,7 @@ ifneq ($(TARGET_BUILD_APPS),) PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/aosp_arm64.mk \ + $(LOCAL_DIR)/aosp_arm64_fullmte.mk \ $(LOCAL_DIR)/aosp_arm.mk \ $(LOCAL_DIR)/aosp_riscv64.mk \ $(LOCAL_DIR)/aosp_x86_64.mk \ @@ -46,6 +47,7 @@ else PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/aosp_64bitonly_x86_64.mk \ $(LOCAL_DIR)/aosp_arm64.mk \ + $(LOCAL_DIR)/aosp_arm64_fullmte.mk \ $(LOCAL_DIR)/aosp_arm.mk \ $(LOCAL_DIR)/aosp_riscv64.mk \ $(LOCAL_DIR)/aosp_x86_64.mk \ diff --git a/target/product/aosp_arm64_fullmte.mk b/target/product/aosp_arm64_fullmte.mk new file mode 100644 index 0000000000..ed6bd4a5f0 --- /dev/null +++ b/target/product/aosp_arm64_fullmte.mk @@ -0,0 +1,27 @@ +# Copyright (C) 2023 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. +# + +include $(SRC_TARGET_DIR)/product/fullmte.mk + +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed + +$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_arm64.mk) + +# Build modules from source if this has not been pre-configured +MODULE_BUILD_FROM_SOURCE ?= true + +$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk) + +PRODUCT_NAME := aosp_arm64_fullmte From 85adf2e404273d9f7c864fb03bb4a901fbfed29e Mon Sep 17 00:00:00 2001 From: Lokesh Kumar Goel Date: Sun, 4 Jun 2023 02:49:07 +0000 Subject: [PATCH 139/139] Update Security String to 2023-08-01 Bug: 285692955 Change-Id: I0f39a4929744496beb9641b67055f8900356f995 Merged-In: I137506c673d9f44789c26f88a416c0fd06df02ce Merged-In: Iec37a521c10365635950d6646f57153e7d3e3794 --- core/version_defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 315f7b2593..3061025c86 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -240,7 +240,7 @@ ifndef PLATFORM_SECURITY_PATCH # It must be of the form "YYYY-MM-DD" on production devices. # It must match one of the Android Security Patch Level strings of the Public Security Bulletins. # If there is no $PLATFORM_SECURITY_PATCH set, keep it empty. - PLATFORM_SECURITY_PATCH := 2023-07-01 + PLATFORM_SECURITY_PATCH := 2023-08-01 endif .KATI_READONLY := PLATFORM_SECURITY_PATCH