Merge "Export PartitionQUalifiedVariables of vbmeta partitions to Soong" into main
diff --git a/core/soong_config.mk b/core/soong_config.mk
index d22d4c7..4537824 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -458,6 +458,8 @@
$(call add_json_list, InternalBootconfig, $(INTERNAL_BOOTCONFIG))
$(call add_json_str, InternalBootconfigFile, $(INTERNAL_BOOTCONFIG_FILE))
+ $(call add_json_bool, BuildingSystemOtherImage, $(BUILDING_SYSTEM_OTHER_IMAGE))
+
# super image stuff
$(call add_json_bool, ProductUseDynamicPartitions, $(filter true,$(PRODUCT_USE_DYNAMIC_PARTITIONS)))
$(call add_json_bool, ProductRetrofitDynamicPartitions, $(filter true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS)))
diff --git a/tools/aconfig/aconfig_protos/protos/aconfig_internal.proto b/tools/aconfig/aconfig_protos/protos/aconfig_internal.proto
new file mode 100644
index 0000000..7930f56
--- /dev/null
+++ b/tools/aconfig/aconfig_protos/protos/aconfig_internal.proto
@@ -0,0 +1,42 @@
+// 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
+
+// This is the schema definition for protos intended for internal aconfig
+// use ONLY. There are no guarantees regarding backwards compatibility.
+// Do not put protos here intended for storage or communication.
+
+syntax = "proto2";
+
+package android.aconfig_internal;
+
+
+// This protobuf defines messages used to store data about flags used to guard
+// APIs which are finalized for a given SDK.
+message finalized_flag {
+ // Name of the flag (required). Does not include package name.
+ // Must match flag name in the aconfig declaration header.
+ optional string name = 1;
+
+ // Package the flag belongs to (required). Must match package in the aconfig declaration header.
+ optional string package = 2;
+
+ // SDK level in which the flag was finalized.
+ optional int32 min_sdk = 3;
+
+ // TODO - b/378936061: Add support for minor SDK version & SDK extension.
+};
+
+message finalized_flags {
+ repeated finalized_flag finalized_flag = 1;
+}
diff --git a/tools/record-finalized-flags/Android.bp b/tools/record-finalized-flags/Android.bp
new file mode 100644
index 0000000..63bcc2d
--- /dev/null
+++ b/tools/record-finalized-flags/Android.bp
@@ -0,0 +1,4 @@
+sh_binary_host {
+ name: "record-finalized-flags",
+ src: "record-finalized-flags.sh",
+}
diff --git a/tools/record-finalized-flags/OWNERS b/tools/record-finalized-flags/OWNERS
new file mode 100644
index 0000000..2864a2c
--- /dev/null
+++ b/tools/record-finalized-flags/OWNERS
@@ -0,0 +1 @@
+include platform/frameworks/base:/SDK_OWNERS
diff --git a/tools/record-finalized-flags/record-finalized-flags.sh b/tools/record-finalized-flags/record-finalized-flags.sh
new file mode 100644
index 0000000..1d85ae9
--- /dev/null
+++ b/tools/record-finalized-flags/record-finalized-flags.sh
@@ -0,0 +1,18 @@
+#!/bin/bash -e
+#
+# Copyright 2024 Google Inc. All rights reserved.
+#
+# 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.
+
+# TODO: implement this tool
+echo "record-finalized-flags.sh $*"
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index e9cb5bb..b6cbb15 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -3138,6 +3138,8 @@
if not os.path.exists(path) and os.path.exists(path + ".py"):
path = path + ".py"
spec = importlib.util.spec_from_file_location("device_specific", path)
+ if not spec:
+ raise FileNotFoundError(path)
logger.info("loaded device-specific extensions from %s", path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
diff --git a/tools/releasetools/test_common.py b/tools/releasetools/test_common.py
index 89933a0..62f425a 100644
--- a/tools/releasetools/test_common.py
+++ b/tools/releasetools/test_common.py
@@ -2157,3 +2157,11 @@
'google/coral/coral:10/RP1A.200325.001/6337676:user/dev-keys',
'ro.product.odm.device': 'coral',
}, copied_props.build_props)
+
+
+class DeviceSpecificParamsTest(test_utils.ReleaseToolsTestCase):
+
+ def test_missingSource(self):
+ common.OPTIONS.device_specific = '/does_not_exist'
+ ds = DeviceSpecificParams()
+ self.assertIsNone(ds.module)
diff --git a/tools/sbom/gen_sbom.py b/tools/sbom/gen_sbom.py
index 9c3a8be..756d9db 100644
--- a/tools/sbom/gen_sbom.py
+++ b/tools/sbom/gen_sbom.py
@@ -709,7 +709,13 @@
'is_prebuilt_make_module': False
}
file_metadata.update(db.get_soong_module_of_built_file(dep_file))
- add_package_of_file(file_id, file_metadata, doc, report)
+ if is_source_package(file_metadata) or is_prebuilt_package(file_metadata):
+ add_package_of_file(file_id, file_metadata, doc, report)
+ else:
+ # Other static lib files are generated from the platform
+ doc.add_relationship(sbom_data.Relationship(id1=file_id,
+ relationship=sbom_data.RelationshipType.GENERATED_FROM,
+ id2=sbom_data.SPDXID_PLATFORM))
# Add relationships for static deps of static libraries
add_static_deps_of_file(file_id, file_metadata, doc)