Ensure java level inter partition dependency with VNDK deprecation.

Previously JAVA dependency over partition was checked only when device
VNDK version is not empty. This change updates logic to enforce inter
partition dependency despite of VNDK version based on VNDK deprecation.

Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: I7444ad612aa6c525e61cc5c2a89f5421ab4465b4
This commit is contained in:
Kiyoung Kim
2024-03-28 15:44:56 +09:00
parent f875565c7f
commit 9743bab964
2 changed files with 1 additions and 14 deletions

View File

@@ -804,7 +804,7 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) {
// Add dependency on libraries that provide additional hidden api annotations. // Add dependency on libraries that provide additional hidden api annotations.
ctx.AddVariationDependencies(nil, hiddenApiAnnotationsTag, j.properties.Hiddenapi_additional_annotations...) ctx.AddVariationDependencies(nil, hiddenApiAnnotationsTag, j.properties.Hiddenapi_additional_annotations...)
if ctx.DeviceConfig().VndkVersion() != "" && ctx.Config().EnforceInterPartitionJavaSdkLibrary() { if ctx.Config().EnforceInterPartitionJavaSdkLibrary() {
// Require java_sdk_library at inter-partition java dependency to ensure stable // Require java_sdk_library at inter-partition java dependency to ensure stable
// interface between partitions. If inter-partition java_library dependency is detected, // interface between partitions. If inter-partition java_library dependency is detected,
// raise build error because java_library doesn't have a stable interface. // raise build error because java_library doesn't have a stable interface.

View File

@@ -1239,7 +1239,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType string libraryType string
fromPartition string fromPartition string
toPartition string toPartition string
enforceVendorInterface bool
enforceProductInterface bool enforceProductInterface bool
enforceJavaSdkLibraryCheck bool enforceJavaSdkLibraryCheck bool
allowList []string allowList []string
@@ -1274,9 +1273,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
android.FixtureWithRootAndroidBp(bpFile), android.FixtureWithRootAndroidBp(bpFile),
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
variables.EnforceProductPartitionInterface = proptools.BoolPtr(info.enforceProductInterface) variables.EnforceProductPartitionInterface = proptools.BoolPtr(info.enforceProductInterface)
if info.enforceVendorInterface {
variables.DeviceVndkVersion = proptools.StringPtr("current")
}
variables.EnforceInterPartitionJavaSdkLibrary = proptools.BoolPtr(info.enforceJavaSdkLibraryCheck) variables.EnforceInterPartitionJavaSdkLibrary = proptools.BoolPtr(info.enforceJavaSdkLibraryCheck)
variables.InterPartitionJavaLibraryAllowList = info.allowList variables.InterPartitionJavaLibraryAllowList = info.allowList
}), }),
@@ -1304,7 +1300,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_library", libraryType: "java_library",
fromPartition: "product", fromPartition: "product",
toPartition: "system", toPartition: "system",
enforceVendorInterface: true,
enforceProductInterface: true, enforceProductInterface: true,
enforceJavaSdkLibraryCheck: false, enforceJavaSdkLibraryCheck: false,
}, "") }, "")
@@ -1313,7 +1308,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_library", libraryType: "java_library",
fromPartition: "product", fromPartition: "product",
toPartition: "system", toPartition: "system",
enforceVendorInterface: true,
enforceProductInterface: false, enforceProductInterface: false,
enforceJavaSdkLibraryCheck: true, enforceJavaSdkLibraryCheck: true,
}, "") }, "")
@@ -1322,7 +1316,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_library", libraryType: "java_library",
fromPartition: "product", fromPartition: "product",
toPartition: "system", toPartition: "system",
enforceVendorInterface: true,
enforceProductInterface: true, enforceProductInterface: true,
enforceJavaSdkLibraryCheck: true, enforceJavaSdkLibraryCheck: true,
}, errorMessage) }, errorMessage)
@@ -1331,7 +1324,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_library", libraryType: "java_library",
fromPartition: "vendor", fromPartition: "vendor",
toPartition: "system", toPartition: "system",
enforceVendorInterface: true,
enforceProductInterface: true, enforceProductInterface: true,
enforceJavaSdkLibraryCheck: true, enforceJavaSdkLibraryCheck: true,
}, errorMessage) }, errorMessage)
@@ -1340,7 +1332,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_library", libraryType: "java_library",
fromPartition: "vendor", fromPartition: "vendor",
toPartition: "system", toPartition: "system",
enforceVendorInterface: true,
enforceProductInterface: true, enforceProductInterface: true,
enforceJavaSdkLibraryCheck: true, enforceJavaSdkLibraryCheck: true,
allowList: []string{"bar"}, allowList: []string{"bar"},
@@ -1350,7 +1341,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_library", libraryType: "java_library",
fromPartition: "vendor", fromPartition: "vendor",
toPartition: "product", toPartition: "product",
enforceVendorInterface: true,
enforceProductInterface: true, enforceProductInterface: true,
enforceJavaSdkLibraryCheck: true, enforceJavaSdkLibraryCheck: true,
}, errorMessage) }, errorMessage)
@@ -1359,7 +1349,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_sdk_library", libraryType: "java_sdk_library",
fromPartition: "product", fromPartition: "product",
toPartition: "system", toPartition: "system",
enforceVendorInterface: true,
enforceProductInterface: true, enforceProductInterface: true,
enforceJavaSdkLibraryCheck: true, enforceJavaSdkLibraryCheck: true,
}, "") }, "")
@@ -1368,7 +1357,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_sdk_library", libraryType: "java_sdk_library",
fromPartition: "vendor", fromPartition: "vendor",
toPartition: "system", toPartition: "system",
enforceVendorInterface: true,
enforceProductInterface: true, enforceProductInterface: true,
enforceJavaSdkLibraryCheck: true, enforceJavaSdkLibraryCheck: true,
}, "") }, "")
@@ -1377,7 +1365,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_sdk_library", libraryType: "java_sdk_library",
fromPartition: "vendor", fromPartition: "vendor",
toPartition: "product", toPartition: "product",
enforceVendorInterface: true,
enforceProductInterface: true, enforceProductInterface: true,
enforceJavaSdkLibraryCheck: true, enforceJavaSdkLibraryCheck: true,
}, "") }, "")